Jump to content

Need tutorial for Server Stats


Recommended Posts

I need a tutorial to implement Stats for server like Burning Sky

 

http://stats.burning-skies.com/?season=

 

http://stats.burning-skies.com/en/planes-ranking.html?season=

 

THX

To achieve the stat page of burning skies I think they write lot of goals in mission editor, and lot of custom code.

The quickest way to implement a basic statistic webpage, is read and parse the LUA TABLE provided by SLMOD.

FlighRIG => CPU: RyZen 5900x | RAM: 64GB Corsair 3000Mhz | GPU: nVIDIA RTX 4090 FE | OS Storage: SSD NVMe Samsung 850 Pro 512GB, DCS Storage: SSD NVMe Sabrent 1TB | Device: Multipurpose-UFC, VirPil T-50, TM WARTHOG Throttle, TrackHat, MFD Cougar with screen.

Our Servers => [ITA] Banshee | Krasnodar - PvE | PersianConquest PvE Live Map&Stats | Syria Liberation PvE Conquest

Support us on twitch subscribing with amazon prime account linked, it's free!

Link to comment
Share on other sites

  • 3 weeks later...

It's a LOT of work - mostly because the events logged in DCS, even with SLmod, omit all sorts of information. Rebuilding it takes a lot of effort. Here's my effort for the 104th Phoenix server (work still in progress):

http://dynamicscore.org

 

 

I based on SLMod and then wrote a bunch of custom code running on an Amazon EC2 server (with a Postgresql database).

 

 

However, once you have stats like this you can do Bomb Damage Assessment, and then link it with a mission generator and Order of Battle database - for a full dynamic campaign (which will be my next trick now I have some free time for modding).


Edited by Moa
Link to comment
Share on other sites

Depends entirely on how you want to generate the stats.

 

 

Basic raw numbers can be grabbed from the gameGUI envirnment with the onGameEvent callback.

 


function onGameEvent(eventName,arg1,arg2,arg3,arg4)
   --"friendly_fire", playerID, weaponName, victimPlayerID
   --"mission_end", winner, msg
   --"kill", killerPlayerID, killerUnitType, killerSide, victimPlayerID, victimUnitType, victimSide, weaponName
   --"self_kill", playerID
   --"change_slot", playerID, slotID, prevSide
   --"connect", playerID, name
   --"disconnect", playerID, name, playerSide, reason_code
   --"crash", playerID, unit_missionID
   --"eject", playerID, unit_missionID
   --"takeoff", playerID, unit_missionID, airdromeName
   --"landing", playerID, unit_missionID, airdromeName
   --"pilot_death", playerID, unit_missionID
end

 

With that alone you can get some pretty basic statistics out of it.

 

SLMOD's stats tap into the mission scripting engine's events and other functionality which lets it track fight time (literally running Unit.inAir() every 10 seconds on each aircraft), hits (which is a mega PITA to attribute kills for), and even gun munitions used. Drawbacks being it has to modify the game to have access to it and the way it writes the stats file can get pretty large if there are a lot of players and the mission runs for a while.

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

@Grimes: if you are ever interested in the mods I made to SLmod for 104th stats just give me a bell. Thanks for your work in maintaining SLmod.

 

Well I see what you've done on that website, most impressive. Best guess is you ditched the approximate categorization of all objects and am saving everything now correct? Does it still have any sort of in game display with -stats me? Looks like it has functionality of some kind to display multiple servers on there.

 

 

I kind of have a love/hate relationship with slmod. It is unwieldy and has excessive scope for what it is needed/used for now a days. Each time I think of adding some new feature to slmod I just kinda groan and prefer working on something else instead.

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

Well I see what you've done on that website, most impressive. Best guess is you ditched the approximate categorization of all objects and am saving everything now correct? Does it still have any sort of in game display with -stats me? Looks like it has functionality of some kind to display multiple servers on there.

 

 

Yes, I store everything I can, including some additional information (like position and velocity of each unit for each event which has it - which I may use later). It's still a work in progress. Slmod works as it did before, I just extended Slmod to write to a separate log, which I transfer to a Postgres database and then have a Java/Groovy REST webservice read that and display using HTML/JS/CSS.

 

 

 

I kind of have a love/hate relationship with slmod. It is unwieldy and has excessive scope for what it is needed/used for now a days. Each time I think of adding some new feature to slmod I just kinda groan and prefer working on something else instead.

 

 

I know *exactly* what you mean. I too have a rocky relationship with Slmod, although I'm very, very grateful to Speed and yourself for providing a stable basis for doing other things with, like detailed pilot stats. So thank you very much for the times you do grit your teeth and fix it up.

 

 

I very much prefer working outside LUA. One day I may add socket export to a service where a more robust language can be used. As I mentioned, once i've finished tarting the stats page up I'll be using it as Battle Damage Assessment for mission generation, and close the loop dynamic-campaign wise (I know ED are working on this, but it always good to have choices and healthy co-opertition).

 

 

Thanks again for your work on SLmod.

 

 

ps. Slmod works fine with the new Dedicated Server - probably due to your work testing. I didn't have to change a thing.


Edited by Moa
Update about Dedicated Server.
Link to comment
Share on other sites

Yes, I store everything I can, including some additional information (like position and velocity of each unit for each event which has it - which I may use later). It's still a work in progress. Slmod works as it did before, I just extended Slmod to write to a separate log, which I transfer to a Postgres database and then have a Java/Groovy REST webservice read that and display using HTML/JS/CSS.

 

 

Gotcha. Just asked cause having any sort of unified stats would be nice. Though it seems that other servers are just generating their own stats these days anyway. Saving position data huh? Suppose there might be a heat map of player deaths some time in the future :D?

 

As I mentioned, once i've finished tarting the stats page up I'll be using it as Battle Damage Assessment for mission generation, and close the loop dynamic-campaign wise (I know ED are working on this, but it always good to have choices and healthy co-opertition).

 

Best of luck on that project. I love that people are creating their own campaigns with the lua API and open sourced nature of the mission file. I want the ED DC to be good, but it is ultimately best that people can create an alternative. I mean what is better than 1 dynamic campaign engine? Multiple engines capable of multiple types of scenarios.

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

Gotcha. Just asked cause having any sort of unified stats would be nice. Though it seems that other servers are just generating their own stats these days anyway. Saving position data huh? Suppose there might be a heat map of player deaths some time in the future :D? .

 

My stats-board is all set for multi-server. Once the UI/styling is complete it can take data from other servers. We are a community after all :)

 

 

As well as a heat map of player deaths I'm also keen on getting aggregated statistical data, such as the actual missile Pk map. Plus, a dynamic campaign needs to know things such as ejection locations etc to generate SAR missions for the rotorheads.

 

 

 

 

 

Best of luck on that project. I love that people are creating their own campaigns with the lua API and open sourced nature of the mission file. I want the ED DC to be good, but it is ultimately best that people can create an alternative. I mean what is better than 1 dynamic campaign engine? Multiple engines capable of multiple types of scenarios.

 

 

Thank you. I'm into realistic Order-of-Battle and 'wargamer' type stuff, and want realistic ATO and maintenance/serviceability and a bunch of other stuff. Plus, I have lots of TN Dupuy's works, such as:

https://www.amazon.com/Numbers-prediction-war-history-evaluate/dp/0672521318

 

 

Working on coding that model is why I originally learned to code (fortunately it has been very lucrative since). So I'd love to complete that model and incorporate realistic ground attrition and movement rates - but that is further in the future.

Link to comment
Share on other sites

  • 4 weeks later...

I've been searching for information on setting-up basic stats for a training server and came across this thread. Have been trying to get various things to work, but with no success so far.

 

 

Basic raw numbers can be grabbed from the gameGUI envirnment with the onGameEvent callback.

 

function onGameEvent(eventName,arg1,arg2,arg3,arg4)
   --"friendly_fire", playerID, weaponName, victimPlayerID
   --"mission_end", winner, msg
   --"kill", killerPlayerID, killerUnitType, killerSide, victimPlayerID, victimUnitType, victimSide, weaponName
   --"self_kill", playerID
   --"change_slot", playerID, slotID, prevSide
   --"connect", playerID, name
   --"disconnect", playerID, name, playerSide, reason_code
   --"crash", playerID, unit_missionID
   --"eject", playerID, unit_missionID
   --"takeoff", playerID, unit_missionID, airdromeName
   --"landing", playerID, unit_missionID, airdromeName
   --"pilot_death", playerID, unit_missionID
end

With that alone you can get some pretty basic statistics out of it.

 

Where would I put this sort of code? Is this a script that runs of a "once" trigger? Or does it need to go somewhere else.

 

 

 

SLMOD's stats tap into the mission scripting engine's events and other functionality which lets it track fight time (literally running Unit.inAir() every 10 seconds on each aircraft), hits (which is a mega PITA to attribute kills for), and even gun munitions used. Drawbacks being it has to modify the game to have access to it and the way it writes the stats file can get pretty large if there are a lot of players and the mission runs for a while.

 

I tried to get SLMOD (v7.0.060) to work, but without success on that too. Installed it to here:

 

C:\Users\Dietrich\Saved Games\DCS\Scripts\net\Slmodv7_0

 

but according to the installation notes, after running DCS Multiplayer, it should create a ...\Saved Games\DCS\Slmod\config.lua file, but it doesn't. So I'm stuck on this front too.

 

 

 

 

 

An alternative stats idea I had would be parse the file:

 

C:\Users\Dietrich\Saved Games\DCS\Logs\dcs.log

 

The problem here is that each time I re-start the server, the file is overwritten. Is there a way to automatically start a new file with a counter (dcs_0001.log, dcs_0002.log) or date (dcs_20190406_163203.log) each time a new mission starts?

 

 

 

 

Thanks for any tips/help/advice.

Link to comment
Share on other sites

Gotta use the development branch from the github. Should be 7.5 or above for DCS 2.5: https://github.com/mrSkortch/DCS-SLmod/tree/develop

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...