From 4e482b0ff803e2f0c8c1b19bb3b1ee5b524176ac Mon Sep 17 00:00:00 2001 From: F2 <916098+F2@users.noreply.github.com> Date: Wed, 16 Jul 2025 16:04:39 +0200 Subject: [PATCH 1/9] Added some logs --- README.md | 4 +++ logs-spec.md | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 logs-spec.md diff --git a/README.md b/README.md index 7a0f37f..aadc1ba 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,10 @@ If you would like to contribute, please follow this process: 3. Test your changes 4. Create a Pull Request describing your changes and how you have tested it +## For developers: Custom log lines + +See [this overview](./logs-spec.md) of all custom log lines being generated by my plugins. + ## Acknowledgements **Lange** for making `soap_tf2dm` and mgemod, from which I borrowed code\ diff --git a/logs-spec.md b/logs-spec.md new file mode 100644 index 0000000..ba6d20c --- /dev/null +++ b/logs-spec.md @@ -0,0 +1,84 @@ +# TF2 Logs Spec 3.0 + +This is the spritual successor to [Logs.tf Spec 2.0](https://github.com/alevoska/logstf-spec). + +## General terminology + +When demonstrating a log line, we first write the general format, and then an example: + + Format + + Examples (unless Format has no placeholders) + +When we write ``, `` or similar, they refer to this format: + + "Nickname" + + "F2<3><[U:1:1234]>" + +## Pauses + +When someone pauses the game: + + World triggered "Game_Paused" + triggered "matchpause" + + World triggered "Game_Paused" + "F2<3><[U:1:1234]>" triggered "matchpause" + +When someone unpauses the game: + + World triggered "Game_Unpaused" + triggered "matchunpause" + World triggered "Pause_Length" (seconds "%.2f") + + World triggered "Game_Unpaused" + "F2<3><[U:1:1234]>" triggered "matchunpause" + World triggered "Pause_Length" (seconds "14.25") + +The only reason we are logging the `World triggered` logs are for backwards compatibility, but these can be ignored. + +## Heals + +When a player heals someone: + + triggered "healed" against (healing "%d") (airshot "1") (height "%i") + + "F2<3><[U:1:1234]>" triggered "healed" against "Extremer<4><[U:1:1337]>" (healing "20") (airshot "1") (height "54") + +The following properties are optional: `airshot`, `height` +These are only logged if the healing was caused by an airshot (e.g. crusader's crossbow). + +## Spawning + +When a player spawns: + + spawned as + + "F2<3><[U:1:1234]>" spawned as "medic" + +Possible values for class: +- `"scout"` +- `"sniper"` +- `"soldier"` +- `"demoman"` +- `"medic"` +- `"heavyweapons"` +- `"pyro"` +- `"spy"` +- `"engineer"` + +## Ubercharges + +When a player pops their ubercharge: + + triggered "chargedeployed" (medigun ) + + "F2<3><[U:1:1234]>" triggered "chargedeployed" (medigun "medigun") + +The medigun name can be: +- `"medigun"` +- `"kritzkrieg"` +- `"quickfix"` +- `"vaccinator"` +- `"unknown"` (it could not be detected) \ No newline at end of file From edce390220b0811de3935647821c7104e0903916 Mon Sep 17 00:00:00 2001 From: F2 <916098+F2@users.noreply.github.com> Date: Thu, 17 Jul 2025 13:00:22 +0200 Subject: [PATCH 2/9] Added all logs from supstats2 --- logs-spec.md | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 69 insertions(+), 2 deletions(-) diff --git a/logs-spec.md b/logs-spec.md index ba6d20c..ad27a17 100644 --- a/logs-spec.md +++ b/logs-spec.md @@ -76,9 +76,76 @@ When a player pops their ubercharge: "F2<3><[U:1:1234]>" triggered "chargedeployed" (medigun "medigun") -The medigun name can be: +The \ can be: - `"medigun"` - `"kritzkrieg"` - `"quickfix"` - `"vaccinator"` -- `"unknown"` (it could not be detected) \ No newline at end of file +- `"unknown"` — it could not be detected + +## Item Pickup + +When a player picks up an item: + + picked up item (healing "%i") + + "F2<3><[U:1:1234]>" picked up item "medkit_medium" (healing "%i") + +The following properties are optional: `healing` + +The \ can be: +- `"medkit_small"` +- `"medkit_medium"` +- `"medkit_large"` +- `"ammopack_small"` +- `"ammopack_medium"` +- `"ammopack_large"` +- `"tf_ammo_pack"` — these are medium sized ammo packs dropped by players + +## Damage + +When a player deals damage to another player: + + triggered "damage" against (damage "%i") (realdamage "%i") (weapon "%s") (healing "%i") (crit "%s") (airshot "1") (height "%i") (headshot "1") + + "F2<3><[U:1:1234]>" triggered "damage" against "dunc<8><[U:1:420]>" (damage "69") (realdamage "31") (weapon "quake_rl") (healing "20") (crit "mini") (airshot "1") (height "33") (headshot "1") + +It has the following properties: +- `damage`: The amount of damage theoretically dealt (say, _450_ for a fully charged headshot) +- `realdamage`: _(Optional)_ The amount of damage actually dealt (say, _125_ for a fully charged headshot on a scout) + If not present: The "real damage" was the same as "damage". +- `weapon`: The weapon used to deal the damage, typically extracted from items_game.txt +- `healing`: _(Optional)_ The amount of self-healing gained from dealing the damage (e.g. using Black Box). + If not present: Healing was zero. +- `crit`: _(Optional)_ Can either be `mini` or `crit`. + If not present: It was not a crit shot. +- `airshot`: _(Optional)_ If it is `1`, it was an airshot. + If not present: It was not an airshot. +- `height`: _(Optional)_ The distance above ground of the victim when the airshot happened. + If not present: It was not an airshot. +- `headshot`: _(Optional)_ If it is `1`, it was a headshot. + If not present: It was not a headshot. + +Note, self damage is not logged. + +## Accuracy + +When a player shoots a weapon: + + triggered "shot_fired" (weapon "%s") + + "F2<3><[U:1:1234]>" triggered "shot_fired" (weapon "scattergun") + +When the shot actually hits someone: + + triggered "shot_hit" (weapon "%s") + + "F2<3><[U:1:1234]>" triggered "shot_hit" (weapon "scattergun") + +Note that `shot_hit` will only be logged once per `shot_fired`, even if the shot hits multiple targets. This makes it possible to calculate the accuracy by using the simple formula: $$\text{Accuracy} = \frac{\text{count(shot\_hit)}}{\text{count(shot\_fired)}} \times 100\%$$ + +For Crusader's Crossbow, friendly hits will also be logged with `shot_hit`. + +Destroying a sticky with a hitscan weapon will also be logged with `shot_hit` (although it might not be 100% accurate). + + From 13d2b7ac3a6e805bd822c9642e0af9eba322ad7a Mon Sep 17 00:00:00 2001 From: F2 <916098+F2@users.noreply.github.com> Date: Thu, 17 Jul 2025 16:50:54 +0200 Subject: [PATCH 3/9] Added some of the medicstats logs --- logs-spec.md | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/logs-spec.md b/logs-spec.md index ad27a17..f4f7365 100644 --- a/logs-spec.md +++ b/logs-spec.md @@ -35,7 +35,7 @@ When someone unpauses the game: World triggered "Game_Unpaused" "F2<3><[U:1:1234]>" triggered "matchunpause" World triggered "Pause_Length" (seconds "14.25") - + The only reason we are logging the `World triggered` logs are for backwards compatibility, but these can be ignored. ## Heals @@ -58,6 +58,7 @@ When a player spawns: "F2<3><[U:1:1234]>" spawned as "medic" Possible values for class: + - `"scout"` - `"sniper"` - `"soldier"` @@ -77,6 +78,7 @@ When a player pops their ubercharge: "F2<3><[U:1:1234]>" triggered "chargedeployed" (medigun "medigun") The \ can be: + - `"medigun"` - `"kritzkrieg"` - `"quickfix"` @@ -94,6 +96,7 @@ When a player picks up an item: The following properties are optional: `healing` The \ can be: + - `"medkit_small"` - `"medkit_medium"` - `"medkit_large"` @@ -111,6 +114,7 @@ When a player deals damage to another player: "F2<3><[U:1:1234]>" triggered "damage" against "dunc<8><[U:1:420]>" (damage "69") (realdamage "31") (weapon "quake_rl") (healing "20") (crit "mini") (airshot "1") (height "33") (headshot "1") It has the following properties: + - `damage`: The amount of damage theoretically dealt (say, _450_ for a fully charged headshot) - `realdamage`: _(Optional)_ The amount of damage actually dealt (say, _125_ for a fully charged headshot on a scout) If not present: The "real damage" was the same as "damage". @@ -148,4 +152,38 @@ For Crusader's Crossbow, friendly hits will also be logged with `shot_hit`. Destroying a sticky with a hitscan weapon will also be logged with `shot_hit` (although it might not be 100% accurate). +## Medic Stats + +These logs are probably quite bugged for vaccinator. For example, "charge ready" is only logged at 100%, but with vaccinator you can use charge at 25%. + +### First heal after spawn + +When a medic heals for the first time after having spawned: + + triggered "first_heal_after_spawn" (time "%.1f") + + "F2<3><[U:1:1234]>" triggered "first_heal_after_spawn" (time "1.2") + +It is not triggered in the beginning of the round. + +It is also not triggered if you switch spawns. + +### Ubercharge is ready + +When a medic reaches 100% charge: + + triggered "chargeready" + + "F2<3><[U:1:1234]>" triggered "chargeready" + +### Medic deaths + +When a medic dies, we log their uber percentage: + + triggered "medic_death_ex" (uberpct "%i") + + "F2<3><[U:1:1234]>" triggered "medic_death_ex" (uberpct "13") + +It is called `medic_death_ex` because there already exists another log line called `medic_death`. +The uber percentage is rounded down, so if they had 99.9% it will be logged as "99". From ec9849b572e78d6375710ee71d7d6c32800a0df6 Mon Sep 17 00:00:00 2001 From: F2 <916098+F2@users.noreply.github.com> Date: Thu, 17 Jul 2025 18:36:43 +0200 Subject: [PATCH 4/9] Added the rest of the medicstats logs --- logs-spec.md | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/logs-spec.md b/logs-spec.md index f4f7365..a7cc1a3 100644 --- a/logs-spec.md +++ b/logs-spec.md @@ -36,7 +36,7 @@ When someone unpauses the game: "F2<3><[U:1:1234]>" triggered "matchunpause" World triggered "Pause_Length" (seconds "14.25") -The only reason we are logging the `World triggered` logs are for backwards compatibility, but these can be ignored. +The only reason we are logging the `World triggered` logs are for backwards compatibility, so these can be ignored. ## Heals @@ -154,13 +154,13 @@ Destroying a sticky with a hitscan weapon will also be logged with `shot_hit` (a ## Medic Stats -These logs are probably quite bugged for vaccinator. For example, "charge ready" is only logged at 100%, but with vaccinator you can use charge at 25%. +**A note on vaccinator:** These logs are very bugged for vaccinator. For example, "charge ready" is only logged at 100%, but with vaccinator you can use charge at 25%. And it does not make sense talking about "uber advantage lost" when one team has uber and the other vaccinator. So, if one team uses vaccinator, think carefully about how you use these logs. ### First heal after spawn When a medic heals for the first time after having spawned: - triggered "first_heal_after_spawn" (time "%.1f") + triggered "first_heal_after_spawn" (time "%.1f") "F2<3><[U:1:1234]>" triggered "first_heal_after_spawn" (time "1.2") @@ -172,7 +172,7 @@ It is also not triggered if you switch spawns. When a medic reaches 100% charge: - triggered "chargeready" + triggered "chargeready" "F2<3><[U:1:1234]>" triggered "chargeready" @@ -187,3 +187,31 @@ When a medic dies, we log their uber percentage: It is called `medic_death_ex` because there already exists another log line called `medic_death`. The uber percentage is rounded down, so if they had 99.9% it will be logged as "99". + +### Empty uber + +When a medic's charge changes to zero, typically upon spawning or after using their charge: + + triggered "empty_uber" + + "F2<3><[U:1:1234]>" triggered "empty_uber" + +### Charge ended + +When a medic's charge reached 0% after using a charge: + + triggered "chargeended" (duration "%.1f") + + "F2<3><[U:1:1234]>" triggered "chargeended" (duration "6.4") + +The duration is in seconds. + +### Lost uber advantage + +When one team gets uber significantly before the other team, but does not use it before the other team got theirs: + + triggered "lost_uber_advantage" (time "%i") + + "F2<3><[U:1:1234]>" triggered "lost_uber_advantage" (time "14") + +Alternatively, this could also be computed by looking at the "chargeready" and "chargedeployed" logs from both teams. \ No newline at end of file From 1e25c368457610975ebce879743406d44370240a Mon Sep 17 00:00:00 2001 From: F2 <916098+F2@users.noreply.github.com> Date: Thu, 17 Jul 2025 18:39:18 +0200 Subject: [PATCH 5/9] Fixed underscore in LaTeX (maybe) --- logs-spec.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logs-spec.md b/logs-spec.md index a7cc1a3..9aa4f3c 100644 --- a/logs-spec.md +++ b/logs-spec.md @@ -146,7 +146,7 @@ When the shot actually hits someone: "F2<3><[U:1:1234]>" triggered "shot_hit" (weapon "scattergun") -Note that `shot_hit` will only be logged once per `shot_fired`, even if the shot hits multiple targets. This makes it possible to calculate the accuracy by using the simple formula: $$\text{Accuracy} = \frac{\text{count(shot\_hit)}}{\text{count(shot\_fired)}} \times 100\%$$ +Note that `shot_hit` will only be logged once per `shot_fired`, even if the shot hits multiple targets. This makes it possible to calculate the accuracy by using the simple formula: $$\text{Accuracy} = \frac{\text{count(shot{\textunderscore}hit)}}{\text{count(shot{\textunderscore}fired)}} \times 100\%$$ For Crusader's Crossbow, friendly hits will also be logged with `shot_hit`. From d12d5d83f6ecd4e06b5716c0ab8ac68328fe8ce9 Mon Sep 17 00:00:00 2001 From: F2 <916098+F2@users.noreply.github.com> Date: Thu, 17 Jul 2025 18:41:46 +0200 Subject: [PATCH 6/9] I lied --- logs-spec.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logs-spec.md b/logs-spec.md index 9aa4f3c..7dbf22f 100644 --- a/logs-spec.md +++ b/logs-spec.md @@ -146,7 +146,7 @@ When the shot actually hits someone: "F2<3><[U:1:1234]>" triggered "shot_hit" (weapon "scattergun") -Note that `shot_hit` will only be logged once per `shot_fired`, even if the shot hits multiple targets. This makes it possible to calculate the accuracy by using the simple formula: $$\text{Accuracy} = \frac{\text{count(shot{\textunderscore}hit)}}{\text{count(shot{\textunderscore}fired)}} \times 100\%$$ +Note that `shot_hit` will only be logged once per `shot_fired`, even if the shot hits multiple targets. This makes it possible to calculate the accuracy by using the simple formula: $$\text{Accuracy} = \frac{\text{count(shot}\_\text{hit)}}{\text{count(shot}\_\text{fired)}} \times 100\%$$ For Crusader's Crossbow, friendly hits will also be logged with `shot_hit`. From 3ab22deb0623fa4ab5f2675fd577bae24eabee16 Mon Sep 17 00:00:00 2001 From: "Anders C." <916098+F2@users.noreply.github.com> Date: Thu, 17 Jul 2025 18:46:42 +0200 Subject: [PATCH 7/9] Fixed accuracy formula --- logs-spec.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/logs-spec.md b/logs-spec.md index 7dbf22f..870381f 100644 --- a/logs-spec.md +++ b/logs-spec.md @@ -146,7 +146,9 @@ When the shot actually hits someone: "F2<3><[U:1:1234]>" triggered "shot_hit" (weapon "scattergun") -Note that `shot_hit` will only be logged once per `shot_fired`, even if the shot hits multiple targets. This makes it possible to calculate the accuracy by using the simple formula: $$\text{Accuracy} = \frac{\text{count(shot}\_\text{hit)}}{\text{count(shot}\_\text{fired)}} \times 100\%$$ +Note that `shot_hit` will only be logged once per `shot_fired`, even if the shot hits multiple targets. This makes it possible to calculate the accuracy by using this simple formula: + +$$\text{Accuracy} = \frac{\text{count(shot\\_hit)}}{\text{count(shot\\_fired)}} \times 100\\%$$ For Crusader's Crossbow, friendly hits will also be logged with `shot_hit`. @@ -214,4 +216,4 @@ When one team gets uber significantly before the other team, but does not use it "F2<3><[U:1:1234]>" triggered "lost_uber_advantage" (time "14") -Alternatively, this could also be computed by looking at the "chargeready" and "chargedeployed" logs from both teams. \ No newline at end of file +Alternatively, this could also be computed by looking at the "chargeready" and "chargedeployed" logs from both teams. From 74c2841ec02079d150679a7976221393e9f97ef6 Mon Sep 17 00:00:00 2001 From: F2 <916098+F2@users.noreply.github.com> Date: Thu, 17 Jul 2025 18:55:53 +0200 Subject: [PATCH 8/9] Minor clarifications --- .vscode/settings.json | 5 ++++- logs-spec.md | 28 ++++++++++++++++------------ 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 977e96c..a660808 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -101,5 +101,8 @@ "TabWidth: ${TabSize}", "UseTab: ForContinuationAndIndentation", "CommentPragmas: '^#define|#tryinclude'" - ] + ], + "[markdown]": { + "editor.formatOnSave": true + } } diff --git a/logs-spec.md b/logs-spec.md index 870381f..67d09c9 100644 --- a/logs-spec.md +++ b/logs-spec.md @@ -2,7 +2,7 @@ This is the spritual successor to [Logs.tf Spec 2.0](https://github.com/alevoska/logstf-spec). -## General terminology +# General terminology When demonstrating a log line, we first write the general format, and then an example: @@ -16,6 +16,8 @@ When we write ``, `` or similar, they refer to this format: "F2<3><[U:1:1234]>" +# Supplemental logs + ## Pauses When someone pauses the game: @@ -49,6 +51,8 @@ When a player heals someone: The following properties are optional: `airshot`, `height` These are only logged if the healing was caused by an airshot (e.g. crusader's crossbow). +Note, a healer is not necessarily medic. For example, an engineer can heal with a dispenser. + ## Spawning When a player spawns: @@ -146,19 +150,19 @@ When the shot actually hits someone: "F2<3><[U:1:1234]>" triggered "shot_hit" (weapon "scattergun") -Note that `shot_hit` will only be logged once per `shot_fired`, even if the shot hits multiple targets. This makes it possible to calculate the accuracy by using this simple formula: +Note that `shot_hit` will only be logged once per `shot_fired`, even if the shot hits multiple targets. This makes it possible to calculate the accuracy by using this simple formula: $$\text{Accuracy} = \frac{\text{count(shot\\_hit)}}{\text{count(shot\\_fired)}} \times 100\\%$$ -For Crusader's Crossbow, friendly hits will also be logged with `shot_hit`. +For Crusader's Crossbow, friendly hits will be logged as `shot_hit`. -Destroying a sticky with a hitscan weapon will also be logged with `shot_hit` (although it might not be 100% accurate). +Destroying a sticky with a hitscan weapon will be logged as `shot_hit` (although it might not always be accurately detected). -## Medic Stats +# Medic Stats **A note on vaccinator:** These logs are very bugged for vaccinator. For example, "charge ready" is only logged at 100%, but with vaccinator you can use charge at 25%. And it does not make sense talking about "uber advantage lost" when one team has uber and the other vaccinator. So, if one team uses vaccinator, think carefully about how you use these logs. -### First heal after spawn +## First heal after spawn When a medic heals for the first time after having spawned: @@ -166,11 +170,11 @@ When a medic heals for the first time after having spawned: "F2<3><[U:1:1234]>" triggered "first_heal_after_spawn" (time "1.2") -It is not triggered in the beginning of the round. +It is not triggered in the beginning of a round. It is also not triggered if you switch spawns. -### Ubercharge is ready +## Ubercharge is ready When a medic reaches 100% charge: @@ -178,7 +182,7 @@ When a medic reaches 100% charge: "F2<3><[U:1:1234]>" triggered "chargeready" -### Medic deaths +## Medic deaths When a medic dies, we log their uber percentage: @@ -190,7 +194,7 @@ It is called `medic_death_ex` because there already exists another log line call The uber percentage is rounded down, so if they had 99.9% it will be logged as "99". -### Empty uber +## Empty uber When a medic's charge changes to zero, typically upon spawning or after using their charge: @@ -198,7 +202,7 @@ When a medic's charge changes to zero, typically upon spawning or after using th "F2<3><[U:1:1234]>" triggered "empty_uber" -### Charge ended +## Charge ended When a medic's charge reached 0% after using a charge: @@ -208,7 +212,7 @@ When a medic's charge reached 0% after using a charge: The duration is in seconds. -### Lost uber advantage +## Lost uber advantage When one team gets uber significantly before the other team, but does not use it before the other team got theirs: From 26f27936e6495a33897ea8802e35af83c6a23c57 Mon Sep 17 00:00:00 2001 From: F2 <916098+F2@users.noreply.github.com> Date: Thu, 17 Jul 2025 18:59:57 +0200 Subject: [PATCH 9/9] More clarifications --- logs-spec.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/logs-spec.md b/logs-spec.md index 67d09c9..f6ba714 100644 --- a/logs-spec.md +++ b/logs-spec.md @@ -1,8 +1,8 @@ # TF2 Logs Spec 3.0 -This is the spritual successor to [Logs.tf Spec 2.0](https://github.com/alevoska/logstf-spec). +This document builds on [Logs.tf Spec 2.0](https://github.com/alevoska/logstf-spec) and describes all additional log lines beyond the standard ones. -# General terminology +## General terminology When demonstrating a log line, we first write the general format, and then an example: @@ -16,7 +16,7 @@ When we write ``, `` or similar, they refer to this format: "F2<3><[U:1:1234]>" -# Supplemental logs +# Supplemental logs (supstats2) ## Pauses @@ -158,7 +158,7 @@ For Crusader's Crossbow, friendly hits will be logged as `shot_hit`. Destroying a sticky with a hitscan weapon will be logged as `shot_hit` (although it might not always be accurately detected). -# Medic Stats +# Medic Stats (medicstats) **A note on vaccinator:** These logs are very bugged for vaccinator. For example, "charge ready" is only logged at 100%, but with vaccinator you can use charge at 25%. And it does not make sense talking about "uber advantage lost" when one team has uber and the other vaccinator. So, if one team uses vaccinator, think carefully about how you use these logs.