I was just casually taking a look
to a diff in Quake3e (an ioquake3 fork with very active development at the moment), and I noticed this, where they added a new cvar:
+ fs_locked = Cvar_Get( "fs_locked", "0", CVAR_INIT );
+ Cvar_SetDescription( fs_locked, "Set file handle policy for pk3 files:\n"
+ " 0 - release after use, unlimited number of pk3 files can be loaded\n"
+ " 1 - keep file handle locked, more consistent, total pk3 files count limited to ~1k-4k\n" );
it looks like
they implemented a way to define descriptions about usage of specific cvars. I haven't tried Quake3e yet, so I don't know how does the user invoke such infos, but I can guess such output may be presented after entering a cvar name without specifying parameters.
PROs:
- Allows players to have basic infos about what a certain cvar does (and about what specific values do) without having to search outside from the game (e.g. on the wiki - Of course, the descriptions shouldn't be as detailed as on the wiki!).
- These descriptions may also work as reminders for developers, as if they were comments, in source code.
- (Potentially) UI3 may show such infos about certain GUI options linked to specific cvars, when mouseovering or by clicking a small icon near the option.
(Note: UI3 has already got a sort of "status line" which shows a descriptive text when mouseovering a certain option -such text is defined in a specific file, which may potentially even be language-specific-, but it's limited to a single line of text and AFAIK is not accessible through the console).CONs:
- Initial "population" may be a big task (however maybe they are not necessary for every single cvar and one may copy some existing descriptions from quake3e -
Note: I don't know if they added such descriptions to many existing cvars or only to their "new" ones).
- A bit more stuff to maintain.
- Some more lenght in source code.
- A bit more resources utilization (however they are just plain text).
- What would happen if using a such thing in gamecode with an engine not supporting it? A crash? A very long series or warnings?
[1]I just wanted to point out this, I don't know if you will be interested.
It might be useful, but PROs and CONs have to be evaluated.[1] Maybe a workaround for that would be to move cvar descriptions to standalone files, similarily to the "status line" texts in current UI3 nightly builds. That would also theoretically allow language-specific cvar descriptions. But that would lose a bit the "pro" of acting as "reminder comment" directly in source code (although the reminder would still be available by checking the apposite file).