🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Untiled pathing

Started by
0 comments, last by entivore 21 years, 5 months ago
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.
*Only in darkness can one truely shine*
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

This topic is closed to new replies.

Advertisement