mesyeti

Home | Page list | Contact me


Arkas Engine

Arkas Engine is my 3D game engine inspired by Ken Silverman's Build Engine. Like Build, it also uses sectors and portals for maps.

This page talks about how each part of Arkas Engine works.

Resources

The resource system is simple and just tracks resource usage by ref counting. All resources are loaded from the VFS

VFS

The VFS is made up of named drives, accessed like this: drive_name:path (similar to AmigaOS). The engine contains multiple implementations of a drive, allowing for resources to be stored in many different ways, like in RAM, in an archive, in memory, or on the disk.

Entities

The engine has an ECS-inspired entity system. Entities have a type which describes what components an entity of this type has, and this cannot be changed during runtime. Entities also contain common data that all entities have, like position and velocity.

Entity types implement one function called getComponent that returns a pointer to a certain component in the entity. They also contain an array of all entity component IDs used in this entity type, which is used for serialisation/deserialisation.

Entity components implement many several functions:

To serialise an entity, the engine goes through each component in the entity's type and calls the serialise function, and adds it to the serialised buffer. A similar process is done for deserialisation.

Multiplayer

Multiplayer is still incomplete, so not much can be said about it

The protocol requires a reliable socket and may optionally use an unreliable socket. For multiplayer with other computers, TCP is used for the reliable connection and UDP is used for the unreliable connection. For local multiplayer, the engine uses its own local socket implementation for the reliable connection, and has no unreliable connection. The unreliable connection is used solely for entity/player position updates.

GUI

Arkas Engine has a table based GUI where rows can have any number of elements. The height of a row is either fixed, or decided by the tallest element. The width of a row is fixed.

To calculate element widths, the UI system keeps track of the total row width, and subtracts the width of every element with a fixed width. Then it divides this equally among the elements with a non-fixed width

In the future, this section will also describe how controllers can use the GUI

Map

The map is made up of sectors and portals. Sectors may be concave but this is discouraged

In memory, the map keeps track of entities by storing an "entity link" in each sector, which is the ID of the first entity in the sector. Each entity stores a next and previous entity, linking to all the other entities in the sector.

Scenes

Arkas Engine has a stack of scenes that can store 8 scenes. Each scene has a type, which can be either game or other. In game scenes, the engine will render the 3D world and handle player movement itself. In other scenes, the game has full control of the scene.


Main website | GitHub

Counter.CO.KZ - a free web-counter on any taste!