Improve Battle Calc Unit Ordering
-
For some complex maps, the unit ordering doesn't seem to make much sense as can be seen for TWW where AA gun, AT gun, and Fighter seem out of place:
The reason for this is that the engine currently doesn't keep the ordering from the Production Frontier in the XML and then applies the following sorting for land battles:
- Land Units
- Air Units
- AA Units (any unit with any type of AA attack)
- Naval Bombard Units
This works well for simple unit sets but any map that uses AA to have units target specific other units then ends up with those units sorted at the bottom after air units as can be seen above (AA gun, AT gun, Fighter) which all have an AA type attack.
I'm proposing to have it respect production frontier ordering and change to the following sorting:
- Land Units
- Air Units
- Non-attacking Land Units (have 0 movement or can't move during combat move)
- Naval Bombard Units
This helps in a few ways:
- Keeps the current functionality of true AA guns in v2, v3, and global sorted at the end
- Allows units like fighter and AT guns (AA attack units that can combat move) to fit with their normal groups
- Helps align the battle calc window for attackers and defenders (puts defend only units towards the bottom)
- Allows map makers to specify order in production frontier which is respected within the above groups
After changes:
-
@redrum The other question is would having a better setup/ordering in the production frontier address this as well?
-
@hepps In theory, we could remove the sorting all together and take what is in the production frontier as the order. The problem with that would be if you add units to the production frontier then they would appear at the end with no sorting.
-
@redrum No what I meant was... can the entire system (with your proposed changes) also be improved by detailing in the POS2 XML that during the design phase.... BC display results can be improved with a standardized set up/unit ordering.
-
@hepps Ah, yes. In general, map makers should order units in the production frontier in the order they would like them displayed. A note should probably be added to POS2 XML to that point.
-
-
@redrum I find that if we did some work on being very clear in POS2 (since it is already such a great tool for map-makers) the quality of new submissions would be greatly improved.
-
After the changes here is the result for TWW:
Definitely better though I'd argue that @Hepps should re-order the production frontier to have AT gun right after artillery and naval fighters right after fighter
-
@redrum I down voted your post.
But truth be told the new ordering seems to be a nice improvement.
-
@hepps Now my forum reputation is ruined... Only thing to do is down vote your down vote response
-
@redrum LMAO!!!! This is going to get ugly.
We are both going to go from respected members to horribly disdained people.
To quote a beautiful mind... "Vengeance is the most assured path to mutual destruction. "
-
-
PR submitted: https://github.com/triplea-game/triplea/pull/2941
-
@Frostion This change for example improves the ordering for Iron War as well. Probably affects a few of your other maps too (most likely for the better).
Before (weird seemingly random order):
After (much smoother/logical ordering):
-
If the productionFrontier is triggered to remove once available units from a nations production.
And there is still some of that unit type on the map. Will it still be listed in the BC?
-
@general_zod Yeah. The way it works is it takes all the units from the production frontier first then checks all your owned units that are on the map and adds in any that aren't in the production frontier at the end.
-
@redrum
This change looks great! The difference between something good and something great is attention to detail -
@redrum 0 movement doesn't imply that the unit is non-attacking, as you can have it movement boosted or transported or, anyways, movement 0 units can attack in contested territories (for example, the Fortress of Napoleonic Empires FFA, when downgrading to war, that have also attack 4, but would attack if having attack 0 too). Of course, in the basic rules games there are no ways a movement 0 unit can attack. But in the moment more games are made in which there are limited combat rounds and you can place units in hostile territory, this occurrence becomes less marginal (for Napoleonic Empires FFA, attacking movement 0 units were specifically wanted, of course).
-
@redrum I'm also not convinced that either movement 0 or cannot combat move units at end is always preferable.
For example, if I make a "static infantry" unit that it is 0/1, movement 1 and cannot move during combat move, I think that would be better displayed before the "infantry".
The same in case territories have movement 0 units already in it, maybe defence 1 simple ones, to represent territorial militia, or something the like (would make more sense being first, as being the foremost fodder).
I believe the ordering would be better if by the same order in which defender casualties are preselected in the battlecalculator. This would also help, especially in PBEM games, in knowing in advance what the order will be, for the defender (of course, this should be documented, to let people know). In this case, a bunker would be still last, if it would be the unit that the battlecalculator would kill last.
The main reason I can see for not having a "bunker", or anyways defence only unit, at the start is that would push down all other defending units, losing the alignment with the attacking ones, so I'm making a feature request specifically for overcoming that issue, another way. -
@redrum I think it woud be just better letting the mapmakers able to define if a movement 0 or cannot combat move unit should stay at the start or at the end or somewhere else in the list, by their order in the production frontier. Alternatively, I would go with the battlecalculator order (so, a 0/1 immobile unit would be first, and a 0/4 immobile unit would be last). For the problem of defence only units pushing the defence listing only down (like in the case of your first image, in which the alpine infantry is pushed down from 1st to 3rd position by the two immobile units), deteriorating simmetry, I've opened this f.r., that would cover that (the solution would be pushing down the attacking alpine infantry too, leaving empty spaces):
https://forums.triplea-game.org/topic/695/always-align-the-same-named-units-in-the-battlecalculator-if-any