OD - Fixing the Multiplayer

Re: OD - Fixing the Multiplayer

Postby oln » 28 Jul 2014, 22:21

The main useful thing with sf.net has been the web hosting, though I suppose it wouldn't be that difficult to replace that either if there was a strong desire to move somewhere else.

As for multiplayer, it's probably a good idea to look at how other games handle synchronisation, not sure whether OD would be closer what's used by FPS games or RTS games though.
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Re: OD - Fixing the Multiplayer

Postby Bertram » 29 Jul 2014, 10:34

Hi,

@Paul and @oln:
I answered your questions on the github topic. :)

As for multiplayer, it's probably a good idea to look at how other games handle synchronisation, not sure whether OD would be closer what's used by FPS games or RTS games though.

Indeed, and hwoarangmy also told a few worthy things about that.

@hwoarangmy:
It would be nice to try a game through internet to see if it lags or not :)
[...]
It is funny because I have the same thoughts but a different conclusion. I would rather say it is good to try a simple synchronisation and see if it works. If not, we will try to do better. As it is said, premature optimization is the root of all evil :)

Yeah, true. To try some online games would tell us where the lag is residing and in what kind of lag we have to deal with. This may also answer oln question about the FPS/RTS hybrid structure of OD.
I'll likely be available on wednesday evening (UTC+1) for such a thing but I'll be testing the beast on linux locally first. Depending on whether we can make this work, what would be your availability for the week's second half, guys?

I usually think it is better to wait a little bit at each turn than freeze during 1 second when a client is too late. I have tried to speed down the client and I've seen that at some point, the client was getting laggy. With the synchronisation, that didn't happen.

Making the server wait a bit is what I had in mind when I spoke of soft timeout, but I wasn't exactly very understandable, sorry. When you said that with the synchronization, it didn't happen, could you explain me a bit more about that part?

And at the moment, I am trying to go for the full server paradigm but I'm not sure I will be able to do it because the gamemap is much related to graphic stuff. We will see :)

That's some interesting part. If you can turn the game map into a component without a flow of ugly workarounds, I'd say you've won and it will ease the later addition of a map mode and such, but maybe it's not the best solution? Good luck on that one.

Regards,
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: OD - Fixing the Multiplayer

Postby hwoarangmy » 29 Jul 2014, 20:06

Bertram {l Wrote}:To try some online games would tell us where the lag is residing and in what kind of lag we have to deal with. This may also answer oln question about the FPS/RTS hybrid structure of OD.
I'll likely be available on wednesday evening (UTC+1) for such a thing but I'll be testing the beast on linux locally first
[teaser on]Don't waste too much time testing it, a new patch should come soon[teaser off]
hwoarangmy
 
Posts: 567
Joined: 16 Apr 2014, 19:13

Re: OD - Fixing the Multiplayer

Postby Bertram » 30 Jul 2014, 10:25

Eh eh,

I'm too evil to wait for the next patch. Once I can have some time for that, I'll test it patch or no patch, mwahaha! ;)
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: OD - Fixing the Multiplayer

Postby hwoarangmy » 30 Jul 2014, 19:37

Bertram {l Wrote}:I'm too evil to wait for the next patch. Once I can have some time for that, I'll test it patch or no patch, mwahaha! ;)
That's not what I meant. I was just saying that I have a more or less working full server version :)
Firstly, how it works : The server now has its own thread and his own gamemap. For each action a client wants to do, he have to ask the server. If we decide to keep this implementation, I will explain how it works on the wiki so that we don't end up with too many hacks.
Secondly, what I have seen so far :
- When we pickup/drop creature, it's a bit slow (1-2 second delay). We would probably have to do something with that. We could hack the client to accept the pickup/drop and until server answer is received. If an unexpected message concerning this creature comes (move, set animation, ...), we drop it automatically because it means server didn't accept pickup/drop.
- Tiles have only 2 states (claimed or not). I have seen there is another state where it has the player color but I didn't take time to look for it.
- Creature's info is only updated when level up (not everything, I just tried the most important). I think it would require too much bandwidth to send each creature info each time it changes. Maybe we could hack the server gamemap somehow so that the server player can have the informations.
- I have tested quite a bit and seen no problem with : creature pickup, creature dig, room objects (including creature beds), creature killed, rooms being destroyed, tile claiming. Wel
hwoarangmy
 
Posts: 567
Joined: 16 Apr 2014, 19:13

Re: OD - Fixing the Multiplayer

Postby Bertram » 30 Jul 2014, 23:31

That's not what I meant. I was just saying that I have a more or less working full server version :)

I was just kidding, don't worry. ;)

- When we pickup/drop creature, it's a bit slow (1-2 second delay). We would probably have to do something with that. We could hack the client to accept the pickup/drop and until server answer is received. If an unexpected message concerning this creature comes (move, set animation, ...), we drop it automatically because it means server didn't accept pickup/drop.

