methusalah / OpenRTS

Real-Time Strategy game 3D engine coded in pure java
MIT License
1.29k stars 151 forks source link

networking support #66

Open meltzow opened 9 years ago

meltzow commented 9 years ago

I created a branch named "networking" in my own repository for that. First step should be, is to create a server client architecture with onboard JME networking (see http://wiki.jmonkeyengine.org/doku.php/jme3:advanced:networking ). The client logged into the server and create events of all needed thing. The server only reports the events. In next step, another second client can connect to the server. The clients are "talking" (with events) to each other to synchronize your games.

methusalah commented 9 years ago

I have no experience in that, but I'm wondering : the server should manage interaction between players, doesn't it?

For exemple, the A-player's unit send an attack event to the server, and the server create and send a damage taken event to B-player.

It seems necessary to me to prevent crash from lags or wild disconnections, and of course cheating. But it's confuse to me and I could use some more info ☺

Le sam. 16 mai 2015 10:19, Mario Meltzow notifications@github.com a écrit :

I created a branch named "networking" in my own repository for that. First step should be, is to create a server client architecture with onboard JME networking (see http://wiki.jmonkeyengine.org/doku.php/jme3:advanced:networking ). The client logged into the server and create events of all needed thing. The server only reports the events. In next step, another second client can connect to the server. The clients are "talking" (with events) to each other to synchronize your games.

— Reply to this email directly or view it on GitHub https://github.com/methusalah/OpenRTS/issues/66.

meltzow commented 9 years ago

Yes, you are right, the server must rule the game. Thats one of the reason for https://github.com/methusalah/OpenRTS/issues/62 . I have some experience for that. I will take a smooth refactoring for that.

meltzow commented 9 years ago

@methusalah should we have a central server, where the clients can logged in? It will be easier as starting the server on localhost everytime you want to play. Starting the server local should be a alternative.

poVoq commented 9 years ago

Many games even run a local server when they in fact start an single-player game. I think this is a good way to do it as it treats multiplayer first and stuff like cooperative campaigns etc. will always work out of the box and not require hacking the singleplayer only code.

meltzow commented 9 years ago

absolutely. That's the current plan. Thx for comment.

meltzow commented 9 years ago

inspect this: https://github.com/menacher/java-game-server (MIT Licence)

poVoq commented 9 years ago

Hmm, does it have to be written in Java? I guess... otherwise there would be also Raknet: https://github.com/OculusVR/RakNet

meltzow commented 9 years ago

Yes its in Java. I must inspect the feactures. But RakNet is written in C++. Why we should use it?

meltzow commented 9 years ago

Just if you are interested to know: https://github.com/EsotericSoftware/kryonet is also looking good. But none of them have realized tickrate support (like here described https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking )

poVoq commented 9 years ago

Raknet is a very fully featured networking middleware used by several commercial games and which was only recently acquired and open-sourced by OcculusVR. So going by those credentials it should be one of the best options if java is not a strict requirement.