Path finding...
Okay, lets say I am making a sports game, theres a field with nothing special but out of bounds lines, and nets. Theres a goalie for each team, and I have it move to make the save, and not go too far out of the net. Then there is one defense, who will not be allowed out of a certain radius (because I want the defence to stay defending) then I have maybe 1-2 forwards per team, now, for the units not player controlled, how do you make them go towards the ball, if they know the balls x,y coordinates, but the ball is moving maybe. Is there an algorithim to calculate this??? will it calculate for a moving ball too???
Also, is there something to figure out the velocity of the ball, and make it slow down and stop somewhat realistically??? Also, can you make it so that the algo above works for each player in each loop???
Mess With the Best, go down like the rest, but please visit:http://members.tripod.com/nu_bgameprogramming/
January 15, 2001 02:56 PM
Well, to make it short: Pathfinding is very komplex.
But with your problem, I can perhaps help you:
Do you now Bresenham''s Line-Drawing Algorithmus?
It''s a tricky Algo to Draw a Line from one Point ot another...
Well, BUT you can also use it to move your player from his position to another!
For the moving ball, check out the last position of the ball and the current one, make a vector out of it: that''s the way the ball move in one frame. Then multiply yout vector with e.g. 100 and you will have the position of the ball 100 frames later.
Perhaps this can help you
Danvil
But with your problem, I can perhaps help you:
Do you now Bresenham''s Line-Drawing Algorithmus?
It''s a tricky Algo to Draw a Line from one Point ot another...
Well, BUT you can also use it to move your player from his position to another!
For the moving ball, check out the last position of the ball and the current one, make a vector out of it: that''s the way the ball move in one frame. Then multiply yout vector with e.g. 100 and you will have the position of the ball 100 frames later.
Perhaps this can help you
Danvil
January 15, 2001 03:02 PM
Oh, and for realistic movement
Look up in your physics book! ;-)
Real physic is the best way to simulate reality...
Danvil
Look up in your physics book! ;-)
Real physic is the best way to simulate reality...
Danvil
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement