I’ve noticed a lot of people use pickle as a data format in networking in the BGE. This is very un-optimized and uses more bytes than it should to send data. In my BGMC 31 game, RAT4T4, I implemented a multiplayer system that sends data to a server in the form of a struct. Using this, I was able to compact the data of 9 players within 128 buffer size of the socket. Using pickle, the buffer size would have to be over 256 bytes for the same data for just 1 player. Clearly the benefit is obvious.
I will be attempting to create a user-friendly and modular networking system for the BGE based on the struct method that will be able to connect to my server which will be able to adapt to any type of data it receives from the clients.
Are they ? In addition it’s not safe AT ALL ^^
Malicious code can be sent in a pickle packet, and if not handled corretly, control of all the machine / server can be taken soooooo easily
I use to do so, or I also json dumps eventually for mostly string containing packets
It has been a while since i said I would make an easy multiplayer system for Blender games and now I am halfway there.
Here is a link to a script that allows a dictionary object that can contain player and client information, for example, to be encoded and decoded to and from bytes in order to be sent over the air. The format is very compact, modular, and efficient for use in networking. But please, if you can think of ways to improve the format, let me know.
Amazing would be honored to give it a shot bud thanks for referring me
If we successfully manage to bring TBW - Multiplayer to the table this could be EPIC with the kind of maps im making these days for my mission Levels!
!!! THE VIDEO BELOW JUST SHOWCASES THE UI Design so far !!!
I did an earlier test multiplayer with the guys on discord the 1st template was a great experiment and we were able to have an successful 6 player death match mode Live in UPBGE!
(Connection was stable but new joining in players would frequently stutter the game but it turns out that our multiplayer template was a more aggressive approach)
2 guys were using UPBGE 0.2.0 i was one of them and the other 3 were using 0.2.4 which was great and compatability worked nicely.
However the integration in to the TBW - Multiplayer template also worked and proved successful but we had a bug that showed players as cubes, in retrospect it was mainly showing player collision bounds lol.
here are some shots from our playthroughs: (WE ARE NO LONGER USING THIS CUZ THE CODE ISN’T REFINED !!!)
@Wkk had a peak through the code and thought he could refine it but it turns out no one understood or could implement such a fix!
But i believe your code is the most refined, and i’ll be looking forward to working with you in the future regarding Multiplayer for TBW - #An UPBGE Game!
The actual code that takes care of sending and receiving data is not important. The most important part of the system will be the way the data is handled. I spent hours working on the design for the encoding and decoding that will be easy to use by anybody and is very compact so as not to use too much bandwidth.
My next plans are to make it so that the client and server only send data when the data has changed, rather than send it continuously to save bandwidth. Additionally, I will be incorporating interpolation which will smooth out the movement of players and objects.
Nicholas_A, dude this looks awesome. I am not good at coding, but from what your saying this is next level multiplayer stuff. Hope you get it refined and out there thanks for all you have done
Wow, this is really cool! I remember playing the FPS demo with @Fred_K.S and others on the Discord and it was actually quite good, I look forward to more innovation with multiplayer
Im currently part of a GROUP Testing a NEW Networking Tool Addon specifically being Developed for UPBGE 0.3.0 Aand currently it holds up to 64 players
The guys are currently testing it until the netcode is officially refined i will make a demonstration with one of my games and how its going to work this one will allow us to run the server directly on UPBGE 0.3.0 on a separate pc and have all players connect to the server hosting the mode or the lobby and also allowing players to have private sessions within the same network segment.
its currently in Alpha development, but as i say my focus isn’t really multiplayer as 1st priority my main priority is to get all base games out and have people playing then expand on networking capabilities… Bridging the gap between how do i take the fun i have alone in my single player experience and share it with my friends around the world.
I think once the multiplayer reaches BETA level i could fully feature a mode in one of my UPBGE Games and have a lobby of 64v 64 players and hopefully the UPBGE Community can join in and have fun together as we test the networking in the game for future UPBGE Games !!!
Like i said i will be testing out various versions so pls be open and feel free to share with me as well u never know which one works best, so far the current one i played with a while back well my 1st UPBGE networking experience was a BLAST lol and that method is quite Aggressive because of the way it was set up.
Youre procedural method is another way of achieving successfull multiplayer and the new one which is an UPBGE EEVEE Addon has high promises.
@Nicholas_A id say get yours to be the best version yet so that a variety of projects can test it out on UPBGE legacy… so basically the versions of UPBGE before Blender 2.8+ and UPBGE 0.3.0
Get your Addon as a masterpiece for Legacy UPBGE so that people can test it out and give you some good feedback !
Because right now netcode is complex and the UPBGE 0.3.0 version seems to be on a different level and only works for the b2.08+