Sending larger data packets seperately

235 views
Skip to first unread message

Jonte

unread,
May 21, 2012, 9:35:20 PM5/21/12
to lidgren...@googlegroups.com
Hi. I'm working on a game that uses lidgren. I've had everything working great for quite some time, but I'm trying to optimize some of the traffic.

When a player connects to a server that has been running for a while, there may be a large packet of data that needs to be sent, currently around 500kb, and this may grow even larger in the future. Currently I'm just sending it as any old package. I'm worried that this might lag the game for other players if the server is under load. 

Is there any way to throttle certain packages to a certain speed or priority, while keeping the rest at highest priority. You could think of it as a separate file server, and the game packet server always has priority.

Thanks.

Matthew Overall

unread,
May 22, 2012, 12:27:55 AM5/22/12
to lidgren...@googlegroups.com

Unfortunatly I don't think it is possible to throttle, however, I would really try to find a way to break it down into many smaller packets. Is there a particular reason it must be so large?

--
You received this message because you are subscribed to the Google Groups "lidgren-network" group.
To view this discussion on the web visit https://groups.google.com/d/msg/lidgren-network/-/fLsA00emSEIJ.
To post to this group, send email to lidgren...@googlegroups.com.
To unsubscribe from this group, send email to lidgren-netwo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/lidgren-network?hl=en.

Jonte

unread,
May 22, 2012, 8:05:57 AM5/22/12
to lidgren...@googlegroups.com
From what I've understood lidgren splits the package into many small packages already, so technically it should work fine, I'm sure worried about these "started" packages filling up the servers network bandwidth. It's most likely not a problem, it's mainly a one time world package that is sent when a client connects and it doesn't have cached world data. When updating the world after the inital starter package has been delivered is much much cheaper. I'd like to think of it as connecting to a server that needs to send a few files before the game can be played. Like a mod or server image files that are transferred as files at a speed which can be set in server settings before a client can start in the game world.

Ricardo Andere de Mello

unread,
May 22, 2012, 9:35:58 AM5/22/12
to lidgren...@googlegroups.com
You are correct about worring about this kind of issue. I have
production environments with this kind of problems.
The easiest way to solve is to create a secondary connection. Its is
not written anywhere that you cant have two connections to the server.
Another thing you can improve is serialization and compression.
In C# is easy to transfer datasets and xml, that get really big. We
had to implement here our own dataset serialization (codeproject has
some code), and fast compression using lz4 for strings bigger that 1k
(if it fits a packet you should not worry).

[]s, Ricardo Mello (gandhi)

2012/5/22 Jonte <jsm...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups
> "lidgren-network" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/lidgren-network/-/2JfEsFDdJBAJ.

Jonathan Smars

unread,
May 22, 2012, 11:56:44 AM5/22/12
to lidgren...@googlegroups.com
I was considering this approach as well actually, but I hadn't found anyone else doing this so I wasn't sure if it would turn out to be even more expensive, or if it even was supported.

I'll have to try this out, I think that this may be a good solution. This way it's easy to distinguish between the file server and the game server, and throttle accordingly.

Thanks!
Reply all
Reply to author
Forward
0 new messages