How to design / code properly a solo game that will go "co-op" / online later?

Hello monkeys,
I am currently looking for developping a game, I am not new to jMonkeyEngine, but I really would like to start coding my game correctly.
It’s gonna be a solo-game, strategy / FPS, but later I would like to add networking, not for managing many players, just for a co-op game (So P2P is possible I think, I don’t think friends gonna cheat when they play togother).
I plan (of course) to use an Entity System, most probably Zay-ES.
I would like to know how should I design the code to be sure that the networking implementation will be done without huge modification / pain. Do you have any suggestion ?
Maybe, if I use correctly Entity System there will be pratically no adaptation to do ? Or should I use some other video games design pattern to achieve my goal ?
I hope my question is not too odd and correctly written.
Thanks in advance for your help :slight_smile:

The only easy way is to build it with networking from the beginning. Else there will be 100 things you didn’t think of that will cause you issues later.

Otherwise, just be mindful of separation of ‘game’ and ‘view’… but even then plan to be surprised by how much it will take to retrofit networking after the fact. Plan on giving up.

1 Like

Ok thank you for your very fast answer.
I readed somewhere that starting by design solo game was easier and better, but I feel it was a bit odd.
It looks like that I was correct, it’s very weird.
Then I will start to add networking from beginning, I am gonna have a look to your Zay-EZ Network system :slight_smile:

A networked game is many dozens of times harder to write than a single player game. But trying to add networking to a single player game later… is pretty much like starting over anyway. (It’s certainly quicker to just start over.)

1 Like

Yes it seems logical.
I have done alot of networking last year, even if it was not in a game context there were alot of sync to-do it was a real pain without framework.
It’s not a big problem for me to do networking, it’s just much longer to have a prototype working, but I do it during my free-time so I have all the time for it :slight_smile:

At the very least, try to start thinking of “server” and “client” already and create interfaces around them to clearly separate them. So even if you don’t add the network messaging/setup now, you have some kind of messaging interface that can be replaced later.

What kind of game is it?

If it’s going to have any kind of real time sync, then you can start from my starter project:

Uses Zay-ES and SimEthereal… pretty easy to swap out the game-specific stuff.

1 Like

Oh yeah interface seems a good idea to do it “later”.

Kind of Sheltered.

I will have a look to this exemple, thanks