Forum

Inner Mysteries of Quake: key_dest, console

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

Moderator: InsideQC Admins

Inner Mysteries of Quake: key_dest, console

Postby Baker » Tue Sep 28, 2010 1:47 am

1. Menu.c does something heinous. If you exit the menu, it sets keydest = key_game. At first thought, it should return you to whatever the keydest was when you entered the menu. That actually isn't perfect either ... you could be playing a demo and the demo ended or you could have been connected to a server and got disconnected somehow.

Either of those, I think cause a CL_Disconnect. So CL_Disconnect should tell the menu whether or not the game has ended and menu.c should, upon exit of the menu, return the keydest to the previous state if (and key_game if the game is still running otherwise do key_console).

2. The Loading Plague.

Mysteriously, you can't do this if not ca_connected. I bet DarkPlaces does. Particularly noticeable with the FitzQuake protocol loading a gigantic map.

3. The stupid between map showing of the console for a split second in DarkPlaces. I get this in my engines too. It occurs, for example, between the start map and e1m1. I see it for just a microsecond, it annoys me. I'll track down why it happens.

4. Spike thinks engines shouldn't write configs in gamedirs. I agree. Furthermore, I don't think engines shouldn't support -game from the commandline at all :!: But at the moment I can't remember my reasoning. Instead it should be +gamedir <whatever>. [But not for an engine like DarkPlaces/FTEQW that supports games radically far from the Quake tree.]

5. MH said something about how he didn't like his cvar support of hipnotic/rogue/quoth/nehahra. MH ... what was the shortcoming about that if you don't mind explaining?

