[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - Sending map data from server to client?

Sending map data from server to client?

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

Sending map data from server to client?

Postby andrewj » Fri Jul 13, 2012 9:48 am

I'm making a 2D game based on the Quake engine, and I need to send 2D map data (tile numbers) from the server to the client, since the maps will be randomly generated on the server.

What's a good way to do this?

At the moment I have it sending tile data in a similar way it sends visible entities (i.e. in SV_SendClientDatagram). But I think it might work better sending the whole map before game begins, during the signon stages. But how can you handle lost packets??

Cheers in advance.
andrewj
 
Posts: 133
Joined: Mon Aug 30, 2010 3:29 pm
Location: Australia

Re: Sending map data from server to client?

Postby taniwha » Fri Jul 13, 2012 10:56 am

I don't know about quake*, but for quakeworld, signon packets are "reliable".

* My quake (as opposed to quakeworld) protocol knowledge is rather sketchy at best. I've spent much more time with the qw protocol.
Leave others their otherness.
http://quakeforge.net/
taniwha
 
Posts: 399
Joined: Thu Jan 14, 2010 7:11 am

Re: Sending map data from server to client?

Postby Spike » Fri Jul 13, 2012 5:51 pm

both have some prespawn/signon/init buffers for things like static entities.
depends how much data there is. if the dataset is quite large, consider loading it on demand as the view moves around the map. just some function to get/request the data that's allowed to fail if its not available yet.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: Sending map data from server to client?

Postby taniwha » Fri Jul 13, 2012 10:04 pm

Yeah, I know of the buffers. It's the reliable/unreliable part about which I'm uncertain.

As an aside, I gave QF's qw-server unlimited signon buffers yesterday :)
Leave others their otherness.
http://quakeforge.net/
taniwha
 
Posts: 399
Joined: Thu Jan 14, 2010 7:11 am

Re: Sending map data from server to client?

Postby Spike » Fri Jul 13, 2012 10:21 pm

meanwhile I'm trying to deprecate the signon buffers in FTE (signon buffers only work if all clients use the same protocol). :P
MSG_INIT is always an issue.
but that's offtopic.

Anyway, it depends how big your map is.
with tiles you can have some special tile=255 marker to mark unknown, and have the client send a request off to the server for all the tiles in some screen-sizedish block whenever you encounter it, then you'll not stall while waiting for the entire map right at the start. Maybe set all 255s to 254 in the block once a request has been sent for that block, and fill them in when they arrive.
The biggest issue with queries is what to draw while you're still waiting for the result of those queries. When teleporting, this can be a major issue.
If you dynamically change the tiles mid-game, the prespawn/signon buffers are static and thus not suited to this. Queries should still work, assuming all replies/updates are sent over the reliable channel, thus ensuring that they're all properly synced and ordered correctly. You'll have to notify the client about every tile which is changed, but you should not need to track what the client thinks the tiles are, if you're broadcasting all changes reliably.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: Sending map data from server to client?

Postby andrewj » Sat Jul 14, 2012 9:26 am

Many thanks Spike, that was really helpful.

P.S. I'm gonna try stuffing tile update messages in the reliable datagram, and increasing MAX_DATAGRAM (which is still 1024 in this antiquated codebase).
andrewj
 
Posts: 133
Joined: Mon Aug 30, 2010 3:29 pm
Location: Australia

Re: Sending map data from server to client?

Postby Spike » Sat Jul 14, 2012 4:29 pm

anything marked 'datagram' is unreliable. you don't want to exceed packet sizes of 1450 or you'll start having issues with broken routers, yes they still exist out there in the wild.
reliables have a max of 8192 or so in vanilla, which can generally be bumped up to 65535 without any other protocol changes.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: Sending map data from server to client?

Postby andrewj » Sun Jul 15, 2012 8:15 am

Yeah, at first I merely saw darkplaces and fitzquake had upped MAX_DATAGRAM (renamed in darkplaces) up to 32768 or 65535, but later I found the code in SV_SendClientDatagram which limits the size to 1400 for non-local clients.
andrewj
 
Posts: 133
Joined: Mon Aug 30, 2010 3:29 pm
Location: Australia

Re: Sending map data from server to client?

Postby qbism » Mon Jul 16, 2012 3:00 am

User avatar
qbism
 
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am

Re: Sending map data from server to client?

Postby Baker » Mon Jul 16, 2012 3:49 am

The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Sending map data from server to client?

Postby qbism » Mon Jul 16, 2012 4:59 am

User avatar
qbism
 
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am

Re: Sending map data from server to client?

Postby Baker » Mon Jul 16, 2012 5:24 am

The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Sending map data from server to client?

Postby Spike » Mon Jul 16, 2012 5:42 am

many limits won't cause issues until they're exceeded. in which case extended clients will survice, while vanilla clients would normally be kicked by the server shutting down.

datagram sizes are fairly often exceeded when you have too many ents visible at once. which means that's not one to blindly extend when serving protocol 15, annoyingly enough. it would be common enough that it would make claiming to use protocol 15 redundant if the server supports something better.
for demo recording, it won't make a difference really.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: Sending map data from server to client?

Postby mh » Mon Jul 16, 2012 5:14 pm

DirectQ gets around this by not even pretending to be suitable for use as a server. I've always taken the stance that it's a client and if you want a server there are other, better options available (running ProQuake -dedicated from another dir on your machine is one option I occasionally recommend). DirectQ itself doesn't have -dedicated anymore and I'm sometimes tempted to remove -listen, just to ram the point home: it's a client.

The philosophy here is, I guess, "do one thing and do it well" rather than trying to do everything.
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Re: Sending map data from server to client?

Postby metlslime » Tue Jul 17, 2012 2:30 am

metlslime
 
Posts: 316
Joined: Tue Feb 05, 2008 11:03 pm

Next

Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 2 guests