Systems and Components to learn from

manu3d

Active Member
Contributor
Architecture
Hi everybody!

Over the past few days I found extremely useful to follow Cervator's tip in the Skysphere thread and look into the Hunger/Thirst System, to get a basic idea of how Systems and Components work in practice.

I am aware there are many systems and components already in place. Would it be possible to have a short list, perhaps published on the wiki, of some representative Systems and their Components, in order of (slowly) increasing complexity?

For people unfamiliar with the codebase it would offer some useful guidance in the not so trivial task of deciding what pieces of code to look at first.
 

manu3d

Active Member
Contributor
Architecture
Allright, we have one taker for the "basic complexity" rank, the Hunger/Thirst System, and one for the "terrifying complexity" rank, BlockNetwork and Signalling modules. Any taker for the "intermediate complexity", "advanced complexity" and "moderately scary complexity" ranks? :)
 

Marcin Sciesinski

Code ALL the Ages!
Contributor
World
Architecture
Let me make a quick list then:
1. Basic - "Hunger" mod, simple component, single widget UI, simple event handling.
2. Intermediate - "Journal" mod, simple component, composite widgets in UI, key binding, introduces events sent over network.
3. Advanced - "Growing flora" mod, advanced components, interaction with world generation and use of scheduled eventing, introduces concept of chunk states, I'd suggest not looking too much into the tree shape and growth generation itself (implementation) just look at the interfaces.
4. Moderately scary - "Workstation" mod, use of components for defining flow, use of prefabs for defining new types of objects, complex interaction with inventory, both player and entity.
5. Insane - "BlockNetwork" and "Signalling" mod, maintains a separate data structure for loaded entities to improve performance, listens on Component, Entity and Chunk life-cycle events to keep the data structure up-to-date, complex logic, delay handling of events.
 

manu3d

Active Member
Contributor
Architecture
Perfect. Thanks Martin. I'll try and find a corner of the wiki where to place this list, for posterity. I guess it will link from pages regarding the Entity System and the Modding Guide. Thanks again. I look forward going through the code.
 

manu3d

Active Member
Contributor
Architecture

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Thanks a bunch to you both, we badly need more documentation like this :)

manu3d - feel free to go nuts in the GitHub wiki. It could use the effort! Modding guide and Modding API were more like ideas long ago that weren't followed through on enough - they need overhauls for sure.
 

manu3d

Active Member
Contributor
Architecture
Will do my best. First I have to figure out how everything works, then I'll let the knowledge trickle into the wiki... ;)
 
Top