Advertisement

Adventure game pathfinding.

Started by December 02, 2002 10:18 PM
5 comments, last by Muzlack 21 years, 11 months ago
I''m going to be making an adventure game engine soon here. To define where a player can and cannot walk will be determined by an image imported. It will be an image with pure white being impassable. (You''d just draw over the original image with pure white and import it. So now I have this 320x240 array of pixels that can or cannot be walked on. I want a believable pathfinding algorithm that will help me move the character from one point to another, pixel perfect, or as close as you can get. Ps, what I mean by believable is I don''t want them to hug the wall just because that''s the "fastest" route if you know what I mean. Someone wise once told me this: "If you ever fall of the sears tower, just go real limp and someone might think you are a dummy and save you cause, hey, free dummy.
--Muzlack
When determining the path, take into account both the distance to the target and the distance from a wall/obstruction in the huristic and play with it until it looks right.

karg
Advertisement
You could try a priority queue to find which "tile" is the most favorable

The nightmare travels across the cosmos with his burning mane. The trail of ash that is produced.

?Have a nice day!?

Someone wise once told me this:

"If you ever fall of the sears tower, just go real limp and someone might think you are a dummy and save you cause, hey, free dummy.


Is that from Jack Handy. It sounds like one from the ''Deep Thoughts'' series.
read some book about graphs and algorithms ... there should be described how to generate a graph and finding the shortest way in it.

[ps]
graph= a number of corners + connections between them (optional: + values for each corner or point)
---- sig coming soon
I was more goin for.. an algorithm that would work well. Thanks!

Someone wise once told me this:

"In theory, there''s no difference between practice and theory. But in practice there is."
--Muzlack
Advertisement
Someone told me the Dijkstra is a good one to use. I''m wanting to look for a tutorial on how to implement, but I can''t find anything good. Also, I''d like to use automatic-node creation, however I do that. Because I don''t want the game maker to figure it out. Thanks
--Muzlack

This topic is closed to new replies.

Advertisement