Git Product home page Git Product logo

game-technologies-csc8503's Introduction

build-date branch-features

About

This repo contains a series of physics, networking and AI exercises completed for CSC8503 at Newcastle University.

List of Features

Category Feature Description Version
Physics Raycasting Fires infinitely thin lines from a point in the world to see which objects collide with it. dev
Physics Linear Motion Uses a semi-implicit Euler integrator to simulate rigid body dynamics. dev
Physics Angular Motion Simulates angular movement dynamics using moments of inertia. dev
Physics Collision Detection + Resolution Sphere and AABB detection capabilities, with a plan to eventually implement OBB, capsule and swept volume collisions. dev
Physics Broad & Narrow Phase Octree Broad and Narrow spatial acceleration structure implementations. dev
AI State Machines Using a templated generic FSM. dev
AI A* Pathfinding Using Manhattan heuristic on grid-based paths. dev
Debug Physics Volume Rendering Displays physics volumes in the scene. dev

Physics


Raycasting

  • The implementation in this repo began as an exercise through Newcastle University Raycasting Tutorial.
  • Mouse Picking using raycasting contains a complete derivation of the inverse of the projection matrix as a tool towards mouse picking.
  • Layers are implemented as to allow for selective layer collision mechanisms.

The following image contains a snapshot of raycasting being used to highlight mouse selected gameobjects and those around them, with the cube object layer objects ignoring the sphere layer during raycasting:

Linear Motion

  • The implementation in this repo bagan as an exercise through Newcastle University Linear Motion Tutorial.

The following gif contains an example of movement using additive forces on selectable objects: Linear Motion Image

Angular Motion

  • The implementation in this repo bagan as an exercise through Newcastle University Angular Motion Tutorial.
  • This is a list of moments of inertia, and was used to implement hollow spheres.

The following gif contains an example of angular movement using point specific additive forces on selectable objects: Angular Motion

Collision Detection

  • The implementation in this repo began as an exercise throughthe following tutorials: 1 and 2.
  • Terminology:
    • Coefficient of Restitution: The ratio of an object's velocity before and after a collision.
    • Perfectly Elastic: Combinations of restitution coefficients of 2 materials = 1
    • Inelastic: Combinations of restitution coefficients of 2 materials = 0

The following gif contains an example of collision resolution between AABBs and Spheres using Projection Seperation and Impulsing: Collision Resolution

The following gif contains an example of collision resolution between AABBs and Spheres using the Penalty Method utilising Hook's Law: Collision Resolution

Networking


Artificial Intelligence


Debug Render View


Below is an example of AABB and Sphere physics volumes in debug render mode:

Keybindings

Key Tag Description
Escape Exit Terminates the program.
Page_Up Enable Console Window Enables the console window.
Page_Down Disable Console Window Hides the console window.
DEBUGGING ---- The keybindings listed below are used to perform debugging on the simulation.
Mouse 1 Object Selection If used over a gameobject on a raycastable layer, will trigger the Object Selection State on that object.
P Debug Render Toggle Toggles rendering between the debug scene and the game scene.
R Camera Movement State Toggle Toggles between free camera movement and no camera movement.
L Object Lock Camera Movement If an object is selected, toggles between object locked camera space and free camera movement.
SIMULATION ---- The keybindings listed below are used to alter the simulation settings.
F1 Reset Resets the simulation world.
F2 Camera Reset Resets the simulation camera to a pre-defined location in the world.
F7 Enable Object Shuffle Enable object shuffling to reduce physics calculation bias.
F8 Disable Object Shuffle Disable object shuffling.
F9 Enable Constraints Shuffle Enable constraint shuffling to reduce physics calculation bias.
F10 Disable Constraints Shuffle Disable constraint shuffling.
G Gravity Toggle Toggles the gravity of the simulation between an active and non-active state.
CAMERA ---- The keybindings listed below are only active when the camera movement state is active.
W Forward Moves the camera in the forward direction.
A Left Moves the camera in the left direction.
S Backwards Moves the camera in the backwards direction.
D Right Moves the camera in the right direction.
Q Up Moves the camera in the upwards direction.
E Down Moves the camera in the downwards direction.
OBJECT SELECTION ---- The keybindings listed below are only active when the gameObject selection state is active.
W Forward Moves the object in the forward direction.
A Left Moves the object in the left direction.
S Backwards Moves the object in the backwards direction.
D Right Moves the object in the right direction.
Q Up Moves the object in the upwards direction.
E Down Moves the object in the downwards direction.

Acknowledgments

I would like to thank Dr Rich Davison for his exciting and informative lectures and tutorial materials throughout my time at Newcastle University.

The framework used for this repository was created and provided by him, and he has given permission for it to be used as learning material.

game-technologies-csc8503's People

Contributors

kney-delach avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

luojunlin1223

game-technologies-csc8503's Issues

Renderer Memory Leak

There may be a memory leak in the renderer every time a debug sphere is being drawn.

Physics engine multi-iteration handling

When the physics engine is ran more than twice per frame, it fails to reduce its iteration count in scenarios where the application can't perform as many iterations as initially requested by the programmer.

Broad & Narrow Phase in Debug mode too slow

When running in debug mode with broad phase toggles to active in the physics system, it currently takes upwards of 1000ms to process each frame, this can be fixed by optimizing the octree implementation and creating different trees for static / dynamic objects.

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.