Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

entivore

Untiled pathing

This topic is 5673 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I apologize if this has been asked before but I''ve searched around for some information on pathing and it all seems to be based on the assumption that things move in tiles. My problem is that things in my rpg''s battlesystem move by pixel, so I don''t see a way to implement A* and all those other nifty concepts. Creatures have varying sizes of "space" they take up, like say a dragon might take up a 50x40 pixel chunk of ground space, but a human might only take up a 30x20 chunk or whatever. The screen position can''t be changed during combat, so there are about 408 pixels of area to path through. At it''s most crowded, there will be 10 blockworthy things on the screen at a time. I''m not sure if I want enemies to block other enemies and allies to block other allies, but I definantly want allies to be able to block enemies and enemies to block allies. Oh yeah, while I''m hear in the AI section, I might as well mention that I''d like the enemies to be able to cooperate. For example, a "smart" enemy fighter and a "smart" enemy mage could work together. The mage casts an area effect spell and the fighter actually moves to intercept anyone he can trying to flee the area of effect. Or maybe he notices the mages spells being interrupted and attacks whoever''s bugging him while the mage falls back or something. Well anyway, any advice, opinions, links, pseudocode, or things along those lines are appreciated.

Share this post


Link to post
Share on other sites
Advertisement
You can use A* with any type of graph. (a graph is a list of waypoints and the edges that connect them). Therefore, the easiest way is for you to create a graph is by positioning waypoints at important places on your map (at intersections, at items etc) and then connect them together (by line of sight) so that all the edges represent paths your character can use to navigate.

Now you have a graph, you can use your favourite search algorithm to search it.






ai-junkie.com

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!