Ticket #994 (new enhancement)
Running / Charging Units
| Reported by: | historic_bruno | Owned by: | |
|---|---|---|---|
| Priority: | Should Have | Milestone: | Backlog |
| Component: | UI & Simulation | Keywords: | run,charge,unit,motion |
| Cc: |
Description (last modified by michael) (diff)
Change History
comment:2 Changed 12 months ago by michael
Here is the currently unused charge attack schema from Sim1, still in the unit templates. Example is from the Cavalry Spearman:
<Charge>
<Hack>15.0</Hack>
<Pierce>30.0</Pierce>
<Crush>0.0</Crush>
<MaxRange>6.0</MaxRange>
<MinRange>0.0</MinRange>
<Bonuses>
<ElephantStench>
<Classes>Elephant</Classes>
<Multiplier>0.5</Multiplier>
</ElephantStench>
<CamelStench>
<Classes>Camel</Classes>
<Multiplier>0.5</Multiplier>
</CamelStench>
</Bonuses>
<PreferredClasses datatype="tokens">Organic Siege</PreferredClasses>
<RestrictedClasses datatype="tokens">StoneWall</RestrictedClasses>
</Charge>
The above is part of the Attack component, but separate from the Melee component.
Walk/Run?(and Charge in Sim1) are here, in the UnitMotion? component:
<UnitMotion>
<WalkSpeed>7.5</WalkSpeed>
<Run>
<Speed>15.0</Speed>
<Range>50.0</Range>
<RangeMin>0.0</RangeMin>
<RegenTime>0.1</RegenTime>
<DecayTime>0.2</DecayTime>
</Run>
</UnitMotion>
I am unsure what RegenTime? and DecayTime? are. But you can see that Run speed has been set to 2x WalkSpeed?. Could be good to add a ChargeSpeed? tag for either the UnitMotion? or Attack/Charge? component, so that it could be set a little faster.
comment:3 Changed 11 months ago by feneur
Have had this ticket sitting in a tab for weeks now, trying to think of something useful/indepth to say :P I can't find anything other to say than that as far as I understand them I agree with your proposed changes. Apart from maybe thinking the correct/wrong distance might be complicating things a bit too much (at least in terms of how much/how easily we can communicate it to the player). Maybe have a "charge timer" could work? E.g. to have a timer start ticking when the charge is initiated that multiplies the attack value. Coupled with stamina running out it would give essentially the same result as what you describe, i.e. if you initiate the charge too close it will not have much time to increase the timer (and thus the attack multiplier), if you initiate it too far away stamina will have run out before you reach the target and you will just attack normally. Perhaps that's complicating things more than what you are suggesting though :-/ And it's possibly harder to balance, at least effort vs result, since it's the same for all players it shouldn't matter much in human vs human games at least, AIs could of course be scripted to always charge at the optimal distance, but that applies to whichever method we'd use :) .
comment:4 Changed 6 months ago by FeXoR
In general I like the idea of charging (base speed x3) is faster than running (base speed x2). Charging should drain stamina 2 times as fast as running does (because it really drives the unit to it limits).
That will result in a strangeness though: If 2 "fresh" (with full stamina) units get close to each other (say both with charge capabilities, so melee likely) it will be impossible to flee. Running for their live however should push the individual units to their limit as well, though. Determining if a unit is "running for it's life" would be hard to determine though.
So in the end (though I like the idea) I think there should be only 1 "faster" speed (2x). That would mean an "exhausted" unit can not run from a fresh unit but a fresh unit can (if in general faster or equal fast as the unit "charging" it).
It may be easiest if "charge" would be an active ability with a maximum and minimum range. If the player clicks "charge" and then on an enemy unit the unit would walk (or run, depending on the command) untill it reaches the maximum charge distance. Then it will start charging if it has enough stamina. If it reaches the target it will execute the charge attack. If the "charge" button is right-clicked the unit will (if enough stamina) start to charge an enemy unit automatically (like "autocast" in warcraft 3). Same with running.
Another thing to think of is when are units regaining stamina? I think they shouldn't if they are fighting/gathering/walking etc. so they should only regain stamina if they are idle. That means that stamina is mostly wasted if used for gatherers. If not used it can then be used in case of an raid to bring the gatherers to safety. Formations with stamina could indeed start to make sense (at least to me) if the unitAI tries to keep all units in the formation to keep stamina by sending fresh units to the outside of the formation while fighting and draw exhausted units inside the safety of the formation (same with units high/low on health, especially good with healers in the formation).
One thing I'm opposed to is that units can "cheat" by running without stamina consumption if catching up to a formation!
Other thoughts: Another thing to consider is that stamina could be widely used for special abilities e.g. throwing spears would be cool to be rare, not the default attack, units with shields could use stamina to block attacks, heroes could boost close allies attack with a warcry with stamina consumption, healers could loose stamina with their heal ability, some units could attack faster/harder for stamina and so on. That way it might be good not to "waste" stamina on running.

First, the distinction between "run" and "charge":
Run: This occurs when a unit is moving quickly to "catch up" to a group of other units it was tasked to move with. This could also occur with input from the player to get units to move to another position quickly. Player can even task units to run to a resource to gather.
Charge: This is a fast movement initiated by the player against enemy units. The unit closes quickly with the enemy target unit (generally at 2x or 3x walking speed) and then the first attack is bonused (usually 2x).
This was how this was achieved in Sim1:
Units that could run/charge had a stamina value in their template file. This would drain at a steady rate while running or charging and would replenish when the unit was idle. If stamina was drained to 0, then the unit would not run or charge (except to run to catch up to a formation move command).
A double-right click initiated a run or charge.
Charging speed was the same as the run speed in the template file.
What I would look is to generally keep the same scheme as Sim1, with some differences:
Running speed and Charging speed should have two different components in the unit template file. I would generally make Running 2x walking speed and Charging 3x walking speed.
Charging should drain Stamina faster than Running.
I would like there to be a distance at which charging becomes more effective and then a further distance at which it becomes less effective. For instance, charge too close and the charge attack is only bonused 1.5x. Charge at the right distance and the unit gets the full 2x bonus. Charge too far and only get the 1.5x bonus.
It would be good to have acceleration if possible.
Please feel free to rip apart my ideas.