Guards make up the majority of the work for the game. I’m probably less than halfway done with them? Not super happy with my work rate so far (but not in crisis about it yet).
What’s done is the basics giving them patrol routes, having pathing where they can move to a specific point on the map, and making it so they can return to their patrol route when finishing moving somewhere. That might sound like a good day’s work, but with Godot these are pretty basic tasks (albeit I had to hack around the fact that it doesn’t directly support a single node using both paths and physics).
From here is the much more interesting work of how they sense things: sound, smell, etc. My initial plan was to have sensation origins generate pulses of sensations. Depending on the type of sense these sensations might move at different rates, get blocked/diminished by walls, or have their radius diminish as they age. Guards would detect these sensations within an area around them and follow whichever one was “freshest” (shortest existence) in order to get close.
Conceptually I liked it a lot because it would make guards move in more sporadic ways where they’re actively having to “sniff” or “listen” for the sensation. But when I started considering the practical realities of how much collision detection I’d be jamming through the system, and edge cases where monsters would get caught on walls trying to find something with a thin pulse (or not tracking sporadicness of player generated sound) I decided to back down from it. We’ll be going with the more traditional method of pathfinding each sensation and using distance to determine how detectable it is.
0 comments