During my entire code career I have always been interested in pixel AI. The theory is that every pixel on a image can occupy one or more AI entities, a AI is never larger then a single pixel but might be part of a cluster forming a mega AI where each part work separately to determine influences from and on nearby pixels but doing one or more shared actions. A example how it might work.
A City AI is one pixel large. By scanning a range from it’s position it finds out that it got access to a river, forest and a gold mine. By adding pollution of the river, decreasing the value of the gold and the thickness of the fortress, the pixel has absorbed enough resources to spawn a child city pixel. Then the city will scan all pixels in next to it, up down left right, to determine if any of them are valid to place a child city part on. If not, the city will terraform the tile with the highest possibility to the extent it can, wasting the resources that would go into the child piece. Then it will gather more resources, pollute the river even more, draining more gold, cutting more forest. The tile is now valid to build on, one more child piece will be spawned. This might be one of many actions, it could be to increase the towns defence by spending gold on a defense or offense value or improve housing allowing one pixel to carry more population. Ones the city got one more tile the number of actions that can be performed are not double but rather a lower value like (1+1/3tiles size) actions to not making the city grow like a virus straight away. Forests could work roughly the same way, determine the temperature and water access in the area, increasing it’s strength by one for every water, with a 1/4 chance to spawn a new forest tile if the strength is over 10. With a hibernation factor if the weather gets to cold.
Fire could be devastating. Spreading to nearby trees in 5/6 chance. The important part here is to not burn the entire forest away, but reducing random positions to power 1 instead of 0 and declining them to grow or catch on fire until all tiles around them are free of fire.
There is essentially nothing that can’t be simulated on a AI point of view in that way. That being said after a while you will need to add more details, deciding how roads are going to be built, probably with the help of a random walking AI type using some kind of fuzzy logic. mark all traveled pixels some how, then mark the way in a node network that expands the same way the city did. make connecting cities know about each other and allow them to trade resources between each other.
All in all it’s a fun way to play around with stuff and i hope that more people then me enjoy it, even if it’s a bit geeky.
