I want to make the AI attack its worst enemy!

Suit to Skill

Chieftain
Joined
Jun 23, 2008
Messages
10
Location
Los Angeles, CA
Hey guys,

I was hoping somebody could help me out with this? I recently made a small WWII scenario for myself and my friends, not really a big deal. I set the start date in September 1939 (with the calendar set to Monthly turns) and tried to make it historically accurate. So everyone who was at war in 1939, is at war here.

This means that the USSR and the United States are neutral states at the moment, though I tried to lure them into eventual war by setting their relationships with the Axis powers (in particular, Russia-Germany and US-Japan) to very VERY low, both ways. So they hate each other and everything.

Germany ends up conquering France and Japan ends up attacking China/SE Asia as planned, etc. so that all works out. But by simply using the default assets that Civ BtS comes with, I can't seem to get Germany to declare war on Russia EVER. Same with Japan vs the United States. Germany (probably intelligently) always focuses exclusively on Britain next, and since Britain isn't meant to be conquered by 1940 (if at all) the two end up duking it out forever and ever. Japan too. I mean, why declare war on the US if you're already fighting China, France, and Britain? We all know why it happened in real life; I just want to make it happen in Civ too. ;)

I don't know of a way (and I don't think one exists, short of modifying the AI or making it a mod/scenario with specific Victory Conditions, which I'd like to do, but don't know how) to make Germany and Japan EVENTUALLY declare war. I think there's a way of modifying something so that the AI puts greater weight on certain objectives/cities? If I could do that, maybe make Germany DESPERATELY want Moscow, and Japan -> Phillipines or Hawaii, it might solve everything. Maybe create "events" that cause this to happen. But I don't know how to do this. Or even if theres way that doesn't require modding.

I'll be the first to admit that I'm not experienced with XML and Python but I am an enthusiastic learner and am willing to learn whatever's necessary. I'll understand if its more difficult than I'm making it seem... But ANY help will be greatly appreciated. Maybe just a prod in the right direction? :)

Thanks,
Carlos
 
The easiest way to do this is with Python, definitely. On turn "X" you have Civ "Y" declare war on Civ "Z". Simple, effective, and also moddable to be random (by date) if you don't want it to be predictable.

The city value thing is also doable, and I've been experimenting with that. I think you can alter the value calculation in the SDK by comparing the city and the civ. What I mean is, if the attacking civ is Germany, and the target city that the AI is looking at is Moscow, you could set it to have a much higher value, meaning the AI will want to take that city more. Same for Japan and Manila. This is purely theoretical, but I believe it can be done. It is harder, though, than the war declaration since the SDK is involved.

An important thing to remember: if the scenario is multiplayer, the special Python events might cause OOS errors. So the way to get around that would be to code it all in SDK. I haven't done this but presumably you would just insert it into the SDK code where the "OnGameTurn" event check in Python is normally triggered.
 
Cool, so its definitely possible.

Between Python and SDK... I'd be playing this scenario a lot, but I'll still be playing other Civ games too. Does modifying the SDK mean that the core game itself will be affected? Like would that translate into other scenarios/mods crashing/not working properly.

If its something as simple as copying/pasting text into a specific Python file (I'll need to know which one) then I don't think that should be too hard... I guess all I need to know is what to put, where.
 
Modifying the SDK will only affect the mod in question (unless, of course, you wanted it to run every time, but in this case you don't). Just put the custom CvGameCoreDLL in the scenario folder under Assets.

Every time they release a new patch you'll have to make a new one, but that's the way it goes. :)
 
Germany ends up conquering France and Japan ends up attacking China/SE Asia as planned, etc. so that all works out. But by simply using the default assets that Civ BtS comes with, I can't seem to get Germany to declare war on Russia EVER.

Hmm, sounds like the AI is a little bit smarter than Hitler. You'll have to design an insanity subroutine. :lol:
 
so does anyone know what segment of text i should copy/paste to make Germany declare war on Russia on turn 21?

and what file i should copy/paste it to? which Python file is it and where is it located.
 
Back
Top Bottom