why can't tanks drive backwards and bots walk backwards?

why can't tanks drive backwards and bots walk backwards?

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

gavan
Posts: 53
Joined: 03 Feb 2006, 13:52

why can't tanks drive backwards and bots walk backwards?

Post by gavan »

I mean, in the real world you wouldn't turn your tank while being shot at, you'd walk backwards and keep shooting..
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Post by Neddie »

It was originally a coding decision, if I recall - allowing for back and forth movement makes movement an exponentially more difficult task since the unit can push into an area, and when the pathfinding engine detects a change (Which it often can't) and it reverses to find a different path, you need to read (hopefully) a secondary speed. Or something like that.

I can't really remember, but somebody explained it on lobby once. I would like the option to have reverse movement as well...
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

The story I heard was that they didn't do it because OTA had no backwards movement and as such no animations for going backwards.
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Post by 1v0ry_k1ng »

only cowards need backwards, real men only go fwrds
User avatar
LOrDo
Posts: 1154
Joined: 27 Feb 2006, 00:21

Post by LOrDo »

LUA anyone?
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

LOrDo wrote:LUA anyone?

Uh huh, then we will need new animations (or maybe reversing the ones we have?) or it will look like shit...
User avatar
Peet
Malcontent
Posts: 4384
Joined: 27 Feb 2006, 22:04

Post by Peet »

Moonwalking peewees = FTW.
User avatar
Agon
Posts: 527
Joined: 16 May 2007, 18:33

Post by Agon »

It would be more realistic if units can do this and it would give more tactics.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Some units in supcom do this
User avatar
Erom
Posts: 1115
Joined: 25 Apr 2006, 05:08

Post by Erom »

I believe the SW:S guys were working on their infantry backpedaling while fireing, through script (Which is the way to do it. Allows backwards and forwards motion, just not at the same time, without more-than-doubling the complexity of the path finding code.) Dunno what kind of success they had with it, though.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

I once scripted my infantry to turn their body by 180° and walk backwards when shooting at something behind them.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Post by smoth »

backwards is not so much a problem but sideways and the 45s for each quadrant.
Ralith
Posts: 22
Joined: 06 Aug 2007, 04:43

Post by Ralith »

I would imagine that 'backwards' would be fairly easy on the pathfinding system; just have it be another 'forwards,' except in a different direction. Some intelligent code to pick which one is most appropriate to use at what time, and you're good.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

Which is exactly what makes it hard: you double the number of theoretically possible moves at each location, since now you can drive forward from square A to square B, then you can drive forward OR backward from square A to square B.

Maybe it would be possible to reduce the complexity again by making the assumption that a unit can only drive backwards from standstill, but even then the pathfinder needs to decide the right moment for the unit to turn around again, so it doesn't keep driving backwards until you manually order it to turn around...

In any case, a pathfinder with proper turnradius and backward-driving-when-necessary support is A LOT more complex then a "simple" pathfinding engine like in Spring which assumes entities can make any turn and do not have a particular driving/walking direction (you do need to keep track of driving/walking direction in the pathfinder for proper forward/backward and turnradius support!).

(higher level code just slows down the unit if the turn is too much to take with the current speed)
User avatar
MadRat
Posts: 532
Joined: 24 Oct 2006, 13:45

Post by MadRat »

Ever play with remote control cars that have turning only when backing up? By using some sort of right hand quarter-turn rule when backing perhaps it would simplify the decision tree?
User avatar
Mr.Frumious
Posts: 139
Joined: 06 Jul 2006, 17:47

Post by Mr.Frumious »

I'd rather see FPS-style/hovertank-style units that can move in any direction, regardless of facing. KP tried to make this work with the Bytes, but they jitter a bit, and it's hard to limit the rotation rate. Gunship-like units on the ground is what's really needed for infantry - that is, the base portion is actually facing the target, and then the script needs to handle moving and animating the legs depending on which direction/speed the unit is actually moving...

This would allow for actual FPS-controls in FPS-mode, and for ground-units where the "turret" behavior is inappropriate, but they still need to be able to fire and move in any direction.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Post by smoth »

doms move backwards just fine :P
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

Do it with script.

Image
Saktoth
Zero-K Developer
Posts: 2665
Joined: 28 Nov 2006, 13:22

Post by Saktoth »

Is that a morty and a reaper riding on its back?

zwzsg you are awesome.
User avatar
SwiftSpear
Classic Community Lead
Posts: 7287
Joined: 12 Aug 2005, 09:29

Post by SwiftSpear »

Just add in the reverse movement function and have pathing ignore it entirely. It's virtually never noticeable except in FPS mode where it debilitates you ridiculously.
Post Reply

Return to “Engine”