Git Product home page Git Product logo

gear's Introduction

gear

Game Engine @ Rust

Open source game engine implemented in Rust. (the name is still debatable..)


Developement

In the first stages of developement, it should be decided which parts of the engine are to be implemented from scratch and which parts can be integrated from already existing crates.

Below are the most significant parts that form a game engine listed with some (definitely not all) of their components:


1. ECS

"Entity–component–system (ECS) is a software architectural pattern that is mostly used in video game development. ECS follows the principle of composition over inheritance, meaning that every entity is defined not by a "type" assigned to it, but by named sets of data, called "components", that are associated to it, which allows greater flexibility. In an ECS, processes called "systems" determine which entities have certain desired components, and act on all of those entities, using the information contained in the components. For example a physics system may query for entities having mass, velocity and position components, and then iterate over all of them and do physics calculations." -Wikipedia

Items to focus on:

  • Entities
  • Components
  • Systems

image

relevant crates:

references:


2. Math Engine

"A Math Engine is the veins of a Rendering Engine (item 3). Without it a 3D object can't rotate nor translate across the screen." -Random game engine indie developer

Items to focus on:

  • Vectors
  • Rotation matrices
  • Quaternions

image

relevant crates:

references:


3. Rendering Engine

"In a software application the rendering engine is the module that is reasonable for generating the graphical output. Basically the job of a rendering engine is to convert the applications internal model into a series of pixel brightness's that can be displayed by a monitor (or other graphical device e.g a printer). In a 3D game, the rendering engine might take a collection of 3D polygons as inputs (as well as camera and lighting data) and use that to generate 2D images to be outputted to the monitor." -Quora

Items to focus on:

  • Wrappers of OpenGL API
  • Shaders (a somewhat complicated topic that should probably have its own section)
  • And many, many more

image

relevant crates:

references:


4. Physics Engine

"A physics engine is computer software that provides an approximate simulation of certain physical systems, such as rigid body dynamics (including collision detection), soft body dynamics, and fluid dynamics, of use in the domains of computer graphics, video games and film (CGI). Their main uses are in video games (typically as middleware), in which case the simulations are in real-time." -Wikipedia

Items to focus on:

  • Forces and gravity
  • Velocity and accelaration
  • Collision detection system

image

relevant crates:

references:



Other Useful Links & Refs


This README

This readme file is obviously incomplete, and is going to be updated constantly at the beginning of the project. Feel free to add useful references to the relevant sections and expand this document as you see fit.


gear's People

Contributors

benny-n avatar grishatsuker avatar iliafeldgun avatar orenkoren avatar

Watchers

 avatar  avatar  avatar

gear's Issues

Implement a basic Math Engine

The math engine should contain 2 modules (for now):
Vectors and Matrices.

Vector operations:

  • Vector addition & subtraction: Allows a character to move
  • Dot Product: Determines how much a vector influences another
  • Cross Product: Allows for the creation of a third vector

Matrix operations:

  • Transformation
  • Transpose
  • Inverse
  • Identity

The transformation operation allows a character to rotate.

Math engine related references can be found in the README file.

Naïve skeleton example:

struct Vector{
  x: i64,
  y: i64,
  z: i64,
}
impl Vector{
  fn add(&self,  other : &Vector){
    panic!("Not implemented!");
  }
}

Investigate OpenGL

Learn OpenGL's API and experiment with very small, basic rendering tasks

CI pipeline and development branch

Do we maintain a development branch and everyone pushes changes to it or do we open a branch per issue? Maybe something in the middle?
Also, should we add some sort of CI pipeline?
Please share your ideas regarding these questions

Physics Engine

As of now, it is not clear for me wether a physics engine is something that can be implemented (even in a very simple way) this early. Personally, I think that the physics engine can be a very good candidate for a module that we can import externally and wrap (by using one or more of the physics crates mentioned in the README, for example), instead of implementing it from scratch.
Please offer your opinions and ideas regarding this matter.
Also, any insights about physics engines in general are extremely valued.

Implementing a simple ECS architecture

Creating a simple ECS architecture should be our main concern right now.
This is the core of the game engine.
in TL;DR terms, if we oversimplify it (and we definitely will at the beginning) then it all comes down to:

  • Entities - generic objects with a unique ID.
  • Components - raw data.
  • Systems - functions.

This guide -> https://www.david-colson.com/2020/02/09/making-a-simple-ecs.html
shows how a simple ECS should look like, and gives a lot of code examples in C++.
A good start would be to follow this guide and re-implement some of its examples in Rust.
Naïve skeleton example:

struct Entity<T>{
    id : u64,
}
impl Entity<T>{
    fn get_id(&self) -> u64{
        self.id
    }
}

Side note: this issue is also marked as research because much more investigation is required. Any useful information and insights regarding ECS would be extremely valued.

Create code base

At the beginning, the project tree should look close to this:

gear
___| src
_____|MathEngine
_____|PhysicsEngine
_____|RenderingEngine
_____|ECS //or Entity, Component, System as seperate folders, also a possibility

We can start with creating this tree and filling the folders with dummy modules with meaninful names but no functionality yet (maybe consider writing functions with panic!("Not implemented");)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.