Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hilkojj/dibidab-engine
Small ECS-based Game Engine with Lua scripting
https://github.com/hilkojj/dibidab-engine
browser cpp ecs game-engine linux lua opengl windows
Last synced: 2 months ago
JSON representation
Small ECS-based Game Engine with Lua scripting
- Host: GitHub
- URL: https://github.com/hilkojj/dibidab-engine
- Owner: hilkojj
- Created: 2020-01-31T17:11:30.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-11-08T07:40:11.000Z (2 months ago)
- Last Synced: 2024-11-08T08:31:43.132Z (2 months ago)
- Topics: browser, cpp, ecs, game-engine, linux, lua, opengl, windows
- Language: C++
- Homepage:
- Size: 1.24 MB
- Stars: 13
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Dibidab Engine 2
Dibidab is a small ECS-based game engine that I use in my game projects.
## Dependencies
- [GU](https://github.com/hilkojj/gu): My C++ OpenGL game library for Desktop & Web.
- [Dibidab Header Tool](https://github.com/hilkojj/dibidab-header): My tool that generates reflection code, Lua bindings and JSON-(de)serialization code.
- [EnTT](https://github.com/skypjack/entt): Core functionality for using the Entity-Component-System pattern.
- [Lua](https://github.com/lua/lua) and [Sol2](https://github.com/ThePhD/sol2): For scripting and Lua bindings.Dependencies are included using submodules in `external/.`
Run `git submodule update --init --recursive` before configuring CMake.## Features
This engine is built as a library and exposes the APIs of the other libraries listed above.
Next to the features that those libraries offer, Dibidab has features including:### Entity Templates & Scripting
Entity templates can be made in Lua scripts.
Because each Component automatically has Lua bindings generated for them, they can be added/modified/removed by the Lua script.
Not only is this possible during the creation of the entity, but also in callbacks of Event listeners or timeouts/intervals.```lua
-- Save template, args and transform:
persistenceMode(TEMPLATE | ARGS, {
"Transform"
})-- Arguments that can be changed in UI, or from other scripts:
defaultArgs({
modelName = "TestCar",
maxVelocity = 3.0,
maxForce = 2000.0
})function create(vehicle, args)
setComponents(vehicle, {
Vehicle {
maxVelocity = args.maxVelocity,
maxForce = args.maxForce
},
ModelSpriteView {
modelName = args.modelName
},
PathFinding {
navData = navData.VEHICLE
},
Hoverable {
category = hoverableMasks.VEHICLE | hoverableMasks.INTERACTABLE
},
MovingSpatialAudio()
})setTimeout(vehicle, 0.5, function()
print("hello!")
end)
end```
### Entity Inspection
Because Components automatically have reflection and serialization code generated for them,
Components can be inspected and modified using an in-game GUI.
The Inspector/Reflection code is smart enough to allow you to inspect maps, vectors, etc..
![Entity Inspector](screenshots/inspector.png)### Behavior Trees
The engine comes with a Behavior Tree implementation that can be used for controlling entities with AI.
Behavior trees and custom Tree Nodes can be made in Lua and/or C++.
Branches of the trees can be entered based on the presence or absence of Components on the entity,
and Nodes can add/remove/modify Components any way they like.The implementation allows for running hundreds/thousands of entities with a behavior tree.
A running behavior tree can be inspected using an in-game GUI.
![Entity Behavior Inspector](screenshots/behavior_inspector.png)### Level saving/loading
Levels can be saved and loaded. A level can consist out of multiple rooms.
Each room is a 'ECS-Engine' with a set of Systems and Entities, of which any can be persistent.