That a great function, I wish i had it when working with the city expansion. Yet do you have any specific use for it in your slics?
Announcement
Collapse
No announcement yet.
Recruiting to do the best AI combat slic handler ever!
Collapse
X
-
Originally posted by Pedrunn
That a great function, I wish i had it when working with the city expansion. Yet do you have any specific use for it in your slics?
Comment
-
Actually the idea is to make the modules first and the correlation later.
Ship Building; Offensive War/Defensive War/Peace advances; I guess a rush to monarchy would be advisable...
Also, are we going to have this operate at all difficulty levels? Some people might not want a ruthlessly vicious AIConcrete, Abstract, or Squoingy?
"I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis
Comment
-
The first part of the code for #3 is done. The AI now build forts!
This script makes the AI now build forts around its capital city and after it has 6 cities, it begins building forts around its major cities as well. Major cities are defined as the cities in the top 30% in terms of population size.
Once the AI has determined to build a fort (a random number generator), is chooses a rondom direction (N, S, E, W) to build the fort. It uses the GetTilePoints search in the "NewSearch.slc" file to evaluate the tiles. When it gets a tile it checks if it is a hill or a mountain and prioritizes them to build the fort. Also, it values mountains over hills when building forts. If there is already a fort in that direction (since it's randomly chosen), it does not build another fort.
The "NewSearch.slc" file must be included either in your script.slc file, or you can open the Stacks.slc file and remove the // in front of the include statement. You must have one, but you can't have both.
Regarding the GetTilePoints search function, it searches the tiles that are pointed to by the corners of the city's map square, which is rotated to a diamond in CTP2. Look at the next post for an illustration.
Also, I will post a picture of the AI using the forts.Attached Files
Comment
-
Comment
-
Comment
-
Sweet
I'll reply here, but possibly a new thread may be useful to keep this discussion (which has a lot of potential to bloom) separate.
Are you working from the assumption here that forts are always good? If the AI is paying their construction cost, then it begins to edge its way into the PW module.
[aside] In fact, it'll sit very well within that once the goal of building a fort has been set... [/aside]
So does the AI really need them all? Depending on how "aware" the AI is, it should probably start building (and manning) them on hot borders, then go on to cold borders (if PW is sufficient) and then into unoccupied space, territory-gap filling, road-bridges and so forth.Concrete, Abstract, or Squoingy?
"I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis
Comment
-
Amazing! Although I share the IW perspective that the forts should be done by the infrastructure module it is great to see you are having a improvemement Since in the othe hand my first attempt for the continent mapping was a failure . But i am a hard to give up kind of guy so i will give a check in my code soon."Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Comment
-
Originally posted by Immortal Wombat
Sweet
I'll reply here, but possibly a new thread may be useful to keep this discussion (which has a lot of potential to bloom) separate.
Are you working from the assumption here that forts are always good? If the AI is paying their construction cost, then it begins to edge its way into the PW module.
[aside] In fact, it'll sit very well within that once the goal of building a fort has been set... [/aside]
So does the AI really need them all? Depending on how "aware" the AI is, it should probably start building (and manning) them on hot borders, then go on to cold borders (if PW is sufficient) and then into unoccupied space, territory-gap filling, road-bridges and so forth.
Since I'm focusing on stack creation not forts, this code will do for now. Later, I'd like to create an array to store the direction of the attacks and the frequency of attacks. More attacks, more forts. More forts in the right direction. Then there must be code so that a city knows if it is a border or not. Also, borders change due to settling and so forth, so the AI should check to see if this is an expanding border (so it should wait until it is no longer expanding in that direction). -- A lot of additional code would be required for that
Comment
-
Originally posted by Zaphod Beeblebrox
forts should be priorizized on hot borders, and even there it is more usefull, to pack them in a way, that few fords block as much potential enemy paths by zoc, even if that sometimes means building a fort on some other terrain than a mountain or hill.
the screen shots where the AI just put the fort in the default location, because there were no hills or mountains, didn't seem as interesting.
Comment
-
Originally posted by Pedrunn
ahenobarb, did you function was tested and is bug-free?
I think i may use it in a second attempt to the continent mapping code
But no crash causing errors when using the script.!
Comment
-
Mustve missed this thread. Not like i can add alot on the slic things but ill test stuff, it all sounds very interesting. I realise the title is for a combat slic handler but im going with the flow of the thread.
On advance lists, i made one awhile back for SAP 2 (in sap2 thread) which is probably as best as i could recommend for an AI (as closely to a MP'er would choose to beat another human), because humans can constantly review the situation and change advance goals you have to choose the list order carefully. And someone asked if advancelist.txt works (i think..) and it does AFAIK. All the AIs noticeably reached Monarchy much quicker and in more or less the same order (unless they found ruins to skip ahead etc)
Another thing that really bugs me about the randomness of the AIs choices, is in building city improvements. How often ive seen an AI building a bazaar in a city collecting only 10 or 100 gold even (especially when gold is practically free anyway), or building a granary in a city with 20 food, such a waste of production.
Would it also be possible to get rid of the AI just keeping PW set at the same amount constantly? Like when theres a quiet period whack PW upto 80-100% for a couple of turns. Just ideas anyway.Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
CtP2 AE Wiki & Modding Reference
One way to compile the CtP2 Source Code.
Comment
-
Maq: that's great, I thought someone had, I wasn't sure. I think I might in fact rewrite it completely and see if I can get the AI to assess the situation more frequently for deciding which advances to get.Concrete, Abstract, or Squoingy?
"I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis
Comment
Comment