Code Monkey home page Code Monkey logo

detonator's Introduction

πŸ’£πŸ’₯ DETONATOR 2D πŸ’₯πŸ’£

An OpenGL ES based 2D game engine and editor for Linux, Windows and HTML5. Designed for simple single player games such as puzzle games, platformers, side scrollers and tile based real time strategy and tactics. πŸ„πŸ§©πŸ—ΊοΈ

Demos

πŸ’₯ CURRENT TOP FEATURES !

  • Supports native Windows and Linux.
  • Supports HTML5 and WASM.
  • Fully featured editor for game development.
  • Fully documented Lua API for game development.
  • Demo content and examples.
Click here for more features
  • Windows, Linux and HTML5/WASM support
  • Qt5 based WYSIWYG editor
  • Text rendering (vector and bitmap)
  • Various primitive shapes, custom polygon shapes
  • Material system with built-in materials and with custom shaders
  • Particle system with projectile and linear motion
  • Entity system with animation tracks
  • Audio engine with approx. dozen audio elements
  • Lua based scripting for entities, scenes and UIs
  • Built-in Lua script editor with code formatting, API help and code completion
  • Scene builder
  • In game UI system
    • Animation ready through simple CSS inspired keyframe declarations
    • Styling support through JSON style files and material system integration
    • Virtual key support and mouse input support
    • Scripting support for integrating with the game
  • Tilemap builder for tile based worlds
    • Multiple render and data layers
    • Isometric (dimetric) and axis aligned top down support
    • Combines with scene and its entities!
  • Physics engine based on Box2D
  • Demo content and starter content
  • Game content packaging for native and HTML5/WASM (with Emscripten)
  • Resource archives, export and import between projects (in zip)
  • Tilemap importer, several handy dialogs for materials, fonts, colors etc.
  • Several other tools such as:
    • Image packer (for packing textures manually when needed)
    • Bitmap font mapper (map glyps to characters and vice versa)
    • SVG viewer and PNG exporter
    • VCS (Git) integration for syncing project changes to Git

GETTING STARTED

  1. Download the latest binary from the releases page
    https://github.com/ensisoft/detonator/releases
  2. Unzip the .zip file anywhere on your computer for example C:\detonator
  3. Run C:\detonator\Detonator.exe

How to Uninstall

If you want to remove the app simply delete the detonator folder.
All user settings are stored in C:\Users<username>.GameStudio and can also be deleted.

Install from Sources

If you're a developer type and want to build from sources or you want to:
  • Use the latest development version
  • Use Detonator on LINUX
  • Build your own safe binary
  • Hack on the engine or the editor

then follow the Build Instructions

Demos

Click here for more screenshots

Screenshot Create tile based maps using the tile editor. The map supports multiple layers and both isometric and axis aligned perspective. The map can then be combined with the scene and the scene based entities in order to produce the final game world.

Screenshot Create animated game play characters in the entity editor. Each entity can contain an arbitrary render tree of nodes with various attachments for physics, rendering, text display etc. The entity system supports scriptable animation state graph as well as animation tracks for managing animation and entity state over time. Each entity type can then be associated with a Lua script where you can write your entity specific game play code.

Screenshot Create materials using the material editor by adjusting properties for the provided default material shaders or create your own materials with custom shaders! Currently supports sprite animations, textures (including text and noise), gradient and color fills out of box.

Screenshot Create the game play scenes using the scene editor. The entities you create in the entity editor are available here for placing in the scene. Viewport visualization will quickly show you how much of the game world will be seen when the game plays.

Screenshot Create the game's UI in the UI editor. The UI and the widgets can be styled using a JSON based style file and then individual widgets can have their style properties fine-tuned in the editor. The style system integrates with the editor's material system too!

Screenshot Create audio graphs using the audio editor. Each audio graph can have a number of elements added to it. The graph then specifies the flow of audio PCM data from source elements to processing elements to finally to the graph output. Currently, supported audio backends are Waveout on Windows, Pulseaudio on Linux and OpenAL on HTML5/WASM. Supported formats are wav, mp3, ogg and flac.

Screenshot Use the built-in code editor to write the Lua scripts for the entities, scenes, game or UI. The editor has a built-in help system for accessing the engine side Lua API documentation as well as automatic Lua code formatting, linting and a code completion system!

Screenshot Create different types of particle effects in the particle editor by conveniently adjusting several sliders and knobs that control the particle effect.

DEV ZONE

THANKS πŸ™

This project would not be possible without the following

  • Qt, GLM, Freetype, Harfbuzz, Lua, sol3, STB, nlohmann/json, mpg123, libsndfile, Box2D, Emscripten and many others!
  • Royalty free art from https://opengameart.com

detonator's People

Contributors

ensisoft avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

detonator's Issues

Add keyboard support in uikit

This is a large ticket and will likely need to be split into smaller ones.

  • Create a concept of virtual keys so that the application can map some native keyboard events into uikit virtual keys that the UI can react on.
  • Create a concept of "input focus", i.e. which widget has the input focus for receiving key events.
    • focus indication
  • React on some uikit virtual keys and perform tasks such as "move focus to next widget", "move focus to prev widget".
    • focus order (also called tab order) of widgets

Add Lua API for accessing packaged game data

The project can have references to multiple opaque blobs of data that are defined outside of the game studio project. This could be text, cvs, json, etc.

There needs to be some way for the game to be able to access this data.

  • Loading the data files/buffers/handles
  • Ability to interpret/access the actual content in some way. Not all possible game data formats can be supported out of the box. A plugin system could be useful here but that's beyond the scope. However for JSON based data we can provide a Lua API around data/reader/writer

Add shader graph editor

This is a large ticket and will likely need to be split.

A shader graph editor would be a new feature in the editor based on the idea of being to able to visually define material shaders by building graphs out of pre-defined material nodes. The evaluation of the graph would be used to build the actual shader could that would be stored and then later on used to create the shader program.

Enhance stencil masking

Enhance and refactor the stencil masking, add a specific option for kind of stencil masking operation to apply.

Investigate more advanced rendering features

For example in the demos/breakout there are simple "spot lights" that are for visual appearance only. It'd be nice if this type of thing could really be used to compute light effects. For example in the same demo the individual tiles could simulate being lit or being in the shadow by seeing how much light falls upon them. This would mean having to rasterize the "spot lights" into some buffer that can be used to rasterize the game tiles.

Add Lua API for accessing runtime game data

This is distinct from the "packaged game data" (see #47) since this is data that is generated by the game when it runs. This is data such as high scores, save games etc.

It's likely possible to share some data access details between this and #47

Add versioning to content files

Add versioning and version checking in various contents such as materials, entities scenes etc. in order to make future expansion easier.

Map world into particle simulation

Currently the particle simulation runs in its own simulation space with only bounds for the simulation. This however means that the particles do not interact with the content of the game world, i.e. the simulation proceeds regardless the particle would in fact fall upon or touch some game space object. It'd be nice to be able to realize something like obstacles. This would require mapping of the game object that fall within the particle engines simulation boundary into the simulation space and then interfacing with the actual particle simulation.

IT should be be possible to do a brute force solution for this type of problem using the GPU by using for example depth testing (since we're not using z) or stencil testing and doing a read back to see if a particle has collided with something.

Add mouse and keyboard grabbing

Add mouse and keyboard grabbing when specified by the project / workspace settings.

Mouse grabbing is important for a game such as demos/breakout for example since in a windowed mode the mouse going outside of the window the application would no longer receive mouse events and game play would suffer. Grabbing the mouse would help here (until a global grab is taken by some other application of course...)

This needs to be implemented in wdk also.
ensisoft/wdk#21
ensisoft/wdk#22

Add interaction entity node component

Add interaction entity node component that can be used to interact with through some means of native input such as mouse/keyboard/touch events.

This would provide a higher level of interaction capability to the application so that it would not have to rely on low level keyboard/mouse/touch events. The API towards the game would something like "interaction component X was clicked" or "interaction component X was dragged"

Bricks game error

"Oops, there was an error. :(
See JavaScript console for details."

Console:

Failed to load resource: the server responded with a status of 404 (Not Found)
game.html:203 wasm streaming compile failed: TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'.
printErr @ game.html:203
game.html:203 falling back to ArrayBuffer instantiation
printErr @ game.html:203
GameEngine.js:1 Filesystem sync. Error= null
GameEngine.js:1 [0.000000] Info: main.cpp:202 "Ensisoft Gamestudio 2D"

GameEngine.js:1 [0.000000] Info: main.cpp:203 "Gamestudio Copyright (c) 2010-2021 Sami Vaisanen"

GameEngine.js:1 [0.000000] Info: main.cpp:204 "http://www.ensisoft.com"

GameEngine.js:1 [0.000000] Info: main.cpp:205 "http://github.com/ensisoft/gamestudio"

GameEngine.js:1 Uncaught TypeError: Cannot read properties of undefined (reading 'getParameter')
    at emscriptenWebGLGet (GameEngine.js:1:165224)
    at _emscripten_glGetIntegerv (GameEngine.js:1:167101)
    at invoke_vii (GameEngine.js:1:234115)
    at 02e158da:0x8208ff
    at invoke_iii (GameEngine.js:1:233951)
    at 02e158da:0x8b9e91
    at invoke_vii (GameEngine.js:1:234115)
    at 02e158da:0x43a6fc
    at tick (GameEngine.js:1:198147)

OS: macOS 10.15.4
Browser: Chrome

Use depth buffering and inverse painting order to reduce overdraw

When the scene contains no (semi-)transparent objects it should be possible to reduce overdraw by inversing the scene panting order so that the nearest layer is drawn first and the lowest (furthest away) layer is painted last. Combined with depth buffering this should take advantage of (early) z testing to discard fragments that would not be visible.

The steps.

  • enable depth buffering in the render target
  • enable depth testing when drawing a scene without transparent objects
  • generate a depth value for the primitive's vertices based on the primitive's layer
  • profit

Pulseaudio playback stops and stream pauses when underrun

Pulseaudio by default stops and pauses the stream if it thinks the write operation didn't provide enough data.
When the stream is paused the write callback is no longer called. This means that the audio source has no chance of providing more
data.

I guess there are 2 options to try to fix this.

  • use the pa_buffer_attr to try to turn this feature off
  • resume the stream conditionally (uncorck) again

Add support for HDPI display rendering

Add support for HDPI display scaling.

What this means.

  • rendering resolution and render target size are no longer the same as the display size.

  • the display window can be scaled either manually or by the underlying platform.

  • the content rendered by the engine needs to be displayed with some scaling factor/mechanism

    • render to a offscreen render target and then rescale and resample in order to display in the window
    • maintain aspect ratio or stretch
  • need engine config flags to define the setting for hdpi

  • need runtime game accessible way to access the hdpi display scale factor

  • need runtime mechanism for letting the game to adjust the hdpi display scale factor

Also applies to fullscreen not just windowed mode.

Investigate scene acceleration structure

Investigate how to support and build an acceleration structure in the scene for resolving and finding entities on some action such as a ray cast query or bounding box query.

This is likely to need some static space partitioning structure with some flags to identify objects that can be optimized (i.e. things that will not move and can have pre-computed world positions/AABBs etc.)

Investigate how to limit the number of physics bodies in simulation

Investigate how to limit the number of physics bodies in simulation. Currently the engine will create physics bodies for all entities that have nodes with rigid bodies regardless of whether they're currently actually contributing to the scene and its game play. For example simulating a physics such as a moving platform body that isn't affecting the user and isn't yet visible in the screen is wasted work.

Related to #37

Add dynamic scene loading in chunks

Currently all of the scene's contents are loaded at once. For large scenes this can be wasteful and load too much data at once. Instead it'd be nice to be able to load the scene in chunks and shuffle the content in and out of memory as needed while the game play advances.

Add (optional) automatic entity killing when outside scene boundaries

Add (optional) automatic entity killing when outside scene boundaries.
There are 2 ways to kill entities that fall outside of game play (imagine for example a falling body that falls through the scene and no longer contributes to the game play). Either the game makes sure that the entity is killed when some criteria is met such as falling to a distance of X meters from the "baseline" in game. But this can be tedious and error prone depending on the exact use case.

Alternative would be to have the game (scene) define a "hard" boundary and any entity completely outside these bounds would then be automatically killed.

Obvious reasons for this killing are

  • performance, get rid of entities that no longer contribute to the game play
  • stability of the game in for example physics simulation, at some point the floats and the physics sim would blow up potentially creating unexpected events in the game.

Handle and recover from WebGL context lost events

In the web environment it's possible for the game to suffer an "context lost" event. This might happen when for example when the browser decides to clean up the underlying graphics context when the user tabs out of the current browser tab that is running the game.

A recovery would require:

  • realize that the rendering context was lost
  • recreate the rendering context
  • recreate the graphics device and context state, reupload all the required data, vertex buffers, textures, programs

Investigate how to improve entity lifetime safety

Currently the Lua based game code is handed raw pointers to entities. This works as long as the game doesn't try to do any kind of "caching" of these pointers. This can be a little bit problematic in the sense that any access to an entity / game object outside of the designated callback that handed the object could result in use after delete bug.

So far the an idea has been to use intrusive reference counting implemented in the entities. The scene and the Lua game code would be the most likely parties participating in this scheme (the engine subsystems are expected to respect lifetimes properly).
The unclear question though is which mechanism to use in order to make the ref counting implicit in the Lua integration so that the Lua based game code doesn't need to do it explicitly (which is no better than the current implementation!)

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.