Skip to content

v0_1_4 (REMASTER) Object Property Based Hierarchy System

PolyWCube edited this page Apr 6, 2025 · 1 revision

Log

This is a very hard decision to make but I have to do it.

I going to create a custom "object management system" (like ESC - Entity-Component System,...) as I think it will make my development process much more enjoyable and potentially give me a strong code base foundation to further extend my system.

And yeah, it was worth it... so much.

Inspired by the Unity component system, I created my property system which has a pretty described and meaningful code format, allowing me to do something like this:

Object::ID windowID = objectManager.CreateObject();
objectManager.AddProperty<Object::Window>(windowID);
objectManager.GetProperty<Object::Window>(windowID)->Create();

So basically, every object will have an "ID" corresponding to its address in the manager class, and everything from object to property will be managed through the object manager. Why? Why don't just have the object own every property it has, which makes more sense? Actually, I'm trying to utilize the supper fast look-up table of unordered_map, which has the complexity of O(1) or constant time. Additionally, this will potentially make the memory much happier as every object will have a continuous address in the memory instead of a fragmented memory chunk ofa each object.

So that's it for the system, it not that complicated but it's needs a lot of effort to fit everything together. And that's time-consuming as I need to test and benchmark every possible solution and architecture...

In this update, I also rework the vector header in math. I think it is not flexible enough for a math library so I did some research and tried some polymorphism implementation, and that's when I discovered CRTP - Curiously Recurring Template Pattern architecture (I leave the link as it is a pretty big topic). Basically, it utilizes the template to pass the derivative implementation of a function or method to the base class without breaking the polymorphism, allowing it to "bypass" the virtual implementation way and increase performance.

That's the two main topics in this update. The others are about redesigning the structure of the engine and so on.

Roadmap

I still create some UIs and actually manage to make it work with the window. However, redesigning the engine's structure breaks everything apart so I need to rework on UI again. Everything will pretty much stay the same as the previous update's roadmap.

Update

  • Rework vector (math)
  • Add Object-Property based hierarchy system (or at least what I call it)

Logo - BG

Clone this wiki locally