Sundae2608 / BattleSimulation

Battle Simulation mimicking the mechanics of the Total War series
1 stars 0 forks source link

Unit State is STANDING but singles' are not #74

Open elainedo opened 4 years ago

elainedo commented 4 years ago

After a unit has moved (UnitState set to Standing), each single belonging to the unit starts to move to a predefined position that eventually forms the unit. It looks like the Unit is moving but the state is Standing - could be confusing...

Sundae2608 commented 4 years ago

This is primarily because the UnitState controls the anchor point, not the single points. The anchor point usually arrives at the destination and switch to STANDING before the singles arrive.

I think this issue is only problematic up to the wrong stamina recovery, but it is probably fine to leave it for the time being while we come up with a solution. One way is when the unit is in STANDING, we scale the stamina lost & recovery according to the number of STANDING singles.

One note is that when the unit is in standing, we should not do stamina lost even if only a 1 single is still MOVING. That is because there are situations in which we cannot make all singles going into STANDING state (when the unit formation is overlapping with trees for example).