November 26, 2025 — [Game] AI pathfinding and Godot signals

Notes

Godot Signals

  • Signals are Godot’s implementation of the observer pattern
  • Use signal signal_name(param1, param2) to declare
  • Emit with emit_signal("signal_name", arg1, arg2)
  • Connect with object.connect("signal_name", self, "_on_signal_received")
  • Super useful for decoupling game systems (e.g., player health changes triggering UI updates)

AI Pathfinding

  • Started implementing AI for enemy AI
  • Key insight: the heuristic function matters a lot for performance
  • Using Manhattan distance for grid-based movement (no diagonals)
  • Need to cache paths and only recalculate when player moves significantly
  • Found a great visualization tool: pathfinding.js

Go Interfaces

  • Interfaces in Go are implicit - no need to declare implementation
  • Any type that implements all methods automatically satisfies the interface
  • Keep interfaces small (often just 1-2 methods)
  • “Accept interfaces, return structs” is a common pattern
  • The empty interface interface{} accepts any type (like any in newer Go versions)

Random

  • Discovered itch.io’s devlog feature - might cross-post there
  • Need to set up a better note-taking workflow (currently using Obsidian + manual conversion)
  • Read an interesting article about roguelike design patterns

Tomorrow

  • Implement basic AI pathfinding for enemies
  • Refactor player movement to use signals
  • Write up a proper blog post about system design