triplea icon indicating copy to clipboard operation
triplea copied to clipboard

BattleTracker - Player, Germans attacks a Neutral territory, and should have had to pay -9, but did not have enough PUs to...

Open tripleabuilderbot opened this issue 9 months ago • 9 comments

Map

Hearts_of_Iron2 / Hearts of Iron2_Lion's Den_1944

Log Message

Player, Germans attacks a Neutral territory, and should have had to pay -9, but did not have enough PUs to pay! This is a bug.

TripleA Version

2.7.14871

Java Version

11.0.19

Operating System

Mac OS X

Heap Size

6144M

tripleabuilderbot avatar Apr 14 '25 17:04 tripleabuilderbot

Might be related to #13239 I can't get 2.5 to work on my machine anymore, so Idk if this worked correctly with 2.5 or if it's a xml error. 13239 was on windows and this is mac fwiw.

I'm not familiar with the map. @RogerCooper do you have any experience with this map ?

I will close the duplicates anyway

beelee1 avatar Apr 14 '25 20:04 beelee1

The XML looks correct. The neutral charge was used in Classic edition but rarely since then. It is probably a bug in the game engine, but I doubt that anyone is interested in tracking it down.

RogerCooper avatar Apr 14 '25 21:04 RogerCooper

@RogerCooper do you know if it worked right in 2.5 ? I remember a change a few years ago dealing with negative PUs not working correctly when you didn't have enough PUs.

I have a mod that cost PUs to Declare War and if I don't have enough, it works correctly. I guess combat/battle are different than a DOW so maybe that's why?

well, I guess if it didn't work in 2.5, then it'd be a low priority. If it did work though, probably a bit higher. I'll dig through the old issues and see if I can find it. Was probably 3-5 years ago anyway.

beelee1 avatar Apr 14 '25 22:04 beelee1

I don't remember whether it worked. The AI almost never atttacked neutrals with a neutral charge and as a player it did not make sense in the Classic.

An action that costs PU's should not be affected.

RogerCooper avatar Apr 14 '25 22:04 RogerCooper

@beelee1, @RogerCooper: Thank you for your discussion! Once you are clear what exactly the problem for this issue is, please provide a save game and a precise description. In case there are multiple topics you encounter, do not hesitate to create new issues in the same manner. I would like to keep developers focused on the code and not on discussions, so I highly appreciate your support with that!

frigoref avatar Apr 15 '25 23:04 frigoref

@frigoref will do although this one seems to be a low priorority.

Thanks for kicking ass developer mode lately :)

beelee1 avatar Apr 16 '25 03:04 beelee1

@frigoref, @beelee1

This is a battle/combat error not a movement/move validation error. The question is when does the neutralCharge happen? According to the engine it is during the battle, specifically, during the taking over of a territory when the attacker takes possession of the territory (BattleTracker/takeOver method). In HoI2 the combat move is before the purchase phase. Verification is done but there are no PUs subtracted for neutralCharge. The player, AI or Human, can spend all the PUs during the purchase phase. Then if the player attacked a Neutral owned territory, and won the battle, the player would then need to pay the neutralCharge.

So before @frigoref can do anything about this error, the topic of "When does an Attacker pay the Neutral Charge?" needs to be discussed.

Cheers...

P.S There is no movement verification for neutralCharge. Even if the attacking player does not have enough PUs, they may still attack a neutral territory. This is also true with 2.5.

Cheers...

WCSumpton avatar Apr 23 '25 16:04 WCSumpton

@WCSumpton , @beelee1 Could you please clarify that? I would also like to add that a payment that is only potentially required (e.g. only when the attacker takes possession of the territory) might cause the following problem: Originally the movement is planed with sufficient PU (e.g. 5) for each action individually (e.g. 3), but the sum of all actions, if all lead to the point where payment is due (e.g. two take overs lead to 6 PUs). Simply assuming each action is requiring the full payment is probably not a good solution as for example attack and retreat tactics might not result in the actual payment and are still intended by the user.

frigoref avatar Apr 23 '25 17:04 frigoref

@frigoref, @beelee1

Please review the following saved game.

2025-4-23-Hearts-of-Iron2_Lion's-Den_1944.zip

Russian's first turn, the save is after Russian purchase. Press done to complete the purchase. The only territory attacked is Neutral owned Armenia. Since this is the only battle the combat will automatically start. Because it is low luck, Russia should win the battle. At the completion of the battle, the "Error" will appear because Russia have spent all their PUs on their purchase and there is nothing left to spend on the neutralCharge of 9PUs. The "Error" is not a game breaker, as play can continue as normal. If Russia were to lose the battle, the message would not appear. Since the "Error" can be ignored, maybe it should be reworded as a warning pop-up? Should the neutralCharge be done after combat movement? I don't know the rules that well, I thought that neutralCharge was applied for attacking? But clearly it is for winning a battle against a neutral territory.

Until someone can answer that question, there is nothing that can be done for this issue.

Maybe change/add a "Discussion" tag?

Cheers...

WCSumpton avatar Apr 23 '25 19:04 WCSumpton

Closing as duplicate (indicated by same title) of #13291 is already closed.

github-actions[bot] avatar Sep 12 '25 00:09 github-actions[bot]