Posts Tagged ‘pathfinding’
So, I’ve spend almost 6 hours today trying to get the pathfinding working for my PACMAN game, fighting lots of strange code bugs (and one eclipse bug). Then, when I get everything right, I realize that the way I was approaching the problem was fundamentally wrong!
See, I was picking one of the closest pellets, and trying to find a path around the monsters to it. If there was a monster between Pac and the pellet, this algorithm won’t find another closer pellet in the other direction!
In short, whenever pacman sees a monster between him and the pellet he wants, he freezes.
The solution is to instead implement a BFS, returning when I find the first pellet available (should have seen that all along ). But since I’ve spent SO much time tweaking the AI already, I will put this on the backburner, and work a bit on the sound effects (Wakka wakka wakka!), and the graphics. After I’m done with a somewhat more polished look to my game, I will concentrate on the AI again.
Here are the links, if you want to play with dumb pacman:
Just releasing a quick library I plan to use in Ludum Dare, consisting of a maze generator and an implementation of A* in java.
I now have industries and trucks, and the trucks have pathfinding. In the screenshot below, red dots are industries (can be anything from a grain farm to a food store) and the blue dot is a truck.
I’m currently trying to figure out how the user interface should work exactly. My original idea will be quite a pain to implement I believe, so I’m trying to figure out if there’s any simpler approach. In the mean time, I will probably add lists at each industry that shows available/desired resources.
Although I am a bit late with it, I have a good feeling about this one. Most of my game mechanic is finished. On the picture you can see the graph of paths drawn out, red paths are active, blue are passive, and are activated, when you reach certain action nodes in the graph. You can see an action node, under the mouse, indicated by a spinning red circle. The filled red circle is you player, who travels over active paths. You can send him to an action node, by clicking on it. He will find the shortest way and follow it, until he reaches that node.
Now I need to replace the black background with scenery, red circle with a sprite, create animations for action nodes and some sounds all wrapped up as a neat puzzle. Right now I hope I can get one level together, after that the menu, and then maybe another level (my head is in the clouds).
BLDR is done! It probably could have used more levels and obstacles, but I think it’s great! Postcompo version will definetly include more levels.
Download it here: http://www.filesavr.com/bldr
EDIT: I forgot to include it in the instructions, but arrow keys to move and R to restart the level.
Postcompo edit: New download link at http://kittylambda.com/files/BLDR.zip (thanks to PsySal)
We cheated! We were two ppl working on SokoBomb me (drZool) and dr Elak. Yes, but we told so up front when we begun. Anyways the compo game is a randomly generated sokoban adventure… minus adventure. And the postcompo game is a puzzle/action adventure, without randomly generated rooms. But with whitty npc’s and melting icecubes
The original entry with random levels are here
The post compo beta/demo of the game with hand made levels can be found here including a video of the gameplay. We did enter Swedish Game Awards with it, but did not place.
Here are screens from compo entry:
First random generated level. Note to self: improve difficulty.
Dr Zoolak in a mean mood. Random-generated level.
A visit to cubicle hell, random style.
Here comes post compo screens:
Soko showcasing the latest in weapon sprite fashion.
Refraction in action.
Better put your shades on, those are real hardshadows.
No smoke without fire. Creeping features abound!
Pathfinding up and running, so are the conveyor belts.