Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

First of all, I love the idea of adjusting walls to navigate the game rather than direct action from the player. I think there are a lot of interesting puzzles that you can do with that.

Also, I think the controls work quite well and I like the point-and-click movement with the grid.

If you build upon this, I think I'd suggest introducing the enemy who can move through walls in later levels, and be careful about how you do it. I think there's a lot to explore with setting up walls to avoid enemies before subverting that mechanic. I think it also really shifts the gameplay from a slow-paced puzzle to something closer to action requiring urgency from the player.

A reset button would be a really nice convenience for the player!

I really like this concept and would be interested to see more!

Also, I'm curious - this was made with Godot, right? How did you implement the pathfinding?

(1 edit) (+1)

Thanks for the feedback.


For pathfinding:

At first I had tried to use a `NavigationAgent2D` and a `TileSet` navigation layer, but eventually gave up on it due to getting caught on corners. Since I had already added navigation polygons to the floor tiles I ended up walking the `TileMap.get_used_rect`, checking the `get_cell_tile_data(0,coordinate).get_navigation_polygon(0)`.  Then I build an `AStarGrid2D` with `set_point_solid(id,true)`. Then the `get_*_path` methods did the hard work.  Enemies end up trying to walk in the center of the tiles most of the time, but it's still possible to get them stuck on corners, or if two enemies have opposite paths they get can get stuck on each other.

There is a bit of fun using `TileMap.get_used_rect().position` as the offset difference between a `TileMap` coordinate and an `AStarGrid2D` id. Conversions are also required to global space for moving, or converting screen space to coordinates for mouse clicks.  Not sure I have the screen -> coordinate 100%, but it works in the current camera/viewport setup.

The skeletons also use a `RayCast2D` to the player and check for wall/pit collisions to act like a line of sight mechanic and only recalculate their target path if they can see the player.

When the tile changes due to a user action it also updates the `AStar2DGrid` and enemies recalculate the path to take.

Thank you so much for taking the time to explain all of that!

Interesting! I've used the Naviation2D with TileSet navigation layer before, but I think it was somewhat limited and was curious what other approaches there are for pathfinding in Godot. 

Cool stuff!