Posted 12-Sep-08 11:38 by Carles

Hi! improving Sample AI...

Hi to everyone! I know Sample AI is perfect to begin programming the AI, and is what I began to do to get my own AI. I'm doing it with Pascal and is a little problematic with debuging.

I have been improving or fixing little things, like being able to achieve Democracy, build more improvements, farms, railroad. I fixed when the city went on building a wonder when it had allready been completed. Or disbanding some units when reaching Monarchy. Also when the enemy destroyed my capital, building another palace. I have to detect interior seas to avoid building ships.

I also began to think in the construction of roads. The first algorithm I used joined groups of cities but sometimes not all. I found the problem and now has been thinking in another algorithm that I find almost perfect and fast: the bubble method (I'm sorry if someone else put it another name before me).

With the Pile structure I would make grow from all cities at the same time its "distance bubble" until the first ones touched. Then I would paint the road between those two cities, and after I would join the two areas (I would have two arrays the size of all the Map: one for roads and the other for keeping the city number), that would go on growing like other areas. When the next two ones touched I would do the same, and till I joined all the possible cities.

Afterwards I want to improve the defensive strategy because the sample AI only attacks. I already improved a little the unit movement taking into acount for the roads. The attack strategy also could be improved taking into acount the city value and to increase the surprise and mass factor.

I want also to increase a lot the score of squares like mercury, cobalt... to force settlers to build cities in these resources to be able to build the spaceship. Also I want to be able to build cities in Praeries, etc.

Is wonderful to be able to build the AI, because I allways suspected that Civilization cheated a lot when increasing the difficulty level. Human intelligence is better to interpret the maps and to think and get conclusions, at least in a cualitative way (and more creative), but artificial intelligence does not get tired in "thinking" the details.

I want to teach the AI to recognize strategic squares in continents where they narrow and you can put less units to defend your territory, and build fortress...

I also would like to improve the choice of the next advance, scoring all the possible advances and taking into acount the next advances. But not allways is easy to score different advances, improvements... ¿Is possible to compare money with trade and research? Also you have to take into acount the number of cities that will benefit.


Colonizing... other continents will be another problem to solve :-)


¿There is someone doing something similar with Sample AI or with Pascal?

Thanks and see you,
Carles

Answer This Posting

User Name

New user

Password

Change password

Subject

Text

Administration

Password