Day 2 of using Arcade

This is my first time using the arcade library, so it was a little bit of a slow start, trying to figure out that structure vs. pygame. But it's actually pretty simple, and I got it down pretty easily. The first day I spent making some assets for my game in Krita, and making a basic map in Tiled that I can use to test and create the rest of the mechanics in my game.


Today, I started to play around with pathfinding. The "lemmings" in my game need to pathfind their way from the Start point on the map, to the End point, and that path needs to be regenerated if the player blocks off or changes states of things on the map. Currently, it works for finding a way to the end, but the problem is that the pathing is too smart. Lemmings need to be dumb, and not look like their following a line, like they currently do.

lemmings being line following robots

I currently have two things I want to implement to fix this:

1. Changing where the path is generated from.

The path generation method of my game generates the path assuming that the lemming is at the start point of the level. Then, when it's regenerated, each lemming finds it's closet point on the new path, and only uses the points of the path from there. The problem with this is that when a path is regenerated, it sometimes will end up farther away from the lemming than expected, and it will move weirdly to get to it. The other problem being that if a lemming gets trapped behind, let's say, a wall, and it's closest point is on the other side of that wall, it will phase through the wall to get to it, which I don't want. So, I plan to make the path regenerate from the lemming that is furthest along the previous path. By doing this, then adding on the new path to the old path, I can make it look like the other lemmings are just playing follow the leader.

2. Allowing lemmings to follow multiple paths.

Currently, for performance, there is a single path that is generated that lemmings can take. However, if they are behind a wall that the player places, and the path changes, they will phase through the wall, no longer following their shortest path, but the shortest path of the others. I need to make some way for a lemming to determine if it should follow the new path, or continue of it's old path.

Lemmings phasing through walls

Once I get most of this flushed out, and I get the rest of the little mechanics working, I can start making more levels in Tiled. My plan is to be able to make most of the levels from there, instead of the way I did it last PyWeek, where I made each level using code.

This is also my first time making a Diary entry. This was mostly because I wanted to write this stuff down somewhere. :)

(log in to comment)

Comments

Cute rendering.
Kind of 8bit-ish :)