cvar "g_log"

Locked
kaffeedoktor
Posts: 13
Joined: Mon Feb 09, 2004 8:00 am

cvar "g_log"

Post by kaffeedoktor »

As it's the first time I had a look into a quake sdk, i'm not sure if I'm right - so please correct me if I'm wrong.

Because cvar "g_log" can't be modified in multiplayer and I'm interested in detailed log output, I search around in SDK where those things might be defined. A simple "grep -R g_log *" didn't have any usable result, so I wondered why this cvar isn't defined anywhere?
After searching around I found in source/game/gamesys files called "SysCvar.cpp" and "SysCvar.h". The .cpp file includes this comment: "All game cvars should be defined here." - but g_log isn't around anywhere. But I found another cvar called g_gamelog, that seems to do the thing g_log does. This cvar (g_gamelog) also appears in several source files together with C-defines for log output. But in server console this cvar doesn't exist, it says "Unknown command".

Is there any sort of alias of cvar defined somewhere outside sdk? As mentioned above grep didn't bring me any result while searching for cvar g_log in sdk game source.

In the next step I'll hack g_gamelog as static "true" and try to compile the sdk to figure out if the dedicated server does the correct output then.

If anyone got a better hint for me, please let me know. As said above, these are my first steps in any quake sdk, so please be patient.

kaffeedoktor.
Last edited by kaffeedoktor on Thu Nov 17, 2005 3:56 pm, edited 1 time in total.
User avatar
Foo
Posts: 13840
Joined: Thu Aug 03, 2000 7:00 am
Location: New Zealand

Post by Foo »

Moved to Programming Discussion. Your talk of compiling SDKs and grep confuses Foo greatly :o
"Maybe you have some bird ideas. Maybe that’s the best you can do."
― Terry A. Davis
kaffeedoktor
Posts: 13
Joined: Mon Feb 09, 2004 8:00 am

Post by kaffeedoktor »

Ok :)
kaffeedoktor
Posts: 13
Joined: Mon Feb 09, 2004 8:00 am

Post by kaffeedoktor »

Ok, after having a closer look to the game source, it looks like there isn't any log output in detail as it was in q3. There may be some output when a player receives damage, but all other output is some physics data (from Physics_Player.cpp). So it seems this is just some debug output.

There's another object containing some game information which is used to calculate the stats output at the end of game. I even don't think it has all information in it, I'll have a closer look to it.

Right now I think game logging like in q3 has to be added and isn't included right now.
kaffeedoktor
Posts: 13
Joined: Mon Feb 09, 2004 8:00 am

Post by kaffeedoktor »

It really seems there's no log output like in q3 builtin. If I'm totally wrong, please correct me!

So it looks like we'll have to do it on our own - now as the sdk is out this won't be such a big problem. I think I'll do the job, but first I want to have some feedback from you if such log output is wanted. On the other side I'll contact developers of mods like q4max oder q4-xbattle for working together - a mod with just extended log output won't get many friends ;)

What do you expect of extended log output for use in statistics software? Please append this list:
- weapon pickup
- ammo pickup
- item pickup
- health / armor pickup
- kills / suicides
- weapon hits with damage and origin
- gametyp specific (ctf, ...)
- detailled gamedata (timelimit, fraglimit, other limits, map, time, date, ...)
- player name & id (punkbuster id?)

So what do you think?
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Post by ^misantropia^ »

