Devlog: Sheerk path-finding AI
Added 2025-08-24 06:00:07 +0000 UTCI made some big progress this week. I might manage to get enough of the level finished in time for the yearly update.
Aug 18
The sheerks are properly animated and exported to Godot. Their idle state has been programmed and should be functional, but making them follow the player without crashing into the environment or into each other will be a challenge.
I noticed a small mistake in the slide puzzle: the player could entirely skip the cavern area by just dropping ahead and breaking the exit block from the outside. Instead of adding more guardrails, which are messy and expensive, I simply restricted the allowed attack direction so it can only be broken from the correct side.
Aug 19
I placed navigation nodes so the sheerks can safely follow the player around the puzzle areas. I also programmed some level events that affect where they can go.
Ruins area: 3 nodes and 1 event (exit ramp deployed)
Maze area: 11 nodes and 1 event (exit ramp deployed)
Sinkhole area: 8 nodes and 1 event (area cleared)
Cave area: 2 nodes and 1 event (area cleared)
Swamp area: 9 nodes and 3 events (adjust props to build a path)
Slide area: 13 nodes and 6 events (adjust props to build a path)
Aug 20
Sheerks can now follow the player along their node paths. Currently they just teleport to the player's position, I'll add some proper animation later.
The algorithm is quite simple: for every pair of adjacent nodes A and B, it projects the player's position P perpendicular to the line that passes through them, clamped to the segment between them, then picks whichever node pair minimizes the distance D between the player's actual position and its projection.
u = (P - A) / ||P - A|| ; v = (B - A) / ||B - A||
Q = A + (B - A) × min(max(u · v, 0), 1) → D = ||P - Q||
I added a little offset distance so the sheerks get out of the way if the player decides to backtrack. The method also calculates the distance of the player to the first or last nodes of the path and, if it is smaller that the distance to every segment, then the player is out of reach and the sheerk either goes back to the start or, if the puzzle has already been solved, tries to exit on its own.
Aug 21
I spent all day fixing bugs in yesterday's code, as the offset calculation caused the sheerks to desperately want to get behind the player. After a lot of trial and error, I made the algorithm compute two safe positions, one in front of the player and one behind them, and the sheerk simply runs to whichever is closer.
I also added running animations and soft turning. It now looks beautiful and, apparently, fully functional. Next step is programming how they behave as a herd, once they're free of their puzzles.
Aug 22
Planning the herd AI was quite tough, I tried a lot of different methods until I found one that worked well: the herd itself is a virtual object on its own, following the player at a safe distance. Then, when the sheerks are released from their puzzles, they take their place in a regular pattern around the herd object.
I added a random delay to their reactions to make them look cuter, although I had to compromise, since too much delay made them overlap with each other.
Sheerks' herd behaviorAug 23
I prepared the base sketch to model the enemies that will be found around the level.
Base sketch of level enemiesI also slightly changed the appearance of the sheerks, adjusting the shape of their heads and giving their wool more curls, as some of you pointed out that they might look a bit too much like Jeff the Land Shark. Or Vress, or Sharkdog. It appears that everyone agrees that sharks are adorable and we want them as pets.
Updated sheerk model and texture