SRL Archive - SRL Suggestions

Fix random stats in stats_Commit


Bixby Sayz

2011-04-16 22:59:03

The stats for randoms are generated automatically in function stats_Commit (stats.simba), but they seem to be geared for the old stats system.

Here is a suggested fix to make them work with the new stats system.

add 2 new variables:
var
stats_RandNames: Array of String;
stats_RandFailed: Array of Integer;

in SetupSRLStats change the random names setup to:
  stats_RandNames := ['Leo', 'Forester', 'Maze', 'P. Pete', 'Evil Bob',
'Demon', 'Quiz', 'Mordaut', 'Molly', 'Pinball',
'Sandwich', 'Beekeeper', 'Pillory', 'Arnav', 'Abyss',
'Certer', 'Mime', 'Frog'];
SetArrayLength(stats_RandSolved, Length(stats_RandNames));
SetArrayLength(stats_RandFailed, Length(stats_RandNames));

in stats_Commit change the random handling code to:
  for i := rand_Leo to rand_Frog do
begin
// Update solved stats.
Increment := RandSolved[i] - stats_RandSolved[i];
if (Increment > 0) then
begin
stats_IncVariable(stats_RandNames[i] + ' (Solved)', Increment);
stats_RandSolved[i] := RandSolved[i];
end;
// Update unsolved stats.
Increment := RandFailed[i] - stats_RandFailed[i];
if (Increment > 0) then
begin
stats_IncVariable(stats_RandNames[i] + ' (Unsolved)', Increment);
stats_RandFailed[i] := RandFailed[i];
end;
end;

I started to simply work around this in my scripts, then realized it would be easier to simply fix the stats commit.

Edit: Tested against stats and 100% working.

Flight

2011-04-16 23:04:52

Are randoms even defined as variables in SRL Stats?

Bixby Sayz

2011-04-16 23:19:53

Yeah they are all there, both solved and unsolved. All with a value of 0.

They are supposed to be transparently updated without any input from the script maker. They are automatically added to each script but don't show in the variables list for that script (unless they have a non zero value).

Flight

2011-04-17 00:03:25

Yeah I've looked through the old Stats committing and I see they were used then, but since SRL Stats has been re-worked since then I wonder if they're still currently being committed to the new system/Stats page.

Bixby Sayz

2011-04-17 00:33:33

They will work if manually incremented using the proper variable, so fixing the commit function should make them useful again.

Bixby Sayz

2011-04-24 23:34:57

The lack of caring on this is understandable but disappointing. Why have stats if we aren't going to use them?

I've added this to one of my scripts. I'll let you know how it works out.

Edit: Oops, double post.

Coh3n

2011-05-04 10:04:31

Sorry, I just saw this now, and I'm really the only active developer now, so I apologize. How'd it work out in your script?

Bixby Sayz

2011-05-04 13:15:03

Ask me that in a few days. In the middle of rewriting to fix a few other issues. As it stands seems to work for some, but not others.

I want to run it a bit more with the new code before saying for sure it works.

Edit: One thing I did notice is that even when it worked there was a lag of up to a day before they showed up as commits to my script.

Coh3n

2011-05-04 13:24:52

From: Bixby Sayz
Ask me that in a few days. In the middle of rewriting to fix a few other issues. As it stands seems to work for some, but not others.

I want to run it a bit more with the new code before saying for sure it works.

Edit: One thing I did notice is that even when it worked there was a lag of up to a day before they showed up as commits to my script.

I'm not sure what would cause that, you'd have to ask Wizzup.

Bixby Sayz

2011-05-13 11:57:33

Now tested and confirmed to work (by me at least). Tweaked it a bit too to make it a bit cleaner before rerunning tests.

This is the result of doing a stats commit with all solved and all failed set to 1:
http://stats.villavu.com/script/120

I realize this is small potatoes in the grand scheme of things, but I think it would be handy to get a feel for what is truly working or not "out in the wild" random-wise by simply checking out the stats being posted.

Coh3n

2011-05-13 12:46:25

From: Bixby Sayz
Now tested and confirmed to work (by me at least). Tweaked it a bit too to make it a bit cleaner before rerunning tests.

This is the result of doing a stats commit with all solved and all failed set to 1:
http://stats.villavu.com/script/120

I realize this is small potatoes in the grand scheme of things, but I think it would be handy to get a feel for what is truly working or not "out in the wild" random-wise by simply checking out the stats being posted.

That's awesome. Do you have everything you changed? I'll commit it as soon as possible.

Bixby Sayz

2011-05-13 14:48:45

Edited first post to reflect most recent changes I am using myself.

Coh3n

2011-05-13 15:16:10

From: Bixby Sayz
Edited first post to reflect most recent changes I am using myself.

Awesome, I'll add this to my list. :)

Sex

2011-05-13 16:43:51

I don't think unsolved should even be a variable. -_-

Yago

2011-05-13 16:48:16

From: Sex
I don't think unsolved should even be a variable. -_-


They should just to see what needs most help and where we are failing/need to improve.

Bixby Sayz

2011-05-13 17:33:29

I am interested to see solved vs unsolved vs which are not increasing.

The ones that don't increase are the real problem ones: either they didn't detect the random, or bombed out before setting solved/unsolved status.

Coh3n

2011-05-14 12:03:02

This has now been committed. :) I didn't get the chance to test it myself, but I just made the changes in the first post. I trust it works just fine.