PDA

View Full Version : Analyzing COD2/COD4 logfiles; Documentation out there?



CaptainSlow
24th September 2015, 01:25
I'm trying to analyze logfiles produced by our COD2 and COD4 servers and I was wondering if there is any documentation out there that tells me how to interpret the logs.
I know the game engine/server is based upon the quake 3 engine (sort of) but I can't seem to find any documentation regarding the logfiles it produces.
For example;

http://i.imgur.com/suIDm2a.png

Thanks!

voron00
24th September 2015, 02:53
There is proably no documentation about that but il' try to explain (for CoD2):

K - kill

timestring;K;victim_guid;victim_slot;victim_team;v ictim_name;attacker_guid;attacker_slot;attacker_te am;attacker_name;attacker_weapon;damage;damage_typ e;damage_location

D - damage

timestring;D;victim_guid;victim_slot;victim_team;v ictim_name;attacker_guid;attacker_slot;attacker_te am;attacker_name;attacker_weapon;damage;damage_typ e;damage_location

Tally
24th September 2015, 08:56
I'm trying to analyze logfiles produced by our COD2 and COD4 servers and I was wondering if there is any documentation out there that tells me how to interpret the logs.
I know the game engine/server is based upon the quake 3 engine (sort of) but I can't seem to find any documentation regarding the logfiles it produces.
For example;

http://i.imgur.com/suIDm2a.png

Thanks!

I can't improve on voron00's post as regards the log string, but just for future reference:

1. starting in 2003, COD1 used a HEAVILY MODIFIED Quake 3 engine (the engine was given to them by Activision, and it is the exact same engine-base as used in Return to Castle Wolfenstein - which was already a heavily modified Q3 engine before it got to Infinity Ward). So, you can't expect to find exact matches to the COD1 engine functions anywhere else other than IW themselves. As such, the logging function in COD1/UO is unique - you cannot find Quake 3 documentation on it because Quake 3 did not have this function.

2. Starting in 2005 with COD2, Infinity Ward wrote their own engine. COD2 has bits of old Quake 3 legacy code in it, but a good 80% of it is brand new - the graphics engine in particular is built from the ground up. As is the AI engine, the animation engine (IW created their own Motion Capture system for use in COD2), and the effects engine.

3. When you get to COD4, even less Quake 3 can be found in it.

So, in future, don't expect to find anything in Quake 3 documentation for the COD2/COD4 engine. It hasn't been Quake 3 engine since 2005.

IzNoGoD
24th September 2015, 12:13
Why not look at the code that actually produces said logs?

Onconnect:

logPrint("J;" + lpselfguid + ";" + lpselfnum + ";" + self.name + "\n");
Ondisconnect:

logPrint("Q;" + lpselfguid + ";" + lpselfnum + ";" + self.name + "\n");
Ondamage:

logPrint("D;" + lpselfGuid + ";" + lpselfnum + ";" + lpselfteam + ";" + lpselfname + ";" + lpattackGuid + ";" + lpattacknum + ";" + lpattackerteam + ";" + lpattackname + ";" + sWeapon + ";" + iDamage + ";" + sMeansOfDeath + ";" + sHitLoc + "\n");
Onkill:

logPrint("K;" + lpselfguid + ";" + lpselfnum + ";" + lpselfteam + ";" + lpselfname + ";" + lpattackguid + ";" + lpattacknum + ";" + lpattackerteam + ";" + lpattackname + ";" + sWeapon + ";" + iDamage + ";" + sMeansOfDeath + ";" + sHitLoc + "\n");
(note: in both ondamage/onkill self is the victim
deathmatch onwingame:

logPrint("W;;" + guid + ";" + name + "\n");
team deathmatch onwin/onlosegame

logPrint("W;" + winningteam + winners + "\n");
logPrint("L;" + losingteam + losers + "\n");
in which the losers/winners are formatted as following:


if((isDefined(player.pers["team"])) && (player.pers["team"] == winningteam))
winners = (winners + ";" + lpGuid + ";" + player.name);
else if((isDefined(player.pers["team"])) && (player.pers["team"] == losingteam))
losers = (losers + ";" + lpGuid + ";" + player.name);
sd onbombplanted:

logPrint("A;" + lpselfguid + ";" + lpselfnum + ";" + other.pers["team"] + ";" + other.name + ";" + "bomb_plant" + "\n");
sd onbombdefused:

logPrint("A;" + lpselfguid + ";" + lpselfnum + ";" + other.pers["team"] + ";" + other.name + ";" + "bomb_defuse" + "\n");

I dont see anything in the source code for ctf or hq related gametypes so it might be impossible to catch those events by just looking at the logs

kung foo man
24th September 2015, 13:27
You can also just look how B3 does it, also I made a small B3 tutorial some time ago: http://killtube.org/showthread.php?1259-Tutorial-B3-Simple-and-Easy-Command-Adding!

CaptainSlow
24th September 2015, 16:04
Many many thanks for all the replies! It's good to see that the COD2/4 community is still alive.
I have enough information for now, many thanks!

CaptainSlow
1st October 2015, 16:13
I'm currently trying to analyze why Statsgen2 reports that 2 players have been teamkilling each other with a sniper rifle, which should be impossible since FF is off on our COD4 servers.

The gametype was sabotage (on COD4) and in in the serverlog, I find the following lines:



39:51 K;0000000046b1d170fcea01807b71cdda;7;;Nad3r77;0000 000046b1d170fcea01807b71cdda;6;;MrTALAL-77;m40a3_mp;147;MOD_HEAD_SHOT;head
40:37 K;0000000046b1d170fcea01807b71cdda;6;;MrTALAL-77;0000000046b1d170fcea01807b71cdda;7;;Nad3r77;m40 a3_mp;107;MOD_RIFLE_BULLET;torso_lower


According to the posts above by IzNoGod and voron00 (tnx), the teams of both players are blank. Is that why Statsgen reports it as a teamkill?

Here's another interesting one:


90:17 D;00000000f36948fa19f10f4e4042b1e7;6;allies;DAVESS ON;0000000026d3972828f323e89cb9e561;7;axis;belzeba ss;concussion_grenade_mp;1;MOD_GRENADE_SPLASH;none
90:18 K;00000000f36948fa19f10f4e4042b1e7;6;;DAVESSON;000 0000026d3972828f323e89cb9e561;7;;belzebass;deserte agle_mp;44;MOD_HEAD_SHOT;head


In the first line the team is logged, second line and the team is empty again... Why and how is this possible?

kung foo man
1st October 2015, 17:59
There are some "bugs" in the system, e.g. you can through a grenade and switch fast to spectator. CoD won't save the old player team in the grenade entity, but will use the newest state, which is then "spectator" (empty string) I guess.

That would at least explain the MOD_GRENADE_SPLASH (just try it out to confirm), I don't know about the sniper kills, maybe some openscriptmenu bug/"hack", which spawns a player without select a team first (often seen in CoD2 at least).

Tally
1st October 2015, 18:29
I'm currently trying to analyze why Statsgen2 reports that 2 players have been teamkilling each other with a sniper rifle, which should be impossible since FF is off on our COD4 servers.

The gametype was sabotage (on COD4) and in in the serverlog, I find the following lines:



39:51 K;0000000046b1d170fcea01807b71cdda;7;;Nad3r77;0000 000046b1d170fcea01807b71cdda;6;;MrTALAL-77;m40a3_mp;147;MOD_HEAD_SHOT;head
40:37 K;0000000046b1d170fcea01807b71cdda;6;;MrTALAL-77;0000000046b1d170fcea01807b71cdda;7;;Nad3r77;m40 a3_mp;107;MOD_RIFLE_BULLET;torso_lower


According to the posts above by IzNoGod and voron00 (tnx), the teams of both players are blank. Is that why Statsgen reports it as a teamkill?

Here's another interesting one:


90:17 D;00000000f36948fa19f10f4e4042b1e7;6;allies;DAVESS ON;0000000026d3972828f323e89cb9e561;7;axis;belzeba ss;concussion_grenade_mp;1;MOD_GRENADE_SPLASH;none
90:18 K;00000000f36948fa19f10f4e4042b1e7;6;;DAVESSON;000 0000026d3972828f323e89cb9e561;7;;belzebass;deserte agle_mp;44;MOD_HEAD_SHOT;head


In the first line the team is logged, second line and the team is empty again... Why and how is this possible?


Looks like some players have switched teams. The logprint() will record it as a death (player suicide passes through the callback_playerKilled method), but no team will show because there is no logging method to store previous team vs new team.

CaptainSlow
4th October 2015, 01:55
Thanks guys. Well, nothing I can do about it. Too bad it messes up the stats (not that anyone looks at them besides me).

filthy_freak_
4th October 2015, 02:14
Thanks guys. Well, nothing I can do about it. Too bad it messes up the stats (not that anyone looks at them besides me).

It's easy to fix.



if(isDefined(lpattackerteam))
logPrint("K;" + lpselfguid + ";" + lpselfnum + ";" + lpselfteam + ";" + lpselfname + ";" + lpattackguid + ";" + lpattacknum + ";" + lpattackerteam + ";" + lpattackname + ";" + sWeapon + ";" + iDamage + ";" + sMeansOfDeath + ";" + sHitLoc + "\n");