Are you, in fact, a pregnant lady who lives in the apartment next door to Superdeath's parents? - Commodore

Create an account  

 
Combat unit autoselection order

I believe quite a few people get frustrated by how the game selects your units in combat in a quite unpredictable, and often inconvenient way, more often than not letting you move a few melee units then ranged then melee again and so on.

I've uncovered how the game decides which units comes next when one finishes moving (or wait is pressed) :
It will be the one at the lowest DISTANCE from the current unit. Which is just silly considering armies start closely packed together and generally are in such a formation for the entire battle. (On top of that, it checks overland distance, so it actually considers the map to be looping around on the sides when determining that, lol)

As an experimental solution, I've made it select the unit with the lowest combat ID first. Since units enter battle in the order of melee troops first, ranged last, this at least groups them by type so all melee troops move, then all ranged ones do.

This change will be available in the 1.43 version of Caster of Magic.
Please try it out for yourself, and let me know if you prefer it, or the original unit order.

I also think the way the units are set up might be worth looking into.

For some reason, the game puts a melee unit in the middle of row 2, and a ranged unit on the far right side of row 1, at least it did in the one battle where I was paying attention to this.
Reply

Who are these people who have been frustrated? You can always select units in whatever order you like. A bigger issue is how units are set up on the battlefield.

Check distance? How does it do that when units are equidistant, as is often the case?
Reply

(March 9th, 2016, 15:13)Tiltowait Wrote: Who are these people who have been frustrated? You can always select units in whatever order you like. A bigger issue is how units are set up on the battlefield.

Check distance? How does it do that when units are equidistant, as is often the case?
If it's equal, first unit is chosen.
I'm definitely being annoyed by trying to pass the turn on melee units, then ending up pressing done on an archer because they are in a stupid order. I've seen other people missing turns on their units due to this as well, both on youtube and IRL.
If you have 4 melee units in the front row, you tend to press done 4 times expecting the game to make sense, but that just does not work, it'll pass a turn on an archer and then you have a melee unit left to move.
It neither follows how the units are on screen (first row moves, then second, then third), nor their types (swordmen, then bowmen), it's just an order with no logic.
What makes it especially bad is if you actually remember the order and try to do it according to that next turn, it still won't work because the units moved and that changed their order.
In all cases you have to play slow and either hit done one at a time, or right click on each of your archers to use them.
This can get frustrating if you have to fight a large number of battles where you have stacks of mixed types of units and cannot afford doing auto.

(meanwhile, I uploaded 1.43 so it's available to try now)
Reply

You know, now that you mention how it works it makes a lot of sense to me. If you right-click to select a unit, you probably want to focus on that part of the battle for a little while. I personally find the current behavior pretty good for stacks of high-movement heroes.

I'd be more interested in how the game decides initial troop layout. I'd never realized the whole melee first, then ranged thing, although now that I think about it it mostly seems to make sense. Heroes with ranged attacks tend to confuse things, though. How does it determine what counts as ranged versus melee?
Reply

(March 9th, 2016, 23:19)spottedshroom Wrote: You know, now that you mention how it works it makes a lot of sense to me. If you right-click to select a unit, you probably want to focus on that part of the battle for a little while. I personally find the current behavior pretty good for stacks of high-movement heroes.

I'd be more interested in how the game decides initial troop layout. I'd never realized the whole melee first, then ranged thing, although now that I think about it it mostly seems to make sense. Heroes with ranged attacks tend to confuse things, though. How does it determine what counts as ranged versus melee?


This is the order of slots to be used. (and this is the order they will be autoselected if this change is applied)

Attacker
3124
7568
B9AC

Defender
B9AC
7568
3124

1. Split armies into two lists : melee and ranged units. A unit is ranged if it has a ranged attack type of 1-99. So thrown, breath and gaze units are melee.
2. Check if there are 6 or more archers. If now, skip step 3 and jump to step 4.
3. Find the Archer with the highest melee attack. Remove this archer from the list of archers and put it in the end of the melee list. Repeat this step until there are 4 or more melee units.
4. Place melee units in the order of the list into free spots. If we are defending a city, and there are walls, skip positions 3 and 4. If there is a central structure, skip position "A" (this one was bugged earlier but is fixed already).
5. Do the same for all archers.
6. Finally all units have their "headed to" field filled by the cell directly in front of them for no reason at all. (actual movement will overwrite this anyway)

As you can see, the game tries to fill the 4 front cells with melee units, or at least the archers with the best melee attack rating if none are available. So in the changed autoselection, you can safely hit done or wait as many times as your living melee units to get to your first archer and then attack with all of them in a row, instead of having to right click one, after which another melee units gets selected automatically so you have to click again.
The old system can be convenient with heroes, or after your melee unit already moved away from the archers, but for the most common scenario, keeping the melee units in place until archers use up their ammo (or enemy comes near), it is bad.

The first unit is in the middle because that's the position of the city gate, changing that would be bad.
However, the remaining positions we can change.

I think the following would make more sense?
4123
5678
CBA9
Reply

Upon further testing I realized my change isn't doing what I expected it to. Unfortunately units do not "enter" the battle in the above order, it merely arranges their positions that way. The order units enter the battle is entirely random.
This means the current starting setup is fine the way it is, however, autoselection cannot be decided based on combat unit ID. I need a new way to determine units selection order. Maybe highest ranged attack first? You usually want to use those units before melee troops engage the enemy, as ranged attacks also add suppression. That would not only order units in ranged->melee, but even group them by type if different units are used. Another option would be lowest ranged first, since that would require the player to figure out using ranged attacks first is more beneficial on their own, but would still group units by their type, making the use of the wait button more convenient.
Reply

I found a bug.
When the game is looking for the archer with the highest melee in step 3, it indexes the wrong units.
Instead of checking Unit[Archer[i]] it checks Unit[i] which might not be an archer nor even an owned unit.
Then it uses the Archer[i] archer, which is at least the correct type of unit, but not the one with the highest melee attack!
For the time being, I made it so that unit placement uses the order proposed above, and the archer strength bug is fixed.
Autoselection selects the unit with the highest (Melee attack-ranged attack) value first, in case of a tie, the unit with the lowest combat ID. I've made sure that placement (aside from the melee-archer-attack strength priority) happens in the order of unit IDs, so if the units are of the same type (and level), they'll be prompted in the order they are placed on the field.
The changes will be available in the next CoM update.
Reply

I know this is a bit stale, but I just got used to the order in MoM. Yes sometimes it's not the unit I expected and that might make me play a little slower, but it is right often enough.

You could always use the order that planar conquest uses though.

which is the badly made MoM remake.

it selects the unit in the furthest left and upward square first. then after you end any unit's turn it will attempt to select the unit in the same row one tile to the right. then moves rightward along the same row searching for a next unit. If no such unit exists it moves downward one row and tries to find a unit going from left to right. if it reaches the end of the map it then resumes the search with the unit in the furthest left and furthest upward location.

planar conquest's order has never once surprised me, although maybe the code for that cannot work in MoM
Reply



Forum Jump: