Thread Tools
Old April 13, 2003, 06:33   #31
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 20:21
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
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?
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Pedrunn is offline  
Old April 13, 2003, 17:56   #32
ahenobarb
Prince
 
ahenobarb's Avatar
 
Local Time: 23:21
Local Date: November 1, 2010
Join Date: Nov 2001
Posts: 437
Quote:
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?
Of course, the thing is the bigger the search area is, the more valuable the function becomes, but also the more time it takes to write the function. I was just testing the premise with these two. There is one in particular I need/want to write to do the stuff I want to do with stacks.
ahenobarb is offline  
Old April 14, 2003, 17:21   #33
Immortal Wombat
Apolytoners Hall of Fame
Prince
 
Immortal Wombat's Avatar
 
Local Time: 00:21
Local Date: November 2, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
Quote:
Actually the idea is to make the modules first and the correlation later.
Yeeeas... I have been thinking over the weekend about how best to go about the science module. Other than simply providing the list of advances, a lot of the goal setting depends very very much on the situation.

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 AI
__________________
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
Immortal Wombat is offline  
Old April 14, 2003, 22:10   #34
ahenobarb
Prince
 
ahenobarb's Avatar
 
Local Time: 23:21
Local Date: November 1, 2010
Join Date: Nov 2001
Posts: 437
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:
File Type: zip stacksv.05.zip (101.2 KB, 6 views)
ahenobarb is offline  
Old April 14, 2003, 22:13   #35
ahenobarb
Prince
 
ahenobarb's Avatar
 
Local Time: 23:21
Local Date: November 1, 2010
Join Date: Nov 2001
Posts: 437
Here is the photo. Notice the AI has built all of it's forts on mountains, not the nearby hills or the plains.

Also notice, the AI hasn't got a clue what they are or how to use them! The stacks walk right by them

On to step two, which will be much more difficult.
Attached Thumbnails:
Click image for larger version

Name:	forts2.jpg
Views:	84
Size:	118.1 KB
ID:	42536  
ahenobarb is offline  
Old April 14, 2003, 22:16   #36
ahenobarb
Prince
 
ahenobarb's Avatar
 
Local Time: 23:21
Local Date: November 1, 2010
Join Date: Nov 2001
Posts: 437
This is an illustration of the search. This illustrates a Northward search of the tile. The tile in blue is the city, those in green are the ones that are searched, and grey tiles are not searched. The direction of the search is bottom to top, left to right.
Attached Thumbnails:
Click image for larger version

Name:	gettilepoints_northsearch.jpg
Views:	84
Size:	12.5 KB
ID:	42538  
ahenobarb is offline  
Old April 15, 2003, 05:31   #37
Immortal Wombat
Apolytoners Hall of Fame
Prince
 
Immortal Wombat's Avatar
 
Local Time: 00:21
Local Date: November 2, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
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
Immortal Wombat is offline  
Old April 15, 2003, 05:48   #38
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 20:21
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
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
Pedrunn is offline  
Old April 15, 2003, 06:41   #39
Zaphod Beeblebrox
Call to Power II Democracy Game
King
 
Local Time: 00:21
Local Date: November 2, 2010
Join Date: Aug 1999
Location: aachen, germany
Posts: 1,100
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.
Zaphod Beeblebrox is offline  
Old April 15, 2003, 09:24   #40
ahenobarb
Prince
 
ahenobarb's Avatar
 
Local Time: 23:21
Local Date: November 1, 2010
Join Date: Nov 2001
Posts: 437
Quote:
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.
IW, I agree with most of what you say. The assumption is that the AI needs to learn to build stacks of 12 and keep them stationed somewhere waiting for action. rather than just choose a random map point, I want the AI to build forts for this. So this code gets the AI to build forts, so I can work with telling the AI where to send units. The AI may not need them all, but I need them all for now so I can test code. In the picture above the probabilty of fort creation was set incredibly high, so I could make sure it was building them. I set the values lower in the code posted above. Also, I give the AI the PW to build the forts right away instead of asking it to build one later.

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
ahenobarb is offline  
Old April 15, 2003, 11:08   #41
ahenobarb
Prince
 
ahenobarb's Avatar
 
Local Time: 23:21
Local Date: November 1, 2010
Join Date: Nov 2001
Posts: 437
Quote:
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.
I agree about focusing on hot borders, that will be incorporated into future code. To you second point, the code instructs the AI to build forts on non-hill/mountain squares if it cannot find any hills or mountains in that direction. I guess I should have posted a picture that illustrated that as well, but this was my favorite because I could see that it had skipped over a lot of terrain to find the best spot.

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.
ahenobarb is offline  
Old April 26, 2003, 13:01   #42
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 20:21
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
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
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Pedrunn is offline  
Old April 29, 2003, 13:53   #43
ahenobarb
Prince
 
ahenobarb's Avatar
 
Local Time: 23:21
Local Date: November 1, 2010
Join Date: Nov 2001
Posts: 437
Quote:
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
Pedrunn, I have tested the code and it works without any problems. The only question I have remaining is whether or not the mathematics is correct for every square. I want to make sure I didn't type the wrong numbers for some of the locations. Its fairly easy to do that when you have so many different variations.

But no crash causing errors when using the script.!
ahenobarb is offline  
Old April 29, 2003, 16:48   #44
Maquiladora
Call to Power II MultiplayerCTP2 Source Code ProjectCall to Power PBEMCall to Power Multiplayer
Emperor
 
Local Time: 00:21
Local Date: November 2, 2010
Join Date: Jun 2001
Posts: 7,665
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 (7th June 2010)
CtP2 AE Wiki & Modding Reference
One way to compile the CtP2 Source Code.
Maquiladora is offline  
Old April 29, 2003, 17:27   #45
Immortal Wombat
Apolytoners Hall of Fame
Prince
 
Immortal Wombat's Avatar
 
Local Time: 00:21
Local Date: November 2, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
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
Immortal Wombat is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 19:21.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team