ELI5: In open world games like GTA V, is the entire world constantly running the simulation, or is it just the parts where the playable character resides?

ITT: People who don't actually know anything about game development.

This severely depends on the game and what the result wanted is. The most upvoted comment here right now is flat out saying no, it's impossible to run an entire simulation, it would be too taxing. This is not true in the slightest. What is being simulated can be scaled back easily enough.

Let's take GTA for an example. Let's think about car traffic. So, how do you think it determines where cars pop in and their positions before they spawn so it's realistic? It's running a simulation of car positions without actually rendering the vehicles themselves. Sure, when you are in downtown, the cars up in the desert areas are not being simulated. This serves no purpose but there is probably a wide, wide area that IS being simulated in the background.

Now, how about the people? Those don't need to run in a simulation as much. Their position is less important and can be more randomly determined. No real simulation needed. They spawn, act as you see them, and despawn as soon as you lose sight of them. Some games do this poorly. Watch_dogs would have people despawn when you turned around and would spawn back a whole different group of bystanders when you look back again. It would be jarring at times and it wasn't always consistent. Sometimes it would keep them there but it was definitely something I noticed when I played.

Skyrim did simulate a large part of the world behind the scenes. Things like positions of dragons, notable NPCs and other monsters. It doesn't take a lot of processing power to simulate a location of an NPC in a 3D space if you just think of them as a point on a map and move them around. Then, when the player is close enough, spawn the character model where they were simulated to be.

You can also take it to the extreme of this and look at dwar fortress which DOES simulate the entire world all at once. The graphics are very simplified but if you take their engine and render it in 3D to represent what the different NPCS are doing, you could do this pretty effectively to simulate a whole world and it would only take the addition of a graphics processor that could run it.

So the answer is... It depends. Things like simulating traffic, NPC locations or even simplified AI does not take a lot of processing power and it doesn't take a lot to even simulate a couple thousand different things at once. Most games don't put the effort in to run entire simulations and tend to just create algorithms to spawn things where they logically should appear in a radius around you.

/r/explainlikeimfive Thread