why can't tanks drive backwards and bots walk backwards?
Moderator: Moderators
why can't tanks drive backwards and bots walk backwards?
I mean, in the real world you wouldn't turn your tank while being shot at, you'd walk backwards and keep shooting..
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...
I can't really remember, but somebody explained it on lobby once. I would like the option to have reverse movement as well...
- 1v0ry_k1ng
- Posts: 4656
- Joined: 10 Mar 2006, 10:24
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.
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)
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)
- Mr.Frumious
- Posts: 139
- Joined: 06 Jul 2006, 17:47
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.
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.
- SwiftSpear
- Classic Community Lead
- Posts: 7287
- Joined: 12 Aug 2005, 09:29