How to create a High Score Table (saved)

Hello!

I`m trying to create a game where you control a character running straight forward and dodging objects / picking up objects. I have a timer which counts down from 60, and at 0 I use “SetGamePaused” to stop the game and bring up the new widget, where I want a High Score Table to appear. The “score” is the amount of objects you have managed to pick up during the 60 seconds. I do have a pick-up system working where it does count every pick up and adds it to the view port when playing.

The problem is that I cant figure out how to bring the score into a “high score table”, and even harder for me, is how to make it work like a high score table in the sense that it puts the highest score on top and so on.

Does anyone know any good tutorials to this, or does anyone know how to do it? Screenshots of blueprints is really helpful, as I am very new to Unreal Engine 4 and blueprints. (I have the basic knowledge only.)

I really hope someone has an answer for this, it would save my game! :wink: (Also I know loads of people are wondering the same thing, as there arent many tutorials showing how to do exactly this, but only showing how to make a score and counter.)

in c++ you can sort arrays, but in blueprint its a bit trickier. if you have an array of Ints representing score, you can organize that array by copying the Max Int from the array, to another array, and removing it from the first array. keep doing this until the first array is empty, and if you want each score to have a name or a structure of data, those should go in a separate array that is kept in sync with the integer array. every time you copy over a score from the integer array, you should also copy over the name/data that corresponds to that score. so basically 4 arrays, copying from 1 pair into the other pair, keeping the score separate from the rest of the data so you can sort by it.

Thank you for the quick quick, @ScottSpadea ! I will try what you said, and hopefully I understood what you meant!

If someone has done it and has screens of blueprints showing this it would be amazing tho!

you may never have to sort it at all, if you insert new scores into the list in the proper location in the first place. first, check if the new score is greater than the first score in the array, if not, you didn’t get a high score. if it is greater than the lowest score in the array, foreach through the array, comparing the new score with each score in the array, until you find one larger or reach the end of the array, then insert the new score at that index.

Thanks for the reply’s @ScottSpadea ! I tried reading it and understanding it, even tried it (I think), but it seemed a bit complex, so I tried a tutorial. Maybe you understand the tutorial it better than me?

So I’ve looked at a tutorial. I followed the youtube tutorial
( Unreal Engine 4 Guide - Scoreboard - YouTube )
and it gave us this:

(It’s a LARGE ((2104x2272)) picture, where we gathered it all, so if you want to take a look you should download it and zoom in to see it more clearly if you already cant).

I see how this would work, and I understand most of the setup. However there are a few details which I need to understand in order to make this work for my game. As you can see in the «PlayerController» blueprint, there is a red box around a Integer variable that I named «fix». The guy in the tutorial (as far as I understand) uses that integer to connect it to the coins he picks up (which gives him a score), and thereby connecting the score to the Score Board.

Here you can see our Object PickUp BP:

(again, you should download in order to see clearly, if you already cant.)

You may notice the yellow marked integer. Is that the integer we’re suppose to somehow use in the «PlayerController blueprint» ? Or is it something else? At this point I`m a bit stuck.

Hopefully someone knows what I’ve done wrong / what I’ve missed.
If there are any problems with the images, please let me know so I can post ever picture in single files with better resolution.

Keep in mind I`m not a blueprint expert, so please be gentle with the techincal language! hehe. :slight_smile:
Thank you in advance!