Peer finding best peer to initiate multiplayer

Started by
10 comments, last by hplus0603 11 years, 10 months ago
How should I match players? I first considered pinging all servers when the client downloads the server list, but after reading about implementing ping there are many caveats, ICMP requires adminstrator access on windows (no go for a game?), many networks filter out ICMP messages, ICMP messages are may not relate to UDP latency, and I would need both windows and mac implementations of a pinging system.

Another thought is to require the client to provide some sort of location information (country, state, city) and then provide this information in the master server list, then the client would have a good idea of how close another server is and they can decide for themselves.

What should I do? Should I simply not worry about it? Use ICMP anyway?
Advertisement

How should I match players? I first considered pinging all servers when the client downloads the server list, but after reading about implementing ping there are many caveats, ICMP requires adminstrator access on windows (no go for a game?), many networks filter out ICMP messages, ICMP messages are may not relate to UDP latency, and I would need both windows and mac implementations of a pinging system.

Another thought is to require the client to provide some sort of location information (country, state, city) and then provide this information in the master server list, then the client would have a good idea of how close another server is and they can decide for themselves.

What should I do? Should I simply not worry about it? Use ICMP anyway?


Cant you just ping them using UDP messages?

o3o

[font=arial,helvetica,sans-serif]From what I have found there is no UDP specification for pinging a server, if you ping a server with a UDP message it will responde with an [/font][font=arial,helvetica,sans-serif]ICMP: Destination unreachable packet so you still need to access ICMP.[/font] I cannot ping with my normal UDP means because that would require doing a NAT punch through to each server, or is that the way that most games do it still? It seems like managing all of those punch throughs would be slow and problematic though.
send bunch of UDP messages, wait return for a time, say 500ms time to live.
you will have both jitter percentage and latency.
you dont need to "ping" to get latency.
I must be missing something, shouldn't most firewalls and routers simply discard the messages, they aren't going to respond.


send bunch of UDP messages, wait return for a time, say 500ms time to live.
you will have both jitter percentage and latency.
you dont need to "ping" to get latency.

I must be missing something, shouldn't most firewalls and routers simply discard the messages, they aren't going to respond.
That is correct.

The article linked to for Q9 in the forum FAQ describes how to handle NAT punch-through for lobby and matchmaking services. There are other articles on that linked-to site about matchmaking services that probably answer other questions you may not have thought about yet.
Do you mean that the servers are regular players with non-portforwarded routermodemthingies, and you need to punchthru to join a server, but dont want to have to punchthru all of them to get ping? (As in a random player is chosen to be a server)

o3o


Do you mean that the servers are regular players with non-portforwarded routermodemthingies, and you need to punchthru to join a server, but dont want to have to punchthru all of them to get ping? (As in a random player is chosen to be a server)


correct, I have updated the thread subject to better reflect my question

That is correct.

The article linked to for Q9 in the forum FAQ describes how to handle NAT punch-through for lobby and matchmaking services. There are other articles on that linked-to site about matchmaking services that probably answer other questions you may not have thought about yet.


Thank you, I have already read the entire FAQ and most related pages, none of them discuss what I am talking about.
If you want to measure the latency between each pair of peers in a set of players, then yes, you need NAT punch-through between all pairs of players. Additionally, not all players may be behind firewalls that accept NAT punchthrough -- those players should probably not be allowed as servers.
What you're trying to do is pretty hard to make robust. This is why the majority of games simply says "the game host == the game server," and if the server goes away, they migrate the server to whatever player had the best connectivity to the old server (basically, the old server keeps sending out packets of "if I were to go away, the next server is ....")
enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement