Improved Combat Odds

Joined
Sep 15, 2006
Messages
511
Improved Combat AI by ClassicThunder

Versions:
Current Version 1.5 (Vanilla Only):
Download (ReadMe,CvUnitAI,Compiled .DLL)
Details:
After taking a look at the function that calculates the odds for the AI. I was surprised at what I found there. Apparently only current strength and first strikes are taken into account. But not Defensive bonuses. I adjusted the code and in my short tests the AI was smarter. But hopefully someone more thorough - stares pointedly at Officer Reene - will DL the new version and leave some more feedback.

Old Version 1.0 (Vanilla Only):
Improved the combat odds wich didn't quite effect the AI the way I hoped it would.

Credits:
ClassicThunder: Code and Dll

Installation:
To use this mod alone simply copy the CvGameCoreDLL.dll into your ModName/Assets folder.

To add this mod component to an existing mod copy the code surrounded by below text (without the quotes) in the CvUnitAI.cpp file and copy it into your file CvUnitAI.cpp.
// Improved Combat Odds

If you haven’t modified the CvUnitAI.cpp simply paste it into your SDK project folder overriding the rest of the files.

What it does:
The Function the AI uses to figure out its probability of success only calculates the units’ involved current strength and the first strikes. But not Defensive bonuses! This mod allows the AI to take defense bonuses into account.
 
Edit: Because I redid the mod this info no longer is valid and is a waste of space.
 
where do you place your files?

Im not sure but this is where I put the files:

CvGameCoreUtils file
CvGameCoreDLL.dll file

in the Assets Folder



CvGameCoreUtils file

in the main/mod folder

is this correct?:confused:
 
where do you place your files?

Im not sure but this is where I put the files:

CvGameCoreUtils file
CvGameCoreDLL.dll file

in the Assets Folder



CvGameCoreUtils file

in the main/mod folder

is this correct?:confused:

No details on how to install the files is a problem for all who want to use this mod. It would be nice if a readme file could be included in the download. ;)

Very Respectfully,

Orion Veteran :cool:
 
Edit: Okay I rewrote everything it should be alot eaiser to get any info you need now; however, don't hesitate to ask any questions.
 
^^I'll fix that by tonight, sorry about that. I've got work to do now though.

But here's to help out untill then.
To add the component with any other CvGameCoreDLL.dll changes simpily place the .dll in your assets folder.

Only add in the smaller file if you wan't to recompile the SDK with this mod included, then simpily copy it into your C++ project or copy the changed text from it to your already modified CvGameCoreUtils.cpp file.



well I put the files as stated in my previous post...
will they affect it at all?

or can I leave them with the your CvGameCoreDLL.dll file since I am not combining them with another mod that edits the CvGameCoreDLL.dll file?

basically if I am using your CvGameCoreDLL.dll file, does the other files even matter whether they are included or not?

please help:confused:
 
well I put the files as stated in my previous post...
will they affect it at all?

or can I leave them with the your CvGameCoreDLL.dll file since I am not combining them with another mod that edits the CvGameCoreDLL.dll file?

basically if I am using your CvGameCoreDLL.dll file, does the other files even matter whether they are included or not?

please help:confused:

lol you posted while I was cleaning everything up.

If you put the CvGameCoreDLL.dll in your Assets folder the mod will work. You only need the other file if you need to merge mods.
 
lol you posted while I was cleaning everything up.

If you put the CvGameCoreDLL.dll in your Assets folder the mod will work. You only need the other file if you need to merge mods.

I also put the other files in there too...

so they wont affect anything then?
 
Nope. There only for if you need to merge.

thx Im gonna test it out to see how it works

then I'll use it in my mod and of course give you and the others credit :goodjob:
 
Edit: Okay I rewrote everything it should be alot eaiser to get any info you need now; however, don't hesitate to ask any questions.

I tried downloading the file again and the zip file still does not appear to have a readme text file. :cry: I'm still trying to determine the correct folder to put the file in. If you put the dll file in the folder C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Warlords\Assets then the game fails to load and actually crashes. :(

Here are some obvious questions that might help everyone:

First: Should the file be put in the C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\CustomAssets folder? If not, please specify exactly where to put the file. :confused:

Second: Am I correct to assume this file is for both Vanila Civ and Warlords? :confused:

Very Respectfully,


Orion Veteran :cool:
 
so far my brother and I are using this combat mod in a multiplayer game and have some early results...

He has been at war with 2 civs for over 40 turns and the results with this mod component has not been different.

We havent seen signifigant change between the vanilla "Combat Odds" and your "Improved Combat Odds"

my brother is basically defending his cities (no offensive attacks against enemy cities)

some examples:

*during the initial attacks his units have a 2 pt advantage in odds but still loses
- this has happened with many units with this odds advantange
(Although after the initial attacks the 2 pt advantage does help his units)

* AI is not attacking smarter - it attacks even though it has no or poor advantage in odds (subsequently losing many of its attacking units)

* after initial army (10 units or more) is repulsed from city attacks the AI still throws Units piecemeal into battle - Ten groups of 2 units attacking cities at one time as opposed to have a 20 unit stack attack the city at the same time

overall my bro lost maybe 20 units but the combined enemy loss (2 civs) was about 100 units...

We have not observed any major change from the vanilla "combat" odds

*Disclaimer* I am not sure if my OWN mod is interfering with your "improved combat odds", since I added some promotions and defensive/offensive bonuses... but my changes are mainly XML changes and should not affect AI decisions (I didnt change any SDK or Python AI scripts)

although I did make taking cities harder...



We will continue testing out this mod component and report/post to you any more observations here....if you so desire...

NOTE: this is my 2 cents so take it as you will... (or dont take it at all :crazyeye: )
 
Okay the ReadMe is definatly there. I've been going off of what other have said so far so let me look ad the SDK a little more and I'll see what I can do.
 
I'm still trying to determine the correct folder to put the file in. If you put the dll file in the folder C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Warlords\Assets then the game fails to load and actually crashes. :(

Here are some obvious questions that might help everyone:

First: Should the file be put in the C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\CustomAssets folder? If not, please specify exactly where to put the file. :confused:

My post here includes a picture of where you should put a replacement DLL, in the warlords case. Replace "Warlords" with "Sid Meier's Civilization 4" for the 1.61 game.

Second: Am I correct to assume this file is for both Vanila Civ and Warlords?

Absolutely not!!

It is impossible to make one dll that will work with both. Using it in the wrong place will cause a crash, which is what I suspect was happening with you.

In the case of this combat odds mod, you only want it for 1.61 vanilla civ4. The fix is already built into warlords, you do not need this fix.

Hope this helps, I was just wandering around and saw this thread,

-Iustus
 
Okay I took a look at the function that calculates the odds for the AI and was surprised at what I found there. Apparently only current strength and first strikes are taken into account. But not Defensive bonuses. I adjusted the code and in my short tests the AI was smarter. But hopefully someone more thorough - stares pointedly at Officer Reene - will DL the new version and leave some more feedback.
 
Okay I took a look at the function that calculates the odds for the AI and was surprised at what I found there. Apparently only current strength and first strikes are taken into account. But not Defensive bonuses. I adjusted the code and in my short tests the AI was smarter. But hopefully someone more thorough - stares pointedly at Officer Reene - will DL the new version and leave some more feedback.

damn! I just updated and tweaked my mod for more playtesting :mischief:

now I gotta add this in the mod and update all my computers again! :cry:

ah well I'll d/l it and re-incorporate it in my mods...

I'll report back later after I test this new version....maybe in a couple of days (depends when they all declare war and stuff :D )

anyway thanks for fixing it...



until my next report :salute:
 
Top Bottom