Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I’m not on the cutting edge of gamedev, but I still believe that ECS is a solid pattern with lots of use cases.


I do make games at home and dont follow ECS religiously, but it is there depsing on how I solve a problem.

:-)


Sounds like relational databases: Entities are IDs. Components are tables with an ID column.


EXACTLY!

It is very much like building a database.

Each class I created is very much like creating a table.

I had my "Objects" which was a simple class with an Id. In ECS land, this would be better known as an entity.

I would then create classes (or tables) for each "feature" to support.

A feature could be

Is it Solid? Is it Visible Is is a Shape/Model Does it has Position Does it have Children

etc.

Each feature an object supports gives it extra data. So each feature is essentially a table with an Id, ObjectId, and additional fields.

Basically, I am "creating my object hierarchy" at runtime, not at compile time with OOP methods. This made it sooo more flexible when more Companies wanted to use the software, especially with their unique approaches to shop management. All configurations were in XML files -- much better than trying to change an OOP hierarchy to suit ALL companies rulesets.

This is going back a few years, now. Its amazing what comes back to memory.. how I wrote most of this entirely in Javascript to eventually moving to a backend language using AJAX.. to simplifying code with jQuery.

Fond memories.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: