Preloading datablocks for Client
by Nick Matthews · in Torque Game Engine · 09/15/2006 (1:03 am) · 4 replies
I have a lot of datablocks to load for a game, and it does take a hell of a long time for clients to connect. I was wondering whether you could sort of "add" the datablocks into the client, before he connected to the server. So you have all the server's datablocks stored in client files (assuming they dont differ from the server) and execute them. I attempted this but got an error almost immediately. Does anyone know of any way this could work?
#2
09/15/2006 (12:26 pm)
While that is a work-around, it should be possible to pre-load data that you know will be the same between server and client. After all, you already do that with other kinds of data, like terrain and buildings and stuff.
#3
09/15/2006 (12:33 pm)
Josh Ritter posted some client-side datablock loading code in a post a while back. Im not sure where it is exactly but I'm sure you can find it if you search through his posts.
#4
I have recently made engine modifications that cache all of the datablock and "GhostAlways" stuff that is sent during a mission load, and I reuse the cache from local disk on second and subsequent server connects if the client and server agree on the mission and the CRC of the cache. Between this and other changes that we've made to the lower level networking code, we managed to drop our server connects from almost a minute or so to around 6-7 seconds (for our current mission file).
The advantage to this method is that you don't have to have the mission file on the client, and you can change the mission on the server and clients will just cache it again as necessary.
These varaibles are useful to change (from the link above):
$pref::Net::PacketRateToServer = 32 (per second)
$pref::Net::PacketRateToClient = 10 (per second)
$pref::Net::PacketSize = 200 (bytes)
but, you'll get a bigger win by going into the engine code and opportunistically cramming as much into each ghost packet as possible up to something close to the MTU size.
09/20/2006 (11:27 am)
Josh posted a method which essentially short-circuits the transferring of datablocks over the wire and instead uses the ones the client already has (from the mission file), if I remember correctly.I have recently made engine modifications that cache all of the datablock and "GhostAlways" stuff that is sent during a mission load, and I reuse the cache from local disk on second and subsequent server connects if the client and server agree on the mission and the CRC of the cache. Between this and other changes that we've made to the lower level networking code, we managed to drop our server connects from almost a minute or so to around 6-7 seconds (for our current mission file).
The advantage to this method is that you don't have to have the mission file on the client, and you can change the mission on the server and clients will just cache it again as necessary.
These varaibles are useful to change (from the link above):
$pref::Net::PacketRateToServer = 32 (per second)
$pref::Net::PacketRateToClient = 10 (per second)
$pref::Net::PacketSize = 200 (bytes)
but, you'll get a bigger win by going into the engine code and opportunistically cramming as much into each ghost packet as possible up to something close to the MTU size.
Torque Owner Martin Schultz
Speeding Mission Loadtimes.