updated to 20th Feb build, stats tables no longer seeming the same.
Closed this issue · 6 comments
I recently updated our servers to 20th Feb build of SLmod and noticed that the stats as they used to be published seemed to have been massively altered? is/was this intentional.
You used to always get the following items in the table
["uid"] =
{
["friendlyCollisionKills"] =
{
}, -- end of ["friendlyCollisionKills"]
["id"] = 1,
["friendlyHits"] =
{
}, -- end of ["friendlyHits"]
["names"] =
{
[1] = "server name",
}, -- end of ["names"]
["kills"] =
{
["Buildings"] =
{
["Other"] = 0,
["Static"] = 0,
["total"] = 0,
}, -- end of ["Buildings"]
["Planes"] =
{
["UAVs"] = 0,
["Fighters"] = 0,
["Bombers"] = 0,
["total"] = 0,
["Transports"] = 0,
["Support"] = 0,
["Other"] = 0,
["Attack"] = 0,
}, -- end of ["Planes"]
["Ships"] =
{
["Warships"] = 0,
["total"] = 0,
["Unarmed"] = 0,
["Subs"] = 0,
["Other"] = 0,
}, -- end of ["Ships"]
["Ground Units"] =
{
["Arty/MLRS"] = 0,
["SAM"] = 0,
["Unarmored"] = 0,
["IFVs"] = 0,
["AAA"] = 0,
["Infantry"] = 0,
["Other"] = 0,
["EWR"] = 0,
["APCs"] = 0,
["Tanks"] = 0,
["Forts"] = 0,
["total"] = 0,
}, -- end of ["Ground Units"]
["Helicopters"] =
{
["Other"] = 0,
["total"] = 0,
["Attack"] = 0,
["Utility"] = 0,
}, -- end of ["Helicopters"]
}, -- end of ["kills"]
["losses"] =
{
["pilotDeath"] = 0,
["crash"] = 0,
["eject"] = 0,
}, -- end of ["losses"]
["times"] =
{
}, -- end of ["times"]
["weapons"] =
{
}, -- end of ["weapons"]
["PvP"] =
{
["losses"] = 0,
["kills"] = 0,
}, -- end of ["PvP"]
["friendlyCollisionHits"] =
{
}, -- end of ["friendlyCollisionHits"]
["friendlyKills"] =
{
}, -- end of ["friendlyKills"]
}
now however a lot of that data no longer seems to be written from base (which really stuffs up a lot of existing stat tracking.
A straight default write all I'm getting is this
["uid"] =
{
["id"] = 1,
["times"] =
{
}, -- end of ["times"]
["joinDate"] = 1588867996,
["names"] =
{
[1] = "username",
}, -- end of ["names"]
}, -- end of ["uid"]
and if you pilot something that looks this
["uid"] =
{
["times"] =
{
["FA-18C_hornet"] =
{
["total"] = 1340.696,
["weapons"] =
{
["AIM-120C"] =
{
["numHits"] = 2,
["kills"] = 1,
["shot"] = 2,
["hit"] = 0,
}, -- end of ["AIM-120C"]
}, -- end of ["weapons"]
["inAir"] = 1120.589,
["kills"] =
{
["Planes"] =
{
["Fighters"] = 1,
["total"] = 1,
}, -- end of ["Planes"]
}, -- end of ["kills"]
["pvp"] =
{
["kills"] = 1,
}, -- end of ["pvp"]
}, -- end of ["FA-18C_hornet"]
}, -- end of ["times"]
["joinDate"] = 1588868264,
["lastJoin"] = 1588869607,
["id"] = 2,
["names"] =
{
[1] = "username",
}, -- end of ["names"]
}, -- end of ["uid"]
Those are some really big changes in the table format and have some well impactful knock on effects as there is no way to tell it to 'use the old' format especailly given that existing stats software that used the old table no longer finds values it's meant to. Just wanting to know if this was as mentioned an intentional effect? Or if i've some how miss configured something suddenly or ?
-Rob
Yes it is intentional. Perhaps I should have summary or release stating the changes better. Just a quick go over though of the big changes...
Moved any TK stat info out of the main stats.lua file and into SlmodPenaltyStats.lua. I did this on request of another server admin and agreed that it was a good idea. Mainly to isolate the data so that if you wanted to delete all stats you had the option to keep penalty stats information. Its also a little easier to look through because it is just tk data.
Rewrote how stats are written to more easily work with multi-crew aircraft. Old code was written in a way that for each player in an aircraft it went through the whole code for deciding what to add and where. The way I rewrote it does that once and figures out who to write the data for.
Started to add more detail to the stats, while also removing some default data. The changes made for the multicrew code made it easier to write new stats categories and frankly created a nice reason to add to the stats detail. In the old version it kept track of all of your Mk-82 drops and APC kills for every single aircraft type. The updated version now has aircraft specific stats for those values. I also deleted the default written values for most stats because it was primarily there for the old code and to populate the in game stats display. I decided to just assume those values were 0 because adding the whole table would be a waste of space and I have seen stats files from several folders that are 10+ MB in size, which is kinda ludicrous for what is basically a text file.
There were a number of features for additional stats and changing the settings that I intend to add, for example the link below. Due to a number of factors I had a pretty substantial lack of interesting in writing code for DCS over the last few months, so nothing has been finished on this front.
#50
So get the idea and the reasoning, but it does cause a lot of headaches at the same time Grimes from backwards compatability with existing systems etc though because now if you have something that did a prase of those files there really really broken at times, great example of a 'public' repo, S3/SLSC we used it as the bases for our system basically taking the lua2json conversion and then because of the table cange we literally just spent 2 days pulling code apart thinking we'd broken our stats system only for me to realise the above changes had happen ;) and with no 'option' to still use older methods it kills a lot of code.
Ah well will talk with the other guy whom works with me coding on what we do now ;) and trust me
I can perfectly understand the lack of interest in writing code for DCS of late, there by and large myself. From what i've encountered etc the new method works but yeah it's just with no specifically looked tables etc you can't easily just pull and populate an object table anymore and with no actual 'structure' documentation it's hard to work out what values to expect to end up in said table that's all.
We'll work something out our end.. thanks for the reply and hope your doing well in these times.
and just to confirm grimes this is the new table structure right?
[uid] // holds the pilot uid like before
| - [joindate]
| - [lastJoin]
| - [id]
| - [name]
| - [names]
| { array of names as before}
| - [times] // holds each ac
| | - [ac] // specific ac
| | - [total] // total time in
| | - [inAir] // obvious
| | - [weapons] // table of weapons used example below
| |-["weapon name"]
| |- [numhits]
| |- [kills]
| |- [shot]
| |- [hit]
| | - [kills] // table of kills and types
| | - [unit type eg groundunits]
| | - table of units eg ivf,tanksetc + total
| | - [actions]
| | - [lossees]
| | - [pilotDeath]
| | - [craash]
| | - [eject]
| | - [pvp]
| | - [kills]
| | - [losses]
I doesn't help that people do cool stuff like what you have done and I don't know it exists. To be honest vast majority of the features over the last year were added from discussing stuff with Hoggit and their needs for the GAW server. I know plenty of other people use slmod for their servers, but seldom do they come to me with issues or suggestions.
Your table looks accurate but can be modified based on what I want to change. Also it will have options so that it can look like that but with new entries.
So with those in mind it follows much of the same principle. The biggest thing is there will be an option to have kill data in the weapons table. The gist of the "stats levels" can be summarized as:
0 = "Old stats"
player>Kills
player>Weapons
player>AircraftData
1= "Detailed"
player>AircraftData>Kills
player>AircraftData>Weapons
2 = "Ultra Detailed"
player>AircraftData>Weapons>Kills
If I do add other stats and the detail level it'll look something like :
Under weapons:
[weaponName][assists] = number -- you hit a target, didn't kill it, but someone else got the kill
[weaponName][kList] = table -- Actual typenames of what was destryoed.
Under actions:
-Refueling: {timeConnected, short, med, long}
-Take-offs: {airbase, ships, etc}
-Landings: {airbase, ships, etc}
-losses could have what killed the player or the type of lose.
Assists have yet to be decided. At minimum it is just a number value that counts up, but I kinda want to have it be a listing like kills. It could mirror the location and detail of the kills stat.
Yeah I know ours was we were using SLSC/S3 and chose to redo our entire dcs system, hoggit was the insperation for it and Dynamic DCS.. one of my guys who does node programming was 'ok i'll start working on it send me x from dcs' we got the data out of dcs and i already had the stats going so we were working on the stats and then because i noticed stats were not updating in 2.5.6 i came noticed the updates ran them and yeah.
I should communicate more again but between health and everything else I forget where and what i've mentioned to whom and well I didn't just want to dm you out of the blue on discord ;)
now that i understand how the table flow works I can work with Boozer (other dev in my group) to work through writing a praser that takes into account that values might not be there at the start more code but I actually agree with everything you've said about the stats being better off for it, the more I've been staring at the tables etc the more 'sense' it makes and is actually a lot better stat tracking. It just as I said threw me for a six because I couldn't find a mention of when the stat format had changed even going back down the commit list just 'Fixed stats' etc.
I find that over the past 2-3 years that i've been server running SLMOD is great for me in 2 very large ways Grimes,
- the original 'Admin' side which really ED should look at something like it for te dedicated servers..
- the stat tracking, there's nothing else that comes close to the depth that SLMOD offers, perun gives basic stats but SLMOD has always given detailed stats on ac hours etc and doesn't require a sql db etc.. eg has less overhead.
On the expanded stuff mentioned
Assists are a hard one because how long do you count an 'assist' as being valid because say if a fighter gets a bullet clip from Guy1 but doesn't get shot down .. goes back to base comes back out and then gets shot down by Girl1 then does Guy1 also get an assist? it's one of those ones I've ran into with moose (and really need to look into the scoreboard system there) were ppl get credit for a kill like 2 - 3 hours later because the bird made it home, got fixed up and then went back out and .. you get the idea.
With the table format known now though it should be fixable.. even if it'll mean a lot of 'for each statements ;) ' though in a way it's just really making something that does the same job as you've done in lua in the detail stats print out section..
Anyway thanks for maintaining and keeping slmod going, trust me it's mucho appreciated from this Aussie.
oh and check your ed forum msg's i sent you a link to what we've been dev'n running an older db.
Re the Assists comment.
For the longest time in DCS the "dead" event didn't contain any information about who hit the target. Really it still doesn't but ED added two other events that are basically the same thing but one of them contains weapon and shooter information. As a result whenever something gets destroyed at least 3 events occur. Anyway, because of the lack of information slmod uses "hit" events to keep track and whenever a dead event occurs it looks back through the hit events for that unit and uses the most recent hit to decide who gets the kill. The entry for hits on a unit gets cleared after it is destroyed or is on the ground and below a certain velocity for a few seconds. If someone respawns they are given a clean slate.
Really the bigger headache for assists is the criteria to award it and applying to TKs. There is a pretty big range of weapons and the damage each does to a given target. For instance you can hit a ship with 100s of bullets and only contribute a fraction to the total damage needed to sink a ship. So that has been a dilemma that needs solving. Really it is mostly the extreme cases of a large amount of target hits or targets that require a large amount of damage even from high explosives to destroy that are the problem areas.
gonna close this out Grimes, we updated and got the system reworked.