As a rule of thumb, you can never log too much information; a parser can always choose to ignore that what it thinks it does not need. Having said that, be sure to include at least frags/suicides and the means of death plus player names (don't strip color codes).
Hex
Posts: 190
Joined: Fri Oct 18, 2002 7:00 am

Post by Hex »

chat text. to verify reports of when someone is being a jerk with the chat.
kaffeedoktor
Posts: 13
Joined: Mon Feb 09, 2004 8:00 am

Post by kaffeedoktor »

Thanks for the posts so far.

Yesterday evening I wrote to developers of q4max and xbattle - which both seem to be the one with the biggest acceptance.

I'll provide news here as soon I have some.
kaffeedoktor
Posts: 13
Joined: Mon Feb 09, 2004 8:00 am

Post by kaffeedoktor »

Some news: I talked to mod developers of xbattle and for now they'll add log extension to their mod if it's good enough.

So I'll start these days and I'll keep you up to date here.
Fjoggen
Posts: 23
Joined: Sat Aug 30, 2003 7:00 am

Post by Fjoggen »

Excellent, wunderschoen, bravissimo, fantastisk

I was actually planning to do the same thing, but with exams coming up I do not think I have enough spare time.
However I will help if I can and I might even write a log file parser/analyser for the new logs

My suggestions
Basically I would like the log to look more or less like the old quake 3 log (especially the osp), with some improvements:
* As with osp put a timestamp in front of every sentence
* Use guid instead of player name to keep track of who does what.
* Make a reference from guid to the player name and if player name change.
* Every shot that are made and with what type of gun, if it hit a player/bot where it hit -> head shot, etc..
* Where in the game a player was killed
* IP
* Ping
* Chatting -> team chatting, normal say, etc..
* Kills -> type of kills, suicide, shotgun, etc..
* Picking up items, weapons, flags, life, etc..
* Points made -> returned the flag, defence etc..
* Voting
* Kicking, banning
* Speed -> Of players when they shoot and on the pray if the shoot hit
*In the or on the ground. -> If player is shooting while jumping, falling etc or is standing on the ground and the same for the pray if it hit

Log format
* Use easy and simple key words so it is easier to track and understand what is happening:
* Use "one words"
- dark_matter_gun or DARK_MATTER_GUN instead of » Dark Matter Gun
- not_used or NOT_USED instead of not used
* Use a separator such as ¦,¡,±,½,»,;, or other almost never used chars


example
time ± player_id ± location ± position ± speed ± action ± (depending on action: ± type ± value ± weapon ± pray ± location ± position ± speed ± hit ± consequents )

* Suicide:
03/04/2005 - 19:38:25 ± 4721A7D0A5450374784B7285888444B4 (guid) ± ground ± "coordinate" ± "units/second" ± shoot ± rocket_launcher ± 4721A7D0A5450374784B7285888444B4 (guid) ± "coordinate" ± ground ± "units/second" ± ground ± suicide

* Chat:
03/04/2005 - 19:38:35 ± 4721A7D0A5450374784B7285888444B4 (guid) ± ground ± "coordinate" ± "units/second" ± say ± team ± "HELP, PEOPLE ARE KILLING EACH OTHER HERE"

* Item
03/04/2005 - 19:38:45 ± 4721A7D0A5450374784B7285888444B4 (guid) ± ground ± "coordinate" ± "units/second" ± item ± red_armour ± 150 (life)

* Kill
03/04/2005 - 19:38:25 ± 4721A7D0A5450374784B7285888444B4 (guid) ± ground ± "coordinate" ± units/second ± shoot ± rocket_launcher ± 1345B68VHW545037474677N858457904 (guid) ± "coordinate" ± air ± "units/second" ± torso ± kill

* Shoot, miss
03/04/2005 - 19:38:25 ± 4721A7D0A5450374784B7285888444B4 (guid) ± ground ± "coordinate" ± units/second ± shoot ± rocket_launcher ± air ± miss

* Shoot, but not kill
03/04/2005 - 19:38:25 ± 4721A7D0A5450374784B7285888444B4 (guid) ± ground ± "coordinate" ± "units/second" ± shoot ± rocket_launcher ± 1345B68VHW545037474677N858457904 (guid) ± "coordinate" ± air ± "units/second" ± torso ± -50_life

Note
How the log look isn't as important, but it must be easy to distinguse the different sections from each other.
kaffeedoktor
Posts: 13
Joined: Mon Feb 09, 2004 8:00 am

Post by kaffeedoktor »

Fjoggen,

thank you for your detailled post. I already had some similiar thoughts of log format and so on as you posted. But there are also some things new.

My next step will be to write a complete planning wich will include all details of log format. I'll post it here when ready to discuss it.
Locked