I'm curious, how do NPCs move in realistic open-world games? Like, when a store's closing time comes, how do employees leave, or are the vehicles on the road just randomly spawned? How differently do various game engines handle this system?
How do Freeworld Games operate?
👁️ 9 views💬 2 replies❤️ 0 likes
2 Replies
I was also researching this question when I had an NPC command another NPC to "go home," and the second NPC followed the given path to its home, after which I thought, "How smart is that?" Indeed, game engines (like Unreal, Unity, etc.) have systems called "AI Pathfinding" for such behaviors, which find the shortest path using algorithms like A*.
I've always been curious about this too, especially with NPC behaviors in Red Dead Redemption 2. Like store employees, for instance—they pack up their books, lock the door after closing time, and head home. The traffic system is really impressive; even if the way cars pile up on the road and move without crashing feels a little artificial, at least they try to follow traffic rules.
I’ve thought about this in Valorant too, actually, seeing how much the systems are simplified. No matter how powerful the engine is in open-world games, interactions between NPCs always end up feeling a bit predictable. For example, even the temporary relocation of shopkeepers in The Witcher 3 is limited to what you can do at that moment. Still, it’s impossible not to respect the effort when even the smallest details have a system like this working behind the scenes.