Skip to content

Simple light-weight game engine using Three.js, three-mesh-ui, rapier.

License

Notifications You must be signed in to change notification settings

WesUnwin/three-game-engine

Repository files navigation

NPM Version MIT License Stargazers Forks Contributors NPM Downloads


Logo

three-game-engine

The ThreeJS game engine, featuring the Rapier physics engine.
Website »

Docs | Demo | Scene Editor | Report Bug | Request a Feature

Table of Contents
  1. About The Project
  2. Scene Editor
  3. Architecture
  4. Documentation
  5. Desktop and Mobile Apps
  6. Contributing
  7. License
  8. Contact

About The Project

This library simply ties together several well known, very capable javascript libraries resulting in a powerful yet simple game engine. These dependencies are minimal and fully open-source.

  • Three.js - a 3D WebGL-based Graphics Engine
  • Rapier - a 3D Physics Engine
  • three-mesh-ui - Lets you build 3D user interfaces in Three.js

Screenshot

Although a web-first game engine, you can very easily package and distribute apps/games using this as desktop apps or mobile using electron, cordova or other libraries (examples of how to do this are included in the examples/ folder).

(back to top)

Why Use this Engine?

This engine is open source, light weight, very readable (seriously check out the source code :) ), it's totally free and allows you to use tools and techniques that web developers are familiar with like javascript/typescript/webpack/json files/etc. Furthermore its very actively maintained and gaining momentum. It's great for rapid prototyping, and developers familiar with three.js and web tools will transition into this quickly.

Why not just use Three.js?

  • ThreeJS is designed to be a graphics engine, its stops short of providing all the things games need:
    • Asset management
    • Input aggregation and abstraction
    • User interfaces
    • Physics
    • Other utilities (eg. Character Controllers, A.I. Path Finding, etc.)

Compared to the Three.js scene editor:

  • This allows you to compose and manage a game with multiple scenes
  • Allows you to generalize GameObjects into types (prefabs)
  • Externalizes and allows for re-use of assets like gltfs, textures, sounds, etc.
  • Allows you to control the physics characteristics of game engines.

(back to top)

The Vision

  • To provide a web-first game engine, for developers that love javascript/typescript (but with support for building desktop and mobile apps)
  • to offer a 100% free engine that can be used by anyone to build personal or comercial apps/games.
  • maintain source code that is highly readable, and extendable
  • to offer VR support

(back to top)

Scene Editor

This game engine comes with a well-equiped scene editor that allows you to compose scenes with game objects.

Your game and scenes are described by a project folder containing .json files that can be manually edited or opened in the scene editor.

The scene editor also allows you to quickly boilerplate a new project also.

You can run the scene editor locally by cloning this repo and:

  npm install
  npm run scene_editor

OR

Use the online scene editor here

Scene Editor

(back to top)

Architecture

This game engine allows you to manage a Scene of GameObjects. Each GameObject controls a Group in the ThreeJS scene graph, and can optionally be associated with a Rapier RigidBody with colliders.

Screenshot

(back to top)

Documentation

View the MD files in the docs/ folder of this repo, or checkout the online documentation.

(back to top)

Desktop and Mobile Apps

In addition to using this library to build web apps that run in your browser, with third party tools like electron, cordova, etc. you can easily package and distribute your game as a desktop app or mobile app.

This repo contains complete working examples of:

  • How to use electron & electron-forge to package your game as a desktop app, see examples/electron
  • How to package your app as an android or iOS app using Apache Cordova, see examples/cordova

(back to top)

Contributing

Your feedback and contributions are welcome! Let's make this engine great, PRs are welcome, for large contributions or new features it is recommended to contact me in advance. All issues, PRs and feedback will be responded to - I greatly appreciate and value your contributions!

Don't forget to give the project a star! Thanks again!

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Wes Unwin - wes_unwin@hotmail.com

Project Link: https://github.com/WesUnwin/three-game-engine

(back to top)

About

Simple light-weight game engine using Three.js, three-mesh-ui, rapier.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published