Best Compression for a Blitz3D Network Messages?

Blitz3D Forums/Blitz3D Programming/Best Compression for a Blitz3D Network Messages?

Techlord(Posted 2007) [#1]
Guys, I'm seeking opinions on the best compression/decompression technique for Network messaging in my Blitz3D game. The game will support upto 255 players. I've been eyeballing LZW real hard. All ideas welcomed.


Gabriel(Posted 2007) [#2]
Why not get it complete and fully functonal first and add compression later? Then you actually have something to benchmark against so you can see at what point compression becomes faster than no compression. It's not as though compression has any fundamental affect on your design, it should be ridiculously easy to add in when it's done, no more difficult than doing it from the start.


Techlord(Posted 2007) [#3]
@Gabriel: The network is functional and I'm at point were I need to add it. What techniques are you using?


Gabriel(Posted 2007) [#4]
Oh, well you had this thread saying what the network "will" support rather than "does" support, and you had another thread in GD talking about all the features you planned to add to your networking engine, so I got the impression you weren't quite finished yet.

I'm not using any compression. I don't need it for the maximum number of players that a game can have. I didn't use any compression in Kick Shot Pool either.


Techlord(Posted 2007) [#5]
@Gabriel: Sorry for "will" and "does" confusion. What is the number of maximum players fo Kick Shot Pool? Is the gameplay real time or turn-based over the network? My FPSRPG is realtime and the updates include more than just the players orientation. Updates inlcude include messages for all other game objects (ie; doors, triggers, weapons, etc.)

I know I need compression and I'm looking for answers from other Blitz3D users who have used it. Thanks for your input.


boomboom(Posted 2007) [#6]
have you looked at raknet for a complete solution? its pretty good (theres a thread on it in the blitz3d userlib forum)


Techlord(Posted 2007) [#7]
@boomboom: I have working network code. I'm just looking for more details on compression techniques others have used. I also want to know why they have used them. I'm open to innovation here.


Techlord(Posted 2007) [#8]
@Gabriel: Kick Shot Pool is really nice.


boomboom(Posted 2007) [#9]
my bad :)


Gabriel(Posted 2007) [#10]
What is the number of maximum players fo Kick Shot Pool? Is the gameplay real time or turn-based over the network?

Two, and it's realtime. ( You obviously can't *play* realtime, but the networking is realtime. ) I went as far as four when testing ( I was thinking about doubles matches ) but even that's nothing like the numbers a FPS is going to want.

@Gabriel: Kick Shot Pool is really nice.


Thanks.

I'm fairly sure I remember this discussion coming up before and the conclusion being that zip compression was the most practical for networking because of the speed. I'm not 100% sure that LZW was being considered that the time, so I'm not 100% it is slower than zip, but I do recall ( and I could be wrong, but I thought it was Antony Wells ) the person doing it concluded that zip compression was compressed enough to speed up the networking without the compression speed causing a greater slowdown than it was saving.

Sorry, I can't be of any more help. As I say, none of my games have had anything like that number of players. The only network coding I did with a lot of players was a TCP chat server/client and as you can imagine, speed was not a problem even with 30 or 40 people.


Matty(Posted 2007) [#11]
If you had access to the Torque engine you could perhaps have a look at how they manage to compress their network messages?

Torque's multiplayer was okay from memory.


Techlord(Posted 2007) [#12]
@Matty: Torque Network Model has been a inspiration for my own Network implementation. I'm using State-change Scoping, Tagged Data, Movement Interpolation, and my own concept of AI Interchange.

My goal is to pack as much Nfo as i can into 1500 byte packet. Ive been pondering over just using a large Look Up Table.


LAB[au](Posted 2007) [#13]
Personally for LAN multiplayer I just use UDP, it seems fast enough for me, I found that the main bottleneck was happening when the "server" computer was slow (on network transactions or on anything else I didn't noticed!), so I just made a very minimal version of my software just updating what it needs and acting as server, that gave me up to 129 "players" (It's not a game but timing and synchronisation is crucial).

I send all data/updates as a bank, I tried with zip compression but it didn't give me any speed/capabilities boost. I would be curious to know if you have better result with LZW. (or with another packet "design").


Techlord(Posted 2007) [#14]
@LAB[au]I'm using UDP as well. Text compression/fast decompression is extremely important on my list. I opted to go with a adhoc form of compression that converts Int/Floats to 1-4 byte Strings, and compresses Text using a Static 4096 English Word LUT (aka Dictionary Compression) available on both Server/Client. The LUT generates a 2 byte index String for the most commonly used English words (to include chat abbreviations). Integer/Float Strings and Compressed Text Index Strings are then concenated into a single line of text and sent via WriteString().

Although the network game play for the game im developing with engine is capped at 16 players, I'm designing support for at least 255 players.


Techlord(Posted 2007) [#15]
Some folks are not using compression. I'm curious as to what type of information they're putting in their network messages and how large their messages are. I would assume a Chat message to be very large without compression :s


Gabriel(Posted 2007) [#16]
I would assume a Chat message to be very large without compression :s

They're also infrequent and often in non-English languages ;)


LAB[au](Posted 2007) [#17]
I send always the same packet size (for my usage, sometimes it can be pretty large at 1280 bytes per packet, 25 packets/s) . I am padding the packet with information on states of different objects, even if they didn't change, trying to minimize the possible effects of a lost packet. I don't have a chat so I cannot comment on that.


BIG BUG(Posted 2007) [#18]
How does your game work? For maximum efficiency you have to design your net code especially for your game. Use restrictions in your gameplay to save net traffic.

I don't think compressing your packets will help here.
Why would one compress a chat message? It takes around 1000 times more time writing it(as a player) than transfering it.

Compressing your data makes only sence with a huge amount of it like bitmaps or sounds.

Send only data that's needed for an accurate gameplay. As a player I don't bother what happens on the other side of the map or if an enemy looks in the right direction if its just one pixel big...

Elaborate on how your game works, maybe we can give better hints then.


Techlord(Posted 2007) [#19]
@BIG BUG: My FPSRPG is a Cooperative Multiplayer RPG. It plays like a Single Player RPG allowing upto 8 friends to join in your Quests realtime.

NPC AI and Dialog are controlled by the Server. Thus, I transmit NPC & Player movement, Animation, Dialog, and other info to all players participating in Quests.

For 8 players this is not a big challenge, however, the server will manage 32 simultaneous Quests for a total of 256 players.

Another Multiplayer feature is Quest Building in which upto 16+ Players can participate in creating new Quest & Tournament (Deathmatch & CTF) Maps , popuated with Buildings, NPCs, Beast, Items, Keys and Triggers.

This Quest Building System is at the heart of the Engine/Game System and how I'm creating the initial RPG Quests and Tournament Maps with help of some online buddies.