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] Petri Reborn #72

Open
TideSofDarK opened this issue Mar 2, 2016 · 47 comments
Open

[SCHEMA] Petri Reborn #72

TideSofDarK opened this issue Mar 2, 2016 · 47 comments

Comments

@TideSofDarK
Copy link

Link to your console log
http://hastebin.com/kifefitoco.vhdl
Link to your settings.kv
http://hastebin.com/kebikozovi.vhdl
Link to your schema.lua
http://hastebin.com/ihopenesaz.lua
Link to your Lua files that defines the functions you pull stats from
http://hastebin.com/hesabavoqi.coffee
http://hastebin.com/jomedupapi.lua

@TideSofDarK
Copy link
Author

Updated names to be a bit shorter, is it okay?
schema.lua
http://hastebin.com/fubakuwizo.lua

@jimmydorry
Copy link
Member

Great.

I would recommend a player value for whether they are hunter or prey (don't remember the name you gave the two teams).

I also recommend a game value for whichever team won, and a game value for duration (round or floor it).

If you need an example or are happy with this schema as it is let me know.

Make sure to update your library. A lot of small changes have been made in the last few months.

@jimmydorry jimmydorry self-assigned this Mar 2, 2016
@TideSofDarK
Copy link
Author

Ok thanks for answer.
How should i describe game winners? Actually game is won by two specific players and not whole team. So i disabled "GAME_WINNER" to manually set winners but i dont know how

@MNoya
Copy link
Member

MNoya commented Mar 2, 2016

You can do it this way:

function BuildRoundWinnerArray()
    local winners = GetPetriWinners()
    for playerID = 0, DOTA_MAX_PLAYERS do
        if PlayerResource:IsValidPlayerID(playerID) then
            if not PlayerResource:IsBroadcaster(playerID) then
                winners[PlayerResource:GetSteamAccountID(playerID)] = winners[playerID] and 1 or 0
            end
        end
    end
    return winners
end

GetPetriWinners will return a table with the playerID indexes of those that won

function GetPetriWinners()
   local winners = {}
   for playerID = 0, DOTA_MAX_PLAYERS do
       if PlayerResource:IsValidPlayerID(playerID) and PlayerIsWinner(playerID) then
          winners[playerID] = true
       end
    end

    return winners
end

How you define PlayerIsWinner is up to you

@jimmydorry
Copy link
Member

You may also just be able to extend your existing winners functions. Let me look for a bit longer.

Line 595 and 616 of http://hastebin.com/jomedupapi.lua

@TideSofDarK
Copy link
Author

@MNoya so i have to make stat-collection round-based to use this?

@jimmydorry
Copy link
Member

No! Can you just clarify exactly who wins? I might not be understanding correctly. To me, it looks like you are setting either DOTA_TEAM_GOODGUYS or DOTA_TEAM_BADGUYS to win.

@TideSofDarK
Copy link
Author

@jimmydorry there are kvns and there are petrosyans. if one of the kvns dies - he turns into mini-actor and moves to petrosyans team. however if petrosyans win - these mini-actors should lose anyway because they started as kvns

@jimmydorry
Copy link
Member

Can you come up with a function that can tell you if the passed player has won or not? i.e. isPlayerWinner(player)

I don't think your current PetrosyanWin() and KVNWin() functions do what you just described.

If you can make that function, then it's rather straightforward to get the arbitrary teams working correctly.

@TideSofDarK
Copy link
Author

@jimmydorry they dont because i don't need such functionality without stat-collection. but i want to submit correct winners to stats.
So OK i added GameRules.Winner = DOTA_TEAM_GOODGUYS and GameRules.Winner = DOTA_TEAM_BADGUYS to KVNWin() and PetrosyanWin(). Now i can use such func to check if player is winner: http://hastebin.com/izezidobuc.lua

@jimmydorry
Copy link
Member

Try this as your schema. http://pastebin.com/5tzddTTg

The important part is line 30, 122, 135. You will want to review it, as I have likely made a mistake or two.

@TideSofDarK
Copy link
Author

@jimmydorry ah, that's it. http://hastebin.com/evedemapag.lua here is new schema, it should work alright

@jimmydorry
Copy link
Member

What does ConvertTime() do?

@TideSofDarK
Copy link
Author

@jimmydorry return string.format("%.2d:%.2d", time/60%60, time%60)

@jimmydorry
Copy link
Member

You definitely don't want to format those strings. Send them as an integer math.floor(GAMEMode.FIRST_BAG), so they can be properly grouped to give ranges of time.

The other two suggestions stem back to before. You should have a team value for players (Petri or KVN), and a winning team value in the game array (Petri or KVN).

@jimmydorry
Copy link
Member

For the player team, something like:

-- Team string logic
local player_team = ""
if hero:GetTeam() == DOTA_TEAM_GOODGUYS then
    player_team = "Petri"
else
    player_team = "KVN"
end

The game value for winning team, will require a bit more work.

@jimmydorry
Copy link
Member

Also, I would make the ks and ps a default of ''. That way the stats for people that don't make a score on one of the teams won't drag the average down.

I would also make a player value to show if they got converted, unless you make the team string for three teams: KVN, Petri, mini-petri

And one more player value for if they ended the game dead.

@TideSofDarK
Copy link
Author

@jimmydorry http://hastebin.com/ekoqopixob.lua updaed it. GameRules.Winner is set just before GameRules:SetGameWinner

@jimmydorry
Copy link
Member

Alright looking good now. I would recommend considering the other three suggestions above... but this schema is ready to be approved if you are ready.

@TideSofDarK
Copy link
Author

@jimmydorry you mean combine score? ok. also added BMA (became mini actor). and i dont think we need player value for dead players. http://hastebin.com/qatiyevoni.lua here is final version.

@jimmydorry
Copy link
Member

Not combined. I meant blank. Lots of 0 values would pull down the average for all of the legitimate scores.

ps = petri_score or '',
ks = kvn_score or '',

@jimmydorry
Copy link
Member

Your schema has been approved (with the two score fields). Please double check I didn't make any mistakes in field names or display names.

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

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

@TideSofDarK
Copy link
Author

@jimmydorry Please change First Money to First 100k Networth. Other things seems alright. Can i upload my game now? I set new schema ID and testing to false.

@jimmydorry
Copy link
Member

Yes, good to go. You should share post your settings file here (with XXXXXXX for modID and schemaID).

@TideSofDarK
Copy link
Author

http://hastebin.com/sufomozama.vhdl here it is

@jimmydorry
Copy link
Member

Are you sure you want MIN_PLAYERS of 3?

Looks good. Let's hope you get some good data.

The graphs will start updating again on the weekend, but all of your data will be collecting in the meantime.

@TideSofDarK
Copy link
Author

@jimmydorry well what does MIN_PLAYERS count? if game started as 12 players then 9 leave will it count as 12players lobby? or as 3players?

@jimmydorry
Copy link
Member

12 players.

The min_players just means no stats get sent at all if it starts with less than 3 players.

@TideSofDarK
Copy link
Author

@jimmydorry good to know ! then i will make it 8

@jimmydorry
Copy link
Member

That will drastically reduce your number of games!

Until you get heaps of games a week, you probably want to set it at 2, and increase it as the number of fuller games increases.

@TideSofDarK
Copy link
Author

@jimmydorry we do get nice amount of games. petri constantly get 8-12 place in top so its ok. you know there were times when petri was top3 custom game with 4k online. Now it barely gets 1k on weekends but still lives. Well i set it to 6 so.. dunno

@jimmydorry
Copy link
Member

Good luck!

@TideSofDarK
Copy link
Author

@jimmydorry Thanks for help! Have fun!

@K1llMan
Copy link

K1llMan commented Mar 4, 2016

@jimmydorry What request I need to send to "getdotastats.com" to get top players info in Panorama? Where are listed full amount of possible requests?

@SinZ163
Copy link
Member

SinZ163 commented Mar 4, 2016

There currently is no public API to get information back from GetDotaStats

@jimmydorry
Copy link
Member

Make an issue on what you want here: https://github.com/GetDotaStats/site/issues

I have a big backlog of features to implement. Making an issue means I won't forget it.

@K1llMan
Copy link

K1llMan commented Mar 6, 2016

@jimmydorry GetDotaStats/site#184
Any progress with this issue?

@jimmydorry
Copy link
Member

Current priority is getting all functionality back online. I migrated the site to a beefier machine, as it is now proccessing upwards of 500 queries a second, but I had to temporarily disable the long running crons.

Keep an eye on GetDotaStats/site#254 and GetDotaStats/site#244

After those two is the API for leaver and player summary. And then is highscores.

That makes highscores soon, but later than originally planned.

Performance stats that made the cron changes necessary: https://getdotastats.com/#site__service_stats

@TideSofDarK
Copy link
Author

sendStage2 ERROR
Stat Collection: You need to call the init function before you can send stats!
What can cause this?

@jimmydorry
Copy link
Member

You need to look up further in the log. It means you didn't sendStage1, and as the match is not registered (to get its matchID), you can't have stats for it.

@TideSofDarK
Copy link
Author

Well i set "OVERRIDE_AUTOMATIC_SEND_STAGE_2" to "true" and added statCollection:sendStage2() in GameMode:OnGameInProgress(). Is it enough or i need to do something else?

@jimmydorry
Copy link
Member

No, don't do that! You just needed to look further up in the log, to see what Stage1 was saying. Either way, we had a small outage due to upgrades. You probably won't get the error any more.

@SinZ163
Copy link
Member

SinZ163 commented Mar 7, 2016

The Stage2 Override doesn't make stage2 magically work, it just makes it not automatically be called. sendStage2() itself checks if stage1 has been sent and received.

@TideSofDarK
Copy link
Author

I started to use it a day ago because i really do need to start game only after GameSetup process. Otherway games that crash during gamesetup will count as yellow (game started). So how should i deal with OVERRIDE_AUTOMATIC_SEND_STAGE_2 ? I already have statCollection:sendStage2() in GameMode:OnGameInProgress().

@SinZ163
Copy link
Member

SinZ163 commented Mar 7, 2016

Phase2 / Stage2 is sent only when PRE_GAME is hit by default, and the only time you ever need to change when its sent, is if you have bad design and need to set flags after hero selection

@jimmydorry
Copy link
Member

The only time you want to OVERRIDE_AUTOMATIC_SEND_STAGE_2 is when you are setting flags after the game has started (i.e. you want to delay stage2).

I doubt you are doing that, so put everything back to default.

@TideSofDarK
Copy link
Author

Well then i will get rid of that override and check "game ended" ratio next day with my new updates to win condition checking. Currently i have 10% of games ended because of my shitcode so i want to fix this as soon as possible. Thanks.

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

5 participants