In open world games like GTA 5, what happens to NPCs when no one is around? Do they still “move,” drive, etc?

765 views

In open world games like GTA 5, what happens to NPCs when no one is around? Do they still “move,” drive, etc?

In: Technology

7 Answers

Anonymous 0 Comments

It depends on the game as obviously a game can be programmed any way you want. But typically an open world game as large and detailed as GTA, it is not feasible to keep the whole world simulation going outside of the player’s little bubble. It’s too much strain on memory and processing resources.

Graphically, assets are removed from graphics memory (culled, as redditspamnotbot described)) when they aren’t visible, this frees up much needed GPU resources. The same process is in place when it comes to the ‘existence’ of objects in the game world. At some point they will be despawned and no longer exist, to save on system memory and CPU resources. No need to remember what the pedestrian looked like, what animation state they were in, what car they were driving, the damage state of that car, calculate their physics etc.

It may be that these two areas are not the same; if you run away from a vehicle collision to the point that you can’t see it, it will be culled, but if you run back to it, it will still be there because it didn’t despawn. But if you run away even further it will cease to exist, there will be no traffic jam or other flow on effects, etc. When you return to the same spot, other objects will randomly spawn into the world, even if it creates an impossible contradiction to the state you had previously observed.

It’s also not a necessarily binary decision. You can implement some state in-between where the object isn’t completely despawned, but reduces how much resources it consumes. As NoCelery1168 explained it might exist in a state where position and vector is maintained but it does not adhere to normal physical or collision detection. Or maybe the object continues to “exist” and travel on some pre-determined path, but like it doesn’t retain the car’s damage state or the fact that you shot 2 of the passengers dead.

You are viewing 1 out of 7 answers, click here to view all answers.