Skip to main content
GameDev.net gamedev.net
🔒 Locked

steering or path finding?

Started by Pet123 Mar 7, 2005 at 10:41 AM 5 replies 7k views
Original Post
Pet123
Pet123
hi i've been thinking about this for a while : In a RTS game, what should i use for units to move around? steering or path finding? if there is a very long wall between a unit and its destination, how can a steering unit get there? in a game like Warcraft, steering behaviors seems to me are everywhere : follow, seek, maybe wander, obstacle avoidance (small obstacles), flee, pursuit, it covers basiclly all steering behaviors i know, but do warcraft guys really use steering? always hesitated and dont know where to start, for now im thinking using both the methods in my game, what do you think? and how you use them in your game? thanks.
Kylotan
Kylotan
I would have thought that the two go hand-in-hand; use traditional path-finding methods to obtain a list of nodes and then use steering to follow that path in a realistic manner.

I doubt they used steering in early Warcraft games. I've not seen the more recent ones though so I have no idea about those.
Nice Coder
Nice Coder
Listen to the good mod.

You use pathfinding to generate a list of nodes, then you use stearing to move through those nodes.

How do you do this?

You go and you use forces.
You have a large (and rather strong) force which is pushing the character into a line between any of the nodes.
You also have a smallish force, which is forcing the character forewards.
YOu also have a variable force, which provides repulsion from the obsticals. These should do up quickly as you get really close.

You also have a random force, which slowly changes in direction and slowly changes in intensity. This force should never be enough so that it just packs up and moves in the wrong direction (most of the time), but it should be enouhg so that it won't just stand perfectly in line with the other forces.

From,
Nice coder
Click here to patch the mozilla IDN exploit, or click Here then type in Network.enableidn and set its value to false. Restart the browser for the patches to work.
Madster
Madster
Forces and steering are probably overkill for a strategy game.
I'd simplify by interpolating orientation along the path, making sure each waypoint (each tile if you're doing it tile-based) has a proper orientation (which should be obtained from the current waypoint position, the last waypoint position and the next waypoint position.

er.. dunno if I make myself clear. I'd say this is what Warcraft III uses, but thats just an opinion.
Working on a fully self-funded project
kaysik
kaysik
Quote:
Original post by Madster
Forces and steering are probably overkill for a strategy game.


When you have 873874 units in a small area pathfinding just simply won't work well (or at all). You might find a nice path from Point A to Point B but you'll be halfway there when a hellfire tank squad blocks your way - what do you do then? If all you have is path finding you'll just wait till the tank is gone and or worse you'll have to computer a new pather which is a real killer. Steering behaviours are really fast to compute and they are easy to write (simple get the vectors between yourself and where you want to go, the closest unit, and some random vector, weight them, then add together ... very simple), and they work wonders where set paths don't. If you have 1 unit walking across a blank map then they're definatly not worth the effort, but in crowded situations they're a life saver, and even if a unit gets stuck he'll still try to find his way out which will look way more realistic that just stopping dead everytime someone gets in his way.
Nice Coder
Nice Coder
Steering behaviours are good once you have a pathfinding manager.

As your getting your new paths ready (for eg. A bridge got blown up and now you need a new path), you simply use steering behaviours to move towards the point.

Also, paths are very fast: Usually below 100ms (or well below that for small paths) For whole paths (you only need a few nodes in the future, and that is FAST)>

From,
Nice coder
Click here to patch the mozilla IDN exploit, or click Here then type in Network.enableidn and set its value to false. Restart the browser for the patches to work.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.