(Not) Another Networking Thread
Posted: Wed Oct 05, 2016 2:28 pm
I know, I know.
I've seen the search results; doesn't take long before someone with sub-50 post count makes ~another~ networking thread. That being said, I need to know a few things. I'm not very experienced with networking. I've dabbled with it in the past but it's never been something I truly dove into... until now. I'm trying to build out a server (using Lua-Enet) that can:
1) broadcast its status to clients which can log them (client-server lobby thing),
2) handle ten concurrent connections,
3) handle sub-optimal play conditions,
4) and interpolate player actions during packet loss.
I know there's no easy way to do this but hopefully, this is a small enough project to warrant some good feedback. Here are my current questions:
1) If I wanted to make this server accessible to anyone with the client, how would I go about implementing it? I'm not talking IP to IP; I mean, an honest-to-goodness server lobby. My first thought was running LOVE behind an Nginx config in Docker somewhere. From my past experience, Nginx can act like a load balancer and Docker is just standard process isolation. Re: the server, I think it needs some type of heartbeat that runs on a separate thread. It gets a bit weird on the client-side though, as I'd want the client to disconnect if the server wasn't responsive. Would I have to await the heartbeat or set a threshold of some sort?
2) I've tried simulating lag by using this tool (https://github.com/tylertreat/comcast) and I don't have a CLUE on how to interpolate player action. To what degree should I attempt to predict the player? What should I do to rollback game state on client if there's a misunderstanding (assuming the server always wins in this regard)? In this respect, I wish Move or Die would release the .love file. I'd kill to see how they wrote their code.
That's all I have for know. LOVE (ha!) to hear your thoughts on this.
I've seen the search results; doesn't take long before someone with sub-50 post count makes ~another~ networking thread. That being said, I need to know a few things. I'm not very experienced with networking. I've dabbled with it in the past but it's never been something I truly dove into... until now. I'm trying to build out a server (using Lua-Enet) that can:
1) broadcast its status to clients which can log them (client-server lobby thing),
2) handle ten concurrent connections,
3) handle sub-optimal play conditions,
4) and interpolate player actions during packet loss.
I know there's no easy way to do this but hopefully, this is a small enough project to warrant some good feedback. Here are my current questions:
1) If I wanted to make this server accessible to anyone with the client, how would I go about implementing it? I'm not talking IP to IP; I mean, an honest-to-goodness server lobby. My first thought was running LOVE behind an Nginx config in Docker somewhere. From my past experience, Nginx can act like a load balancer and Docker is just standard process isolation. Re: the server, I think it needs some type of heartbeat that runs on a separate thread. It gets a bit weird on the client-side though, as I'd want the client to disconnect if the server wasn't responsive. Would I have to await the heartbeat or set a threshold of some sort?
2) I've tried simulating lag by using this tool (https://github.com/tylertreat/comcast) and I don't have a CLUE on how to interpolate player action. To what degree should I attempt to predict the player? What should I do to rollback game state on client if there's a misunderstanding (assuming the server always wins in this regard)? In this respect, I wish Move or Die would release the .love file. I'd kill to see how they wrote their code.
That's all I have for know. LOVE (ha!) to hear your thoughts on this.