THIS REPOSITORY WILL NO LONGER BE UPDATED BEYOND FIXES
If it wasn’t obvious from the last time a commit was done to the Github repository, this thing is no longer maintained anyway. I wasn’t happy with how this ended up turning out, and ran into quite a few issues while trying to work with it. I approached the ECS problem on Roblox incorrectly, not fully taking into account how Roblox handles things, instead I tried to bruteforce Roblox to work with this framework, instead of trying to get them to play together nicely.
I may try to approach a ECS framework on Roblox again in the future, but I’ll do a better job at it in the future.
Latest Update
Fixed a issue with using the Replications Shared System, that caused everything to hang. (reported by YourFriendlyError)
More on Systems
Systems are usually called in intervals and all the entities are sent with each call, but the systems only get the entities with the Components the System needs to operate on. The order of the Systems will also affect how things work, usually. For example, you wouldn’t want the Input System to be after the PlayerController System (if you had custom player movement) as there could be input lag.
Systems also can’t communicate to each other by default, but on Roblox it’s easy with bindables and remotes.
What are the benefits of the Entity-Component-System over Object Oriented Programming?
In ECS it is easy to create Components and easily swap them out with others, add new ones on the fly during runtime, and allows for easy reuse. While in OOP you have to create new classes that inherit from many things, which doesn’t allow flexibility, nor can you make a new class during runtime to create a class that inherits from it. Since Components are easy to reuse, it allows for less classes that work in similar but varying ways, such as players, bullets, walls, trees, weapons, and so on.
Why I use the Entity-Component-System
It’s ultimately made it easier for me to create game logic, experiment with new things, for example, if I wanted to I could have a game where there are cows, rockets, cars, etc., and at random during runtime I can add a Rocket Component to a random cow, and watch as it flew off. It allows for easy configuration and even allows people who don’t have the full knowledge of coding to mess with things easily.
Github Repository
Github repository for the Entity-Component-System:
https://github.com/FirstValentine/Roblox-Entity-Component-System