Games Engines

Starting developing a video game from scratch is a bad idea. Most video games share the same base that can be reused.

A game engine will deal with a lot of things related to the hardware (sound, io, graphics) and let us focus on our game (quests, inventory, levels).

Picking a game engine is usually a choice based on:

  • The targeted platforms for our game 🧐
  • The knowledge of the team 😎
  • The features of the game engine πŸš€
  • The price and/or the license constraints ✨
  • The community, support, and documentation πŸ“š

Some developers are building frameworks and tools on top of game engines called game templates. For example, MoreMountains.


Basic Elements

Lifecycle and game loop

Most game engines have a similar lifecycle.

  1. It initializes the game elements
  2. It repeatedly calls the game loop
    1. We fetch the user input
    2. We update the game accordingly (update)
    3. We update the screen (render)
  3. We dispose of the game elements

Frames Per Second (FPS)

The Frames Per Second (FPS) represents the number of times the game loop is executed per second.

Unfortunately, the graphic card may not call the game loop with a constant time (e.g., not every 1ms). This may be because the update was slower, the render was slower, or they were too fast 😎.

The side effect is that moving objects may not move smoothly. To fix this behavior, we use the delta time (=time since when the last update) every time we are moving something. ✍️


πŸ‘» To-do πŸ‘»

Stuff that I found, but never read/used yet.

  • 9patches technique
  • 2D Tilemaps

Game Engines