I am making an online game and currently you can shoot fireballs
how it works is the player shooting them sends out in rpc with all the starting data (position, rotation, impulse to apply) and then it gets instanced on each side but it’s local and I think that might cause problems
physics are pretty consistent and the world is the same on all sides so if the fireball on one side hits a wall the one on the other side should likely hit a wall too but what I am worried about is issues with syncing causing some items to be on one client but not the other (such as a player not getting properly instanced) which would make it so on one side the fireball would bounce off the player and on the other side the player wouldn’t exist making it so if you wanted to do some sort of ricochet off the player (1) to hit the player (2) that didn’t properly instance the player (1) then it would look like it hit the player (2) to you but on the player’s (2) side it did not hit them (2) making it so the damage didn’t happen
so should I try and figure out how to instance a object that syncs for all sides or should it be okay how it is?
Your explanation is fine. You would ideally want an authorized peer (typically the host, for server-client network architecture) to be the singular truth on what happened between peers instead of what the client did or saw. A central authority in other words.
If you want a good read check this article series out.
And this is my current MultiplayerSynchronizer that I have been working on inspired by the articles
Also you can do a lot of network code with the MultiplayerSpawner and MultiplayerSynchronizer without using rpc’s
You will need rpc’s, but generally speaking the two multiplayer nodes eliminate a lot of complexity.