• Mike

Dissertation Diary: High Scores & Thinking With Portals

Welcome back ladies and gentlemen!

Last week didn't have much to show since it was focused on getting documentation done and dusted, but this week I've got some very nice little features to show you - so let's jump right in!


Introducing ℍ𝕚𝕘𝕙 𝕊𝕔𝕠𝕣𝕖𝕤

One of the main features I want to try replicating is the high score leaderboards you would have on any classic arcade game. I did some digging to try getting me on the right track, and the base table looks like this:

Basic High Score Leaderboard Table Unity
Basic High Score Leaderboard Table

Unfortunately, the image isn't very clear to look at with the colours bleeding into each other, but inside the game it is much, much crisper. I may need to change the fog colour to help make future images cleaner to view, but for now please take my word that it is in fact sharp and easy to view in game!

During testing, I populated the table with some pre-defined values to see how it looks with a full leaderboard up to 10th place, with data for positions after 10th not being used by the table. I also wanted to have the top spot highlighted in a distinctly different colour from the rest of the board, however I ran into some troubles, with this being the initial result:

Populated High Score Table With Incorrectly Coloured 1st Place Unity
Populated High Score Table With Incorrectly Coloured 1st Place

As you can see, the top spot is just black. Not the best colour to try highlighting the #1 player! It was supposed to show up in green, and on closer inspection it seemed that the colours were somehow being mixed to make a very, very dark shade of green, but you could only tell when really zoomed into the text. After a while, I finally discovered what was going on; I had set a 'Face color' for my text's material inside the Inspector window to be one colour whilst trying to change the vertex color of the characters within my script, causing the two colour values to be mixed together. The fix was nice and easy - reset the Face color back to white, and huzzah, there's now a unique colour for 1st place!

Populated High Score Table With Correctly Coloured 1st Place Unity
Populated High Score Table With Correctly Coloured 1st Place

To get this basic table working, I learned about something Unity uses called PlayerPrefs which are for things like saving and loading persistent data, in addition to many other little features that I've not encountered before, so it was quite the learning curve!

This table is by no means complete; first, I need to add a means of checking if the player's score is in the top 10 and if it is, give them the ability to input their name. This will be even more of a task as I need to find a good way of doing this in VR, but I am toying with a few ways of inputting this. It may be manual like the arcade games did it, or perhaps I will grab the name from the computer to populate the "Name" field. If it's beyond my abilities to integrate, I may adapt the high score into something like the highest score for the level, but we shall see!


Adding Portals

Something that occurred to me in the recent weeks was "what interesting way could I have my enemies appear or disappear if I gave them the ability to 'escape' the levels?", which is where the idea for adding portals originates.

So, I began to learn about even more new things, this time it was VFX (visual effects) graphs and more PBR (physically based rendering) graphs! I've created one of each just to get me set up with some of the basics and to give me options for different types of portals I may want to add across my levels, and here are the fruits of my labour …


This first portal is the main showcase that uses the power of VFX graphs for multiple effects, including a startup glow, blast of light, breathing and much more. For visual aid, I added in a torus object using ProBuilder to act as a physical border for the effect. The glowing rings you can see use custom drawn circles I made with Adobe Photoshop, with the rest being done inside the VFX graph.


This second portal uses the PBR shader graph to create the main vortex effect as well as 2 particle systems; one for the coloured particles moving around, and one for a faint black backdrop (although this might be hard to see). Although this is not as visually impressive or dramatic as the previous portal, it still looks quite nice, and so may yet find a home somewhere in the game! Creating this one with the PBR shader graph was necessary to achieve a similar effect in the VFX shader, hence why the vortex effect can be seen in both videos.


Closing Thoughts

Not too bad considering a couple of days of work were lost due to travelling to London and Cornwall, so I think things are shaping up quite nicely! There is of course plenty left to do, with a fair few items being half-baked now, so I may try to get those features fully implemented in the coming week. It is good fun adding in some new additions to the project, its spawning all sorts of nifty ideas that I'd like to eventually try creating!

Well that's all from me this week, so thank you for continuing to read these updates, and I shall see you next week - buh bye! :)

10 views0 comments