





🌟 Special thanks to our amazing supporters:
✨ $10 Tier: [Geeks Love Detail]
🌈 $5 Tier: [Benedikt][David Martínez Martí]
Hi and welcome to our next blog post about the more slightly technical side of game development. In todays post, well cover almost the whole game because well be looking at the game loop: what it is and how it looks.
Game loop is the main part of a game program, where the game spend most of it's time. It is a basic logic which manage the whole run of a game. Of course there are step which are taken before and after the game loop but these are not important for this article. The basic architecture of a game loop may have many forms, but the the most simple and often sufficient looks like this:
Thats it. But dont forget, under each of these parts there may be thousands or even millions of lines of source code. So lets look at these parts in more detail.
At the beginning of a game loop its necessary to handle all the inputs which may affect the state of the game. Typically this input comes from the players devices like a keyboard, mouse or controller. But in a multiplayer game, input may come from the server as well. In VR games input may be derived from the position or movement of the VR controller. There are also other sources for input. This is the simplest function of a game loop but no less important.
The second part is simulation of the game world. Each pass of a game loop moves game time forward and its task, at this point, is to compute how the game world is altered during gameplay. Typically, this means: go over the games objects, compute their mutual interaction ( i.e. a bullet hitting a wall) and also compute interactions with handled inputs from the previous part of game loop. ( i.e. player press key to move forward) After the computation the game stores this new world state and goes to the third part.
The last part is rendering. In this part, we render the current state of the world to output devices. In modern games, this part of the process is the most performance consuming. But in games focusing on advanced simulation, the simulation part may be more demanding.
[ 6081 ]
[ 1481 ]
[ 2067 ]