Sounds relevant. Do you know whether it is slow also on the server?

- Tiles have only 2 states (claimed or not). I have seen there is another state where it has the player color but I didn't take time to look for it.

When you see dirt colored but not claimed, it's a bug. Tiles are either claimed or not on the visible side. Internally, the colourValue parameter is here to tell about how much % the tile has been claimed.

- Creature's info is only updated when level up (not everything, I just tried the most important). I think it would require too much bandwidth to send each creature info each time it changes. Maybe we could hack the server gamemap somehow so that the server player can have the informations.

That's a bit more complicated, I guess but I'm fine with your proposal for the moment. Later, remote clients will want to know "real-time" how much PV a creature has got for instance.

The small levels are fun. :D

N.B.: Could you have a look at the pull request I've made? Thanks!

Best regards,
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: OD - Fixing the Multiplayer

Postby hwoarangmy » 30 Jul 2014, 23:59

Bertram {l Wrote}:Sounds relevant. Do you know whether it is slow also on the server?
I've added logs and it seems 1 turn lasts a bit less than 1 second. The problem is that the server receives the ask pickup command and checks if it is allowed or not. If yes, he posts a server message for the client. Then, he does 1 turn and processes for the server message. The validated pickup order is sent back to the client. It was much faster when I was sending directly the message to the client (without posting a new message) like in the version you puched. But It is not clean because gamemap may have posted stuff concerning this creature.

Bertram {l Wrote}:When you see dirt colored but not claimed, it's a bug. Tiles are either claimed or not on the visible side. Internally, the colourValue parameter is here to tell about how much % the tile has been claimed.
Ok. I have still not seen workers take over tiles claimed by an ennemy. But I have seen a bug : one of my worker claimed a tile after one partially claimed one.

Bertram {l Wrote}:N.B.: Could you have a look at the pull request I've made? Thanks!
I'm not very used to it but yes :)
I'm not really used to creature definition files but it is the occasion to have a look :) Will test it tomorrow
hwoarangmy
 
Posts: 567
Joined: 16 Apr 2014, 19:13

Re: OD - Fixing the Multiplayer

Postby Bertram » 31 Jul 2014, 00:27

But I have seen a bug : one of my worker claimed a tile after one partially claimed one.

Doesn't seem to be a bug said like to me :? A worker can finish the work of another one. It's ok that way, IMHO.

Note that enemy workers can steal one another ground tiles. And they can steal wall claimed tiles if the enemy claimed wall tile aren't got any claimed ground tile around anymore.

Thanks in advance for the review. :)

Regards,
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: OD - Fixing the Multiplayer

Postby hwoarangmy » 31 Jul 2014, 08:16

Bertram {l Wrote}:Doesn't seem to be a bug said like to me :? A worker can finish the work of another one. It's ok that way, IMHO.
That's not what I am talking about. I have seen a worker claim the tile AFTER the partially claimed one. Which is a bug IMHO :)
hwoarangmy
 
Posts: 567
Joined: 16 Apr 2014, 19:13

Re: OD - Fixing the Multiplayer

Postby Bertram » 31 Jul 2014, 10:44

Ah ok. I get it now. Indeed. :)
Might be related to how we check the coloring. If the coloring value can fool the material coloring function, it probably can fool the game logic as well.
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: OD - Fixing the Multiplayer

Postby hwoarangmy » 04 Aug 2014, 19:01

I have created a pull request for the full server implementation :)

I have tried to have a proper implementation. When a client wants to pickup/drop a creature or mark tiles, he sends a message to the server. Then the server checks if the action is allowed. If yes, a message is posted and processed during the server phase. As a result, picking a creature is not as reponsive as it was. If someone could test this version and give me feedback, it would be appreciated. I have already in mind some hacks we could do to improve that if needed.

If someone is available, it could be nice to test a network game :)

BTW, I have done some memory tests to see if there was memory leaks on entities and it is not the case anymore :)
hwoarangmy
 
Posts: 567
Joined: 16 Apr 2014, 19:13

Re: OD - Fixing the Multiplayer

Postby paul424 » 04 Aug 2014, 20:15

Well does establishing a TCP/IP session requires to have a unique IP address ?
User avatar
paul424
OD Moderator
 
Posts: 660
Joined: 24 Jan 2012, 13:54

Re: OD - Fixing the Multiplayer

Postby hwoarangmy » 04 Aug 2014, 20:32

paul424 {l Wrote}:Well does establishing a TCP/IP session requires to have a unique IP address ?
If you play through internet, yes.
In fact, if you play a single player game, you need nothing. localhost will be enough.
If you play on a local network, you have to enter the local IP of the computer host.
If you play through internet, and you are host, you have to configure your router to route OD port (31222) to your local IP. If you are client, you need to enter the host public IP.
hwoarangmy
 
Posts: 567
Joined: 16 Apr 2014, 19:13

Re: OD - Fixing the Multiplayer

Postby paul424 » 04 Aug 2014, 20:52

So do you have an public IP server?
User avatar
paul424
OD Moderator
 
Posts: 660
Joined: 24 Jan 2012, 13:54

Re: OD - Fixing the Multiplayer

Postby Bertram » 05 Aug 2014, 08:31

Hi there guys,

@hwoarangmy:
congrats for the newest pull request. :)

@All:
Once it is merged, we can have a lan party if you want. What is your availability for the end of this week and the next?

best regards,
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: OD - Fixing the Multiplayer

Postby hwoarangmy » 05 Aug 2014, 09:34

paul424 {l Wrote}:So do you have an public IP server?
We all do when surfing on internet :) To know yours, you can go to some site like http://whatismyipaddress.com/

Bertram {l Wrote}:congrats for the newest pull request. :)
Thanks :)

Bertram {l Wrote}:Once it is merged, we can have a lan party if you want. What is your availability for the end of this week and the next?
I am usually available after 9pm-10pm (when babies are sleeping). Is there some good chat program we could use to set up the game and the network (or maybe IRC) ?
hwoarangmy
 
Posts: 567
Joined: 16 Apr 2014, 19:13

Re: OD - Fixing the Multiplayer

Postby Bertram » 05 Aug 2014, 09:53

Let's use IRC: (The channel link advertised on the website) http://webchat.freenode.net/?channels=opendungeons

I'll be available on Friday night most probably. would this be ok for you?
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: OD - Fixing the Multiplayer

Postby Akien » 05 Aug 2014, 10:25

Bertram {l Wrote}:Let's use IRC: (The channel link advertised on the website) http://webchat.freenode.net/?channels=opendungeons

Bertram on IRC! :shock:

Not sure I'll be available to play, but I might be at least on IRC to follow how it's going on :-)
Godot Engine project manager and maintainer.
Occasional FOSS gamedev: Lugaru, OpenDungeons, Jetpaca, Minilens.
User avatar
Akien
 
Posts: 737
Joined: 22 Feb 2014, 13:14

Re: OD - Fixing the Multiplayer

Postby paul424 » 05 Aug 2014, 10:33

We all do when surfing on internet :) To know yours, you can go to some site like http://whatismyipaddress.com/

Ohh really , I though that's IP of my ISP provider ...
User avatar
paul424
OD Moderator
 
Posts: 660
Joined: 24 Jan 2012, 13:54

Re: OD - Fixing the Multiplayer

Postby Bertram » 05 Aug 2014, 11:00

Bertram on IRC! :shock:

:lol: There was indeed a time when it was more common. But yeah, I'd come up for some lan testing. ;)

Not sure I'll be available to play, but I might be at least on IRC to follow how it's going on :-)

Cool. :) The more the merrier.
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: OD - Fixing the Multiplayer

Postby hwoarangmy » 05 Aug 2014, 11:07

paul424 {l Wrote}:Ohh really , I though that's IP of my ISP provider ...
No, it's you public IP (given to you by your provider) :)
Do you use a modem to connect to internet or a box (with phone and TV) ? Do you know if your IP is static or dynamic ? If your modem is a router, do you know how to configure it ?

Concerning Friday, I will try to come :)
hwoarangmy
 
Posts: 567
Joined: 16 Apr 2014, 19:13

Re: OD - Fixing the Multiplayer

Postby Bertram » 05 Aug 2014, 12:42

@hwoarangmy:
Ah btw, have you seen my comment there?
https://github.com/OpenDungeons/OpenDungeons/pull/32
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: OD - Fixing the Multiplayer

Postby Danimal » 05 Aug 2014, 12:55

im sorry, im not sure ill be in the city this friday :cry: .
Be sure to ceate a good log of the match :)
User avatar
Danimal
OD Moderator
 
Posts: 1407
Joined: 23 Nov 2010, 13:50

Re: OD - Fixing the Multiplayer

Postby hwoarangmy » 05 Aug 2014, 14:33

Bertram {l Wrote}:@hwoarangmy:
Ah btw, have you seen my comment there?
https://github.com/OpenDungeons/OpenDungeons/pull/32
Yes, It's answered :)
hwoarangmy
 
Posts: 567
Joined: 16 Apr 2014, 19:13

Re: OD - Fixing the Multiplayer

Postby hwoarangmy » 07 Aug 2014, 20:46

I've added support for chat. To activate it, press enter. To deactivate it, press enter or escape. When you press enter, if the message is not empty, it will be sent to every connected player
hwoarangmy
 
Posts: 567
Joined: 16 Apr 2014, 19:13

Who is online

Users browsing this forum: No registered users and 1 guest