Can adding custom units to the equipment file break the AI ?
Moderators: Slitherine Core, Panzer Corps Moderators, Panzer Corps Design
Can adding custom units to the equipment file break the AI ?
Cheers fellow tacticians,
after having quite a fiddle with PC and the already available user-created mods (thanks for those), I have started to mess around with custom units and some polishing/stat editing in the equipment file. For this, I have started with a working vanilla install of PC 1.04.
Among other things, I have added some more tank and fighter/bomber varieties to the French mix (not on the maps, just in the equipment roster).
When I started the 1939 vanilla campaign using this modified equipment file, it seems that the AI is now broken:
I have noticed a strange AI behaviour that got obvious when I reached the France map (Fall Rot): The French AI army would no longer try to fortify the mainland cities behind the initial front line, as it always did in previous campaigns I played (same difficulty level). There were almost no infantry and/or AT gun units to hinder the German advance to capture objective cities - all but one (that had a lone French infantry defending) were deserted and taken by the advancing Wehrmacht forces without resistance.
Did anyone else notice odd things like this after having added some custom units to the game? Is it possible that the AI is probably saving money to buy one of the new units (which are "reasonably priced" similar to the vanilla units BTW) rather than drafting cheap units for quick city defense?. Can I fix this by adding the "nopurchase" flag to all custom units (and thus restrict them to appear on custom maps/scenarios)?
I am looking forward to your thoughts on this matter. Regards!
after having quite a fiddle with PC and the already available user-created mods (thanks for those), I have started to mess around with custom units and some polishing/stat editing in the equipment file. For this, I have started with a working vanilla install of PC 1.04.
Among other things, I have added some more tank and fighter/bomber varieties to the French mix (not on the maps, just in the equipment roster).
When I started the 1939 vanilla campaign using this modified equipment file, it seems that the AI is now broken:
I have noticed a strange AI behaviour that got obvious when I reached the France map (Fall Rot): The French AI army would no longer try to fortify the mainland cities behind the initial front line, as it always did in previous campaigns I played (same difficulty level). There were almost no infantry and/or AT gun units to hinder the German advance to capture objective cities - all but one (that had a lone French infantry defending) were deserted and taken by the advancing Wehrmacht forces without resistance.
Did anyone else notice odd things like this after having added some custom units to the game? Is it possible that the AI is probably saving money to buy one of the new units (which are "reasonably priced" similar to the vanilla units BTW) rather than drafting cheap units for quick city defense?. Can I fix this by adding the "nopurchase" flag to all custom units (and thus restrict them to appear on custom maps/scenarios)?
I am looking forward to your thoughts on this matter. Regards!
-
- Panzer Corps Moderator
- Posts: 2119
- Joined: Tue Jun 03, 2008 9:32 am
Welcome to the forum Cortilein.
I assume you made a backup of the equipment.pzeqp before you edited it, so I would suggest restoring the original and testing the scenarios again to see if the AI does what you think it should. My guess is that you have (inadvertently) affected some of the standard equipment and the AI can no longer use them - just a guess, though. The AI is not affected by e-file edits - only the stats of the equipment is.
How did you edit the e-file? Did you use the Equipment Editor or do it in Excel?
If you don't have a e-file backup (always backup before editing files blah blah!) let me know and I can send you my 1.04 one.
I assume you made a backup of the equipment.pzeqp before you edited it, so I would suggest restoring the original and testing the scenarios again to see if the AI does what you think it should. My guess is that you have (inadvertently) affected some of the standard equipment and the AI can no longer use them - just a guess, though. The AI is not affected by e-file edits - only the stats of the equipment is.
How did you edit the e-file? Did you use the Equipment Editor or do it in Excel?
If you don't have a e-file backup (always backup before editing files blah blah!) let me know and I can send you my 1.04 one.
Hi El_Condoro,
thanks for the welcome!
I have only worked on copies (of course), so restoring the vanilla 1.04 e-file was no problem. In fact I have observed the AI to act more aggressively again now (e.g. tank attacks) - most importantly, the AI has resumed placing at least an infantry or anti-tank unit to defend its hinterland cities, slowing down rush advances.
Strange thing though... I would love to expand the e-file as I did, but not at the cost of 'confusing' the AI - which undoubtedly is superior to the classic Panzer General AI. Seems more of a fun breaker for me if the AI gets lame than having to pass on a slightly greater variety of units.
My guess is that the AI is 'thinking' what to do with its prestige and can't really handle some of the custom units modded in (or it is so keen on getting them that it neglects to get some cheap units for defense).
I think I will stay with the vanilla file for now - and apply only minor changes like eliminating typos, adding missing long descriptions and tweaking one or two stat values here and there. That should be fine with the AI, I suppose...
thanks for the welcome!
I have only worked on copies (of course), so restoring the vanilla 1.04 e-file was no problem. In fact I have observed the AI to act more aggressively again now (e.g. tank attacks) - most importantly, the AI has resumed placing at least an infantry or anti-tank unit to defend its hinterland cities, slowing down rush advances.
Strange thing though... I would love to expand the e-file as I did, but not at the cost of 'confusing' the AI - which undoubtedly is superior to the classic Panzer General AI. Seems more of a fun breaker for me if the AI gets lame than having to pass on a slightly greater variety of units.
My guess is that the AI is 'thinking' what to do with its prestige and can't really handle some of the custom units modded in (or it is so keen on getting them that it neglects to get some cheap units for defense).
I think I will stay with the vanilla file for now - and apply only minor changes like eliminating typos, adding missing long descriptions and tweaking one or two stat values here and there. That should be fine with the AI, I suppose...
Well, I did some more testing.
The AI seems to work fine again with the 'cautiously' modified e-file. It gives me a good challenge in the Low Countries with continuous armoured counter-attacks and small reinforcements popping up in minor cities to block my advancing forces from gaining ground quickly.
However, I also gave the PG Classic mod a try - when using that mod (which features a lot of custom units) the AI appears to be far less aggressive if not passive in that regard. Units there use high ID numbers in the e-file (as almost all modded-in units do), and I'm afraid that the problem described above when I was using my own modifications pops up again.
If this turns out to be true, it might be a severe blow to user-created expansions of the equipment roster - at least at this point in development of the Panzer Corps game.
I wish I had better news - is anybody else in this community experiencing this strange AI behaviour when playing mods?
The AI seems to work fine again with the 'cautiously' modified e-file. It gives me a good challenge in the Low Countries with continuous armoured counter-attacks and small reinforcements popping up in minor cities to block my advancing forces from gaining ground quickly.
However, I also gave the PG Classic mod a try - when using that mod (which features a lot of custom units) the AI appears to be far less aggressive if not passive in that regard. Units there use high ID numbers in the e-file (as almost all modded-in units do), and I'm afraid that the problem described above when I was using my own modifications pops up again.
If this turns out to be true, it might be a severe blow to user-created expansions of the equipment roster - at least at this point in development of the Panzer Corps game.
I wish I had better news - is anybody else in this community experiencing this strange AI behaviour when playing mods?
Please do report back if this turns out to be true.Cortilein wrote:However, I also gave the PG Classic mod a try - when using that mod (which features a lot of custom units) the AI appears to be far less aggressive if not passive in that regard. Units there use high ID numbers in the e-file (as almost all modded-in units do), and I'm afraid that the problem described above when I was using my own modifications pops up again.
One way to possibly explain this would be the AI settings - most units in PGClassic are on "Default" AI, and unlike what I thought initially, that doesn't seem to imply they're offensive in offensive scenarios and defensive in defensive scenarios.
It also leads to sometimes odd/unfavorable AI actions like leaving perfectly good defensive positions behind or just sitting there waiting to be killed etc.
I plan on retouching the AI states, but I'm somewhat reluctant as it would be a gargantuan task to click on basically each AI unit on all maps ... *shudder*.
_____
rezaf
-
- Panzer Corps Map Designer
- Posts: 4537
- Joined: Fri Jun 24, 2011 1:21 pm
- Location: Belgium
- Contact:
I know the feelingrezaf wrote:
I plan on retouching the AI states, but I'm somewhat reluctant as it would be a gargantuan task to click on basically each AI unit on all maps ... *shudder*.
_____
rezaf

But it is well worth in the end, scripting each unit seperately gives more control over the general behaviour of the AI. It is hardly ever necessary for units in close proximity of a VH, but those further away, like along the frontlines or laying in ambush for example, do need a developer's hand.
Sofar with GTPG i had no reactions that the AI is not putting up a fight

https://www.facebook.com/NikivddPanzerCorps
https://www.youtube.com/channel/UCk2lyeEuH_hoA1s7tnTAEJQ
https://www.youtube.com/channel/UCk2lyeEuH_hoA1s7tnTAEJQ
Some good news - I just installed the PzC 1.05 update and as far as I can tell this fixed the AI problems I had observed previously.
Most interestingly, when I resumed an old save game of my PGClassic session (which uses its own e-file that should not have been touched by the update) and played on with the 1.05 patch applied, the AI fought back again! Remote cities were again fortified and defended with a variety of infantry units, AT guns, and artillery - armoured counter-attacks were back as well!
So whatever had caused the problem here, at the current state my PzC installation works again. I will now carefully mod in a few units to the 1.05 e-file and start over with the vanilla campaign to see what happens.
No clue what exactly went wrong before - probably the AI simply didn't buy reinforcements any longer, for whatever reason. Fingers crossed for the next mod attempt...
Thanks again for your help!
Most interestingly, when I resumed an old save game of my PGClassic session (which uses its own e-file that should not have been touched by the update) and played on with the 1.05 patch applied, the AI fought back again! Remote cities were again fortified and defended with a variety of infantry units, AT guns, and artillery - armoured counter-attacks were back as well!
So whatever had caused the problem here, at the current state my PzC installation works again. I will now carefully mod in a few units to the 1.05 e-file and start over with the vanilla campaign to see what happens.
No clue what exactly went wrong before - probably the AI simply didn't buy reinforcements any longer, for whatever reason. Fingers crossed for the next mod attempt...

Thanks again for your help!
Entwarnung, meine Herren! 
The AI just made my forces' ride through Norway (!) a disaster - AFTER modding in a whole bunch of custom units for various nations! I guess I figured out the issues that caused the problems before:
First of all, there was a double entry for a British AA unit in my personal modded e-file. After going through the whole thing (and the efx file as well) line after line, I also noticed that indeed some tabs were incorrect. It appears that this somehow broke the AI - while, otherwise, the game started up normally.
I guess I learned my lesson. I am very happy with the result now! Cheers to the developers, the modders and the community - which will hopefully overcome the recent 'quarrels'...

The AI just made my forces' ride through Norway (!) a disaster - AFTER modding in a whole bunch of custom units for various nations! I guess I figured out the issues that caused the problems before:
First of all, there was a double entry for a British AA unit in my personal modded e-file. After going through the whole thing (and the efx file as well) line after line, I also noticed that indeed some tabs were incorrect. It appears that this somehow broke the AI - while, otherwise, the game started up normally.
I guess I learned my lesson. I am very happy with the result now! Cheers to the developers, the modders and the community - which will hopefully overcome the recent 'quarrels'...