Jump to content

Pushing mechanism: pathfinding of Rams, Elephants and other siege hardware


Yekaterina
 Share

Recommended Posts

We should make battering rams able to go through allied units more easily. Often, a large group of allied archers are spread out over the entire territory and rams are blocked, unable to reach any important buildings. Furthermore, rams are often involved in melee battles, just twisting itself in the middle a huge firefight. This makes pathfinding more difficult for everyone and the game will lag, therefore I think rams should be able to pass dense crowds of human units more easily but not through buildings or palisades. The same applies for elephants.

 

In real life, the archers would move themselves a bit to let their friend's ram to pass through, and the ram would always head towards some enemy structures instead of trying to involve itself in a melee confrontation. Elephants would definitely step on human units instead of politely going around them. So I am suggesting that we add a feature which lets large objects pass through allied units but not structures or enemy lines.

 

On top of that, cavalry units often get stuck at a building site, unable to move out. Therefore I think we should add a mechanism which allows units to push others away if necessary.

  • Like 2
Link to comment
Share on other sites

This wasn't a very big problem back in A25, probably since we disabled unit overlapping, the rams can't squeeze through infantry anymore. So the solution is to decrease the effective size of rams or add a repulsion field for rams that automatically scatters nearby infantry, like a proton flying into a cloud of positrons. 

  • Like 1
Link to comment
Share on other sites

8 hours ago, Yekaterina said:

This wasn't a very big problem back in A25, probably since we disabled unit overlapping, the rams can't squeeze through infantry anymore. So the solution is to decrease the effective size of rams or add a repulsion field for rams that automatically scatters nearby infantry, like a proton flying into a cloud of positrons. 

I think it’s been a problem for awhile. Part of the problem is also turn rates. We tried to change turn rates for community mod, but I think it was voted down

  • Like 1
Link to comment
Share on other sites

2 hours ago, chrstgtr said:

Part of the problem is also turn rates.

I'm not sure what you mean by turn rates, but I think the response of units can definitely be improved. Right now, it seems like the units would freeze for a moment then respond to formation orders. When retreating, many units struggle to turn around and run before they are killed by a shower of enemy arrows. There were also instances when an enemy spearman was just waving in the air and the cavalry unit on 30% health that was already some distance away from him just dies suddenly.

Furthermore, I noticed that some units, especially cavalry and siege, have acceleration. If you order them to change direction, they stop themselves, then take a long time to rotate itself to the direction you pointed to, then gradually accelerate towards there. I think the acceleration is completely unnecessary; just let the speed be a step function and that will feel much smoother. If you must consider physics, then perhaps the unit can choose a curved trajectory towards your point, given its current position and momentum. A curved path is how a real human would walk if you wave at them from across the street. The rotation of units would ideally be instant, i.e. the angular velocity is very large. This will cause less stuttering as described above and less miscalculations, meanwhile improving the smoothness of the gameplay.

 

  • Like 1
Link to comment
Share on other sites

2 hours ago, Helicity said:

I'm not sure what you mean by turn rates, but I think the response of units can definitely be improved. Right now, it seems like the units would freeze for a moment then respond to formation orders. When retreating, many units struggle to turn around and run before they are killed by a shower of enemy arrows. There were also instances when an enemy spearman was just waving in the air and the cavalry unit on 30% health that was already some distance away from him just dies suddenly.

Furthermore, I noticed that some units, especially cavalry and siege, have acceleration. If you order them to change direction, they stop themselves, then take a long time to rotate itself to the direction you pointed to, then gradually accelerate towards there. I think the acceleration is completely unnecessary; just let the speed be a step function and that will feel much smoother. If you must consider physics, then perhaps the unit can choose a curved trajectory towards your point, given its current position and momentum. A curved path is how a real human would walk if you wave at them from across the street. The rotation of units would ideally be instant, i.e. the angular velocity is very large. This will cause less stuttering as described above and less miscalculations, meanwhile improving the smoothness of the gameplay.

 

Turn rates refer to the time it takes for a unit to turn (like you’re describing in the second paragraph). So when a unit is facing north to move south there is like .1 seconds where turns around in place before it begins to walk south. When there are a lot of obstacles (I.e., units) blocking the way of a ram then the ram has to turn frequently in order to move. All those turns add up to a lot of time. Also, moving units means pathfinding is constantly recalculating and rerouting, which, again, leads to more turns and time where the rams aren’t actually moving. 

I’m not a fan of turn rates, but some developers apparently really, really care about them. The current state is much, much more playable then it used to be (turn rates were introduced in a24 and made the game much less fun, imo, whereas now turn rates are mostly and annoyance, imo)

  • Like 1
Link to comment
Share on other sites

@Helicity turn rate is the angular velocity of the unit's self spin that you were talking about and is measured in radians per second and the value is stored in the template file for the unit type. The acceleration is measured in SI units like real world physics, but beware that values are strange: the average walking speed of an archer is already faster the Usain Bolt's maximum speed, so take these values with a biscuit. Acceleration was introduced after the release of A25 to nerf cavalry rushes (because javelin cav were too OP)  and to make the movement of units visually smooth and satisfying. 

@chrstgtr  On one hand, turn rates nerfs cav rush, so that you can boom in peace. On the other hand, you don't want it in late game because of lag, annoyance etc. So to achieve both, we can only introduce a finite turn rate for citizen javelin cav and citizen archer cav. Everything else, from rams to infantry to melee and Merc cav, all get infinite turn rate. This means no lag and frustration in late game, but early cavalry rushes are still reasonably nerfed. In code, that is 10^6 radians per second.

Link to comment
Share on other sites

14 minutes ago, AIEND said:

I think it needs to prevent battering rams and siege towers from attacking things other than buildings, so that there will be no situation where the battering rams of both sides attack each other and get into a melee.

Agreed. Delenda Est has been doing this with Battering Rams for some years.

  • Like 2
Link to comment
Share on other sites

1 hour ago, chrstgtr said:

I’m not a fan of turn rates, but some developers apparently really, really care about them. The current state is much, much more playable then it used to be (turn rates were introduced in a24 and made the game much less fun, imo, whereas now turn rates are mostly and annoyance, imo)

I personally just care more that the feature doesn't get taken out. lol

Instant speed and turning for cavalry though looks a bit weird to me. Maybe a little faster acceleration and turn rates for cavalry than now to make it more responsive, but still have it look a little better than instant acceleration and snapping around 180 degrees. The think for most units turn rate and acceleration should be subliminal. The only units where it should be noticeable are ships and siege maybe. 

Link to comment
Share on other sites

1 hour ago, Yekaterina said:

@chrstgtr  On one hand, turn rates nerfs cav rush, so that you can boom in peace. On the other hand, you don't want it in late game because of lag, annoyance etc. So to achieve both, we can only introduce a finite turn rate for citizen javelin cav and citizen archer cav. Everything else, from rams to infantry to melee and Merc cav, all get infinite turn rate. This means no lag and frustration in late game, but early cavalry rushes are still reasonably nerfed. In code, that is 10^6 radians per second

You can select where you want turn rates. 

 

1 minute ago, wowgetoffyourcellphone said:

I personally just care more that the feature doesn't get taken out. lol

Instant speed and turning for cavalry though looks a bit weird to me. Maybe a little faster acceleration and turn rates for cavalry than now to make it more responsive, but still have it look a little better than instant acceleration and snapping around 180 degrees. The think for most units turn rate and acceleration should be subliminal. The only units where it should be noticeable are ships and siege maybe. 

I don’t find it terrible now. But I’m generally not a fan. On ships, it makes sense, though. With rams there are definitely times where you just see rams constantly turning instead of moving 

Link to comment
Share on other sites

21 hours ago, Yekaterina said:

This wasn't a very big problem back in A25, probably since we disabled unit overlapping, the rams can't squeeze through infantry anymore. So the solution is to decrease the effective size of rams or add a repulsion field for rams that automatically scatters nearby infantry, like a proton flying into a cloud of positrons. 

this isn't true, I remember it well because it was the first thing I tested at the time. units would squish in front of the ram (being faster) and the ram was constantly pushed back until the units in front maybe stopped and suddently the ram had to make a circle around them.

Link to comment
Share on other sites

1 minute ago, Stan` said:

automatic dancing

Dancing can be prevented by using infinite speed arrows. Currently the speed of arrows is just 100m/s. We can change this speed to 10000m/s and that will solve dancing completely. I can still dance (with difficulty) right now, even with turn rate and acceleration.

I don't see why dancing is so hated

Link to comment
Share on other sites

4 hours ago, Stan` said:

Static pushing is tricky to get right. Cause you don't want rams to push enemy units, it makes no sense.

Can we only allow the ram to push allied units, not the enemy units? I assume the allied soldiers would very happily allow their rams to pass through their formations but the enemies can stubbornly stand there and block the ram with their bodies.

Link to comment
Share on other sites

1 hour ago, Helicity said:

Can we only allow the ram to push allied units, not the enemy units? I assume the allied soldiers would very happily allow their rams to pass through their formations but the enemies can stubbornly stand there and block the ram with their bodies.

It is probably possible, given somebody to write the code.

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...