Tremulous Forum

Mods => Mod Releases => Non-Gameplay Changing => Topic started by: Paradox on May 20, 2008, 12:21:31 am

Title: qvm_build cvar; Lets establish a standard
Post by: Paradox on May 20, 2008, 12:21:31 am
Knowing which QVM a server uses can be difficult, if not outright confusing. Also, knowing which version can be useful too, not only to players, but to server owners. Rezyn and I have made a simple patch (incredibly simple) that adds a new cvar, qvm_build, that contains info from the qvm. QVM authors and compilers have to add the information by hand, but it is pretty easy. The cvar is a serverinfo, so it is easy to figure out whats used where, and gain statistics about a qvm.

I am hoping various qvm authors add this feature to their qvm.

The patch can be found at the Patch Tracker (http://www.mercenariesguild.net/patches/index.php?do=details&task_id=169)
Title: Re: qvm_build cvar; Lets establish a standard
Post by: Paradox on May 20, 2008, 01:24:09 am
Well, i forgot that cvars are limited in length, so i split this off into 4 cvars. Patch has been updated.
Title: Re: qvm_build cvar; Lets establish a standard
Post by: Lakitu7 on May 20, 2008, 01:42:04 am
I've thought about something like this for a bit, to give people more of a way to differentiate the crap servers from those that might be worth playing on, and also so that I can pester people who're still running with godawful old bugs to update. But, *4* serverinfo cvars is incredibly excessive. Just use qvm_version and put the qvm name + version there. Scrap URL and date; those are useless and redundant.

I'll come on board to do qvm_version I specified. The rest just spams users unnecessarily.

It does raise a bit of a naming problem when people make derivitive QVMs, being as most QVMs nowadays are derived from others, and then people with compilers go and add even more retarded patches on top of those. What is such a qvm called? Who knows, but oh well. This is better than nothing, anyway.
Title: Re: qvm_build cvar; Lets establish a standard
Post by: Paradox on May 20, 2008, 01:48:24 am
What i really want is to just set up a standard for providing qvm info

I hope to establish that in the format of cvars with a qvm_ prefix.

QVM owners could set their own data, but the prefix should remain the same.

The main goal is to make it possible to gather statistics using qstat and grep
Title: Re: qvm_build cvar; Lets establish a standard
Post by: Lakitu7 on May 20, 2008, 01:50:24 am
Sure. Put whatever you want.. in one cvar. We do not need to use our positions as qvm authors to spam up the serverinfo list with tons things that the player who queried it doesn't give a damn about.
Title: Re: qvm_build cvar; Lets establish a standard
Post by: Paradox on May 20, 2008, 02:39:27 am
Your correct, and ill remove the 4, shrink them back down to 1.
Title: Re: qvm_build cvar; Lets establish a standard
Post by: benmachine on May 20, 2008, 03:30:11 pm
I'm uneasy about the qvm_ prefix. Remeber that there are actually three QVMs in use during normal play. Admittedly only one will show up in serverinfo, but nevertheless I don't see why we can't keep to the convention of using g_ as the prefix for game variables.
By the way, I read the patch and it seems to me it could be made a lot simpler if you remembered that adjacent quoted string constants in C are automatically concatenated: you should be able to just use
Code: [Select]
trap_Cvar_Set( "g_qvmVersion", QVM_VARIANT " " QVM_VERSION " " QVM_URL );Lakitu is right though, that serverinfo string space is limited. It might not be an issue yet but sooner or later you will find it overflowing and then you will be in trouble.
Title: Re: qvm_build cvar; Lets establish a standard
Post by: Paradox on May 21, 2008, 02:13:34 am
Doh. I was just used to substitutions with %s. And as i said, i have switched back to 1 cvar.

You are correct that 3 qvm's are called. But when the community at large refers to "the qvm", they generally mean game.qvm. If they mean otherwise, it is usually mentioned explicitly, as in "i have a problem with ui.qvm".

Currently 2 servers are using it, both running SVN versions of pgqvm
Title: Re: qvm_build cvar; Lets establish a standard
Post by: Amanieu on May 21, 2008, 09:40:36 am
Added to release 1.3 of tremulous-amanieu.
I just set the contents of the var to Q3_VERSION and modified q_shared.h a bit.
Title: Re: qvm_build cvar; Lets establish a standard
Post by: Paradox on June 11, 2008, 02:12:12 am
Here are some statistics:

Pie of usage based off QVM type (grouped)
(http://chart.apis.google.com/chart?cht=p&chd=t:22,9,2,1&chs=500x300&chco=050040&chl=Lakitu7|P-G-QVM|Amanieu|AU&chtt=qvm_version%20cvar%20breakdown)

Permeation
(http://chart.apis.google.com/chart?cht=gom&chd=t:34&chds=0,198&chs=500x300&chl=34)

And in the next svn of p-g-qvm, ill be removing the website tag. It is pointless, and looks silly
Title: Re: qvm_build cvar; Lets establish a standard
Post by: Le Compilateur on June 11, 2008, 02:47:06 am
I like the qvm_ cvar initiative, only one question: should regular players be allowed to read it from their console?
Title: Re: qvm_build cvar; Lets establish a standard
Post by: Lakitu7 on June 11, 2008, 03:50:56 am
If it's not serverinfo, nobody can see it. If it's serverinfo, players can see it in /serverinfo.
Title: Re: qvm_build cvar; Lets establish a standard
Post by: Le Compilateur on June 11, 2008, 09:46:49 pm
Ohhhhhhh... I thought they could just do /qvm_version...
Title: Re: qvm_build cvar; Lets establish a standard
Post by: Lakitu7 on June 12, 2008, 12:09:51 am
Client consoles see client vars. Server consoles see server vars.

You could make a server command named qvm_version that would send the text back to the client, but this is more convenient. Personally as a player I'd rather know if people are running something sane or something full of godawful crap BEFORE I get there and start to play.
Title: Re: qvm_build cvar; Lets establish a standard
Post by: Paradox on June 12, 2008, 12:18:30 am
Lak, thats half the idea of this qvm_ thing.

So you can tell if someone is using a qvm to your liking or not.
45% percent is for qvm devs, to see how their qvm breaks down
5% is for ops and players to see how up-to-date a qvm is
Title: Re: qvm_build cvar; Lets establish a standard
Post by: Lakitu7 on June 12, 2008, 12:28:35 am
Yes. That's why it's serverinfo.