How does an Engine like Source process entities?
- by Júlio Souza
[background information]
On the Source engine (and it's antecessor, goldsrc, quake's) the game objects are divided on two types, world and entities. The world is the map geometry and the entities are players, particles, sounds, scores, etc (for the Source Engine).
Every entity has a think function, which do all the logic for that entity.
So, if everything that needs to be processed comes from a base class with the think function, the game engine could store everything on a list and, on every frame, loop through it and call that function.
On a first look, this idea is reasonable, but it can take too much resources, if the game has a lot of entities..
[end of background information]
So, how does a engine like Source take care (process, update, draw, etc) of the game objects?