Hi there, could someone please explain this to me:

I don't understand why the player named "Yo" is ranked 3rd, I thought he should be ranked 4th.
Is ranking not just based on the score?
Am I missing something here?
Thanks!
Patrick
ranking confusion
(14 posts) (3 voices)-
Posted 2 years ago #
-
Yes, ranking is based on the score.
It's a bug. Something is wrong with your rankings but I don't know what.You might be triggering the "2 transactions" issue.
Rankings are using 2 transactions (instead of 1) to store the scores and the rankings.
If the 2nd transaction fails, the 1st is not rolled-back.Posted 2 years ago # -
I see.
Is this "2 transaction" issue discussed anywhere?
Any way I can try and avoid creating this situation?
Thanks,
PatrickPosted 2 years ago # -
I've mentioned the "2 transaction" issue in this forum.
Basically, the "ranking" feature is still in experimental because of this issue.The bug is not very common, but it is there.
Here are the instructions to fix the bug:
http://groups.google.com/group/google-app-engine-ranklist/browse_thread/thread/36ecaa495b6c3413(see the last 3 messages)
Posted 2 years ago # -
I've read over that post, but it seems to me that the bug is in the code of the cocoslive server, so I couldn't do much about it.
Is that correct or am I missing something?
Also, if I delete a score, will that mess up the ranking even more?
cheersPosted 2 years ago # -
Yes, the bug is in the server (the server is open source too).
I'm not sure what would happen if you delete that score, but I would do it.Posted 2 years ago # -
I saw that bug also. I think it started when you enabled deleting scores when ranking is enabled. I see you're talking about those "2 transactions", and I am sure something is not updated, as it should be, when you just delete some individual score...
Posted 2 years ago # -
Something has changed.
If I go into the cocoslive page of the game to edit the scores,
the "pos" field now no longer shows the ranking, but simply what number the score is.
The game itself still shows the ranking, incorrect still.
I tried deleting a few of the scores that might be the source of the problem.
That seems to have fixed the ranking, as it is correct now.
I hadn't deleted any scores before though, so the bug must have been caused by a score posting.I'm doing something to retrieve the ranking for a player.
When the player submits a new high score I locally save the username and score, then when a player wants to check his rank later on, he can go into the options and look at them.
To retrieve the rank, I re-send the score with the same "cc_score" and player name, and I get the rank back.
Is that wrong?
Could that be causing the bug?
Is there a better way to retrieve rank for a player?
Cheers
PatrickPosted 2 years ago # -
Eh, then I was wrong. I spotted that bug after I deleted some scores, so I thought it could be the reason.
Posted 2 years ago # -
@patrick: what you are doing is not wrong, but it's not the best approach.
The server supports "queries by score / queries by rank" but the client doesn't, yet.But you can implement it manually.
What is the ranking of the score 10.000 of the game DemoGame 3 for category easy2 ?
http://www.cocoslive.net/api/get-rank-for-score?gamename=DemoGame+3&category=easy2&score=10000So, instead of saving the name-device_id, you should only save his best score, and then query by that score.
Posted 2 years ago # -
I am also saving my last player name locally, because if I want to get his rank with PostScore I get just the first row in the table with that rank, so cc_playername could be somebody's else...
Posted 2 years ago # -
Yeah but if the score is the same then the rank is the same and it doesn't really matter I suppose.
I just don't know how to make a call to that page from within the iPhone, I've never done anything of the sorts.
Any hints/code?
cheersPosted 2 years ago # -
Sure it doesn't matter for the rank itself, but I am displaying the whole row including player name and country, so I must save them locally
Posted 2 years ago #
Reply
You must log in to post.