[b]Hello, you herbaceous enthusiasts of agriculture![/b]
I hope everyone has had a wonderful week sweating through finals, submitting term papers, finishing up "that project you've been working on" - and, of course, touching some grass!
Yes, summer-time is quickly approaching. With each passing day, it's getting warmer and warmer! The birds are chirping, and it's perfect beach weather outside! You know what that means, friends!
It's finally time for us gamers to [b]*SLAM*[/b] that window shut, set the air-conditioner to "maximum blast", and plop down in our elite gaming chairs with an ice-cold can of [i][b]Monster[/b][/i] energy drink. Warm weather is disgusting, the beach is lame, and these stupid chirping birds are preventing me from listening for footsteps at Long A.
Go away, birds! I'm trying to get out of MG2!
...
Anyway, let's talk about Dev Stuff!
[h2]Broken Leaderboards (kinda)[/h2]
The Leaderboards for [i][b]Touch Some Grass[/b][/i] have been UTTERLY DESTROYED by some of you "Golden Gods of all that is Green and Grassy". It has been just over a month since the initial release date, and some of you have already managed to exceed the roughly 570-hour limit on the Leaderboards.
Let's talk about that, and take a look at how I "fixed" it -
[h4]WARNING: RAMBLING NERD STUFF AHEAD. EXPAND AT YOUR OWN RISK.[/h4]
[expand]
[h4]The Problem[/h4]
Steam Leaderboards require a "32-bit integer" ("int32" or just "int") variable to store the numerical information associated with a player's score. This is what professionals in the game-development industry refer to as "silly" (just kidding, please don't hurt me).
By default, an "int" has a maximum value of 2,147,483,647. In [b][i]Touch Some Grass[/i][/b], I convert the in-game time to an "int", by allowing the "int" to represent the total number of milliseconds associated with a player's score. Then, when the Leaderboard score gets pulled to the client, I convert it back.
Because of this requirement, the limit of the Leaderboard was 2,147,483,647ms total, or roughly 570 hours (plus some minutes, seconds and milliseconds in there). I honestly never anticipated players would exceed this number any time soon. However, I've clearly been proven wrong, and I'm actually blown away by how awesome you are!
[h4]The "Solution"[/h4]
I looked at the conversion I was running to translate the total time to an "int", and noticed that there was a trailing number that didn't get utilized in the score information. This is because the player's time is actually recorded in milliseconds (thousandths of a second), but in game, we only display hundredths of a second (Or, "centiseconds". Yes, this is a real word. Look it up. I'll wait.).
In order to get the "int" to "hold more time", I decided to pull a "big-brain 5head pro gamer move", and scheme on the aforementioned conversion process...
First, I convert the time into a "64-bit integer" ("int64"). By default, an "int64" has a maximum value of 9,223,372,036,854,775,807 (that's a big-boy number!). Then, I divide this value by 10, to shave off the last digit. In the wise words of Albert Einstein, [i]"This gives more room for the numby to go uppy!"[/i]
Lastly, I convert the "int64" to an "int32", and submit this value to the Leaderboard. [b]BOOM![/b] Now the limit is 2,147,483,647 centiseconds, or roughly [b]5,900 hours[/b]!
[/expand]
Essentially, I did a thing, and the new limit is going to be [b]5,900 hours[/b]. When this update goes live, there will be a [b]new Leaderboard system[/b]. Players will need to play just *one game* in each mode to re-submit their scores to the new system.
AGAIN, SCORES WILL NOT BE RESET. THEY JUST NEED TO BE ADDED TO THE LEADERBOARDS AGAIN. NO ANGRY EMAILS, PLEASE.
[h2]Cosmetic Collection System[/h2]
This week, I focused heavily on the updates necessary for the Experience and Unlock System. All of these updates are in anticipation of the upcoming new "Survival" game mode. This week, I started work on the new Cosmetic Management system, which is progressing nicely.
This new system consists of a menu where player's can select their preferred Hand and Skin, and view their complete collection of Hands and Skins they have earned by playing the game. Here's a quick sample of what that screen looks like in-game -
[img]{STEAM_CLAN_IMAGE}/42182142/c7e257b5d32f1f79556c68c34a7ecd993109d148.jpg[/img]
The left and right arrows will allow you to select your Hand, and the bottom container will show all of the available Skins you have earned for that particular Hand! This new system will ultimately replace the "toggle skin" button in-game, which will now only switch between the "left" and "right" versions of the Hand and Skin you have previously selected.
[h2]Final Thoughts[/h2]
Everything is progressing nicely, and I anticipate having this update ready for release in the next week or so! I hope you all have a wonderful week, and I look forward to sharing more progress with you soon!
And as always, happy grass-touching my friends! ːsteamhappyː