Deathmap Tutorial

TheBladeRoden

L420: High Member
Oct 26, 2007
491
168
Remember those map overviews Valve released that showed where in the map people died the most? Wish you too had the ability to make those things? Do you want to make cool death maps for strategic analysis like I do? Well now you can! And here's the trick!

First, you must file a requisition order to your local goods and products distribution officiztat
Or in other words, ask one of the server admins for a log of your map being played.

deathmaptut1.jpg


While you're waiting for your file, I recommend downloading Notepad++ for the purposes of this tutorial.
http://notepad-plus.sourceforge.net/uk/site.htm

Now, if you have your log, use Notepad ++ to open it and it should resemble something like this.

deathmaptut2.jpg


Now what we are looking for is the messages created when one guy kills another. As you can see in the pic, they contain vital information such as the attacker's and victim's respective coordinates.

deathmaptut3.jpg


Now somehow get "victim" without quotes into your clipboard. Go ahead. Select all the text with ctrl+A. Now go TextFX > TextFX Viz > Hide Lines Without (Clipboard) Text. Now select all agaim and return to that same submenu again and click Copy Visible Selection.

deathmaptut4.jpg


Create two new files and paste into each of them. The first file is going to be just for attackers and the other just for victims.

deathmaptut5.jpg


in the attacker file, make sure the cursor is at the start. Press ctrl+r. In the first box put in

Code:
L.*attacker_position

and in the second box put

Code:
entity
{
    "id" "3"
    "classname" "info_target"
    "angles" "0 0 0"
    "spawnflags" "0"
    "targetname" "attackers"
    "origin"
Make sure that Regular Expr is checked and hit Find. Once the proper selection is highlighted hit Replace Rest.

deathmaptut6.jpg


Now all you attacker coordinates should start looking like entities. Go to the top of the file and delete the stuff before "entity". Press ctrl+r again. In the first box put in

Code:
\).*$
and put in the second box

Code:
    editor
    {
        "color" "220 30 220"
        "visgroupid" "51"
        "visgroupshown" "1"
        "visgroupautoshown" "1"
        "logicalpos" "[0 500]"
    }
}
notice the extra line break. Use the Find and Replace Rest Functions again. Yay, now it should resemble a list of entities in the end! The attacker's coordinates have been made into a bunch of info_targets.

deathmaptut7.jpg


Now go into the tab for victims. Once again using the Find/Replace dialog, put in the first box

Code:
L.*victim_position
and in the second box

Code:
entity
{
    "id" "26"
    "classname" "gibshooter"
    "angles" "0 0 0"
    "delay" "0"
    "gibangles" "0 0 0"
    "gibanglevelocity" "0"
    "m_flGibLife" "4"
    "m_flVariance" "0.15"
    "m_flVelocity" "200"
    "m_iGibs" "3"
    "spawnflags" "0"
    "targetname" "victims"
    "origin"
Do that replacement. Now if you find some lines don't get converted, bring your cursor back to the start and do the find/replace rest function once again. And also delete the junk before the first entity.

Now for another replacement, in the first box put

Code:
\)
and in the second box put

Code:
    editor
    {
        "color" "220 30 220"
        "visgroupid" "52"
        "visgroupshown" "1"
        "visgroupautoshown" "1"
        "logicalpos" "[0 500]"
    }
}
Find and replace until your doc looks like this

deathmaptut8.jpg


Now open your map in Hammer, save a copy named mymapkillersanddeath.vmf with all the extra junk besides basic geometry deleted. Now open that vmf in notepad++.

In the visgroups section, put in two new visgroups

Code:
visgroup
    {
        "name" "attackers"
        "visgroupid" "51"
        "color" "0 255 0"
    }
    visgroup
    {
        "name" "victims"
        "visgroupid" "52"
        "color" "255 0 0"
    }
deathmaptut9.jpg


Scroll down until you get to camera, put a little space above it, and paste in everything from your attackers and victims docs.

deathmaptut10.jpg


Save it and load the map in hammer.

deathmaptut11.jpg


Behold! Now your map is filled with little targets representing killers and little giblits representing killees!

deathmaptut12.jpg


And since these items are in their own visgroups, you could turn the 2D overhead virews into photoshop layers, do a little hues adjustment, overlay that onto your map overview, and boom, you have a death map!

complexdeathmap1_00M.jpg
 

Spike

L10: Glamorous Member
Feb 13, 2008
716
82
I'm not going to use it but l33t tutorial. You got skills man.
 

ryodoan

Resident Bum
Nov 2, 2007
409
117
Ok, I think I am going to look into writing a program that will automate the text portion, seems simple enough.
 

DJive

Cake or Death?
aa
Dec 20, 2007
1,465
741
If you do that Paul next step could be working it right into the website. IE upload a log and it will produce a downloadable .vmf =p

Amazing work Roden, i've said this in a different thread before but i was complaining that this would be the single most useful tool for mappers and Valve didn't make it available..

You just did, VERY impressive.
 

TheBladeRoden

L420: High Member
Oct 26, 2007
491
168
Ok, I think I am going to look into writing a program that will automate the text portion, seems simple enough.

Roden also humbly requests that you make check boxes for weapon type filters and buildings built.
 

MacNetron

L5: Dapper Member
Dec 12, 2007
203
47
That last request looks like a separate program like, for instance, FOoM Logalyzer.
But should not be too difficult, as everything is in the log.

Question: are the logs rotated and yes, how? After every map change? In that case, the server could generate death files after every map change...

ryodoan, give a shout if you really want to build a "death file generator". Would be a shame if we both would program the same stuff separately. Might be better to join forces.

Will take a quick look to see if I can make my local CVS-repository available to the outside world...
 

dirtyminuth

L5: Dapper Member
Nov 5, 2007
221
15
This could emerge as a superior analysis tool. Notable ways to view data:

* Sort deaths and kills by team.
* Time-lapse analysis.
* Sort by class activity.
* Sort by player activity.
* View CP / CTF events and possibly extract context of said events.

And of course, your standard flow / balance issues can be viewed. Now, if there was an automated way to extract a map overview that can be overlayed with non Hammer output, we'd be golden.

Either Jive or I can handle your log requests. There doesn't appear to be any sensitive data in the logs; the worst I can think of are SteamIDs, but you can 'status' those in game anyways.
 

DJive

Cake or Death?
aa
Dec 20, 2007
1,465
741
Either Jive or I can handle your log requests. There doesn't appear to be any sensitive data in the logs; the worst I can think of are SteamIDs, but you can 'status' those in game anyways.

Ya after looking into it SteamID's are harmless. the log will mention Rcon but not put up the password which is good =)
 

ryodoan

Resident Bum
Nov 2, 2007
409
117
Yeah, I looked over Psychostats and I think that what would be nice to have is something simple that any mapper can use.

Psychostats is really cool, but it takes a bit of know-how to get set up and working correctly, not to mention access to a webserver (personal, or otherwise)
 

VeryBad

L1: Registered
May 25, 2008
4
1
As someone who is just starting to learn to map, I feel the Heat Maps do not provide all the info needed. All it seems to show is the most chosen place to die. Like ctf_2fort, the main 2 doors are very hot, but I wouldn't say it's a choke point. Also there is no feeling of what killed people. So you cannot infer if say a demoman has some ungodly advantage that could be fixed by making it a bit harder to lob grenades or remotes to the death spot. Or if your map is just a sniper heaven. I think a tool showing attackers and victims with maybe a connecting line describing what method of dispatchment used would provide more valuable data. Also something that comes to mind is the whole issue of engineer buildings and how well they work. Say showing how many kills a Sentry gets before being destroyed, if it was destroyed. Possibly showing how much healing the engineer did to it would be nice too, so you can find those spots where the engineer is ridiculously too safe to repair his toy. The last one is just an idea, not sure it can be deduced from logs. Again these are just some thoughts from someone who is just starting to map.
 

ColdFire

L2: Junior Member
Mar 11, 2008
87
15
Heatmaps by weapons (including sentries) should be available in psychostats later. I know one of the devs is working on many improvements to heatmaps.
About healing, it doesn't appear in logs so unless someone makes a server plugin which adds this info in the logs, it'll be impossible.
 

ColdFire

L2: Junior Member
Mar 11, 2008
87
15
Yeah, I looked over Psychostats and I think that what would be nice to have is something simple that any mapper can use.

Psychostats is really cool, but it takes a bit of know-how to get set up and working correctly, not to mention access to a webserver (personal, or otherwise)

Did you looked at Psychostats 3.1? There's an installer for the web part, it's really easy. All you have to do is have a mysql database, a database user, and put that info in 2 files before going to http://your_psychostats/install
 

ryodoan

Resident Bum
Nov 2, 2007
409
117
However, I was reading on the install manual that while, yes the main install is relatively easy, if you want the heatmaps you need to install several non-standard perl libraries. However they are outdated perl libraries that are no longer provided (as far as I can tell) in the latest perl download. I searched through the perl package manager and could not find the libraries they were talking about.