High Score Logic

If the game is a human versus a computer player, how do I track high scores? Do I only track/sort human scores? If not, I could see where all the high scores could end up belonging to the computer opponent. On the other hand, if I only track human scores, the high scores could end up being all losing scores. And what about sorting the scores? If there are two scores for each game (winner/loser), do I sort by the highest in the game, or by the highest human score, or maybe something different like the difference between the winning and losing score?

Alternatively, is tracking high scores a “must-have” feature? What about just remembering the most recent games?

I’d appreciate any ideas or suggestions.

Hi scores seem to be quite a standard feature. How you track them? Could place slots. I only do one. So, when a level is completed, I calculate the score, them I retrieve my stored hi score, set in PlayerPrefs. If crntscore is greater than hi score saved, make current score hi score.

Not that complicated really.

I think you misunderstand. Sounds like you have one score per level with no opponent. I have two scores, and there are no levels.

It’s a game, human against computer. Like bowling, or darts, or pretty much any sport. At the end of the game there are two scores, for example, Human: 10, Computer: 8.

You could try handicapping… If a high score is generated whilst losing you could use the difference between scores as a handicapping mulitplier. That way two high scores of the same value where one has beaten the computer and one has not would cause the one who beat the computer to have the higher handicapped score. Conversely the difference of the human over the computer could be handicapped in the positive direction. That way s two humans beat the computer with scores of ten but one did it by two and the other by three then the one who had the 3 point spread over the computer has the higher handicapped score.

HTH

Human scores only, and only if they win.

Well, hopefully this is what you want…

Just have two hi scores. One for player, one for computer, you can compare them against each other directly of course but you can also compare them against older scores.

function setScores()
{
PlayerPrefs.SetFloat("playerHiScore", playerScore);
PlayerPrefs.SetFloat("computerHiScore", computerScore);

If it is just two scores. Hopefully I am understanding you now.

Thanks. I know how to save prefs. It’s the game logic I was looking for some advice on.

One other complicating factor I forgot to mention, you can play to a set score or to a set number of turns. For games played to a set score, the high score will be the same for every game.

I don’t know man. I don’t really get what you are asking.

I would store the last 10 games played, showing the player score and computer score with some kind of identification as to who won:

formatted nicely with color indicating if the player won or lost, and sorting it by winner on top.

in terms of logic, basically: if A > B, highest score = A; else highest score = B

That not bad ^^^. A good example you should perhaps look at is Letterpress. The iOS app, game does not show hi scores, but all scores. Where it is you Vs a friend.

Thanks for the suggestions. Just looking at some card and sports games where a human plays against the computer to a set score. Rather than high scores, they all (the ones I’ve checked) list the results of the most recent several games. Some also give some statistics, like human vs. computer winning percentage.