Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SCHEMA] SWAT: Reborn #83

Open
campbt opened this issue Aug 27, 2016 · 14 comments
Open

[SCHEMA] SWAT: Reborn #83

campbt opened this issue Aug 27, 2016 · 14 comments

Comments

@campbt
Copy link

campbt commented Aug 27, 2016

Link to Schema:
http://hastebin.com/raluqitoku.lua
Link to Console:
http://hastebin.com/zejaqukovu.lua
Link to settings:
http://hastebin.com/afihixuniz.vhdl

Note: SWAT has a delay between when the game is won/lost and when I actually make a team win and lose. During this time, I'm worried teams may leave, so I manually trigger stage 3 before the library will hear about it through its standard hookins (but it looks like it will ignore sending it again if the game does reach the standard win/lose stage so it should be fine).

The code for this is simply:

 -- Send end of game stats now
 SendEndGameStats() -- Sends custom schema stats
 statCollection.winner = DOTA_TEAM_BADGUYS
 statCollection:sendStage3(statCollection:calcWinnersByTeam(), true)

Also, can schema keys be optional? Would the server choke up if a key was simply not sent to it? It'd be nice to submit some metrics based on which difficulty was selected, rather than lumping all difficulties together but appending some key to them to denote the difficulty.

Thanks for setting all of this up guys!

@SinZ163
Copy link
Member

SinZ163 commented Aug 27, 2016

Your schema has been approved. Please double check I didn't make any mistakes in field names or display names.

https://getdotastats.com/#s2__mod_schema?mid=145

Your schemaID is here: https://getdotastats.com/#s2__my__mods

@jimmydorry
Copy link
Member

I should really update the guide, as this is important:

  • -1 to store a value, but not display it (affects stats)
  • 0 (or any other value) to store a value and display it (affects stats)
  • '' (key defined, but no value given) to not store a value (not affect stats)

@campbt
Copy link
Author

campbt commented Sep 25, 2016

Hey, so far I've been loving this metrics collection. I'm thinking of updating the schema to accomplish a new task, but before I submit that, I'd like to ask for what would be the best way.

I like the Player Flags breakdown, but I noticed a problem. My game has a variety of difficulties, but the player values metrics aggregatesu all of those into one. Ideally, I'd like to be able to filter the player flags breakdown based on a Game value (in this case, difficulty), so I could see the breakdown of players' selections in each difficulty. If there is already functionality to do this, that'd be great. If not, I'm thinking of just updating the schema to have a prefix in front of most of the current player flags, and only send values if that difficulty is the one being played. If I go this route, I would only care about one difficulty.

Also, just to confirm, assuming I had a key like this:
{
some_key=123
, nm_some_key=123
}
That would submit 123 into the player fields "some_key" and "nm_some_key". But if I sent:
{
some_key=123
, nm_some_key=nil
}
That would submit 123 into the player fields "some_key" but NOT into "nm_some_key" (so not affect the average of "nm_some_key" in any way).
Is this correct?
What would nm_some_key=-1 do?

Finally, is it possible to change what the Top Players orders by? Could I create a player value (or maybe multiple ones, allowing the list to be sorted multiple ways?)

Thanks again

@SinZ163
Copy link
Member

SinZ163 commented Sep 25, 2016

Lua tables don't have the ability to have nil as a value, and if you want it to not affect stats in any way, make the value '' (an empty string) and you get what you wish.

@campbt
Copy link
Author

campbt commented Sep 27, 2016

Fair enough. So, what happens if the key is simply not there? If I update the schema and someone plays an older version which does not send the new key, would there be any problems? Would it essentially be the same as using an empty string for a value?

@SinZ163
Copy link
Member

SinZ163 commented Sep 27, 2016

if the key isn't there, GDS will invalidate that message, and return an error saying you missed a key

@SinZ163
Copy link
Member

SinZ163 commented Sep 27, 2016

Which is why there's always a new schema key for every schema version, you don't change your code without also changing the schema key to reflect the changes

@campbt
Copy link
Author

campbt commented Oct 1, 2016

Oh right. I did forget about the schema key. Ok, I should be set then.

Here is my new schema code: http://hastebin.com/semodubada.lua
Here are the logs for them: http://hastebin.com/hohumagawa.md

New Game Keys:
(Duration is being tracked, but I'd like them in more defined chunks of 10 minutes and to separate some of the difficulties out)
"dur" "Duration"
"dur_nm" "Duration (Nightmare)"
"dur_sv" "Duration (Survival)" (This difficulty is all about living as long as you can whereas the others are often trying to have a low time)

New Player Keys:
"re" "Renown"
"rc" "Reconnections"
"ki" "Was Kicked" (this returns a boolean right now. Please let me know if you need it as a number or string)

"nm_cn" "Class (Nightmare)"
"nm_an" "Armor (Nightmare)"
"nm_tn" "Trait (Nightmare)"
"nm_sp" "Spec (Nightmare)"
"nm_lv" "Level (Nightmare)"
"nm_de" "Deaths (Nightmare)"

Thanks!

@campbt
Copy link
Author

campbt commented Oct 4, 2016

Hey, any update on getting this schema approved?

@jimmydorry
Copy link
Member

Sorry, I've been in South Africa with very spotty internet connection (still am). Let's have a look.

@jimmydorry
Copy link
Member

Good thing you posted the schema and logs. I don't see re in them, so you may want to double check that. I assume you meant rn?

Your schema is up and should be found in https://getdotastats.com/#s2__my__mods

Double check your schema fields here: https://getdotastats.com/#s2__mod_schema?mid=145

@campbt
Copy link
Author

campbt commented Oct 7, 2016

Thanks. I think the new schema is posting correctly now. I noticed that after the schema update the mod page seems to have purged all the metrics from the old schema, and old schema games are not contributing metrics to the new schema (even if keys match). Is this intended? It's not a huge deal, just curious.

Thanks and enjoy your trip.

@SinZ163
Copy link
Member

SinZ163 commented Oct 7, 2016

the site only shows info for the latest schema, and ignores data from old schemas

@jimmydorry
Copy link
Member

Slight correction, it still receives and stores data for valid & active schemas, but only displays the latest one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants