-
monsters movement
I'm making a pacman game and now I've came to when it's time to add the ghosts. How should I do to make them navigate the map? I have thought about putting a special number in every corner in the map file and then decide which way to turn based on what typ of corner/intersection it is and where the player is. Is this the best way?
-
I'm not sure what would be the best way, but if you take a look here...you might get some ideas...
http://www.visualbasicforum.com/show...threadid=21616
-
well as far as I know the pac man ghosts are pretty dumb. All they do is move till they get a chance to move to a different direction and they chose to go the direction towards the player.
The calculations for this would be really easy too.
-
Take a look at this and you'll see that they are acturally pretty "inteligent"
http://jongy.tripod.com/GhostPsychology.html
I don't want my ghost to be as advanced as those ones but still...
-
alright I had no clue :) I only played a pacman clone on my atari st 1024 so I couldn't know there were different personalities to them. Though I knew that there are two modes. I would implement the second mode (when you are able to eat em) exactly like the first one only that they would decide to do the exact opposite.
Well if you want them to be smart search the web (or the forum PaulLewis had a great example posted here 2years ago I think :)) for the A* algorithm which is about pathfinding. That would be kind of a overkill, but you could pretty much program the smartest pacman there ever was. You could also put movementcost in there in order to make them even smarter (let's say in the avoiding mode they would select the corner of the field the furthest away from you, than calculate the path there. You could put a weight/cost increase around your actor so they would not just take the shortest path, but a short path that also tries to avoid you as good as possible, that would also work for different personalities, paying different levels of respect to those cost points)
alright before I get totally carried away I stop writing, in case you are interested in some more detail about those thought (which I doubt :)) you can always post.
-
As you said, that would be over-kill!!!
I think I will go with your first idea, the one about deciding where to turn when they are able to turn, based on theirs and the players position...
-
oh to bad I was kind of hoping you'd be one of those young motivated programmers doing everything that comes into their mind :D
well anyways would have given a great demonstration on concepts of pathfinding in a simple application...
well best luck with the other way, I think the game will stay much more playable that way :)