Abstracting the multiplayer logic from the base game logic

Options

Hey,

I've been tasked with developing an FPS fgame, and it's been decided that it should feature a multiplayer mode. I'd say I'm a decent programmer; I can whip up elegant prototypes fairly quickly, and I had a simple FPS setup with shooting, health, score, interface and all sorts of fancy extras set up in no time — all modular, using UnityEvents. Now I have to make it multiplayer (using Photon PUN2), and quite frankly I'm pulling my hair and hemorrhaging time.

I have no prior experience in multiplayer programming, and it shows: I suck at it. Chances are, someone else is gonna take over the multiplayer aspect of the project eventually, but in the meantime I still have to deliver functional multiplayer builds. What I feel should take me minutes is taking me hours; I'm basically grasping at straws, and as a result I keep having to rewrite my base code in the meager hope that it would work as intended in multiplayer.

I wish there was some simple way to have a dedicated code layer deal with going multiplayer. Is there any way to "abstract" the multiplayer logic from the base game logic? It would be great if I could work as if the game were a solo experience, and then have separate classes (which eventually I hope someone else would write) handle the multiplayer bit. Ideally my Health class for instance wouldn't have to handle PhotonViews, ownership, streams, RPCs or anything — just the base code handling the practical hurting/healing/dying/reviving.

Is that at all possible?

Cheers.