Jump to content

Running, charging, stamina and stances (with a bit of formations)


Karamel
 Share

Recommended Posts

Hello, just a big topic about all of this.

Previous charging discussions

First some previous discussions: see http://trac.wildfiregames.com/ticket/994 about how charging could work.

If tldr, here is a summary (that may be innacurate at some points) :

Units could run by double clicking, and be ordered to charge ennemies. When running and charging their stamina reduces until it is depleted and they cannot run anymore. When they stay idle, their stamina replenishes.

When charging the first attack is the charge attack, which is better than the regular one.

Instead of stamina it could also have distances triggers to increase speed (auto charging when at range)

Suggestion (based upon Sibyllae Vox)

After reading the previous discussions and as a general thing, KISS (Keep It Stupidly Simple). Players won't have time and focus to manage some stamina bars closely for multiple units, while managing a battle and keeping a good economy/production.

There were two way for this: using battalions to reduce the number of controlled entities, or automate the use. I'm currently for the second way (which is not incompatible with the first).

Why charging/running

Multiple reasons, even more when all infantry and all cavalry are walking at the same speed not to give side effects on resource gathering and such.

  • Get in range faster (melee), evade (ranged)
  • Add an offensive impact
  • Send reinforcments
  • Retreat

Why not charging/running

  • It's exhaustive
  • It is harder to stay organised and can lead to weaknesses

With this in mind, here is my suggestion

Stamina

Stamina is used to travel, fight, and charge. I remove it from the economic part (running to get resources faster) because I don't think there is a reason a citizen that would go to war in armour should be less effective that his neighbour that goes with a javelin (they don't work with weapons). Nor I see a reason to add micro in resources gathering.

So stamina reduces when units are walking (going accross the map), fighting, and obviously charging. It replenishes when they get "at home" somehow.

For walking, when you send reinforcements from far accross the map, your army should make a pause before fighting, or else it would be disadvantaged from the natives who are fresh up.

When they fight, they are less effective when exhausted than fresh ones. It is particularly true when charging.

  • Walking reduces stamina slowly, fighting and chargind greatly
  • Standing idle increases stamina
  • Civil Centre and houses have a regenerative aura that compensate the walking depletion (working at home)
  • Once stamina is below a threshold, units become less effective

It may be when stamina is below 50% (or 40, 33 or whatever), attack rate, moving speed and charge attack reduces up to say one half when it comes to 0 stamina. For less micro it can even take only the average stamina of a group (the fresh ones motivating the tired ones).

Charging

Charging is the fact of going in battle at higher speed and give a blow impact. Some units like archers and slingers may not be able to charge.

Single units can charge and formations can do so if they can attack while in formation (phalanx, syntagma, wedge, skirmish and maybe testudo). It is easy to run individually, more harder to run everyone at the same pace while keeping cohesion.

So you have some options in the battle

  • Charging to get in battle quickly with an offensive bonus
  • but may break your formation and remove some armour bonus
  • or keep your formation (like phalanx) to charge slower but surely
  • Do not charge and wait in formation, with full stamina and formation bonus to hold the charge and take a stamina advantage on a longer battle

Charge attack can then be just a bonus to the regular attack instead of a new one (at least, when it is not the Persian scythed chariot). This bonus can then easily be reduced when stamina is not high enough to perform well.

There should be also a minimum running range for the charge, not to charge multiple time.

Running

Running is also usefull for example just to run away or pursue. This is particularly usefull for skirmishers to hit'n and run (well, run…) and archers to run for retreating units.

The charge speed is then used defensively to avoid being in the battle or offensively to pursue. Everyone should be able to run.

But this doesn't say how to handle charging. Having a special command like double clicking seems to me too microish. This is when stances comes into play.

Stances

Currently stances doesn't do much, especially the first two ones (violent and aggressive). By just tweaking them with charging ability, it can automate some behaviours.

  • Passive: stay like this, don't do anything and flee (like it currently does)
  • Stand ground: stay there, wait for incoming ennemies or new orders, don't charge nor evade anyway (again this is already the case)
  • Defensive: don't charge, respond to nearby threats, this is almost the current behaviour, but with ranged units automatically running back to melee threats (auto hit'n run)
  • Aggressive: attack with charge and charge nearby threats, ranged units automatically evade (or not, I don't know). But move without charging
  • Violent: always run and charge, even just for moving, while an ennemy is on sight, either to attack or retreat

Why only with ennemies on violent? Because I don't feel there is a need to make an army run all day long to get reinforcements (they would just arrive exhausted anyway and get killed) or use it to run to the trees and metal mines.

The objective, with some nice unit AI to automatically pick decent targets, is to move micro from triggering a lot of orders to switching stances. If you want your troops to wait for incoming, then charge when rather close, use stand ground and switch to aggressive to say "now!", if you want to hold a line use defensive and if you want to surprise use violent to run around. You can also set your ranged units on defensive to protect a line then switch to aggressive when the ennemy is derouted to pursue them.

With groups shortcuts and stance shortcuts, battles could even be run only with the keyboard :) (well not very effectively)

  • Like 3
