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
- state machine [in detail]
- combat engine
- path finder
- animation engine
- 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
- simulation
- networking
- rendering (sound) ..
- storage of data
- 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
- Data related to game mechanics are stored in CSV files
- images of buildings are stored separately (individually) as simple png files
Sprite sheet
Building
game data [plays a prominent role]
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
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
- on Entry
- on Message
- on Execute
- 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
- Factory
- Abstract Factory
- Singleton
- Pub-Sub
- Visitor
- Decorator
Optimizations
** States generalization ** Sprite Mirroring