Day 19- Healthy

Day 19- Healthy

Quote of the Day: The entire conversation that Jared and I had with Alex about Quantum Computing/Mechanics.

Music of the Day: The entire Witcher 3 soundtrack. Amazing game, with a phenomenal soundtrack. My personal favorite is “Geralt of Rivia” (main character theme). “The Trail” is also awesome.

I came in super early today because I had to take my sister to school. Continuing on from yesterday, I started troubleshooting the boss’ health bar, starting with making it… y’know… actually appear. The player’s gotta have some way of tracking their progress, right? So I set out to do just that.

Thankfully, the code for health bars is already working and built into the game (as I’m sure you’ll remember from my wondrous adventures in the world of teleporters). So, in theory, all I had to do was copy the code over and change the variable names, right? Well, sort of. That does work in the sense that the compiler (thing that reads/interprets code) doesn’t throw errors, but it’s not quite as simple as that. The code for player health bars depends on a series of pre-established health bars in each of the levels that tell it what to look like and where to sit, and the code then basically makes a copy of one of those that can be updated. It’s actually super inefficient if I’m being honest, but it’s on the office list of “old code that needs to be updated,” so I may be working on that in the future.

So after copying over the code and making another of those pre-established health bars for the boss, I felt like I had it. But of course, I didn’t. I kept getting an error that said “Setting the parent of a transform which resides in a prefab is disabled.” Now, in essence that means that I was trying to set my boss’ health bar to be a child (subset) object of a prefabricated object, rather than the one in the scene. If you remember about prefabs, they’re just a chunk of objects and code that can be saved off separate, and then dragged and dropped into other scenes without having to reconstruct them from scratch. So basically, I was trying to make one of those external pieces of data the container for the boss’ health bar, which causes issues. That isn’t doing a full explanation justice, but it should suffice to explain the basic concept.

The solution was to actually instantiate a brand new health bar, rather than just copy one out and stick it in the HUD with the others. Turns out that this was in the player health bar code, I had just missed it by accident. So this is what the health bar looked like at first (bottom right):initialBossHpBar

Beautiful, isn’t it? OK so maybe it’s a little squished. OK so a lot a bit squished. I used what I had on hand, sue me. The giant compressed gummy icon behind it is actually the one from the enemy selection screen, so it’s meant to be much larger and higher resolution, it’s being forced to squash down. The little pink sliver is the health bar itself, I got the boss really low before I took the screenshot. Obviously it’ll look better in the future, but an artist (aka anyone but me) has to make an actual health bar image in Photoshop. Jeremy took a look and said it looked good (minus the squashed gummy), he just asked that I move it up to below the score counter. So this is it’s final position:bossHPBar v2.PNG

I have also officially petitioned to name it Timmy, Destroyer of Average-Sized Cities (or just Timmy), so we’ll see how that goes. Update: He will officially be called  Timmy, Destroyer of Average-Sized Cities. Whopee!

Then it was time for lunch, and I was feeling like some (cheap) Chinese food. Conveniently I had lunch plans with this cool cat: IMG_0555

We went to Golden Phoenix. It was pretty good as cheap Chinese food goes.

Then it was back to the office to polish off  Timmy, Destroyer of Average-Sized Cities. By polish off I mean move all of his files over to the master computer. Man I miss the versioning software. After a few small bumps I got that smoothed over, and the boss is now (almost) ready to be fully implemented into the game. As I write this Alex is behind me finishing some of the textures and effects up for the gummy projectile  so that it looks a lot more gummy-esque (rather than the giant white ball I had initially). With that done, Jeremy asked me to fix one small bug.

The bug was with the player health bar, as a matter of fact, in one of the newer builds. There had been a recent change so that the animation of the health bar draining/filling was smoother, rather than big chunks snapping in and out when you gained/lost health. However, the health bar is supposed to flash white when you take damage, and somewhere in the smoothness change a bug had arisen causing the health bar to flash white without stropping. It was a massive eyesore. So I looked through the scripts and determined the cause pretty quickly: the check that told it to flash white was based off of comparing the current health value and the previously recorded health value, however one was calculated as a float value between 0 and 1 (percentage without multiplying by 100, basically), while the other was the actual numerical value of health the bot had left. The fix was pretty easy, just multiply the first by the maximum health the bot could have and all was well. In the middle of that I got a surprise visit as well:IMG_0556

So yeah. Jared says hi. That was about it for today, I kind of meandered about for the remainder before heading off to home. The game is going to PAX East (One of the biggest gaming convention in the world) in Boston this weekend, so people are flying out on Thursday, which means I get Thursday and Friday off! More time to play The Witcher 3. I can’t wait.

If you’ve made it this far, congratulations! Go read Jared’s post. It’s wicked cool.

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