Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with PLAYER mode in multiplayer #228

Closed
mihahauke opened this issue Jul 23, 2017 · 10 comments
Closed

Issues with PLAYER mode in multiplayer #228

mihahauke opened this issue Jul 23, 2017 · 10 comments
Assignees

Comments

@mihahauke
Copy link
Collaborator

https://groups.google.com/forum/#!topic/vizdoom/4NWF_xRKYfs

@glample
Copy link

glample commented Jul 26, 2017

Hey, any update on this?

We noticed that the more players in the game, the slower it is. When we make a match between 2 agents (+1 if we count the host), in SYNC mode we are able to play 10x faster than real time. But when 4 agents join, it's only 2x faster, and when 6 agents are in, it becomes slower than real time (and then it's just better to use ASYNC).

Could it be a problem with the communication between vizdoom processes?

@mwydmuch
Copy link
Member

Hello,
sorry, I didn't have time to look into that. Eventually I will test SYNC mode extensively and will look for bugs, but I suspect that what you experience is correct behavior... Main focus of SYNC mode is to assure deterministic processing, so in SYNC every game waits for message from other games (Doom's multiplayer is p2p) that they also processed same number of tics and send their actions to everyone, then next tic is processed and waiting process repeats. So with large number of players with different processing time and different skip in worst case scenario processing X tics will take time that is sum of individual processing time of X agents.

Thank you for your feedback

@wjaskowski
Copy link
Collaborator

wjaskowski commented Jul 26, 2017 via email

@mwydmuch
Copy link
Member

mwydmuch commented Jul 28, 2017

There is parallelism, for example if two agents get next state in the same tic, then they can process it in parallel, but other agents who have already declared their actions (for example one tic ago with some skip) have to wait for them. So simply SYNC mode has 35 synchronization points per second. And right now waiting is active cause doom's multiplayer "api" can only send and check if there are new packages (or maybe I'm missing something + I was to lazy to touch os dependent code), so this probably generates some overheat.

@glample
Copy link

glample commented Jul 31, 2017

Wouldn't it be more efficient to have each agent communicating its actions to the host only, and let the host inform every agent about the other agent actions?
But still, there must be something else responsible for the speed. I would imagine communication at a localhost level should be fast enough to not be the bottleneck.

@mihahauke
Copy link
Collaborator Author

@glample Yes, that would be nice to have client-server, but in 1993 they hadn't figured it out yet for multiplayer fps.

@wjaskowski
Copy link
Collaborator

wjaskowski commented Jul 31, 2017 via email

@mwydmuch mwydmuch self-assigned this Aug 1, 2017
@mwydmuch
Copy link
Member

mwydmuch commented Aug 1, 2017

@wjaskowski: I put it badly - I mean that there are 35 sync points per in-game second. Simply, there is sync point before every logic tic.

@glample, @ebonyclock: I think in this case (speed is priority, local network, only one thread per game) p2p approach is better (faster) solution. And as @ebonyclock said, original Doom supports only p2p, but in ZDoom sever-client multiplayer is also implemented ('-netmode 1' argument) and it's seems to be slower option (yes, right now it can be also used with sync mode).

I've introduce little patch that should boost performance for "large" number of players like 8 or 16, my little experiments indicate this, but @glample: Could you check this patch out?
And I will continue to work on this.

@glample
Copy link

glample commented Aug 5, 2017

Thank you. I prefer not to reinstall ViZDoom right now because I have some models currently running, but I'll try just after the deadline and keep you updated.

@mwydmuch
Copy link
Member

mwydmuch commented Dec 2, 2022

Old issue that was partially solved, closing.

@mwydmuch mwydmuch closed this as completed Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants