Combat analytics
Combat analytics
I've been helping Noit with some testing of the Shattered Paradise mod and I had the idea to see which units are dangerous to who. Turns out that all it takes is changing 2 lines in the source code of OpenRA and you can get that info dumped into a debug file and later analyzed but another python program I wrote.
This allowed me to analyze a replay and get results like this (dots are inserted to prevent clutter):
--- THREE TOP EASY KILLS FOR EACH ---
dino: ('harv', 1340),('mutfiend', 827),('muradr', 520)
visc_lrg: ('cyborg', 450),('worker', 120),('mupowr', 60)
.
.
.
cyborg: ('marauder', 2023),('mutfiend', 1580),('gacnst', 1505)
.
.
.
From this one you can see that cyborgs were the most effective against marauders and against fiends, and that dinos were mostly useful for attacing harvs.
Is anyone interested in something like this for OpenRA? I'd gladly send my code to everyone who is interested, it is really only a few lines.
This allowed me to analyze a replay and get results like this (dots are inserted to prevent clutter):
--- THREE TOP EASY KILLS FOR EACH ---
dino: ('harv', 1340),('mutfiend', 827),('muradr', 520)
visc_lrg: ('cyborg', 450),('worker', 120),('mupowr', 60)
.
.
.
cyborg: ('marauder', 2023),('mutfiend', 1580),('gacnst', 1505)
.
.
.
From this one you can see that cyborgs were the most effective against marauders and against fiends, and that dinos were mostly useful for attacing harvs.
Is anyone interested in something like this for OpenRA? I'd gladly send my code to everyone who is interested, it is really only a few lines.
- Murto the Ray
- Posts: 487
- Joined: Mon Nov 10, 2014 4:34 pm
Can a lua script dump lots of data to a file? The whole idea is that we don't know in advance what to analyze, so we just record every time something damages something and then run an analyzer program on the report. What I showed is the output of the analyzer, but every damaging hit is saved.
Also, the nice thing is that you can run this on replays to see how things went in the game.
Also, the nice thing is that you can run this on replays to see how things went in the game.
- Graion Dilach
- Posts: 277
- Joined: Fri May 15, 2015 5:57 pm
-
- Posts: 37
- Joined: Thu May 21, 2015 10:58 pm
The Lua sandbox has been designed to prevent maps from accessing IO and other system utilities, so no.lucassss wrote: ↑Can a lua script dump lots of data to a file? The whole idea is that we don't know in advance what to analyze, so we just record every time something damages something and then run an analyzer program on the report. What I showed is the output of the analyzer, but every damaging hit is saved.
Also, the nice thing is that you can run this on replays to see how things went in the game.
However, a custom patch can be made for each release in order to add non-standard client-side features, if it doesn't get merged upstream. This could be done in two ways: a custom build or a mod.
- Murto the Ray
- Posts: 487
- Joined: Mon Nov 10, 2014 4:34 pm
Actually, if you use print it will output into the lua log.Canavusbis wrote: ↑The Lua sandbox has been designed to prevent maps from accessing IO and other system utilities, so no.lucassss wrote: ↑Can a lua script dump lots of data to a file? The whole idea is that we don't know in advance what to analyze, so we just record every time something damages something and then run an analyzer program on the report. What I showed is the output of the analyzer, but every damaging hit is saved.
Also, the nice thing is that you can run this on replays to see how things went in the game.
However, a custom patch can be made for each release in order to add non-standard client-side features, if it doesn't get merged upstream. This could be done in two ways: a custom build or a mod.
http://pastebin.com/FCXPcbaW - Patch to modify OpenRA
http://pastebin.com/7iNXuuXB - Utility to analyze debug.log (I use command line '<' to make it input)
The whole idea to extend the analysis utility as much as we want. For example, the next thing I want to add is information about damage effectiveness. I.e. how many times did a unit target an armor class that wasn't its best class.
http://pastebin.com/7iNXuuXB - Utility to analyze debug.log (I use command line '<' to make it input)
The whole idea to extend the analysis utility as much as we want. For example, the next thing I want to add is information about damage effectiveness. I.e. how many times did a unit target an armor class that wasn't its best class.
The metadata header should be easy to parse. That is what sites like https://www.gamereplays.org/openra/ do. However the actual gameplay, which is just a binary stream, is better parsed by the game functions itself.