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
ConcurrentBattleCalculator#calculate:200 - java.lang.IllegalStateException #12488
Comments
hmm .. havent seen this in 2.6 Maybe try the latest 2.6 It might be already fixed |
Thx for your answer, but isn't 2.6.14470 the latest 2.6 version? |
@fasthard looks as if 14705 is latest. https://github.com/triplea-game/triplea/releases/ I've been using 14696 and haven't noticed it. It may have just not come up yet though. Looked like when same units went at it is when it nutted up. So that's possible it's not known about and still going on. |
@fasthard do you remember what happened when you got this error? Do you happen to have an autosave from a phase right before this that reproduces the error after loading? We've gotten a few reports of this type of error, but not a reliable way to reproduce, so any help would be appreciated! |
Hi, well I edited this file: |
Those two saves have all players set to human and there are no pending combat moves. So it doesn't seem like there's enough to reproduce the issue there? Can you clarify again how you got the error? Were you playing this game online with a bunch of humans - or did you play with AIs? You don't have any autosaves from right before the bug happened? |
Although I guess I can reproduce this by just leaving edit mode on when ending a phase. autosaveBeforeEndTurn.tsvg.zip I guess we can make it so ending a phase will turn off edit mode. Or we can make it so no combats happen in edit mode. |
Looks like the error is not new to 2.6. I tried with 2.5 and hit this one: #12434 |
I looked through at the code history of when edit mode was made to ignore combat casualties and it was when it was originally added here: So I guess it always worked this way (i.e. no casualties are done when edit mode is active in combat). I'm actually not sure why that's the case. To me, edit mode is just about editing the state of the game. I feel like after you do that, there's no reason to also make combat dice rolls have no effect - why not let it happen as normal? That would simplify the code a lot and let us get rid of bugs like these. |
This logic was just adding code complexity and some bugs and it's not clear why it's needed. (It was making so no casualties would ever happen during battles when edit mode is on.) Fixes: #12488 (And the duplicate issues.)
yea, so the G 40 Expansion mod uses edit with no casualties being selected so it can produce the desired game result that triplea can't do otherwise. For example, there are units that get a +1 on 1st rd of attack or defense and then revert to there normal combat modes. The only way I can make it work, is to play the battle in edit and pick the casualties manually. They still show as a hit or not according to there combat values but don't auto hit. If you make it so they auto hit, it will require a mass amount of edit to use and since the dice roller isn't documented, which would be a slower process, one would have to use an outside dice roller for verification. Please don't change this behavior or maybe I have misunderstood what was being discussed Edit Being able to select casualties manually, same as you would playing in person, offers a lot of flexibility. Obviously, it's not ideal, but if not available it will limit ways to play that have rules that triplea can't do. |
I don't think so. I remember that in the past having Edit Mode selected just allowed you to take whatever casualties you wanted (comprising possibly none at all), then (many years ago) the behaviour changed to everyone being immortal with Edit Mode on. I guess it was not an intended change, but I think I've never reported it. It was many years ago when this happened, so I might be remembering wrong, but I'm almost sure of what I'm saying. |
Interesting. Can you give more details about how selecting casualties manually works in edit mode? From what I can tell (before my change) is it would just default to no units taking damage, but the dialog to select which ones to take as casualties still pops up. Do you mean that you still play through the combat, but after each roll of dice, you go back to the map and delete units (and that affects the running battle)? Or is there some way to do this from the combat UI? Seems like a pretty cumbersome use case. Perhaps we can just support whatever rules "G 40 Expansion" required natively in the engine? Are there any maps where people need to do this? |
@asvitkine yea so here's how I currently do it on 2.6 14705 Just a quick hack to show it. If there are 3 Submarines, they get A1 D1 for first rd of combat only. Then they get there normal combat values of A2 D1. Here are some shots so we have 3 U-boats attacking. When there are 3 they get a +1 attack for first rd only. So i use edit to be able to pick the casualties as needed. so no hits in this case as a 4 and two sixes are rolled. this is what shows up in the battle window. The hits are currently zero but I can pick as many as I want. That way, if there was a hit at 3 in the first rd I could select it. Hmm I don't think I explained it very well. Basically you can choose to take a hit or not |
@asvitkine yea it's not ideal play wise but only way to be rule compliant with this mod :) It's actually just part of game play at this point as were on game 4 using it. I'm not entirely sure I'm understanding your change. I haven't tried it yet. On 14705 |
@asvitkine I had forgotten your question And on page 8, it's talking about Tank Armies and Army Corps which sound like they might be changing the number of dice rolled, etc. Wouldn't that not be supported with how Edit mode combat works due to number of dice differences? Yea the extra rolls show up in edit. So it works correctly. Yea Paratroopers will work with no edit now. This can probably be closed. wc has opened a feature request at the site https://forums.triplea-game.org/topic/3797/paratroopers-and-u-boats It'd still be nice to have at some point in the future. A lot easier to work with and other maps might use it differently. And still keep edit as is. There are other situations it's still needed. The flexibility it provides is a great tool for non rule compliant games. Anyway, Thanks again for your help. |
@beelee1 Cheers... |
@WCSumpton heh heh not that hardcore :) What I did was add a "ParatrooperBoost" unit that gives the support. He's "isAir" with 99 movement, so can go anywhere. It's essentially Player Enforced. If you forget to buy one or not enough, need to edit one in at start of CM. They are "isConstruction" so they don't count as a placement. You'll have to edit them in for defense after the battle if you win. I have some extra boxes too and have thought about just at top of map I could store some in. Then you could just click on them in NCM and "Perform Move or Other Actions" . Might be a little easier than adding by hand. Edit Or just by a extra one at start. Leave him in your Capital. That'd be easy enough :) Still have to hand roll for any AA fire they encounter as the defender can choose his targets if normal Air Units attack with it. Otherwise I could make a special aaGun to shoot at just the Paratroopers. I suppose I could make one trhat only shoots once and you can edit those in for the defender as needed. The Wolfpack is the one I went big on :) But I already had that done for removing the Wolfpack if there were less than 3 U-boats. Just for Atlantic and Med. So I just copied it and changed that for it to add a Wolfpack when theres 3 or more :) A little edit still but a Major improvement :) |
So assuming we want to keep edit as-is, how to resolve the 10000 rounds error? For battle simulation (that AI does behind the scenes), it's easy enough to just turn edit off for the simulations. At first, I thought we could make AI retreat, but then that's not always an option. |
I think for now, I'll just make edit mode get turned off when transitioning to an AI player step. Before the change, that would have just hit that error anyway, so now at least it won't. |
I have another idea of how to make subs work as you want them. Same idea of spawning a special unit before attack phase whenever there are groups of three subs of the current player. Make this unit suicide and make it actually have attacking rolls that the subs should have on first round. Then make its support attachment negatively affect the three subs by removing their dice rolls or changing what they hit on to 0. I think that should work. Could you try it out? |
Yea Idk about player vs AI in edit. I would think that wouldn't work. Never tried it. I think edit would require a human to use it. I'm actually quite pleased with how things are working now. Just a HUGE improvement thaks to your suggestion :) I like the support unit, because we can use hepps badass looking unit image, which helps tell at a glance that there is a wolfpack formed. I will test out your latest idea though. Thanks again. Really a Major improvement, with both it and paratroopers |
just reread. Yea, I see what you're saying now. The result would be the same, just a different way todo it. But I will test it |
Using your last suggestion I get an extra roll in combat. 3 U-boats and 1 Wolfpack get 4 rolls. Maybe I have the supportAttachment written wrong. The negative bonus so the U-boats don't fire works correctly. I tried it with 4 U-boats and got 5 dice. The Wolfpack is now A3 D3 and kills itself on both attack and defense. Anyway, your original suggestion works great :) And revisiting this has made me realize I should try and have the Wolfpack spawn end of CombatTurn. Won't need to buy and place at all then :) |
Is the I would expect it to be attached to Then you want |
Right now, the global_40_expansion_uhd_boxes.xml is over 78k lines long and makes for a difficult read. Every 'work-around'/hack only make editing more difficult. It's no wonder @beelee1 would rather leave thing 'as they are'. Even though the hacks look good here, each sea zone for subs, escorts, transports, etc. must be check 3 or 4 times per sea zone and there are 127 sea zones to check, and these checks are multiplied by each player. Without the use of variables and foreach loops, the number or xml lines just continues to increase. Again, I suggest that adding "maxRounds" check to both supportAttachments and territoryEffectAttachments would be a better route for what @beelee1 wants to accomplish. Cheers... |
yea that's how I set it up the first time, which works. I was just trying your new idea because you asked me to. I don't really see the difference result wise. The Wolfpack boosts the U-boats +1 for 1 rd in the first way. The second way the U-boats boost the Wolfpack for 1 rd with the Wolfpack taking away the U-boat 1st rd combat to 0. The first way works good, so i'll just roll with that :) @WCSumpton |
I thought it didn't work on attack because a suicide unit dies before it can provide support? Or did I misunderstand.
I think there was a miscommunication since my new idea was still having the special unit to provide support. It was meant to workaround it not working on attack due to the suicide thing - but maybe I didn't understand and it actually works already?
Doesn't that still require the map script creating the support unit (which I think is the main part of the complexity)? I don't see it being different in terms of complexity of XML between the two solutions except adding that property requires coding engine changes (and a lot of complexity) whereas the idea behind my suggestion is existing features can already accomplish the task. ... And yeah if you want to do checks per-sea zone etc, that should be done with variables. If it's not doing that, that would be the first thing to clean up. (Just define a list of sea zones at the top of the file and do foreach on them.) Also, just in terms of reducing file size, you can remove everything except the last name for all the |
I sent a PR for that here: triplea-maps/global_40_expansion_uhd_boxes#4 |
No, the GermanUBoat would apply the buff itself and there would be no need for a separate Wolfpack unit. If there was a "maxRounds" option in support attachments then:
Is all the code needed to handle the attack support. It's like "maxRoundsAA", which govern how may rounds a unit may conduct an AA attack. Cheers... |
yea muts've been a Led Zeppelin breakdown. :) I will look at the suggestions to clean up the code. yea still wanna have the Wolfpack image show up thow, which is easy enough todo with conditions. Anyway, it's working real good right now. I just changed it so the Wolfpacks place or remove before combat. Also after place. For placement, so if you buty 3 and place, then it'll spawn as well. Only time we'd need to edit is if the Wolfpack disolved in defense. Anyway, I don't wanna bug on your guy's time. It's working real good right now. Thanks for all your help :) |
Actually your suggestion is the best, because if the U-boats were attacked during another players turn and still had at leat 3 present, the behavior would be correct. The image would be gone, but bfd it'll respawn :) |
Let's take a second to look at what @asvitkine is suggesting. First you would need to create variable list or all the sea zones:
Now for some conditions:
Next are the triggers:
If this seems easier, then there you have it! Cheers... |
Oh way sweet you taking time on this. :) I'll look closer tommorow as it's getting late in the day for me :) But yea, i need to get that variable shit to work lol |
I'm not really following how this works, do you mind explaining? How does it ensure that the bonus only applies when there are three units present? I see you're using
|
A unit can give a support to the supported unit once Hope this explains what I am talking about. Cheers... |
Beside that the "number" of the second attachment should be 3 too, have you tested it (asking because I haven't)? To make a simpler example, are you sure that, when there is a unit which can give support to 3 other units and each of these units can receive up to 3 supports of that type, each of the units are supported once instead of only one of the units being supported thrice? I agree that should be the behaviour (and I suggest to change it to that if it is not), but I remember that I argued about it with @ron-murhammer, and I remember that he instead decided to go for stacking supports on the same unit as much as possible before supporting more as a behaviour. Again, I've not tested this specifically, and it was years ago, so I may be remembering wrong. |
I have tested this. Also, every unit added will receive that 'last bonus'. So, even though the bonus stopes at 3, adding a fourth unit and all 4 unit will attack at 3. As to the debuff, stack count is 2, and it is the same unit, so the number does not matter as long as it is equal or greater than the stack count. Cheers... |
That is what I said, the "number" does not matter as long as it is equal to or greater than the stack count. 2, 3, 4 they work because it is the unit debuffing itself, so the addition of another unit only adds to the stack count not the "number" of unit affected. Funny things will happen if the "number" is less than the stack count. LOL Cheers... |
Yes, I see it now, and anyway you tested it so most likely all good. Still, if what I remember from years ago is correct, that would mean that, when a single unit can support multiple units each of which can be supported multiple times by that same type of support, the behaviour is never to support any same unit more than once even if that means wasting the exceeding supporting modifiers, whereas, when each of multiple units can support a single unit, the behaviour is to support a same unit as much as possible before supporting more units. Am I right (Still have not tested it yet.)? If so, that seems somewhat inconsistent to me, but I need to get around doing some testing about it and maybe opening a discussion or an issue about it. Anyway, since you tested it that it works that way, I definitely agree that having a "maxRounds" is all that it is needed, and doing it that way is way better and cleaner. On top of that, a "maxRounds" would be a very valuable feature on its own. |
It is also an interesting albeit rough example of sort of "economies of scale" (not the right phrase), where having more submarines in the same zone makes each of them more effective. It makes me think to some cards of "Magic" where the offence/defence (or whatever it is called) of each of the cards is equal to the number of these cards in play. In TripleA terms, it would be like that, if you have 1 unit in the battle, the unit is 1/1, if you have 2 units in the battle, each of the units is 2/2, if you have 3 units in the battle, each of the units is 3/3, and so on. |
Map
world_war_ii_global
Log Message
java.lang.IllegalStateException: Round 10,000 reached in a battle. Something must be wrong. Please report this to TripleA.
Territory: 62 Sea Zone Attacker: Japanese Attacking unit types: carrier,battleship,fighter,transport,destroyer,cruiser, Defending unit types: carrier,battleship,submarine,fighter,destroyer,cruiser
TripleA Version
2.6.14470
Java Version
11.0.4
Operating System
Windows 10
Stack Trace
The text was updated successfully, but these errors were encountered: