Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

P2P multiplayer support with samples #2400

Open
wants to merge 60 commits into
base: master
Choose a base branch
from
Open

Conversation

ArnisLielturks
Copy link
Contributor

I would like to get some feedback on the implementation as I think that the code quality can be improved but not sure what is the best way.

…k events added, network object lifecycle updated, identity broadcasting updated, p2p create/join flows updated, code cleanup
@ArnisLielturks ArnisLielturks added the улучшение Улучшение существующих вещей label Dec 6, 2018
@ArnisLielturks
Copy link
Contributor Author

One more thing, P2PMultiplayerExtended sample will be removed in the nearest future and placed in a seperate repository since it's quite big and involves external systems to be set up.

@weitjong
Copy link
Contributor

weitjong commented Dec 7, 2018

Thanks for your PR. I will try to review it over this weekend. I hope Eugene or others have time to do so too.

@ArnisLielturks ArnisLielturks self-assigned this Feb 14, 2019
@ghost
Copy link

ghost commented Aug 17, 2019

@ArnisLielturks Could you formulate your doubts about the current form of the implementation?

@ArnisLielturks
Copy link
Contributor Author

@Modanung Oh boy, where do I begin...

  1. Bacwkards comatiblity
    When doing the implementation I always kept in mind that the current networking mode - server-client should be untouched and should remain the same. I think I succeeded with that by introducing mode switch for the networking - classic server-client and p2p mode. As I remember I also implemented safety checks to disable network connections with different modes, not sure if it works in 100% of the cases.

  2. Replication
    Replication is something that becomes increasingly difficult for the p2p mode so that is something that I didn't try to fix or update. https://github.com/ArnisLielturks/Urho3D-P2P-Multiplayer sample uses the old replication mechanism without any modifications, though I believe the approach there is a bit rough and all players might get out of sync pretty quickly. But the good news is that I don't think that the engine itself should deal with that at the moment since it requires heavy modification of the current replication model.

  3. Host election
    One thing that I noticed when doing the implementation is that if the new peer tries to connect to different peer which is not a host, they would form new p2p session which would lead to unpredictable behaviour. Maybe I was doing something nasty there and didn't enable some sort of switch to disable that, but it seemed like it was a bug in the networking library itself. What can you do to avoid that? When implementing p2p always make sure that new peers are connecting to the host, otherwise you're 🦆 ed. You're also 🦆 ed if there's a host migration going on while you connect.

In conclusion I believe that the current implementation is quite good. It requires additional servers to be set up but that's what you get when doing p2p application.

@github-actions
Copy link

github-actions bot commented Apr 8, 2020

Marking this stale since there has been no activity for 30 days.
It will be closed if there is no activity for another 15 days.

@ghost
Copy link

ghost commented Sep 10, 2020

Are there any updates on this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backlog улучшение Улучшение существующих вещей
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants