-
Notifications
You must be signed in to change notification settings - Fork 124
Prepare for more scoring data. #286
base: develop
Are you sure you want to change the base?
Conversation
Didn't see this - was commiting when this came up. @clemens-tolboom conflicts... |
8e81026
to
5bb660d
Compare
|
||
oContent.push('games played: ' + bot.scores.length); | ||
oContent.push('a: ' + Math.round( | ||
bot.scores.reduce(function (a, b) { return a + b; }) / (bot.scores.length)) + | ||
bot.scores.reduce(function (a, b) { return a.score + b.score; }) / (bot.scores.length)) + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 1222 exceeds the maximum line length of 100.
Unexpected space before function parentheses.
Fixed. But why does 753b883 has not an issue # attached? |
@clemens-tolboom What issue ? |
Hmmm ... need to test my merge! |
@ermiyaeskandary each commit should be related to an issue / PR if possible. (me no saint either). My guess is commit 753b883 is related to #260 Tested my rebased branch. No UI change but this is what I see more games I see @ermiyaeskandary I did a bad use of reduce :( var avg = Math.round(bot.scores.reduce(function (a, b) { return a.score + b.score; }) /
+ (bot.scores.length)); does not seem a proper use of reduce by my change. Argh. I must stop derailing my own work. @ermiyaeskandary you mind to help? |
@clemens-tolboom Did it work before the commit I did ? |
Take a look here: #203 Also, I was wondering if we could gather the scores from users. |
Fixed it. @tjorim thanks for the link. I would propose to add a new 'pane' containing your data including browser and OS. Then bot bug reporters and developer can use that new 'pane' This is now good to go (pfew) |
This does allow for more data - but do we need more data ? |
I said it @ several places. The score is not enough but I've updated the summary |
@clemens-tolboom Correct but we only need average score to test the effectiveness. But I see where you're coming from - it needs to be a fair test. |
I'd argue we need the median, but yeah overall I agree - the other stats are distraction. |
I just played this games played: 270
a: 177 m: 34 1. 9585 2. 5233 3. 5233 4. 5095 5. 5095 6. 1690 7. 1227 8. 381 9. 347 10. 347 and the stats gives me no clue on the why. Having # players + highest 10 could give a clue about it's performance. The stats could be csv exported into spreadsheet for all games. About mentioned score ... I guess it's due to screensaver. So duration played would help a lot too. |
See #260 too |
I guess it's fair that more info would help us figure out why the bots scored as they did. One thing I've noticed is that the average is always higher than the median. There seem to be lots of short runs with quick deaths. |
3e62892
to
4c4f66d
Compare
@@ -1456,5 +1464,6 @@ var userInterface = window.userInterface = (function() { | |||
setInterval(userInterface.framesPerSecond.fpsTimer, 80); | |||
|
|||
// Start! | |||
bot.startTime = Date.now();; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing whitespace after semicolon.
Unnecessary semicolon.
' m: ' + median); | ||
|
||
for (var i = 0; i < bot.scores.length && i < 10; i++) { | ||
oContent.push(i + 1 + '. ' + bot.scores[i]); | ||
oContent.push(i + 1 + '. ' + bot.scores[i].score + | ||
' in ' + Math.round(bot.scores[i].duration/1000) + 's'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Infix operators must be spaced.
I've added the game duration. and a bad table which could become nices (but that's another issue)
|
Ping me this weekend if I haven't gotten around to testing+approving it by then. My PC's hard drive started clicking so I can't leave it running tests until I get a replacement drive. |
Please check whether by code flow for resetting is enough. There is
My guess is we can do a refactoring through another issue with a new |
Can this be merged? Future: found export to CSV https://jsfiddle.net/terryyounghk/kpegu/ which could export the terse version. {
score: score,
duration: duration,
topTenScore: [1,2,3,4,5,6,7,8,9,10],
numberOfPlayers: 497
}; |
@clemens-tolboom Needs to be tested and then approved... |
All y'all doing the testing need to compare against the develop branch... standalone results don't mean much. That said I expect this will not impact performance much or at all, but it's still worth testing. Holding off my approval until my PC is repaired and can do testing, or if I see someone else has done a head-to-head comparison. |
f9a92e4
to
e3a98a6
Compare
median = Math.round((bot.scores[Math.floor((bot.scores.length - 1) / 2)] + | ||
bot.scores[Math.ceil((bot.scores.length - 1) / 2)]) / 2); | ||
|
||
var avg = Math.round(bot.scores.reduce(function (a, b) { return a + b.score; }, 0) / |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected space before function parentheses.
Testing today - I will only do about 10-15 games as it shouldn't affect performance at all like @ChadSki said but you never know - removing vars seems like it can't affect performance and it did so I'll test head to head with develop - @clemens-tolboom will probably be merged into master this week if there are no performance issues. 👍 |
In https://gitter.im/ErmiyaEskandary/Slither.io-bot?at=575bd2ff97e1b2d245e1d05c @ermiyaeskandary reports a performance decrease but this PR but rechecking the code that could not be as the code AFAICT is ran outside the game. |
My results might have been anomalies but please correct me if I'm wrong: |
@clemens-tolboom the extra calculation in If you changed the code so that My PC is fixed so I can run tests overnight again. |
}); | ||
userInterface.updateStats(); | ||
} | ||
|
||
if (window.autoRespawn) { | ||
bot.startTime = Date.now(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change suggests bad state management. We should have some bot states to check our code against
- Not playing
- Connecting
- Connected?
- Playing
- Dying
I think my reply on #286 (comment) is gone to /dev/null (wtf) I have no clue of what is wrong apart for
|
I think we had all those states until the rewrite from @j-c-m, now the code
|
The function was called every frame before your changes here. The difference is that you're adding more calculation to the function that's called every frame, which slows down the bot.
Because we shouldn't be recalculating updateStats every frame in the first place. |
Description
This patch only prepare for storage of more score data. Others can gather the other data.
Our scores only contain the snake score but there is no context for the score
Competing snakes
In a dense arena (bigger snakes) you can score more easy and probably die too.
Number of snakes
Playing with 400 or 500 does matter I guess
TESTING STAGE
No test needed apart from does it break the score list.
Types of changes
Checklist: