[WIP] Event Map Generator

ryodoan

Resident Bum
Nov 2, 2007
409
117
FOOLED YOU!! hahahaha, all you all thought I was finally posting a MAP WIP, when instead this is a Mapping Utility WIP. :p

So, for a little bit now I have been looking for a new programming project, and been thinking about writing a utility to help all yall mappers.

Then, TheBladeRoden made up this amazing deathmap and I figured that this seems like a simple enough thing to automate.

So here is the...

Basic Premises


  • Every time there is an event on a Source server, the event gets added to a log in a fairly standard format:
    • L 04/19/2008 - 16:21:40: "Paul<46><STEAM_0:0:....><Red>" killed "R3dRuM.cdn<38><STEAM_0:....><Blue>" with "shotgun_primary" (attacker_position "-435 -1378 -679") (victim_position "-396 -1176 -679")
  • Using this data you can do some black voodoo magic and end up with what TheBladeRoden has in his thread.
Things I need to decide and or learn still:

  • What events do I want to track, how to parse each event, and how to store each event.
    • Death Locations
    • Killer Locations
    • Killed by [Weapon] Locations
    • [Object] Built Locations
      • Sentry / Dispensor / Teleporters
    • [Object] Killed locations
      • So you can filter by all objects or just objects that actually killed people aka Sentry 1 killed so it shows up
  • I need to decide how I am going to track / retrieve / filter / whatever events.
  • What programming language do I want to use?
    • Leaning towards Java at the moment.
  • I need to do a program design.
So, this thread is going to be me tracking the progress, maybe showing example output, bitching about problems, and generally asking for ideas.
 
Last edited:

Vilepickle

Banned
Oct 25, 2007
372
199
Hope you get this working, would be interested in analyzing locations like this for gameplay.
 

DJive

Cake or Death?
aa
Dec 20, 2007
1,465
741
Yay!! WiP MAP!! by Prodoan! wait a second...

oh damnitity damn damn!.

=p
 

R3dRuM

L6: Sharp Member
Feb 13, 2008
303
19
"Paul<46><STEAM_0:0:....><Red>" killed "R3dRuM.cdn"

I hate you...


Anyway, will be using this in the future if you finish it!
 

drp

aa
Oct 25, 2007
2,273
2,628
ryodoan,
are you looking to make this as a web app, or a desktop app?
 

ryodoan

Resident Bum
Nov 2, 2007
409
117
ryodoan,
are you looking to make this as a web app, or a desktop app?

While I think it would make a cool web app, but the problem is I dont know any php nor do I really feel like teaching myself php at the moment.

Maybe after I write a basic version up in java I will look into creating php version.

So, in long, Web app would be cool and probably doable, I want this to be a fun project for me, so I am going to stick with regular, boring java.

In short, No.

However, I will be posting most of my thought process, and probably links to the source code in this thread. If I know other people will read my code then I can make some pretty detailed comments. So if anyone wants to port it over to PHP for me as I go along then that would be great.

However, as I am typing this the idea does keep sounding more interesting (making it as a php webapp) does anyone have any recommendations for an IDE to edit PHP in?
 
Last edited:

drp

aa
Oct 25, 2007
2,273
2,628
IDE?
you can edit php with notepad :confused1:
 

ryodoan

Resident Bum
Nov 2, 2007
409
117
Yes, you can also write C++ with notepad but it does not make it an enjoyable experience...
 

DJive

Cake or Death?
aa
Dec 20, 2007
1,465
741
i use adobe dreamweave for all my notpad needs =)
 

xgloryx

L1: Registered
Feb 26, 2008
21
2
However, as I am typing this the idea does keep sounding more interesting (making it as a php webapp) does anyone have any recommendations for an IDE to edit PHP in?

Zend Studio seems to be the gold standard for PHP IDE's, but it's ridiculously expensive. Aside from that I've only ever used a few others and never been impressed with any, which is why I just use a basic text editor with syntax highlighting (SubEThaEdit on X and Crimson Editor on Windows). Haven't looked at IDE's in years though, google turns up quite a few options I've never heard of.
 

dirtyminuth

L5: Dapper Member
Nov 5, 2007
221
15
Have you considered using SQL to store this (ultimately static) information?
 

ryodoan

Resident Bum
Nov 2, 2007
409
117
Have you considered using SQL to store this (ultimately static) information?

No because I dont think this is really a data storage application or an application that would need to access saved data really.

Here is the basic use case I have been tossing around in my mind.

  1. User opens the program.
  2. User browses to their server log file and clicks "Load"
  3. Program parses server log for data.
  4. User checks off what information they want displayed.
  5. User browses to their .vmf file.
  6. User clicks "Generate event mapping"
  7. Program creates a "<mapname>_events.vmf" file with the event data inserted into the .vmf file.
If it is made as an online web application I can see this being taken in a couple directions.

  1. Virtually the same as the downloadable program I discussed above, except instead of "1. opening the program" it would be to navigate to the page.
  2. A much more complex way would be to..
    • As a new log is created on the server, the web app picks this up and parses the data for the log and saves it into the database.
    • When a user navigates to the page they are presented with a list that looks like:
      "<date> - <time> - <Mapname>"
    • They select a map from the list and then are given the option to select information from a list of checkboxes as stated in my first post (killers / killed by weapon type, ect...)
    • Then I see 2 options:
      1. Upload the map .vmf, click "Generate" and it inserts the new data into the .vmf and provides it for download.
      2. Just click "Generate" and it allows you to download a .txt file containing the code you can manually insert in the .vmf file.
So, in all I still like the stand alone program idea the most, while the Online application with a database might be more elegant I think it is less portable and would require more work that I dont feel like doing.
 

xgloryx

L1: Registered
Feb 26, 2008
21
2
For your goal it sounds like a desktop app would be the better solution. A more expanded one like the webapp version you described would be pretty darn nifty if the data were actually stored and accessible by anyone. Given the coordinates it would take some fancy footwork and precise top-map views to do, but generating the heat maps "on the fly" would be certainly be possible.

It would be a pretty good way for mappers to find common elements that work, while having a legitimate "cool" factor for the general public.

But as you say, quite a bit of work :)
 

ryodoan

Resident Bum
Nov 2, 2007
409
117
Ok, I have been using TheBladeRodens' dom_complex_b5 log from April 19th as my test bed.

Filtering out all things that dont mention "position" we go from 1152 lines down to 733 which means there are 733 potential events we can map out.

So I am thinking of trying to make this program as dynamic as possible with as little hard coding as possible.

So it will parse through the server log on its own and try to pull out and categorize everything it can on its own with only limited intervention.

So, here is what I am thinking at the moment...

From looking at the logs there are eight basic events:

  • Team <color> triggered "pointcaptured" (cp #) (cpname) (# people) (player 1 name) (player 1 location) (player2 name) (player 2 location)
  • <user> triggered "captureblocked" (cp #) (cpname) (position)
  • <user> triggered "kill assist" against <user> (assist position) (attacker position) (victim position)
  • <user> killed <user> with <weapon> (attacker position) (victim position)
  • <user> committed suicide with <weapon> (attacker position)
  • <user> triggered "builtobject" (object) (position)
  • <user> triggered "killedobject" (object) (weapon) (owner) (attacker position)
  • <user> triggered "flagevent" (event type) (position)
Here is an example of each type of event w/ position, not in the same order.
Code:
L 04/19/2008 - 16:04:27: Team "Blue" triggered "pointcaptured" (cp "2") (cpname "The Offices") (numcappers "2") (player1 "shmitz<3><STEAM_0:1:5763384><Blue>") (position1 "-991 -506 -940") (player2 "Narkissus<17><STEAM_0:0:3441206><Blue>") (position2 "-792 -475 -933") 

L 04/19/2008 - 16:04:43: "Narkissus<17><STEAM_0:0:3441206><Blue>" killed "MrAlBobo<10><STEAM_0:0:16550084><Red>" with "tf_projectile_rocket" (attacker_position "-407 -594 -679") (victim_position "1039 -276 -654")

L 04/19/2008 - 16:05:35: "shmitz<3><STEAM_0:1:5763384><Blue>" triggered "captureblocked" (cp "3") (cpname "The Double Ramps") (position "467 -705 -940")

L 04/19/2008 - 16:05:59: "<eVa>l3eeron<18><STEAM_0:1:3807650><Blue>" triggered "kill assist" against "Velvet Fist, Iron Glove<2><STEAM_0:1:11222290><Red>" (assister_position "-203 -1535 -940") (attacker_position "-580 -1825 -940") (victim_position "-691 -1476 -933")

L 04/19/2008 - 16:06:55: "MrAlBobo<10><STEAM_0:0:16550084><Red>" committed suicide with "tf_projectile_pipe" (attacker_position "766 -1030 -940")

L 04/19/2008 - 16:07:33: "TheBladeRoden<11><STEAM_0:1:2099488><Red>" triggered "builtobject" (object "OBJ_DISPENSER") (position "-794 1009 -451")

L 04/19/2008 - 16:12:15: "Narkissus<17><STEAM_0:0:3441206><Blue>" triggered "killedobject" (object "OBJ_DISPENSER") (weapon "tf_projectile_rocket") (objectowner "TheBladeRoden<11><STEAM_0:1:2099488><Red>") (attacker_position "-1335 1257 -760")

L 04/19/2008 - 16:34:36: "vilepickle<27><STEAM_0:0:15734738><Red>" triggered "flagevent" (event "picked up") (position "-35 -2851 -1555")
So from this I am working on figuring out how I want to structure the code and how I want to store the parsed data.

I think I am going to leave this post with just info on the types of events, and leave design discussion for another time.
 
Last edited:

ryodoan

Resident Bum
Nov 2, 2007
409
117
Ok, updated my post with the flagevents, however in the process I thought of something.

Really what i would imagine people would be interested mainly from flag events would be locations where the flag got completely halted and it was sent back to base, However, I dont see a "Flag Event Type" that relates to the flag returning to the base.

There were several different flag "events", and I was looking for a "Flag Returned" event, but I dont see one.

So the basic form for a "flagevent" in the server log is:

Server Log said:
L 04/19/2008 - 16:34:36: "vilepickle<27><STEAM_0:0:15734738><Red>" triggered "flagevent" (event "picked up") (position "-35 -2851 -1555")

Breakdown of the quote:
<User><Team> flagevent (event type) (event location)

So for the (event type) section, here are the different types of flagevents.

  • picked up
    • Flag was picked up off the ground.
  • captured
    • Flag reached a capture point
  • defended
    • Triggered on the user who kills the flag bearer.
  • dropped
    • Triggered on the user who actually drops the flag.
Thinking about it I will be keeping track of each events time, so if I have a "dropped" flag event type, I can ask the user for the default flag return time. If no "picked up" flag event is thrown during the return time, then I can assume it was a returned flag.

The only potential problem I see with this is if someone is waiting back on the flag stand and immediately picks it up, if the timer is off by a fraction of a second then there could be issues, I think I could always error on the side of caution and just take 1 second off whatever time the user inputs.

On that note, isnt the default return time something like 60 seconds?
 

trainRiderJ

L5: Dapper Member
Mar 14, 2008
203
31
Thinking about it I will be keeping track of each events time, so if I have a "dropped" flag event type, I can ask the user for the default flag return time. If no "picked up" flag event is thrown during the return time, then I can assume it was a returned flag.

The only potential problem I see with this is if someone is waiting back on the flag stand and immediately picks it up, if the timer is off by a fraction of a second then there could be issues, I think I could always error on the side of caution and just take 1 second off whatever time the user inputs.

On that note, isnt the default return time something like 60 seconds?

Maybe this is more complicated than it needs to be? That is, if you see on the maps that 90% of your "flag defended" events occur in the same location, and you have a huge concentration of player deaths there as well, you know you have a gameplay issue.

In the same line of thinking, if there is a flag drop location that is so hard to get to that it almost always returns to base, this will also show up as a highly concentrated group of player deaths. I wouldn't even say that these are necessarily bad things, for instance some times people will try to take the flag out through a path that just doesn't make a lot of sense, or can only be accessed by rocket-jumping soldiers, etc.
 
Last edited:
Dec 25, 2007
566
439
However, I will be posting most of my thought process, and probably links to the source code in this thread. If I know other people will read my code then I can make some pretty detailed comments.

Surely this is crying out for using the new [map] developer blog!


In the same line of thinking, if there is a flag drop location that is so hard to get to that it almost always returns to base, this will also show up as a highly concentrated group of player deaths.
Not necessarily; in some maps, it's possible to drop the flag in a location where it is impossible to pick it up. Remember the 2fort bug where the flag would fall through the floor if dropped on the stairs in the ramp room?

But Ryodoan, I think a simple way of determining whether a flag was returned is just to compare the next pickup event for the same flag. If its position is very different at all, then the flag must have returned to base in between.