Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AI api? #72

Open
frnsys opened this issue Aug 28, 2015 · 2 comments
Open

AI api? #72

frnsys opened this issue Aug 28, 2015 · 2 comments

Comments

@frnsys
Copy link

frnsys commented Aug 28, 2015

I'm interested in trying to build city planning AIs - do you think micropolis would be conducive to an api for developing AI players?

@lloydsparkes
Copy link

So I've recently been playing around with this project (I've rewritten it into C#).

It is possible for an AI to be written against it, but as the API stand's it is not really conductive, It is heavily optimised for fast and efficient drawing of the Map.

So you would need to build a translation layer in between, to provide a higher level, more semantic API for an AI to work with.

Also there are a few bits where the engine may do things which you will want the AI to have control over.

The main one I can think of is the automatic placement of Hospitals and Churches, but it should be quite easy to disable that code, and then add in API's to place them exactly.

@smearle
Copy link

smearle commented Aug 23, 2018

I've taken a stab at this in this repo (find a more detailed description on reddit.

I'm currently using a very slightly modified Debian package of micropolis-activity (find it here), and sending build commands from python over tcl. I only had to duplicate some of the game's build-functions, making them editor/gui-independent, and then make them available as tcl commands.

I'm very interested in how one might speed this process up, though, since training is quite slow. I'm currently trying to compile MicropolisCore - if I could have the same commands I do now, but available directly to python via wrapping, rather than via the python expect module and tcl, I imagine there would be a speed increase. After all, if you can run the simulation ultra fast (via, i.e., the tcl command "sim Delay 0"), then I don't see why you shouldn't be able to build/destroy a road or zone once-per-timestep in the simulation, rather than over the course of a few hundred in-game years, as my current solution using tcl permits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants