|
Author
|
|
Topic: Making the AI diplomatically aware..... |  |
|
Dale Prince Melbourne, Australia Dec 2000
|
 |
posted January 10, 2001 20:59
 |
 |
 |  |
Folks,Just so you know, even though I've been saying I can't be bothered fixing the AI, I'm looking into the one section as I see as needs work. Diplomacy, and it's prioritys. So last night I ran some experiments. 1 - I changed the prioritys on sending and receiving certain diplomatic events (namely pacts and alliances). 2 - I set the regard bonus amount for each turn at peace/pact/alliance a little higher. 3 - I changed a couple of the response priorities as well. 4 - I fiddled with roads to make them more 'attractive' bonus wise for the AI, and added roads to the lists of improvements to build for all categories (growth, production, etc). 5 - As an expansion on diplomacy-war, I made the ATTACK and SIEGE goals almost irrisitable to the AI. Here's what happened. Remembering that at this point I'm working on extreme conditions and will narrow down to something balanced. Setup a mid-size planet with 8 civs on impossible. I cheated and gave each civ advance: cannons (and everything below it added in auto), 10000 PW and 20000 gold. I also gave each civ 4 settlers. Basically, I wanted it to be a bit further on than a beginning game. Myself as a player did nothing but build defense units (keeping 6 in my city at all times, disbanding excess). I didn't improve or anything. I quickly ran through 50 turns. Turning off FOW I saw: 1 - The AI had spread all round the globe. 2 - The AI had built roads EVERYWHERE! It had gone nuts with them. I even saw a roman city in the centre of 6 cities with double roads to each city. Even roads going to nowhere. 3 - Units flowed down these roads comfortably. There was no congestion of stacks, no blockages or whatever. Just stacks moving comfortable to where they were going without hindrance. I took a look at the diplomacy of every civ. 3 civs were fighting an all-in war (with stacks of cannon/riflemen on the borders). But the interesting thing was that these three civs had built roads to this triple-border area and had connected. Therefore, battles were occuring between AI stacks. 2 civs had research pacts with each other, one of them having a normal pact with civ number 8 as well. Civ number 7 was on an island all by itself, and only had a couple of contacts, but couldn't do anything as it hadn't got diplos to them yet. I kept the turns rolling. I noticed: 1 - The AI would declare war, fight an intesive battle with someone, then after a while when one sues for peace the war ends. The wars were short and bloody. I saw one civ send three stacks of 6-8 units at another civ at the one time. When peace reigned between two civs, the regard went up quickly till the next war (or sometimes turned into a pact). 2 - During peace, the AI built roads like nuts for infrustructure. During war, it built roads near the frontier (reminding myself to add forts to the improve lists as well) thus making unit movement good. 3 - The diplomats of the AI civs actually interacted. Admittedly it was usually an extreme (refuse a pact and they declared war) but it was something. Maybe there is life in there afterall. Will go back to moding tonight. ------------------ Rommell to a sub-commander outside Tobruk: "Those Australians are in there somewhere. But where? Let's advance and wait till they shoot, then shoot back." |
Triumphus Romanus Chieftain Jacksonville, Florida Nov 2000
|
 |
posted January 10, 2001 22:24
 |
 |
 |  |
Awesome work Dale!! Thats very encouraging news. And I am soooo jealous.....I want to come to Australia bad. Been there twice....oh to be wealthy with nothing to do. .. Gary |
MrFun Prince United States, Iowa Nov 2000
|
 |
posted January 11, 2001 00:18
|
 |
 |  |
I perked up when I read our interesting modifications. But please clarify - you said you changed this and that but in those documents and on those lines, what specifically did you enter as the new modifications? |
Dale Prince Melbourne, Australia Dec 2000
|
 |
posted January 11, 2001 01:16
 |
 |
 |  |
At this point as I mentioned I used extremes, so I wouldn't base my mods into a real game.  But here's an example of what I did in diplomacy.txt The original: ProposalElement { Proposal PROPOSAL_TREATY_ALLIANCE SendPriority 100 AcceptPriority 110 RejectPriority 100 SenderRegardResult 200 ReceiverRegardResult 200 ViolationRegardCost -100 ViolationTrustCost -30 } The moded:
ProposalElement { Proposal PROPOSAL_TREATY_ALLIANCE SendPriority 200 AcceptPriority 200 RejectPriority 50 SenderRegardResult 250 ReceiverRegardResult 250 ViolationRegardCost -300 ViolationTrustCost -50 } As I said, an extreme. But the increased priorities made the AI consider them. By increasing accept priority to the same, it makes the AI accept more alliance requests, as lowering reject makes it not want to reject it. The violation costs make the AI want to hold onto it a little longer. For example, with a -50 trust, by violating an alliance, the other party is going to take a LONG LONG time before it trusts the violator again. More in line to how I think.  I'll try and fine-tune the diplo a bit more tonight and let you know tomorrow. ------------------ Rommell to a sub-commander outside Tobruk: "Those Australians are in there somewhere. But where? Let's advance and wait till they shoot, then shoot back." |
joe77 Chieftain Seattle, Washington US of A Jan 2001
|
 |
posted January 11, 2001 04:57
|
 |
 |  |
hey dale ...where do you find the road stuff ?? |
MarkG Apolyton CS Co-Administrator Macedonia, Greece b.02-15-99
|
 |
posted January 11, 2001 05:58
  |
 |
 |  |
quote:
 Originally posted by joe77 on 01-11-2001 04:57 AM hey dale ...where do you find the road stuff ??
 | in the strategies.txt look for RoadUtilityBonus |
Dale Prince Melbourne, Australia Dec 2000
|
 |
posted January 11, 2001 21:09
 |
 |
 |  |
Hmmm...... having trouble getting AI to build diplos. If I give him a diplo, he gets stuck in diplo. However on the plus side, I actually got this request from the Greeks:- They requested 200 gold in a haughty tone. - I refused. - They threatened war. - I still refused. - They declared war. After declaring war, they sent a couple of stacks at me, which I brushed off and they requested a cease-fire. This is the weekends goals: 1 - Make the AI build diplos. 2 - Make the AI pursue diplo functions as per their government (communist with other communist, repub with other repubs, etc) Birds of a feather flock together basically. 3 - Make the AI pursue diplo functions based on their personality. Eg. Militarilist leaders pursue demands/threats. Scientists pursue advances/research pacts. Etc. ------------------ Rommell to a sub-commander outside Tobruk: "Those Australians are in there somewhere. But where? Let's advance and wait till they shoot, then shoot back." |
Alpha Wolf Settler Prince of the Barbarians Feb 2001
|
 |
posted January 12, 2001 00:54
 |
 |
 |  |
I like the way people are approaching AI changes. Set goals then try to achieve them. I think we have a great opportunity to recreate CtP2 as a playable game.Keep the ideas flowing.  ------------------ History is written by the victor. |
Savant Warlord The Mountain Empire Jul 1999
|
 |
posted January 12, 2001 12:11
|
 |
 |  |
Dale - Your changes are encouraging. You might want to communicate what you are doing and what you've found with Wes as he is seeking input on what changes ot make to create a revised mod pack.------------------ 'Blood will run' |
Dale Prince Melbourne, Australia Dec 2000
|
 |
posted January 13, 2001 21:52
 |
 |
 |  |
Have got the diplomacy mod happening well, intertwined with Blueo's frenzy mod (See general forum for teaser readme). It is however, the ai.slc I downloaded last friday, so the script may have errors. Since I don't have a website, who wants to host the zip file for me?------------------ Rommell to a sub-commander outside Tobruk: "Those Australians are in there somewhere. But where? Let's advance and wait till they shoot, then shoot back." |
slamp King Cannes, France Sep 1999
|
 |
posted January 15, 2001 08:29
  |
 |
 |  |
Dale, I could do it for you, I will send you an email |
OmniGod ACS CtP2 Database Manager Philadelphia, PA, USA --> Really Canadian Dec 1999
|
 |
posted January 15, 2001 10:59
 |
 |
 |  |
Ready for ddl on King Arthur's Court... I'll try the mod later tonight. But just from reading into some of the changes it looks really good... nice job Dale.Rich |
Dale Prince Melbourne, Australia Dec 2000
|
 |
posted January 15, 2001 17:30
 |
 |
 |  |
Am emailing version 2.1 of the mod to Rich this morning. Here's a short rundown of changes from 2.0:- Name change to Diplomod 2.1. - Made it generic, should work with any other mods, not just frenzy AI. - Supports frenzy AI 1.02 (just a little change of the script is needed) - Cleaner and meaner.  ------------------ Rommell to a sub-commander outside Tobruk: "Those Australians are in there somewhere. But where? Let's advance and wait till they shoot, then shoot back." |
Alpha Wolf Settler Prince of the Barbarians Feb 2001
|
 |
posted January 15, 2001 18:33
 |
 |
 |  |
dale, I'm glad someone is looking at the diplomatic aspects of the game. however, your mod makes the AI way too timid. Since the AI still insists on infringing on my borders with new cities, its been a tactic of mine to demand sale of these cities before they become too much of a nuisance. On occasion I hit the wrong button and no offer of payment is included in the demand. Today when i did this, instead of receiving a rejection, the AI accepted. In fact, i realized that they accept EVERYTHING. So, I demanded their largest city with no payment. They happily agreed, at which point I demanded every city of every civ I had contact with. I now control 1/2 the world without firing a shot or paying a dollar. Before that, I was getting offers to exchange maps every 4 or 5 turns. I'm looking forward to more realistic diplomacy, can this be fixed without undoing everything?------------------ History is written by the victor. |
Dale Prince Melbourne, Australia Dec 2000
|
 |
posted January 15, 2001 19:59
 |
 |
 |  |
Thanks for the feedback Alpha Wolf. I'll look into it.Edit: I've found the problem. I used a "Consider" statement when I should've used a "Change" statement. Will fix for version 2.3 ------------------ Rommell to a sub-commander outside Tobruk: "Those Australians are in there somewhere. But where? Let's advance and wait till they shoot, then shoot back." [This message has been edited by Dale (edited January 15, 2001).] |
Cardinal red Settler England Jan 2001
|
 |
posted January 16, 2001 05:35
 |
 |
 |  |
Great work guys - does anybody know where I can get my hand on these mods?Cheers |
OmniGod ACS CtP2 Database Manager Philadelphia, PA, USA --> Really Canadian Dec 1999
|
 |
posted January 16, 2001 09:40
 |
 |
 |  |
Ahmmmm... *cough* http://ctp2.homestead.com *cough* |
Alpha Wolf Settler Prince of the Barbarians Feb 2001
|
 |
posted January 16, 2001 12:23
 |
 |
 |  |
Nasty cough you have there Omni....  The new design for your website is substantially better. ------------------ History is written by the victor. |
MrFun Prince United States, Iowa Nov 2000
|
 |
posted January 16, 2001 15:29
|
 |
 |  |
Eagerly waiting for Version 2.3.  |
Dale Prince Melbourne, Australia Dec 2000
|
 |
posted January 16, 2001 16:42
 |
 |
 |  |
Got a frog in ya throat Rich?  BTW, expect v2.3 (maybe v3.0 if I re-write the lot) after the weekend. I'm starting to code the full AI diplo-handling routines. In previous versions I left it to the program to handle the considerations, but now I've got the mod-skeleton I'm going to add them in. The AI diplo-handling routines will be the ones that look at the current position and force a proposal/response based on that analysis. EG. Player[a] looks at player[b] and says "Hmm, nice border-city. I'll extort that." Player[a] sends player[b] a request_give_city. Player[b] looks at the proposal and says "Hang on a second, he receives THIS bonus, and I receive THIS bonus. My bonus is less so I'll counter-request." Player[b] sends player[a] a counter-request for GOLD equalling value of CITY. Player[a] looks at player[b] and says "Hmmm...... I don't have much gold left so NO SALE!" and refuses counter-proposal. BTW, I got this routine running. It seemed like the easiest to do. Obviously, if player[b] receives a 'gift' proposal it's gunna say "Cool! Free stuff!" and accept.  ------------------ Rommell to a sub-commander outside Tobruk: "Those Australians are in there somewhere. But where? Let's advance and wait till they shoot, then shoot back." |
Martina Settler Germany Jan 2001
|
 |
