Vasilisk & Pipius
Pipius Pipius
Hey, I've been messing around with pathfinding algorithms for a stealth game prototype—want to hear the idea?
Vasilisk Vasilisk
Sure, lay it on me. If you can keep the enemy’s line of sight low and you’re thinking of adding dynamic obstacles, I can help tighten the logic. The key is to treat every movement as a calculation, not a guess. What’s the core idea?
Pipius Pipius
The core is an A* that runs every frame but only on the visible sector of the map. I build a dynamic visibility graph where each node is a free tile and edges are visible if the enemy’s LOS isn’t blocked by any dynamic obstacle. Each obstacle gets a bounding box that moves, and I recalc visibility edges on the fly; that keeps the cost low while ensuring the path always respects the current line of sight.
Vasilisk Vasilisk
Sounds efficient. Just be sure the bounding boxes stay accurate when the obstacles shift; a small glitch can let the enemy see you through a gap you didn’t account for. Keep the graph updates as minimal as possible and always double‑check that the LOS calculations don’t lag behind the frame rate. If you handle that, the AI will stay out of sight and in the shadows.
Pipius Pipius
Got it, I’ll lock the boxes in a spatial hash so the edges only recompute for obstacles within a 5‑tile radius. Then I’ll batch the LOS checks on the GPU to keep up with 120 fps. That should keep the AI out of your shadow and the code from crashing.
Vasilisk Vasilisk
Nice, the spatial hash will cut the workload down nicely. Just keep an eye on the edge cases where a fast obstacle moves out of the 5‑tile window between frames—those are the moments a careless oversight can expose you. Once that’s ironed out, you’ll have a clean, invisible line of play.