[Fixed] IllegalArgumentException: Cant remove more than player has of resource
I am playing on version 22.214.171.124.9687 with some of the WWII maps. Consistently I am getting "IllegalArgumentException: Cant remove more than player has of resource" errors during the Japanese (Hard AI) purchase phase. I have found that after I save and load the game later, that none of the players have any money to buy new units. Attached is the log and save file (saved once I regained control from the AI at the start of the American turn).
@gogmosis Which Java version are you running TripleA with?
From time to time (engine version to engine version?) I see something like this in Iron War, as the different nations continuously have different special resources removed by triggers.
But I don't recall the game breaking down. Still, pretty annoying.
It's ww2v5 here, nothing special inside. The savegame doesn't include anything weird as far as I can see, as the game history is clean. Also the players have all their PUs correctly accounted and are able to buy units. I don't get an error message, either. In other words: I cannot reproduce the issues mentioned.
That is why I assume a Java compatibility error here.
@gogmosis Some of the errors in your log suggest you're running TripleA on Java 9, 10, or 11. Currently, TripleA only supports Java 8.
However, we've recently made some changes that should fix one of the most serious Java 9+ bugs. You can download the latest pre-release (available here) to see if that resolves at least some of the issues you're seeing.
IllegalArgumentException, I believe I saw the same thing yesterday when I was doing some Java 9/10 testing. It only happened when it was the AI's turn, and it didn't seem consistent. I'll try to reproduce it again. If I can, I'll create a bug report on GitHub and post a link here.
@gogmosis Using pre-release 126.96.36.199.12035, I tried to reproduce this issue by running several majority Hard-AI games using the World War II v5 1942 SE TR map. I ran these tests using both Java 9.0.4 and Java 10.0.2. The exception you reported above was never raised, so it's possible that the recent Java 9+ fixes also addressed this symptom.
Would appreciate it if you could try 188.8.131.52.12035 on your machine (using the same version of Java you used above). It's possible that the issue still exists, but I simply can't reproduce it on my machine. Thanks!