We're seeing higher-than-we-would-like number of people who simply cannot host or connect to games. We're using lidgren which supports some form of NAT punchthrough and all of our user hosted servers are likely behind NAT. For most cases it appears to be client specific i.e. they cannot connect to any games anywhere.
We added some tracking and out of about 40k connection attempts we fail NAT punchthrough about 15% of the time. If we then attempt to connect anyway we get though in an additional 6% of the time giving us an overall failure rate of 9% of our user attempts. Not good enough to stop complaints :-) We've checked out code many times (and found/fixed a few bugs) and also wiresharked to show that the packets simply do not make it through the routers.
So before we spend even more time digging deep I thought I would ask if 15% seems reasonable or if something is wrong?
Many of our users declare they can play other games without problems - we suspect they are playing on servers hosted on machines with no NAT (or very very permissive ones). We tried hosting on AWS and Azure VMs and are seeing about the same 15% - the cloud services are all behind NATs too. Our next step here is to try a server with a static IP/No NAT to see if everyone can connect even if they have a 'bad' router at their end.
Any idea how the ping times are calculated for online games in the game server list.
We have a master server that keeps a list of the current games. When a client goes to the lobby we send them the list of game servers. We thought we could do some fancy math on ping times between the master server and the game server but that doesn't work of course.
So we have come to the conclusion that each client must iterate the servers in the list and 'ping' each one. But we see online games with hundreds or thousands of game servers and we know some games have 10s of thousands of people in the lobby so it seems like a lot of traffic with everyone pinging every game server and every game server having to respond to every ping request.
If we do send a ping packet to every server then we need to worry about NAT stuff just to get that ping time - usually we don't worry about that until we try to connect.
We wiresharked TF2 and didn't see anything that lead us to believe this is calculated on the clients...
I cant find any conclusive docs on how this is done, though there's lots of speculation by gamers usually about why the game developer gets it wrong :-)
I'm having trouble finding triangulation algorithms that will enable me to match a scanline fill algorithm.
I'm being passed a polygon which can have intersecting sides. The '2d' editor version uses WPF/GDI to 'fill' this triangle. It looks like a fairly standard scan line fill. I'm expected to match the output in the 3d rendering.
I'm using ear clipping right now http://www.geometrictools.com/Documentation/TriangulationByEarClipping.pdf - which of course fails to produce the same result.
Off the top of my head I am thinking I need to break down the polygon into multiple polygons and determine which are filled and which are not. I've drawn lots of simple cases I think I can cover but as soon as I draw a more complex case I can't see how it would work.
Given a closed 2d polygon how can I tell if its clockwise or counter clockwise? I'm feeding it to a triangulation routine which requires a certain winding. Right now the best I ahve come up with is feed it to the triangulation and throw away the result that has fewer triangles ;-)
Seems like something I should be able to tell in advance and my google voodo has not come up with the right magic words.