High score table malfunction on specific level

Found a bug in R'n'D? Report it here!

Moderators: Flumminator, Zomis

Post Reply
jm28121977
Posts: 84
Joined: Thu Aug 16, 2018 8:04 pm
Location: England

High score table malfunction on specific level

Post by jm28121977 »

Hello

Contributions 2003 > Sam Bateman > level 35

It's a weird level where the score goes over the 5 digit display because you get 250 points per emerald and you're basically running through a narrow tunnel with no choice of route, being forced to collect every emerald in the level.

My score was something like 36204 (actually 136204) but it shows 5133 on the high score table. It's also ordered them incorrectly, putting a 5127 above a 5133.
Screen shot.png
Screen shot.png (664.91 KiB) Viewed 1294 times
Lots of love
Jamie xoxox
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: High score table malfunction on specific level

Post by Holger »

Whoops, that's two bugs in one go! :shock:

Very strange behaviour indeed, I'll have a look at this, and will try to reproduce it!

Update: At least it's apparently a problem of displaying it correctly in the local R'n'D, as you are currently listed in the high score server on the first rank for this level, with a score of 136205 (which is shown as "36205" in R'n'D).

Could you please quit R'n'D, restart it and go to the hall of fame for this level again? Are the scores still ordered incorrectly (regarding both problems you described)?
filbo
Posts: 647
Joined: Fri Jun 20, 2014 10:06 am

Re: High score table malfunction on specific level

Post by filbo »

136205 - 2^17 = 5133, so it looks like the score's being passed through a 16-bit integer somewhere...
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: High score table malfunction on specific level

Post by Holger »

You're right here, filbo -- score values are indeed stored as 16-bit values in the local score file. Of course, this results in wrong scores being stored and shown if scores exceed 65535, which is bad (even though the correct score is uploaded and also retrieved again from the high score server).

This also explains the wrong order of score values, as all new scores will always be higher than the (truncated) previous entries, putting the new score at the top position, but then truncating it when saving. (Score values are not sorted when loaded from score file, but are expected to be already sorted, which is true, as long as this bug does not occur.)

I've fixed this problem by using a new score file chunk with 32-bit score values if needed (which should not happen that often with most levels). Also, truncated local score file entries will be replaced with the corresponding score entries retrieved from the server. (This only works for the highest local score, as the server only returns each player's highest score entry for the current level, so all other truncated local score values won't be corrected.

The fix will be available with the next bugfix release version, which is expected to be released very soon.
jm28121977
Posts: 84
Joined: Thu Aug 16, 2018 8:04 pm
Location: England

Re: High score table malfunction on specific level

Post by jm28121977 »

It has now put me top when I reopened R'n'D.
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: High score table malfunction on specific level

Post by Holger »

This bug should be fixed now with the new version 4.3.1.1 (just released a few minutes ago). It does not fix existing truncated scores, but should prevent such things in the future. Please check it out with the level mentioned in the first post!

In addition, although the score value in the hall of fame is still limited to five digits, the number of digits of the score display in the game panel during the game will now be dynamically extended, if the score gets higher than 99'999. (This should usually not happen, but with some levels, it happens nevertheless, so I think I will not enforce it for levels like the above, which would else have the same score for all players.)
filbo
Posts: 647
Joined: Fri Jun 20, 2014 10:06 am

Re: High score table malfunction on specific level

Post by filbo »

> It does not fix existing truncated scores

Since the high score server does know the true score, shouldn't the client receive that and therefore the person who[se RnD] uploaded that tape see the correct score, even in their own local RnD user interface? Unless they're playing offline.

And if they're playing online, couldn't the client notice and actually correct the local saved file? (I think lazily: only if / when the user ever plays that level again; not as an automatic scan over their entire local repository of tapes, the first time they run a new enough client...)
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: High score table malfunction on specific level

Post by Holger »

Since the high score server does know the true score, shouldn't the client receive that and therefore the person who[se RnD] uploaded that tape see the correct score, even in their own local RnD user interface?
In fact, the latest version does just that! It works as described a few posts before:
Also, truncated local score file entries will be replaced with the corresponding score entries retrieved from the server. (This only works for the highest local score, as the server only returns each player's highest score entry for the current level, so all other truncated local score values won't be corrected.
This means that your best score will be corrected locally using the score from the server (if needed), but not all your other scores for that level (if played multiple times). As you are right that the server has them all, it would indeed be possible to query all those scores, too, and correct the locally stored scores, too. The problem here is that I cannot see from the locally stored scores if they have been truncated or not (and most of the scores will fit perfectly in 16 bit integers, I assume), so I would have to do it always, all the time, for all local scores, even if it is not needed (which is probably the case most of the time).

So the reason that this will not be supported is that I think it's just not worth the effort to write the required code for it, and that I don't want to query all local scores from the server every time if it is just not needed 99% of the time. (And it is only a small time window where this could have happened, namely between adding score server support in 4.3.0.0 and the latest 4.3.1.1, which is about three month, and most levels played during that time probably do not have maximum score values of over 99'999.)
Post Reply