Say I'm building a persistent-world RPG with standard 'paper doll' equipment layered over the base player form. Some of this equipment is merely visual; some of it affects player stats. Generally, I would imagine the best way to store what equipment the player is using is via global variables, since my game will take place non-linearly across a large number of layouts.
However, that would be a problem when it comes time to connect to another peer and 'go multiplayer'; the host (another player, not a central host) has values of their own for these variables.
I can imagine two ways of handling this:
1. Have instance variables on the player object that mirror the relevant data from the global variables upon entering the layout, then copy this information over when the player enters the multiplayer space as a peer.
2. Transmit only the player's 'user ID'. The host then uses that user ID to contact the central character database and retrieve the relevant stats/information about each player.
Or perhaps there's a third and better way I haven't thought of yet?
Let me know what you think of this plan!