[6. Why isn't there a stock add "Nehahra support to an engine tutorial" or was there once upon a time maybe in the form of the Nehahra engine?]
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

Postby revelator » Tue Sep 28, 2010 6:28 am

heh aye cant tell how long i been grinding my teeth at that particular codebit.

try looking in the tenebrae2 source xmlmenu.c ouch.

as for nehahra as far as i know there was no tutorial when i built demonquake i ripped most of it from bengt jardrups nehquake and the VM from telejano. needless to say it takes quite a while to get all that code in.

i skipped dzip support in demonquake (was planning to add pk3 at some point but then i fell in love with mh's engine and newer got to it).

most also resent the dependancy on the fmod library that was needed for mod support because you couldnt include the dll as a part of the source the user had to download it seperatly.

well atleast that part i can get over now :) i use the now free midas player for mod support.

besides i might add nehahra support to realm at some point.
User avatar
revelator
 
Posts: 2567
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Postby Baker » Tue Sep 28, 2010 6:56 am

#7. This one is really annoying ...

In a map, go to the exit teleporter. Particularly noticeable is go in to the E1 episode teleporter in start.

Before the map load is completed, release the forward button.

The -forward or -attack gets losts and the next map you continue walking forward. The server never knows it happened.

The only "right" way to fix this is to somehow queue minus commands (-attack, -forward, etc.) and impulses (or maybe even all of them?) ? I'm not sure.

I believe clearing them server side is the wrong thing to do, if "hub system" type of transit to previous levels instantly ever gets used (it will) then you should maintain walking and such if you were walking before.

Then again ... maybe either kind of solution in practice is viable.
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

Postby andrewj » Tue Sep 28, 2010 9:18 am

Baker wrote:I believe clearing them server side is the wrong thing to do, if "hub system" type of transit to previous levels instantly ever gets used (it will) then you should maintain walking and such if you were walking before.

I'd say it's the client's responsibility to re-check and re-assert stuff like +forward when a new map has loaded (or after any pause in gameplay, like after playing a cutscene).
andrewj
 
Posts: 133
Joined: Mon Aug 30, 2010 3:29 pm
Location: Australia

Postby Spike » Tue Sep 28, 2010 10:53 am

1: key_game is designed to revert to key_console if there is no map active. Alternatively you could have it trigger demo playback (and have quake boot into the menu instead of demos - useful for multiplayer clients with server browsers - note: should probably have separate console-active flag instead of key-dest in this case!).

2: server is server, client is client. server can't show loading screens as the code is all somewhat separate. Its a simple omision.

3: when you type while that console is down, its even more annoying (key_game->key_console).

4: Some settings are generic settings that should apply to all mods. So some parts should be written to the gamedir, while the majority should not. Also you shouldn't lose your settings in one engine simply because you tried your mod in another.
Stripping support for -game is folly, it should be handled by the engine as a wrapper to +gamedir, rather than be stripped (consider: which gamedir do my configs get execed from, is commandline execed before or after configs).

5: I don't like cvar support for hipnotic/rogue either. Such mods should be detected by the presence of named wad lumps, rather than cvars. I can't comment on quoth/nehahra. No fiddling with whatever-the-heck-the-engine-modder-chose-for-that-cvar-name.

6: Because the majority of nehahra is evil code which is useful only for nehahra (in which case, you can use the 'proper' nehahra engine) (floats for alpha?... seriously?). Many engines already have many of the features (like alpha or fog) already, so such a tutorial would be fraught with conflicts.

7: Client bug. Fix it on the client. Movement commands have impulses as events, but movements are movement values rather than changes, recalculated each frame. You need to stop the engine from ever discarding the cbuf, or to at least retain commands with a leading minus, I guess. But yeah, client bug.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby revelator » Tue Sep 28, 2010 1:02 pm

(floats for alpha?... seriously?).


hehe aye that one might turn a few heads today. but the mod is rather old and none of us knew better so bad coding practices would eventually happen :twisted: besides i think bengt jardrup changed em to byte in his engine ?.

one sad puppy about it is that the qc source was lost so fixing that part will eventually be a real bitch.

more so as it was compiled with a strange half pascal based qc compiler that only ran on dos/win9x and as far as i remember the syntax used was a bit? different from the real qc.

but that part is understandable seing as the quake source wasnt even released back then.
User avatar
revelator
 
Posts: 2567
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Postby qbism » Tue Sep 28, 2010 4:54 pm

reckless wrote:one sad puppy about it is that the qc source was lost.

The qc source in the neh_devkit?
http://quakewiki.net/archives/nehahra/xdownload.html

#1 Can key_game etc. be reorganized? There's a "real" key_game situation which should maybe kick out of Key_Event before going to console, and then there's a "key_game_console" situation when key_game is set but the console is already down.
User avatar
qbism
 
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am

Postby Baker » Tue Sep 28, 2010 6:55 pm

qbism wrote:
reckless wrote:one sad puppy about it is that the qc source was lost.

The qc source in the neh_devkit?
http://quakewiki.net/archives/nehahra/xdownload.html


Or a more direct non-FilePlanet link:

http://www.quake-1.com/quakec-gallery/neh_devkit.zip
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

Postby revelator » Tue Sep 28, 2010 10:44 pm

my bad been a while since i tried anything with it it was the source for the models that where missing :oops:
User avatar
revelator
 
Posts: 2567
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Postby r00k » Wed Sep 29, 2010 7:33 am

I don't think engines shouldn't support -game from the commandline at all Exclamation But at the moment I can't remember my reasoning. Instead it should be +gamedir <whatever>. [But not for an engine like DarkPlaces/FTEQW that supports games radically far from the Quake tree.]


CTF uses player.mdl in the /CTF folder, which has 4 player skins.
without -game ctf, the /id1/pak0.pak/progs/player.mdl gets loaded 1st, then even using "gamedir ctf" from the console, the player.mdl with 4skins doesnt get loaded.
Thus, players connecting to a ctf server get invalid skin errors spammed to the console constantly. :(

Unloading of precached data (everything) needs to be implemented before switching gamedirs for -game parameter to be fully removable.

The -forward or -attack gets losts and the next map you continue walking forward. The server never knows it happened.

#7 I fixed this sometime last year. Though now off hand I cant remember how. I think the fix was in console.c, though it was along the same lines of moving forward then toggling the console. Doing so would make your keydown stuck in the +forward. I think it's a clearstate called somewhere..iirc.

edit:
Code: Select all
      Key_ClearAllStates();//R00k: if a +alias was interrupted by toggleconsole, then execute the -alias.
r00k
 
Posts: 1110
Joined: Sat Nov 13, 2004 10:39 pm

Postby Chip » Wed Sep 29, 2010 8:01 am

Baker wrote:
qbism wrote:
reckless wrote:one sad puppy about it is that the qc source was lost.

The qc source in the neh_devkit?
http://quakewiki.net/archives/nehahra/xdownload.html


Or a more direct non-FilePlanet link:

http://www.quake-1.com/quakec-gallery/neh_devkit.zip


OFFTOPIC: I'll update the links on QuakeWiki pretty soon. Sorry for that.
QuakeWiki
getButterfly - WordPress Support Services
Roo Holidays

Fear not the dark, but what the dark hides.
User avatar
Chip
 
Posts: 575
Joined: Wed Jan 21, 2009 9:12 am
Location: Dublin, Ireland


Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest