Re: BGT multiplayer game a lot of ping client disconnect
I am sorry to bring this to you, especially now during a bgt game project, but bgt is quite dead by now, mainly because of the same problem you are experiencing , as well as other factors widely known in this community, so, I don't think you could get much bgt support anymore. I don't want to be rood, sorry if I came out this way, but that's the truth so I feel you should have a right to know it as it truely is.
I don't actually know why, but the networking support in bgt is very slow at best, terible with great data loss at worst. This is really strange because bgt uses a natively compiled library and its performance is horible, while python is interpreted(bgt is as well, but not so much), and I never experienced such long moments of latency when using twisted or other networking library , needless to speak of packet loss.
I understand that it's very hard to switch away from bgt, but the sooner, the better, in my opinion. Believe me, as a bgt user my self, it was verry hard to switch away from it, much like adiction to a drug, but I forced my self to, teling my self it's for my own good and now, I am really happy with a kind of combination of .net, c#, c++ and python, though mostly .net for now. Xamarin.forms is great, btw.
Those being said, if you still want to develop that game in bgt, please take into consideration the folowing advice which I learned while testing with my little demos.
Try sending as few data as possible to the server, letting it carry on with the harder and longer work and send only the resulting movements and changes in the game state to the clients.
for example, if you have a game involving a machine gun, you could probably improve the overall network performance by sending packets only when it starts firing and when it stops, as folows.
as soon as the spacebar is pressed, the folowing ruff outline of a communication should happen:
the client will send:
machinegun started:player_pos=(122:0), interval=225 ms...
and when spacebar is released, it will send something like this:
machinegun stopped.
After the server receives that notice, it could then calculate what enemies are there, manage bullet colision and send the notifications to the client which will play sounds accordingly, much like a mod, in this regard. This way,the server does most of the work, thus both reducing the physical processing time for the player's machine as well as drasticly improving network speed and bandwidth through reducing trafic, most of the packets being nothing more than noise anyway.
so much info for now, nothing else comes to mind right now. If there are questions, please post here and I will try answering to the best of my capabilities.
Have a good day, and success to your game.
-- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector