[PYTHON] Bizarre attack behavior in Neoteric World. It does not contain a "CvUnitAI.cpp" for me to inspect.

arcvoodal

Chieftain
Joined
Jan 14, 2009
Messages
46
I have seen some rare weird attacks by the AI and am trying to find out what changes Neoteric World makes to the AI. I cannot find the python file.

The main thing I am asking here is if anyone knows how to access the info on what Neoteric World does with the AI because I may want to check it out for other reasons in future, but of course I will explain the behavior I want to investigate now too.

The behavior is that sometimes the AI will do a very random attack on the player with a single unit that makes no sense and nab a win, but might not attack with anything else anywhere. I must also note this behavior of a lone unit attacking irrationally like this has never resulted in a loss for them. The most extreme example was an AI getting rekt on the other side of the world just randomly has a lone transport waltz up to my full-health +20% strength destroyer and sink it, then merrily sail away.
Similar thing happened when I had a SOD outside their city. They have siege weapons and a big SOD inside the city, yet they only attacked with a single unit, a swordsman against a SOD of macemen all +10% Strength on a forested hill, swordsman won with only decimal health lost. They didn't use their siege units at all for some reason.
Another time I had a full health rifleman on a hill with +hills defense, the AI had a lot units nearby (grenadiers and cavalry), yet attacked with a maceman and won with minimal damage.

I am wondering if neoteric world does something similar to XCOM where successive losses gives a free 100% guaranteed win on the next attack (or if they are behind in tech), the AI calculations know when it has this 100% win chance and so make these random attacks that result in unlikely victory, and also why they do it without coordinating it with siege weapons.

As an aside, I also want to inspect if neoteric world removes amphibious attack penalty for the AI, maybe to compensate how hard it would be for the AI to understand to spend movement points to cross a river first and then attack their target? Just curious about that because the AI seems to cause a lot of damage to full-health well defended units for attacks across rivers and amphibious landings when in my experience amphibious attacks result in doing little damage to full-health defending units in cities and on hills.
 

f1rpo

plastics
Joined
May 22, 2014
Messages
1,419
Location
Germany
CvUnitAI is a C++ class; there is no such Python script. As I wrote in another thread of yours, I can't find C++ sources for the game core DLL in the Neoteric World thread. Having taken another look, it seems likely that Neoteric World uses the RevDCM DLL with few changes - if any:
This mod uses RevDCM core, all credit goes to the guy called Jdog something, cant remember the last part of his internet name its been a long time but he done a lot of work and time on civ 4. [...]
(Ftr, Dale would also deserve some credit, seeing that DCM is "Dale's Combat Mod.") All the "expanded gameplay" changes listed in the opening post of the Neoteric World thread also seem to be present in RevDCM, maybe apart from changes to map scripts and scenarios. The credits also match those in the RevDCM thread. It's not obvious which version of RevDCM BobeBrown used; some development on RevDCM continued until 2013. In the Neoteric World thread, it doesn't sound like updates from RevDCM were incoporated, so my best bet would be the code version from 1 June 2010, right after BBAI was merged into RevDCM. Neoteric World was first released on 10 June. Unfortunately, one can't be certain that BobeBrown didn't make some DLL changes on top of RevDCM,

The AI does have a routine AI_anyAttack (defined in CvUnitAI.cpp) for a single opportunistic attack when the odds are favorable. Seeing that the AI attacks succeeded in the examples that you've listed, it would seem that the odds were indeed favorable. Though it sounds like they shouldn't have been. If you still have savegames – what odds are shown in the combat log (Combat tab of the Event Log; Ctrl+Tab) after the attack? Maybe there are powerful promotions in the mod? Or, as you surmise, some insufficiently documented change to some aspect of the combat rules. CvUnit::resolveCombat (CvUnit.cpp) would seem like a good starting point for inspecting the code, but I think it's more promising to check the log first – also regarding the river penalty.
 

arcvoodal

Chieftain
Joined
Jan 14, 2009
Messages
46
Oh cool that there are those logs for combat! Will check it out when I am back at my beloved pc 10 days from now and report back here
 

f1rpo

plastics
Joined
May 22, 2014
Messages
1,419
Location
Germany
Here's an example, just to clarify what I mean:
Spoiler :
(Needs to be read from the bottom up.)
combat-log_AI-turn.jpg

(But the mod could do things that aren't covered by the log.)

Also: The RevDCM code version that I've suggested is probably too recent. Based on this post by BobeBrown in the RevDCM thread, this version is more likely the correct one: RevDCM 2.721
(Apparently, the BBAI merge on 1 June was merely an update to BBAI v1.0, i.e. RevDCM 2.721 already includes an earlier version of BBAI.)
 
Top Bottom