A Bird Eye View of Game Engine - ranjitkumarborra/Never-Ever GitHub Wiki

What is Game Engine ? the basic software of a computer game or video game.

How is this Presentation organized ?

  • user engagement and Game Design
  • The Main (heart) loop of Game
  • hierarchy of characters (architectural)
  • how Assets are stored ?
  • how Path planning works ?
  • how the state Machine works ?

user engagement and Game Design

The Main (heart) loop of Game

//Basic game loop while(1)

{

ProcessInput();

DoLogic();

Render();

}

  • Let's talk about few components in the game engine
  1. state machine [in detail]
  2. combat engine
  3. path finder
  4. animation engine
  5. network engine
  • How threads are used in Game engine ? [Minimal use of threads] usually the less number of threads the more maintainable is the code 3 threads are used in game engine
  1. simulation
  2. networking
  3. rendering (sound) ..
  • storage of data
  1. data is stored in different forms, for (small) characters it is stored in the form of sprite sheet, a ffx file will take care of maintaining the meta data
  2. Data related to game mechanics are stored in CSV files
  3. images of buildings are stored separately (individually) as simple png files

Sprite sheet

Building

game data [plays a prominent role]

data

Path planning

A* grid-based pathfinding works well for games in which the characters can move freely along both the x- and y-axes. A typical 2D should do the magic

**Path finding time complexity comparison .. **

Let's have a look at the code ... Code

Challenges in path finding

failed

Demo Demo

State Machines( The FSM's )

A Finite State Machine (or FSM for short) is one of those concepts that sounds much scarier than it actually is. In the simplest form itโ€™s a datatype that can have only one value (state) from a finite selection of values(states).

typically Each state will have 4 processing fundas

  1. on Entry
  2. on Message
  3. on Execute
  4. on Exit
    • we defined a macros for the state and did applied a generalization technique to simplify and reuse the code a lot
    • state objects are static
    • state of unit is responsible to change it's animation

Design Patterns Used in Dev

  1. Factory
  2. Abstract Factory
  3. Singleton
  4. Pub-Sub
  5. Visitor
  6. Decorator

Optimizations

** States generalization ** Sprite Mirroring