posted January 16, 2001 17:07
|
 |
 |  |
quote:
 Originally posted by Dale on 01-15-2001 07:59 PM I've found the problem. I used a "Consider" statement when I should've used a "Change" statement. Will fix for version 2.3

|
Could you please let us know the bugfix for this i.e. where we need to replace the "consider" statement with the "change" statement ? I feel I can change this on my own in the 2.2 version (so no publishing of the bugfix version necessary) but I would need to know where.... Thank you! Martina [This message has been edited by Martina (edited January 16, 2001).] |
Kinjiru Prince Chicago, IL USA b.02-15-99
|
 |
posted January 16, 2001 17:56
 |
 |
 |  |
One suggestion I would make is to take a look at the while Gift offer. Getting a free city can be a VERY bad thing.In SMAC you could cripple the AI by giving faction A a city of yours that is about to be overrun by faction B. Faction B is going to take that city, even if they are allied with faction A. You could keep doing this and always keep everyone fighting. If it is possible, I would suggest that the AI consider the diplomatic status outcome for accepting a free city. If the sender is at war with a faction that shares a border with the gift city, then the AI should probably turn down the free city offer. I have no idea what is possible through modifying the text files, so if this is too complex to implement, no big deal. It would be good to close that kind of loophole though. |
Dale Prince Melbourne, Australia Dec 2000
|
 |
posted January 16, 2001 21:32
 |
 |
 |  |
Martina:The AI wasn't changing it's diplomatic strategy. It considered it but didn't change it. Therefore, in the 'BeginTurn' routine you need to change all the ConsiderDiplomaticState's to ChangeDiplomaticState. Kinjiru: At lunch I drew up some flowcharts to map the flow of diplomatic proposals and what to check (on paper of course). Pity I got beetroot juice all over it. Anyways, I thought of just that problem you mentioned. I figure it could be overcome if CityToExtort is within 10 squares of OwnCity which would make the city a border-city. That way, at least it has a fighting chance of getting defense there quickly. If you take into account the reality of supply problems, you don't want to accept a city that is too far from your borders, or on another island totally. I think this simple measure could simulate that. Any suggestions anyone? ------------------ Author of Diplomod. The mod to fix diplomacy. Rommell to a sub-commander outside Tobruk: "Those Australians are in there somewhere. But where? Let's advance and wait till they shoot, then shoot back." |
Martina Settler Germany Jan 2001
|
 |
posted January 17, 2001 02:21
|
 |
 |  |
quote:
 Originally posted by Dale on 01-16-2001 09:32 PM Therefore, in the 'BeginTurn' routine you need to change all the ConsiderDiplomaticState's to ChangeDiplomaticState.
 |
Thanks a lot, Dale! I did exactly that (in the 'BeginTurn' routine, changed from 'ConsiderDiplomaticState to ChangeDiplomaticState in total 3 times), however still I can get each and every city I request from others (independent from the tonality of my request). Did I miss something ? Martina
|
Changmai Beagle Chieftain The Great White North & warmer climes Oct 1999
|
 |
posted January 17, 2001 22:35
|
 |
 |  |
Dale, I'm having some trouble with your mod. I'm getting an array out of bounds slic error as soon as I startup. I'm also running Frenzy v1.03. Maybe I'll just wait until v. 3.0 and re-try. I unzipped into install, but the files were in a 'default' folder, so I copied them over their namesakes down a couple of levels. Maybe I missed something.P.S. Is there a way I can set this up with Frenzy as a scenario, and leave the base system alone? |
Dale Prince Melbourne, Australia Dec 2000
|
 |
posted January 18, 2001 01:04
 |
 |
 |  |
To those who have errors with my diplomacy mod, sorry bout that. Here's my suggestion. Instead of me spending time bug-fixing v2.2, I'll continue with v3.0. I now have the AI's swapping maps, advances and peace-treaties. Alliances are a little more complex to work out. I'm basing alliances on a combined overall rating of the two civs, whether they're at war or desire war with the same civs, and regard is fairly high. Now to get that part of the script running.So question for you guys: Do ya want me to bug-fix or continue till I get a v3.0 alpha for you to play with?  ------------------ Author of Diplomod. The mod to fix diplomacy. Rommell to a sub-commander outside Tobruk: "Those Australians are in there somewhere. But where? Let's advance and wait till they shoot, then shoot back." |
Alpha Wolf Settler Prince of the Barbarians Feb 2001
|
 |
posted January 18, 2001 01:53
 |
 |
 |  |
i'm not much for temp fixes, so my vote is 3.0------------------ History is written by the victor. |
Tjoepie Settler Belgium Nov 2000
|
 |
posted January 18, 2001 05:19
|
 |
 |  |
Same for me , ... and keep up the good work Dale !Thanks! |
GreatDane Settler
Jul 1999
|
 |
posted January 18, 2001 12:49
|
 |
 |  |
One annying thing I noticed in the diplomod is that when I exchange an advance with the AI for gold I do not get any gold. I think they got my advance so they cheated.  I don't know if this is a bug in the game or in your mod cause I never tried exhanging advances for gold with the AI before. Maybe it is just my version or something so I would like to have it confirmed. Otherwise I will have to reinstall the game/mod. Keep up the good work. Looking forward to v. 3.0 GreatDane |
Calphor Settler Columbus, OH, USA Dec 2000
|
 |
posted January 18, 2001 13:29
 |
 |
 |  |
The advance for gold bug is part of the game not the diplomod. Hopefully it's something that can be addressed by future patches.Thanks for the great work on the mods everyone! |
Dale Prince Melbourne, Australia Dec 2000
|
 |
posted January 18, 2001 19:24
 |
 |
 |  |
Yeah, the advance for gold exchange ain't my bug. But the "array out of index" bug is. I know what it is now. It's when the "player[DIP_civx]" variable goes out of the amount actually there. Basically, the script trys to make a call to a player number that isn't there. I did a quick test on my machine and found that changing:DIP_NumOfPlayers = Preference("NumPlayers") + 5; TO DIP_NumOfPlayers = Preference("NumPlayers"); fixed the problem. Of course, if you're in a saved game you need to reload SLIC (either through the chat dialog or the cheat menu). Just on version 3.0, I had an interesting test last night. Started a hard - small map game (so contact is made quickly). Found the Greeks about turn 5. They immediately demanded my capital. Over the next ten turns they demanded my capital 3 times, and on the last one threatened war. I rejected all of them, they declared war and sent their army at me (which consisted of a hoplite and a warrior). He beat me as I only had a warrior in my captial. The other was getting ruins. This was all within 30 turns. So how's that folks? I just don't know if it was an isolated incident. ------------------ Author of Diplomod. The mod to fix diplomacy. Rommell to a sub-commander outside Tobruk: "Those Australians are in there somewhere. But where? Let's advance and wait till they shoot, then shoot back." |
Changmai Beagle Chieftain The Great White North & warmer climes Oct 1999
|
 |
posted January 18, 2001 20:16
|
 |
 |  |
I'll probably wait until version 3.0 so that's my vote. (But just in case - in which files would I change the numplayers and the considerdiplo.... statements?) P.S Thanks for all the effort. Sounds good and I look forward. P.P.S It might be a while before you see any mods from me, being a beagle of little programming ability. For example. I was trying to do a bit of tweaking the other day and couldn't figure out why I was crashing. Then I realized I had left Net Nanny on and she had edited out all the "naughty bits", like "bomb_cabinet". |
Dale Prince Melbourne, Australia Dec 2000
|
 |
posted January 18, 2001 20:51
 |
 |
 |  |
quote:
 Originally posted by Changmai Beagle on 01-18-2001 08:16 PM I'll probably wait until version 3.0 so that's my vote. (But just in case - in which files would I change the numplayers and the considerdiplo.... statements?)
 |
diplomod.slc quote:

P.S Thanks for all the effort. Sounds good and I look forward.
 |
No problemo. quote:

P.P.S It might be a while before you see any mods from me, being a beagle of little programming ability. For example. I was trying to do a bit of tweaking the other day and couldn't figure out why I was crashing. Then I realized I had left Net Nanny on and she had edited out all the "naughty bits", like "bomb_cabinet".
 |
It'll do that. haha.  ------------------ Author of Diplomod. The mod to fix diplomacy. Rommell to a sub-commander outside Tobruk: "Those Australians are in there somewhere. But where? Let's advance and wait till they shoot, then shoot back." |
WesW apolyton.net/wes Huntsville, Al., USA b.02-15-99
|
 |
posted January 19, 2001 06:42
  |
 |
 |  |
Nice site, Omnigod. There needs to be a central place where people can go to try out all the new things being worked on.Dale, I would be very interested in seeing your mod once you are a little further along in it. Are you just adjusting the original text files, or are you making slic for all this? |
Pintello Warlord Deland, Florida b.02-15-99
|
 |
posted January 19, 2001 08:52
 |
 |
 |  |
Hi Dale,quote: P.P.S It might be a while before you see any mods from me, being a beagle of little programming ability. For example. I was trying to do a bit of tweaking the other day and couldn't figure out why I was crashing. Then I realized I had left Net Nanny on and she had edited out all the "naughty bits", like "bomb_cabinet". That was very funny! Computers, you gotta love them! Timothy Pintello |
Huysmans_666 Chieftain Hoeven,Noord-Brbant,netherlands Jan 2001
|
 |
posted January 19, 2001 13:36
 |
 |
 |  |
Hi,I'm rathern new on the block here but that solution to the array out of bounds error don't work when you take away the + 5. In the for statements you have to change DIP_civ1 to player[DIP_civ1] and you have to change all of these statements ! This is a simple C programming language error...you have to let the SLIC know which array it's about ! The player array ! But having changed this leaves me with a new error. To many arguments in ConsiderDiplomaticState. What the heck is this ? How do I solve this. |
Dale Prince Melbourne, Australia Dec 2000
|
 |
posted January 21, 2001 18:53
 |
 |
 |  |
If you didn't see my post in the Activision statement post, then I'll repeat myself here.I'm very pissed off with the support we've received for CTP2. While a good game, the glaring problems will not be addresses (namely diplomacy and AI ferocity). In response to the frustration I'm facing in trying to get the AI to perform diplomacy, I'm putting Diplomod V3.0 on the shelf. If I don't have anything else to do, I may go into it. But considering how many crashes I get with patch 1.1, and the fact that the unpatched CTP2 has almost no diplomacy SLIC available, I doubt very much that I'll continue. Thanks for your support though. Except for the fact the AI will NEVER make a treaty or alliance (because of the internal programming settings and there is no SLIC to force a proposal/acceptance), I actually had a pretty decent AI diplomacy model working. But without treatys or alliances between AI's, what's the point of using diplomacy? These two options make diplomacy, not all the others which I have working well. PS. If there is interest for the AI diplomacy script that I do have working, then let me know and I'll send it to Rich to update his link on V2.2. Wes, it's a SLIC script, not just txt file changes. ------------------ Author of Diplomod. The mod to fix diplomacy. Rommell to a sub-commander outside Tobruk: "Those Australians are in there somewhere. But where? Let's advance and wait till they shoot, then shoot back." |
kormer Chieftain
Jan 2001
|
 |
posted January 21, 2001 19:12
 |
 |
 |  |
Dale, please do not give up your efforts. I just installed your diplomod into my modern era scenario today. I already had treaties setup, and the game was going awesome. I was playing as the indians. After a few turns, the EU declared war on russia, and the next turn 4 other nations declared war on russia as well. |
MarkG Apolyton CS Co-Administrator Macedonia, Greece b.02-15-99
|
 |
posted January 21, 2001 19:36
  |
 |
 |  |
yeah, Dale, dont give up! i believe we have a lot to find out on what we can do with ctp2! |
OmniGod ACS CtP2 Database Manager Philadelphia, PA, USA --> Really Canadian Dec 1999
|
 |
posted January 21, 2001 19:54
 |
 |
 |  |
I agree with Mark there.. there is potential for this game, and we'll find all the things that we can change, and maybe MrOgre will pop back, once he's had a nice rest, and give us a little guidance or someone else will find part of your solution... there's enough of us, we should be able to improve this considerably.rich |