Link to comment
Share on other sites

I do not really wish to sound too critical, but the system you propose doesn't really seem to make much sense to me. Running/Charging based on stances? I prefer the stamina bar. It is not that complex compared to the mana bar to units in Starcraft, and certainly the abilities cast in Starcraft introduce far more complexities. Double-clicking being like too much micro compared to the stances option you propose, and also micro is an important component to RTS. Double-clicking is intuitive with games like Total War, and 0 A.D.'s combat would emulate that in some ways.

  • Like 1
Link to comment
Share on other sites

Running/Charging based on stances? I prefer the stamina bar. It is not that complex compared to the mana bar to units in Starcraft, and certainly the abilities cast in Starcraft introduce far more complexities.

I don't really understand, running/charging is related to stamina, stances in my suggestion are just the triggering way, there is still a stamina bar. Can you explain a bit more your thought (other than the fact you prefer having more real time micro, which from my point of view is an unecessary thing considering all the things to manage in the game)?

About #3177 and camouflaging, I'll have to test this patch, I don't get what it does at a glance just by looking at the code. According to the War Story it was designed as infantry being able to move inside trees and for Celts and Iberians be invisible while not moving. So if they are not moving, they regain stamina (maybe the patch could still make them move at a decreased speed with more stamina loss), so it may not be incompatible. Also considering Iberian had light units and used a lot of guerrilla tactics (and their unit set being good for it), they could have for example more stamina and charging range than the others or more running speed. Finally if they are the only units having a triggered ability it seems weird in the overal design.

  • Like 2
Link to comment
Share on other sites

  • 4 weeks later...

Critiquing greentext mode because quotes take too much space.

> There were two way for this: using battalions to reduce the number of controlled entities, or automate the use.

Bataillons aren't coming anytime soon.

> [Your stamina system]

This just can't work. If running/walking reduces stamina, it means you won't be able to win any war away from home. If just running those, why use running at all apart from the charging mechanic since distances just aren't that big?

The fact can't be avoided: given our maps, it will always be better to either walk or run.

> [On charging]

This mostly relies on combat in formation (which realistically just isn't happening). I do agree that this could be used somewhat, for example when attacking (see my post on trac), but it's complicated and stamina isn't imo needed.

> [Running]

See the rest of what I mean but basically it's gamey all the way.

No opinion on stances.

Link to comment
Share on other sites

I think that the Starcraft II concept is the best for 0 ad in a KISS sense.

No running, no marching. Only charging. When a unit is near to another, they should automatically charge (it should be able to turn off the autocast and to manually select targets) when a unit is near to a enemy in x space.

So units would charge continuously in the mosh pit until stamina is drained. (just small cooldowns for the ability)

BTW, for immersion sake, I think that units in fight mode should use run animations.

There are some design decisions here: if stamina is used, we should think about an ability system, instead of hardecoring the features (camoflauge, charging, healing) make them working in a more dynamic and comprehensive way for modding (thinking about warcraft 3/starcraft 2 ability system).

But I know, that it's easy to write, and the important is getting the things done, so that it's only a humble opinion.

Edited by av93
  • Like 2
Link to comment
Share on other sites

How funny, it looks almost completely as how wraitii made me rethink about it.

Why charging? Because it allows you to have an offensive bonus or having a defensive one (when not).

So why stamina? At first it was for some historical purpose, with armies being very weak for traveling the whole day and being attacked by night or thing like that (having already a lot of things about preparing an army that is the thing too much). This is for the walking part. For the running part it may still be a timer, for skirmishers not hit'n run forever for example and still give charging a drawback on long battles, be quick or be dead as a rock group said (and the run speed is required to differenciate resource gathering ability and in battle movement ability).

And the charge button is what I called behaviour against order. Because we already have stances that are almost useless, that would just be recycling some code.

The good new is that is more easy to implement (but still an harcoded thing not realy geared toward auto-abilities).

Link to comment
Share on other sites

Running: 2x speed. Automatic, not triggered by player. Usually when catching up to formation, when "kiting", or when running away from attacker (female citizens)

Charging: 2.5x speed (infantry), 3x speed (cavalry). Manual, triggered by player. Units will not start the charge until they walk to within charge distance. Units will not charge if too close to target.

Stamina used simply as a cool down for the ability (must rebuild stamina). Stamina bar shows in UI but not in unit status bar. Some units (cavalry) have more stamina than others (heavy infantry), so can charge 2 or 3 times before cool down required.

Charge give 2x attack (infantry) or 3x attack (cavalry, elephants, chariots) on contact. But charging units also receive 1.5x damage from retaliating target units on first strike.

Very simple.

Some thoughts for:

  • Make spear cavalry have a heavier charge than sword cavalry. Viceversa, make sword cavalry have heavier standard attack than spear cavalry. Same goes for spear infantry and sword infantry.
  • Battering Rams can "charge" as well, against building.
  • Cool down/stamina, charge bonus, etc. open opportunity for technologies, e.g. "Hoplomachia" - Increased running and charging speed for Hoplites. "Othismos" - Increased charge attack bonus, "Shield Bash", "Hippika Gymnasia" - Increase stamina for cavalry, etc.
Edited by wowgetoffyourcellphone
  • Like 1
Link to comment
Share on other sites

  • 3 years later...

I'm sorry to revive a really old thread, but I am experimenting with charging and I think it is good to keep information together.

I currently have a system in place (thanks @Angen (batalion mod) and Councel of Modders (Mythology mod) ) where a unit starts charging at a fixed distance (set in its template) and, if it has enough mass over the enemy, it pushes the enemy backwards. But I would like some feedback on where to store some variables. Currently I have:

  • Min/Max charge distances in UnitAI.js (because they are called there).
  • ThrowbackResistance in Armour (function of Mass and whether a unit can brace itself (i.e. is idle; which in turn comes from UnitAI again) ).
  • Mass in Identity.

Any (other) feedback and/or places where I can find comparative code is appreciated! My intention is to submit this as a patch for #994.

  • Like 1
Link to comment
Share on other sites

Not to discourage you but the chances that we commit something that changes gameplay in such a way is low at the moment.

In my opinion, these need a physics manager that handles collisions in c++, something that we will also need for unit pushing.

  • Like 2
Link to comment
Share on other sites

5 minutes ago, Freagarach said:

 Any (other) feedback and/or places where I can find comparative code is appreciated! My intention is to submit this as a patch for #994. 

You will find an old similar code here:

https://trac.wildfiregames.com/browser

The idea of min - max distance was more or less the idea at some moment.

Stamina was another option.

But then there was the issue: morale, capture, health, stamina, ... that sounded many (and as all are abstractions, even intersecting themselves).

Link to comment
Share on other sites

I can tell you that Knockback should not be implemented like that. When I wrote that, it was purely for mods and therefore it’s just one ugly hack. (From the looks of the video, it seems exo built a lot on top of it. A much nicer trajectory at least (that could be anims too). So use that as a base if that is really needed.)

Edited by Guest
Link to comment
Share on other sites

5 hours ago, wraitii said:

Not to discourage you but the chances that we commit something that changes gameplay in such a way is low at the moment.

In my opinion, these need a physics manager that handles collisions in c++, something that we will also need for unit pushing.

I will not be discouraged quickly, if I think of (or find) a nice feature I try to implement that, purely for myself (how selfish). If I think it might be of use for more people than just me, I upload it on Phab. A physics manager would do a much better job indeed :) Would be cool to have that.

4 hours ago, (-_-) said:

I can tell you that Knockback should not be implemented like that. When I wrote that, it was purely for mods and therefore it’s just one ugly hack. (From the looks of the video, it seems exo built a lot on top of it. A much nicer trajectory at least (that could be anims too). So use that as a base if that is really needed.)

That is so much cooler! I'll check it out next week. Makes me aware again that I have started programming almost exactly two months ago ;)

  • Like 1
Link to comment
Share on other sites

8 hours ago, Freagarach said:

I will not be discouraged quickly, if I think of (or find) a nice feature I try to implement that, purely for myself (how selfish). If I think it might be of use for more people than just me, I upload it on Phab. A physics manager would do a much better job indeed :) Would be cool to have that.

That is so much cooler! I'll check it out next week. Makes me aware again that I have started programming almost exactly two months ago ;)

look at the video from begining 

 

  • Like 3
Link to comment
Share on other sites

39 minutes ago, Stan` said:

You might want to look at the date at which this thread was created.

My fault ;)

3 hours ago, Servo said:

@Karamel I hope you succeed. DoM like units behavior and more realistic mechanics is really missing in the game.

@ServoI've got charging, but without proper pushing the code is ugly and there are some unintended side effects. @asterix Is the code of Hyrule Conquest available somewhere? I saw there is a git for it, but that is empty :(

Furthermore, I can't seem to let formations run, is that intended?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...