Tangled Mess: Disconnect / Demo Stop / Loading Plaque

Discuss programming topics for the various GPL'd game engine sources.
Post Reply
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Tangled Mess: Disconnect / Demo Stop / Loading Plaque

Post by Baker »

In NetQuake, disconnect + stop demo playback + shutdown server + the loading plaque are a huge mess.

CL_Disconnect_f.
Called by "disconnect" command or "load" (load a save game) command. This command can disconnect a dedicated server.
CL_Disconnect.
Called all over the place. Cannot disconnect a dedicated server. I'm wondering if it should be able to do so.
CL_StopPlayback
Called all over the place, but less places than disconnect.
SV_SpawnServer
Map load on the server. If this fails, it sets sv.active to false without bothering to use the traditional routes of disconnect.
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 ..
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Tangled Mess: Disconnect / Demo Stop / Loading Plaque

Post by Baker »

Finally sorted this out, sheesh. The loading plaque (plague?) code is terrible, but once you figure it out it makes a great deal of sense and is easy to deal with.

What I mean is that the console showing/hiding and the loading plaque in Quake is terribly, terribly wrong in the actual code. But once you figure out the design, it is simple. I think Carmack might have just said to hell with it.

Every engine I've seen tries to deal with the console by opening and closing it instantly to avoid what the real problem is. There isn't anything wrong with the console transition between open and close if that is what the user is intending, but instead the code tries to do that but is broke in about 8-9 different places.

What it wants to do is sometimes show "loading", sometimes not even update and sometimes close the console normally.

Now is this a boring topic? Probably, except it bothered me to no end that there isn't an engine that can have the console transition as Quake was designed to do, but correctly deal with the cases where the original code messed up and put console in your face when you didn't want it.

These solutions always result in hideous things, like at least once upon a time, the console would pop-up in DarkPlaces between levels and then maybe start flooding the keyboard with "WWWWWWWWWWWW" if that is your forward key. Or in most other engines, the solution would leave the console on the screen if the map crashed.

The unglamourous problems never get fixed usually. I would have normally even tried to tackle this except Quakespasm has so hordes of unglamorous fixes and combined with the fixes MH and others dredged up here, I realized that this is all in striking distance.

(i..e. Quakespasm flat out conquered 3/4 of the ugliness in the original source code, places I can't imagine anyone wanting to deal with the tediousness would go. Yet, that is Quakespasm. Seeing that blueprint, I've probably offed maybe 40 little nuisances (little as in that their annoyance level is somewhat small, but it doesn't mean the solution is easy --- usually the problem still exists because the solution is not fun at all). And --- at the moment. My grand total list of nuisances is unbelievably 0.0000 )
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 ..
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: Tangled Mess: Disconnect / Demo Stop / Loading Plaque

Post by leileilol »

It's messy because it's all a big workaround for a stack overflow when quickloading (where it'll annoyingly show a console scrolling up instead). I never had that happen though, so it must've been an isolated incident with older versions of DJGPP...
i should not be here
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Tangled Mess: Disconnect / Demo Stop / Loading Plaque

Post by Baker »

leileilol wrote:It's messy because it's all a big workaround for a stack overflow when quickloading (where it'll annoyingly show a console scrolling up instead). I never had that happen though, so it must've been an isolated incident with older versions of DJGPP...
I think I read those notes when working with winquake and some of the DJGPP topics in an article on the net somewhere. And I know many of the messes in Quake were due to having to interface with asm for speed, and GLQuake in particular being an "after-market" unsupported add-on Carmack *somehow* coded in month.

And I think the software renderer is probably 3x as complex as all of GLQuake is in total.
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 ..
Post Reply