-
Notifications
You must be signed in to change notification settings - Fork 402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Matches#lambda$territoryIsPassableAndNotRestricted$120:1007 - java.lang.NullPointerException #13158
Comments
Here's a text version of the XML file I'm using for the game. |
Hi, thats an old version, upgrade to 2.7 Maybe worth having the old 2.5 installed at the same time, as sometimes it gives better error messages. |
OK, I think I've found the problem -- looks like the Hard AI and the Fast AI don't have any instructions for how to place non-infantry units for a noPU nation. They can buy and place units with PUs as normal, and they can place infantry for a noPU nation, but they can't place, e.g., artillery for a noPU nation. The previous version of my custom map had a separate bug in it that caused the noPU nations to only produce artillery (see https://forums.triplea-game.org/topic/3323/building-multiple-unit-types-with-productionperxterritories?_=1738422331993 for more details), which is what was causing the Null Pointer Exception. Today's version of my custom map has fixed that separate bug, so human-controlled noPU nations can produce infantry, artillery, ships, etc., and the Hard/Fast AI controlled nations will just produce infantry. This is still not the desired behavior, but at least it's not crashing the game. |
Do all your nations have a Capital, even fake ones? |
I believe so! Sowjets_Puppet_States are in Afghanistan, French are in Sahara, Dutch are in Himalaya, Chinese are in Mongolia, and Minor_Axis_Powers are in Greenland. And then the majors have their capitals in the usual places: Washington, London, Berlin, Rome, Moscow, Tokyo. That's eleven, right? It's the 11 Nation Mod. I don't think I missed any. |
Have you tried 2.5, if so did it error and give you more info? |
playerAttachment, rulesAttachment should only be one each per player. This maybe causing some of the problems. Cheers... |
Thanks, but I remembered when you taught me that lesson two years ago, and I was careful to only have one rulesAttachment per player. In fact, some players have no special rulesAttachment. Here are all the rulesAttachments in my .xml:
|
Nice! After making those changes, I was able to run your xml using world_war_ii_v3 with Fast_AI and seen no errors. Will do more testing. Question, how long/rounds until this error shows? Cheers... |
Thanks! The error shows up the first time a HardAI or FastAI begins its turn. So, if Russia is a HardAI, then in round 1 at the start of Russia's turn the game will crash. |
I'm not able to reproduce this error. I'm using your attached xml in world_war_ii_v3, setting all players to Hard/Fast AI and encounter no errors between 5 and 10 rounds. I am sorry. I'm trying to reproduce this error, but it seems that I'm not able. Cheers... |
I've checked the engine code for "territoryIsPassableAndNotRestricted", and it seems more for placement/movement and not with purchaseNoPU. So, I'm still unable to figure out what is happening. I will be going to bed soon, and tomorrow is the Super Bowl, so I'm not sure how much time I can spend on this until Monday-Tuesday. Again sorry. Cheers... |
@JGreenLowe |
I tested using both 2.5 and 2.7+. I'm beginning to think its map related. Cheers |
Here's the complete folder I'm using, including the map. |
Thank you! I've tested all the maps, with only WW2v3-1939-11N-test.xml showing errors. This error was because French and Minor_Axis_Powers not having required Capitals (Sahara and Greenland respectively). Also, in WW2v3-1939-11N-test.xml, I noticed that the rulesAttachment were not combined (these I did not change). Because there are no playerAttachment, I decided to set the option for not having capitals to true for both French and Minor_Axis_Powers thus I did not change the status of Sahara or Greenland. After changing their capital requirements, WW2v3-1939-11N-test.xml was able to run 5 rounds with no errors and all players set to Fast_AI. I tested WW2v3-1939-11N-custom.xml with all players at Fast_AI, all players at Hard_AI, all axis as Fast_AI with allies as Hard_AI, only Russians as Fast_AI, and one more time as only the Sowjets_Puppet_States as Hard_AI. There were no changes made to the xml and all games played with no errors. All tests were made on engine version 2.7.14934. Cheers... |
OK -- thank you for your support! WW2v3-1939-11N-test was just for debugging, so it doesn't need to work. The only map that's new is WW2v3-1939-11N-custom. Sorry I didn't make that clear in advance. I believe the map works fine on 2.7; this is probably just a 2.6 bug that's already been fixed. I am currently playing a game on the forum on another map with an opponent who specifically requested that we use 2.6, and I don't want to be constantly reinstalling different versions, but when that game is over I will continue my development of this map using 2.7! |
User Description
I'm trying to play a custom version of WWIIv3 1939 that allows players to place non-infantry units for minor powers based on the number of territories they control, using productionPerXTerritories.
The game works properly with human players, with Easy AI, and with DoNothing AI, but when using Hard AI or Fast AI I get a Null Pointer Exception as soon as it's the AI's turn.
Possibly related to #12872.
Map
ww2v3_11n
TripleA Version
2.6+14176
Java Version
11.0.9.1
Operating System
Windows 10
Stack Trace
The text was updated successfully, but these errors were encountered: