Page 1 of 1
JSON based AI
Posted: Tue Oct 10, 2017 2:34 pm
by Sunrise Samurai
Since most of the rest of the game has become easily configurable, I would like to propose making the ai just as easily edited. This would enable us to do most of the work in figuring out a better ai, as well as perhaps a few different basic strategies it could use.
Necessary tools include​ the ability to set weights to production of units and technologies, plus the ability to adjust those by a variety of factors, including turn number (to reduce the chances of things like light cavalry late game, plus raise the chances of technologies over time.) And the "best against me" tag. Terrain should also be a viable factor, both to prevent the ai making battering ram in "forest run" type maps (95% forest, so it can't move) and to encourage naval units and technologies in maps with say 50% or more water.
Also, we would need to dictate where the ai would build what, and in what order and what probability.
To distinguish between light and hard ai, maybe have a menu option titled "AI cheats" to dictate the ai getting it's usual advantages.
Re: JSON based AI
Posted: Tue Oct 10, 2017 3:30 pm
by Stratego (dev)
if you can figure out a format (how to tell things) i can implement the usage.
Re: JSON based AI
Posted: Tue Oct 10, 2017 5:34 pm
by Sunrise Samurai
Maybe Alexander could offer suggestions for a format. He's got more experience than I do with this. At a guess, it's probably going to look a lot like the sound selection JSONs.
Re: JSON based AI
Posted: Tue Oct 10, 2017 5:43 pm
by Stratego (dev)
it is not about the loook, it is about the data content.
Re: JSON based AI
Posted: Tue Mar 20, 2018 12:30 pm
by godOfKings
i got some ideas to improve ai workers
if the the four adjacent tiles to a town is filled, for example with towers and factory building, then the workers will start building siege units in the next closest tiles to the town,
if the tile is forest then they will build siege mantlets,
if the tile is grass then their first priority will b battering rams, once they have at least three surviving battering rams then they will build catapults, and continue to build catapults until they have less than three battering rams at which time they again start building battering rams
if tile is water then, if enemy player has lots of infantry based units like archers, then ai will build galley, if enemy has lots of galley and transport ships, then ai will build triremes, even if player has only transpot ships then too ai will build triremes, if player has triremes, turtle ships or just about any other ship, then ai will build catapult ships
Re: JSON based AI
Posted: Tue Mar 20, 2018 6:34 pm
by Sunrise Samurai
I'm still looking for the ai to prioritize castles over towers, then build towers adjacent to factories if it gets that far. I also proposed building siege/ships in any available space adjacent to a worker, ensuring there's never nothing for workers to build.
Re: JSON based AI
Posted: Tue Mar 20, 2018 7:05 pm
by godOfKings
How do workers in aof build castles?
Re: JSON based AI
Posted: Wed Mar 21, 2018 12:51 am
by Sunrise Samurai
Possible model for json based ai. If we have a list of possible behaviors to apply for each unit/building, then assign priority modifiers based on various factors, such as opposing unit types or turn count, to give orders. Behaviors range from "produce x unit" for buildings to "build x object adjacent to y unit type" for workers, and "retreat to heal" for injured units or "maintain maximum range and attack" for ranged units.
The attachment is a Minecraft json for skeletons, and it includes the simple ai that controls them. Included are commands to attack, run, and avoid sunlight.
Re: JSON based AI
Posted: Wed Jan 09, 2019 11:45 am
by Lawrence
This is great, maybe in the future we get the oppurtunity to choose AI for maps (recreating famous tactics)