Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Rewrite Entity Component System #1110

Draft
wants to merge 122 commits into
base: main
Choose a base branch
from
Draft

Conversation

aronwk-aaron
Copy link
Member

@aronwk-aaron aronwk-aaron commented Jun 9, 2023

The purpose of this PR it to overhaul the Entity Component System (ECS) with knowledge gained from reverse engineering the client.
Goals are to:

  • Reduced code duplication between components
  • Optimize hot code paths to be more efficient
  • Less error prone way to Add a component to an Entity
  • Use unique_ptr for Component storage so that it is clear that when an Entity is deleted, its components are too.
  • Remove an ungodly amount of crusty code
  • Clearer and less error prone creation and initialization of components through a constructor, and then all initialization and loading is done through and Startup and loader methods
  • Remove outdated C like component getting
  • Use proper delta compression for serialization
  • Add tests for serialization to ensure progression and future protection
  • etc (I couldn't think of anything else, this is just a fun thing to do after doing a LOT of RE)

aronwk-aaron and others added 30 commits February 10, 2023 21:33
into the model, item, and mutable model behaviors
And add more virtuals
Use const everywhere that makes sense
return const variables when it makes sense
const functions and variables again, where it makes sense
No raw access and modifications to protected members
Move template definitions to tcc file

idk how I feel about this one
- Add order for loading Components
- Enforce all components have Entity* in the first argument
Racing Stats

Minigame Control
Class must be complete to be used in a MoveAssignment
m_DamageImmune = m_ParentEntity->GetVar<bool>(u"rail_activator_damage_immune");
m_NoAggro = m_ParentEntity->GetVar<bool>(u"rail_no_aggro");
m_NotifyArrived = m_ParentEntity->GetVar<bool>(u"rail_notify_activator_arrived");
m_ShowNameBillboard = m_ParentEntity->GetVar<bool>(u"rail_show_name_billboard");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've wondered, does this need to talk to the Player Forced movement component. that has two bools that are serialized ("is on rail" and "show billboard"), which this has vars for

@aronwk-aaron
Copy link
Member Author

This PR wont be merged, but remains a draft since there's a lot of research in this PR that will be implemented in smaller chunks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants