-
Notifications
You must be signed in to change notification settings - Fork 0
High level overview
At the topmost level the application is a stack of game states. Ryne Editor implements a main menu that adds the Editor game state on top. All game states have Initialize, Update and Draw functions, similar to frameworks like Monogame. For more flexibility in logic separation there’s currently a PostFrame overridable function, and it’s easy to extend this if you require more such steps. The Register- and UnregisterEntity functions can be used to run custom logic when adding any entity to the scene.
An entity component system is running parallel to the above. My past article on entity component systems laid out some interesting concepts regardings ECS designs, however in Ryne the design is intended to be as simple as possible. It’s plainly laid out as follows
- Systems
- Can run a loop over all entities with a certain set of components. For example the physics system loops over all components with a transform and physics component.
- Entities
- Game objects that can have one of each component type.
- Components
- Data structures with optional logic.
- Events
- To connect systems to entities using an event. For example the CollisionSystem sends out an event to all entities involved in the collision
Entities can be controlled using InputMappings fed to a Controller. The input mapping describes an action that is executed when the input combination triggers. Currently this is done by polling the input combinations on the backend, but future release plans involve transforming this to an event based system.
All of the Editors graphical user interface features have been implemented using custom C# bindings of ImGui. Delegated window creation with editable inputs are made possible by GuiElements, which can store the final values in a Dictionary to lookup at a later time. All in all this gives a powerful feature set to support a lot of tool creation possibilities.
Material editing supports a simple Node Editor built on top of ImGui. This editor can be used for mapping texture channels to material inputs. I’m not sure if this feature is going to stay as I plan to move away from texture maps completely, and for now that is it’s only use.
The final aspect for this high level overview is the Utility folder in the repository. Hidden in there you can find a basic vector math library (which also translates to the backend) which also contains quaternions to describe rotations in transforms. Collision detection is done using the Separating Axis Theorem implementation, combined with a scene Bounding Volume Hierarchy.