Upcoming Tutorial: The Seamless Multi-Map World

Discuss programming topics for the various GPL'd game engine sources.
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: Upcoming Tutorial: The Seamless Multi-Map World

Post by Spike »

well, 'signon 1 when at 1' means your code is sending the svc_serverinfo and the following svc_signon twice in a row without sending a 'reconnect\n' stuffcmd in between.
Note that reconnect is normally sent in SV_SendReconnect at the top of SV_SpawnServer while svc_signon is sent at the bottom.
You'd normally think that this means you can just call SV_SpawnServer multiple times in a row, but the reconnect message is sent instantly and without buffering, while svc_signon will be sent on the next frame. Which means you get two reconnects then two signons, and then your client complains and disconnects.
cl_shownet 2 can normally help what is sent across the net in greater detail.

Simply put, if your LoadGamestate function contains its own call to SV_SpawnServer, you shouldn't call SV_SpawnServer a second time. It'll be counter productive anyway.

The spawnspot system previously discussed here is generally compatibile with hexen2, except that hexen2 has some additional extras.
ClientReEnter being the most noticable one (player is preserved in its entirety from the previous level and copied into the next as an alternative to player mapchange parms). Note that this isn't specifically tied to hubs, and can be used even when not preserving the previous maps.
But there's also some rather annoying 'hubsavereset' qc flag which is a really nasty one to implement without hideous hacks (fte implements that by clearing out a few system fields that the gamecode might not always initialise the same then sneakily calling the spawn function again, seems to work!). In hexen2 its useful for things to update based upon runes and stuff (using persistant flags in serverflags).
You'll want to be sure that the new map's startspot global is set properly even if the new map hasn't previously been visited yet.
Post Reply