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

Fix levels skipped status #258

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

opello
Copy link

@opello opello commented Jun 18, 2015

Tested locally, makes the "Skipped xxx levels in last 5s" status not be about 2x what it should be.

@JimRaynor56
Copy link

This does fix the doubled calculation, but it makes it calculate skipped levels over the last 10 seconds, not 5.

@opello
Copy link
Author

opello commented Jun 18, 2015

So maybe iterate from 2 down to 0 instead?

@JimRaynor56
Copy link

I've been working on this issue with someone else and we've yet to come to a fix that solves the calculation issue and also keeps the tickrate correct. We're still trying, and also testing your fixed fix locally.

@opello
Copy link
Author

opello commented Jun 18, 2015

When I first looked at this it seemed obvious that the shifting down of the levelsSkipped array in getLevelsSkipped was wrong, after all why should getLevelsSkipped be moving data around when the MainLoop already was handling the adjustment in each iteration. Is this not the case?

@JimRaynor56
Copy link

It seems, to us, that the second shift is actually important to keeping the count to a 5s interval rather than 10s.

@opello
Copy link
Author

opello commented Jun 18, 2015

So the MainLoop management piece for the levelsSkipped array:

// Make sure to only include ticks that are relevant
var level_jump = getGameLevel() - oldLevel;
if (level_jump > 0) {
   // Iterate down the levelskipped memory
   for (var i = 4; i >= 0; i--) {
      levelsSkipped[i+1] = levelsSkipped[i];
   }
   levelsSkipped[0] = level_jump;

   oldLevel = getGameLevel();
}

It never adds zeroes to the list. The MainLoop is scheduled to run once a second. If we assume that it ever takes longer than 1 second to clear a level (which seems pretty clear that it does) then we aren't really a 5 second sum anyway.

The way I see it is that the array represents the number of levels transitioned when levels were actually transitioned. It will store a 1, but not a 0. So if you beat 1 level every 10 seconds for a minute, the status would show that you skipped 4 levels (levelsSkipped=[1,1,1,1,1,1] at the end of the minute, the status for loop would sum up 4 of them).

I very well may be misinterpreting this, but the above seems to be accurate and I've never seen the status say "Skipped 0 levels in the last 5s" while sitting on a boss for 3-4 minutes. And if I cared to be critical of the text instead of extracting meaningful information from the intent of the text, that would be where I would start.

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

Successfully merging this pull request may close these issues.

2 participants