Day 2- Achievement unlocked

Day 2- Achievement unlocked

Quote of the day- “I’m gonna have to do this for every single… God dammit” – Me

Music of the day- Spotify really liked Metallica today

Today started much the same as yesterday, it only took me about 5 minutes to have 20 tabs of chrome open browsing any forum, guide, or YouTube video I could to try and figure out how to get achievements working. After about an hour of random video-watching and forum-browsing, I had slightly more of a grasp on the concept than I did yesterday, but I was still confused. Incrementally I made progress, a line of code here, an error message there, before I managed to stumble onto my first “breakthrough” of the day. I had forgotten yesterday to list the SteamID of the game in the code, which had presented quite a few problems.

Now it’s time for everyone’s favorite paragraph, the Garrett-explains-what-the-hell-he’s-talking-about-to-people-who-aren’t-familiar-with-videogames-paragraph. let’s hop in, shall we? A SteamID (if you’ll remember from yesterday, Steam is the distributor that MiniBotz is going through) is the numerical identification (crazy right?) of a product on the Steam store, used to actually find it in the database when it is searched for. However, it is also the cloud location of any and all data stored for said game, which in plain English means that to find, say, the list of achievements for a certain game, the SteamID is retrieved and then the subsection of achievements is accessed. Code-wise, you obviously have to tell the game where it’s looking when triggering or storing achievement data, which I had neglected to do. It was a pretty simple oversight.

So after doing that, I felt encouraged and ready to take on the next step. That quickly went away as my console exploded into everyone’s favorite: the red wall of death (error messages). Now as you’ll learn in a bit here, I was getting errors not because I was missing thins in my code, but rather because I had OVERcoded the achievements and the system was confused as to what I was asking it to do. So after a couple of cans of Coke and some Red Vines (I am slowly becoming addicted to Red Vines. This Internship is also becoming a lesson in self-control), I went back to the good-ol’ forums. This time, I managed to access a private group on Steam that had a treasure trove of information, and I finally felt like I was getting somewhere.

Skip ahead about half an hour, and I managed to make something that (sort of) worked! It still threw errors and wasn’t consistently calling, but the conditional logic was there and it was systematically checking what it needed to. After a bit of assistance from Alex and some specific bits of code, I had successfully created an achievement called “Millionaire” that triggers when the player scores one million points in survival mode. After trying unsuccessfully to trigger it 4 or 5 times (I am not very good at the game) I realized that I could just change the number to something easy, like 1000. So, the game booted, I killed one gummy bear, scoring 1000 points, and hey presto I got an achievement popup notification. tabbing into Steam, I had in fact earned the achievement, everything had tracked exactly as it should have, and I now had a completion rate of 100%:

achievementI am just the best. Only took me 5 minutes to complete every achievement in the game. granted there was only one, but it’s something.

By now Jeremy had arrived, and after showing him my nifty (there it is again) achievement code, he had me make the options menu actually usable. It had been presenting issues, not saving user preferences, and above all was not changing the volume when the user moved the sliders, so when they game was launched you would be deafened by a maximum volume output. This was especially problematic for live streaming (did I mention we live stream MiniBotz and a few other games? Check out the Angry Skull Channel > https://www.twitch.tv/angryskullstudios. Shameless plug over) because the streamers had to tab into and out of the game to mess with system-wide volume settings. All in all, that project took me about 10 minutes of fiddling and changing 1 or 2 lines of code. I ended up consolidating the individual SFX and music sliders into one master volume slider and everything worked just as it should.

At this point I was feeling pretty good, I had gotten a ton of work done in only 3 or 4 hours, and was ready to start coming up with ideas for more achievements, but first I was asked to make a test build to make sure that the volume control would work outside the editor. here’s a mini-explanation paragraph on that: you can test your game inside the Unity editor itself, so that you can quickly make a change then test it right after. A “Build” is a fully executable file that you save onto your computer, it’s basically what the actual finished game is. So when you see a program with something like “V 5.0.1” or “Build 3.0,” it means that that program is on that specific consumer-accessible update. Making a build means you can test that everything will work when it’s all been complied together as a consumer would see it. It required me to click on the “build” button, real hard I know.

But in game development, nothing can ever be that simple. Try as I might, I could not get Unity to build. Turns out, when doing Steam integration, we had initially been using a plugin called Facepunch, and when we converted to Steamworks as mentioned yesterday, not all of the files from Facepunch were deleted, so while it was trying to compile it was receiving data from two identical sources and didn’t know which of them was the correct one. After about an hour of searching through every windows file I could, I could not find the duplicate file anywhere, so Jeremy had to send me the build on his computer, and because of an earlier series of unfortunate events in which our versioning software (The stuff that allowed us to all share files collectively without having to directly transfer between systems) had stopped working, I lost all of the progress I had made today. Thankfully, I was smart enough to copy my code onto a notepad file, so the process of redoing it all wasn’t as tedious and frustrating as it could have been.

After transferring the files, everything was peachy once more, and it (thankfully) only took me 15 minutes or so to redo all of the work I had just lost. Enter part 2: the endless tedium of repetition. When I had programmed the options menu, I had done it only for the title screen. Essentially, you were only able to change your settings right at the start of the game. Think of it like being able to change the volume and subtitle settings of a movie, but only in the main menu, never during the movie. This mean that I now had to do what I had just done for the title screen, but in every single level. Now, that makes it sound a bit worse than it actually was. First of all, there’s only 5 levels, so not too bad on that count (Ha, count. Math puns). Second, game engines make use of these nifty things called Prefabs (short for prefabricated), which are essentially saved off chunks of code and objects that you can just drag and drop into a level rather than creating it by hand all over again. You still have to drop in the specific parts for each level, but you don’t have to work fro the ground up every single time.

So, for each of the 5 levels, I changed all of this stuff:tedium

plus a bit more that I didn’t want to take a screenshot of. What you see in that picture is the completed version for one level. Everything is empty on a non-finished level. Needles to say, it was painful and tedious, but thankfully I had the wondrous tunes of Steppenwolf to drag and drop 100 times to. It was fun, in a masochistic sort of way (I’m making it sound way worse than it was, it really wasn’t that bad). With that finally finished at about 5:30, I built a final test build to make sure everything was working as it should (it was, else I would’ve had a conniption), and called it a day.

Tomorrow I get to add more achievements, which will be a lot more creative than today was. I’m looking forward to it. For now I’m off to the treadmill, it’s tempo day.

If you’ve made it this far, congrats, you’ve now read 2 days and will probably notice the emerging pattern of the openers and closers.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s