Inside3D!
     

On-the-fly game changing without disconnecting players?

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Mon Aug 25, 2008 12:28 am    Post subject: On-the-fly game changing without disconnecting players? Reply with quote

FrikaC wrote:
all globals are reset (actually the progs are completely unloaded then reloaded) on level change. The only global variable kept across level changes is serverflags. If you want others, yes, then using cvars is not a bad solution.


This information has given me an idea. A real problem for mods is getting them hosted on a server. But this makes the assumption that hosting 1 mod requires 1 server.

Theoretical ...

What if a single server had the ability to, via player voting, change the mod running?

For instance, let's say I took 3 open source mods and added identical vote code to each to allow the users to select a mod.

A successful vote executes a command by a modified server engine to "copy airquake.dat -> progs.dat"

Quote:
For the moment, let's assume the gamedir does not need to be changed and these mods have a folder structure as such that their respective QuakeC uses to make this unnecessary ...

/mygamedir
/mygamedir/progs/airquake/*.mdl
/mygamedir/progs/qrally/*.mdl
/mygamedir/sound/airquake/*.wav
/mygamedir/sound/qrally/*.wav

etc. you get the idea


Let's further assume the server is DarkPlaces with the model/sound download feature activated or that the server isn't DarkPlaces but has model/sound download capability.

What kills this idea? The new progs is freshly reloaded upon changing the level. Model, sprite and sound caching is done by the QuakeC. Is there some terrible limitation that would be hit rather quickly or something else that would hinder this idea?

If not, what stops the idea of a single server from being a hub to run 30 different mods? Server hosting companies usually supply loads of filespace for the server because modern games use a ton of disk space.
Back to top
View user's profile Send private message
mh



Joined: 12 Jan 2008
Posts: 910

PostPosted: Mon Aug 25, 2008 8:49 pm    Post subject: Reply with quote

You'd need a rewrite of the server code in the engine to properly support this. Right now there are a couple of structures that hold server info, with only one instance of each being active at a time. Ideally, all of the sv_*.c files would need to convert to C++ (not difficult, I've personally already done that bit) and the sv and svs structures (at least) would need to convert to classes. You could do it with C, but it would be very messy indeed.

Break out from there into the host code, and Host_Frame and all of it's descendents will also need to be reworked (not too dramatically though) so that they're aware of which server instance they're running against.

Server cvars will need to be instanced too, otherwise someone on Server1 will get a nasty shock when Server2 starts up Ziggurat Vertigo!

You also need a mechanism for tracking which clients are connected to which server instances, as well as arbitrarily moving any client to any server instance, as well as killing off any server instance that drops to 0 clients.

I think the protocol should be OK, so long as the clients can reliably determine which server instance they are connected to. The net code would need some reworking, as a lot of it assumes that there is only one server which all clients listen to. Connections would need to re-route to the correct server, broadcasts would need to know which server they're coming from, stuff like that. You'll probably also want to run each server on a different IP port, so there's something else to do.

Then you're going to start hitting a serious memory overhead - the server keeps copies of all entities in a fixed size array, so take the size of that and multiply by 30. The server also needs it's own copy of the world model (and probably other models too), as well as a lot of other state info. 200 megs is not unreasonable for 30 server instances. OK for LANs, but on the internet your host will start looking at your usage well before you get to there.

Then you need to consider CPU. 30 x the CPU load of a Quake server would make a small load into a fairly large load. To maintain isolation and better use resources, you're looking at moving the server code over to a multithreaded model with a thread pool of some sort supporting it.

Bandwidth - Q1 can utilise 20 Kbps per client as is, so you'll need about 10 megs of bandwidth (adding a little for headroom), and let's hope there's no contention on that line.

There's also 30 x the potential attack surface to consider, so you'll need to ramp up your OS security (and your Quake server security) or one progs.dat which is exploitable could bring the whole thing down.

So yeah, a big job (and I doubt I've even touched on half of it), but one which seems fairly interesting nonetheless.
_________________
DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines
Back to top
View user's profile Send private message Visit poster's website
mh



Joined: 12 Jan 2008
Posts: 910

PostPosted: Mon Aug 25, 2008 8:53 pm    Post subject: Reply with quote

Actually, I think I may have misunderstood the original post. Embarassed Laughing

But the ability to host multiple server instances is something intriguing, don't you think?
_________________
DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines
Back to top
View user's profile Send private message Visit poster's website
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Mon Aug 25, 2008 8:58 pm    Post subject: Reply with quote

mh wrote:
Actually, I think I may have misunderstood the original post. Embarassed Laughing

But the ability to host multiple server instances is something intriguing, don't you think?


Yes it is, and I'm going to do it because it works Very Happy Very Happy

http://www.quakeone.com/forums/showthread.php?t=3803

I'm really tired of seeing stuff where someone went to a lot of work only for it to go unused. I really want to see DarkPlaces map/model download put to good use, maybe in conjunction with DPP7.
Back to top
View user's profile Send private message
mh



Joined: 12 Jan 2008
Posts: 910

PostPosted: Mon Aug 25, 2008 9:49 pm    Post subject: Reply with quote

Baker wrote:
mh wrote:
Actually, I think I may have misunderstood the original post. Embarassed Laughing

But the ability to host multiple server instances is something intriguing, don't you think?


Yes it is, and I'm going to do it because it works Very Happy Very Happy

http://www.quakeone.com/forums/showthread.php?t=3803

I'm really tired of seeing stuff where someone went to a lot of work only for it to go unused. I really want to see DarkPlaces map/model download put to good use, maybe in conjunction with DPP7.

Very Happy Very Happy Very Happy

Looking forward to seeing it up and running!
_________________
DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group