Devlog #3: Path generation



Hi guys!
This path generation stuff is taking me way longer to figure out than I thought. I think it is mostly done, though there is one problem where the algorithm can get stuck in edge cases where it can't go anywhere.
The algorithm is basically just a random walk, with a few rules, like don't place paths parallel to other path tiles and don't try to connect with already loaded chunks. It works by scoring three options (left, straight and right) and choosing the direction with the highest score. The score is partly random, but there are bonuses if the direction is in line with the current direction (so it doesn't turn all over the place) and if it is in line with the target direction. The target direction is set at the beginning and is basically just to help the path move towards the unloaded chunks.
The blue squares are "entrance points" and are tiles on the edge of chunks that the algorithm starts from. When the path gets up to the edge of an unloaded chunk, it saves an entrance point so that when that chunk is loaded, it has a path to start from that is already connected to everything else.
I also want to allow the path to branch every now and then, but I don't think that will be too difficult, since the algorithm is already in place I just need to make it start from a random path tile every now and then.
I am hanging out with friends tomorrow so I won't have as much time, but I at least want to get this path generation done. Again, I hope to get to work on enemies, but we'll see how we go.
See ya!
The Waker
A dungeon-crawler of sorts in the very earliest stages of development
| Status | In development |
| Author | neyoe_j |
| Genre | Adventure |
| Tags | Indie, monogame, No AI, Pixel Art, Singleplayer, Top-Down |
More posts
- Devlog #27: Late night coding10 hours ago
- Devlog #26: I am not dead1 day ago
- Devlog #25: Sorry, nothing again today39 days ago
- Devlog #24: More UI for corpses40 days ago
- Devlog #23: Start of corpse UI41 days ago
- Devlog #22: Uni work got in the way41 days ago
- Devlog #21: Today I did nothing because I was playing Baldur's Gate 343 days ago
- Devlog #20: Little bit of UI44 days ago
- Devlog #19: Enemy attacks45 days ago
- Devlog #18: Yet another nothing day, unfortunately46 days ago
Leave a comment
Log in with itch.io to leave a comment.