Archived

This topic is now archived and is closed to further replies.

Civilization AI

This topic is 5533 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m currently programming a strategy game, just like Civ. Does anybody know how to make an AI that can control planet (in this case) and spaceships without making too much mistakes? I don''t need any code, just ideas about how the AI should be constructed.

Share this post


Link to post
Share on other sites
As with any large problem, you probably want to break it down into a hierachy of manageable modules. The entire civilisation might have a vague strategy (build, expand, accumulate knowledge, etc), and each city will have its own strategy, usually with some mandatory elements such as providing enough food and resources, with spare resources being allocated according to the global strategy.

[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions | Organising code files | My stuff ]

Share this post


Link to post
Share on other sites
This sort of problem can be tackled using techniques from scheduling theory (which is a subset of planning). Essentially you have a number of actions to perform that each produce a particular outcome. Some actions may require the completion of other actions before they can begin (you have to build a ship before it can work for you) and you may want certain actions done at, before, or after certain times (like harvesting food after it has ripened but before it rots. This requires hiring of staff, or building of harvesters, before harvesting begins). The reason why this is scheduling is because there are invariable time constraints for actions: either finite durations to complete or constraints on when they can and cannot be enacted.

There''s plenty of literature online regarding this topic.

Good luck,

Timkin

Share this post


Link to post
Share on other sites
Thanks for the tips. Now I''m thinking of building the AI with different ''modes'', like explorer, aggressive and economic. The only problem is how to detect which mode the AI should be on. If the AI is under attack, it shouldn''t immediately turn to defensive. And when it detects an enemy, it is not wise to attack without any fleet of spaceships around. So the mode of the AI must depend on various factors. Which factors? And how do I make the AI not too simple to intimidate?

Share this post


Link to post
Share on other sites
Here''s a site where there is a LOT of discussions about this
-Go to the AltCiv section, where civ-type developers hang out

http://apolyton.net/


-----------------------
Always down - Never out

Share this post


Link to post
Share on other sites