Advertisement

An AI that moves around objects

Started by February 25, 2003 11:14 AM
5 comments, last by henksgu 21 years, 7 months ago
I have made a game with grids, and I now want an AI I want the AI (0) to move around the building to the X position. |------------| | |--|0 |--| | | | |__| | | | |Building| | | |________| | | X | |____________| Please help me!!! RGB
To help people understand your question, the figure was meant to look like:
|------------|| |--|0 |--| || |  |__|  | || |Building| || |________| ||     X      ||____________| 


If you need to do this with a robot in the real world, its very difficult, but doing it in a computer game is easy: Look up pathfinding algorithms on google. A* is a pretty good one, but if you''re only interested in simple cases there are others that might be faster.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
Advertisement
Actually it''s fairly trivial with a real world robot... how accurate it works depends on the accuracy of the sensors onboard. If the map is known a priori then you can use Policy Iteration to find a plan that covers every location in the domain that your agent could enter (it gives the optimal action to execute in that state for the given goal). Pathfinding per se only works if you know exactly where the agent is and its exact transition function from state to state. If the map isn''t known, then you need to perform exploration as well as localisation.

Cheers,

Timkin
What does A* mean?

And thank u for your replies!

RGB

[edited by - henksgu on February 26, 2003 12:43:50 PM]
It is a pathfinding algorithm that could be used to solve your problem in a game. Use the resources at this site and others to learn about it. Use google.com
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
henksgu: One solution would be to create waypaths inside your building. These waypaths could be generated "by hand" or by an algorithm. A Follow-Path behaviour can be used to produce a steering force, which in turn can be used to move your AI controlled character. Steering behaviours are a solid and robust method which can serve as a basis for additional algorithms, such as realtime-pathfinding.
Advertisement
To learn all about A* (A-Star) and other pathfinding algorithms check this site out
http://xenon.stanford.edu/~amitp/gameprog.html

This topic is closed to new replies.

Advertisement