Re: BGT multiplayer game a lot of ping client disconnect
There is probably a function in BGT that runs the Enet loop for a bit when you call it. You probably need to call that function more often on both sides.
Python etc. aren't slow at this because they also use native libraries, and they provide proper select primitives and such (also can we say composability?) UDP overall is a good idea but Enet is frankly archaic at best, and I believe also unmaintained for at least a few years. Other things are very likely to work better (but you don't have them in BGT). At the end of the day without some tuning, UDP (and Enet) will have problems because the OS is free to just drop packets--you can certainly write reliable protocols on top of it, and many have, but the OS isn't going to just wait around for you to happen to read the buffers, since contractually it can just throw out data if they're full, so you have to make sure whatever event loop is responding stays very responsive (so: in a thread, called continuously in a spinloop while the game is waiting on time for the next update, passed a large enough timeout if the library exposes that, etc).
My guess is you're not multiplexing. That is, you're waiting on data from one player at a time and not stopping until you get it, rather than waiting on data from everyone and storing it until someone passes a threshold. And you're not calling whatever ticks the Enet loop often enough.
@2
Today in Python is fast enough for audiogames, I give you this high-performance gigabit Ethernet driver in (almost) pure Python.
-- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector