I am trying to create an architecture for an MMO game, and I canโt understand how I can store as many variables as I need in GameObjects without having a lot of calls to send them to the wire while updating them.
Now I have:
Game::ChangePosition(Vector3 newPos) { gameobject.ChangePosition(newPos); SendOnWireNEWPOSITION(gameobject.id, newPos); }
This makes the code garbage, it is difficult to maintain, understand, expand. So think about the Champion example:

I would need to do many functions for each variable. And this is just a generalization for this Champion, I can have 1-2 other member variables for each type of Champion / class.
It would be ideal if I could OnPropertyChange from .NET or something like that. The architecture I'm trying to guess will work well if I had something similar to:
For HP: when I update it, automatically call SendFloatOnWire("HP", hp);
For position: when I update it, automatically call SendVector3OnWire("Position", Position)
For the name: when I update it, automatically call SendSOnWire("Name", Name);
What is SendFloatOnWire , SendVector3OnWire , SendSOnWire ? Functions that serialize these types in the char buffer.
OR METHOD 2 (Prospective), but can be expensive
Update Hp, the position is usually, and then each network thread checks all instances of GameObject on the server for the changed variables and sends them.
How will this be implemented on a high-performance game server and what are my options? Any useful book for such cases?
Can macros be useful? I think I was hacked into some kind of source code for something like that, and I think it used macros.
Thanks in advance.
EDIT . I think I found a solution, but I do not know how reliable it is. I am going to go at him and see where I will be later. https://developer.valvesoftware.com/wiki/Networking_Entities