The holidays are on, but the bug smashing doesn't stop for Mark Abent in Bugsmashers!
As per usual, anything said during the show is subject to change by CIG and may not always be accurate at the time of posting. Also any mistakes you see that I may have missed, please let me know so I can correct them. Enjoy the show!
A bug where you’re supposed to pass out from too many Gs but instead you don’t pass out and lose control of your ship
The player animation system is enslaved to the vehicle, so any animations played on the vehicle also play on the player, this functionality gets called when the vehicle or player gets done with an animation and because the vehicle doesn’t have any animation it happens instantly
Mark Abent: Hey everyone, welcome to Bugsmashers. I’m your host Mark Abent, I’m a Gameplay Programmer here at CIG Los Angeles and I’m here to show you some bugs that were playing the game. Let’s take a look.
Hey everyone, we’re here in good ole Dying Star and we have a bug where if you turn off G-safety and you go full speed, you’re supposed to black out and play this, you know, animation like well you passed out. Then some time later you recover and go, ‘yeah, I can start fighting again’. However, weee… if we make the guy try to pass out, oh that was quick, we’re in an M50. So, in this code I’ve put some break points so when we actually black out, we’ll hit this little call step so I know when it’s happening and, let me remove this break point. We’ll continue while passing out but look he’s not passed out and I can’t… I don’t have control of the ship. Now we recover and I have sweet control and of course I hit an asteroid. Luckily I’ve god mode, let’s stop the ship, going way too fast.
All right, so what’s happening. Well, shenanigans, that’s what’s happening and a long, long time ago we introduced this little bit of code where it will start playing a black out animation til you fall down and then after the animation is done you recover and unfortunately that code is… well, still there and it expects that after the animation is done, you recover.
However, the animation and set up was changed so that it’ll play the animation and it’ll stay there until the code recovers. However, this bit of code right here actually when any animations get done it’ll just be like, ‘oh, I’m done’. So it gets you out of the animation even though the game code still have you in the black out state.
Unfortunately the way the mannequin works is we have the ship and we have the player, and we enslave the player’s animation system to the vehicles and we play an animation on the vehicle which plays also on the player. Now this functionality right here will actually get called when the vehicle gets done with the animation or if the player gets done and since the vehicle doesn’t have any animations, it’s going to happen instantly.
So that means, once you play the black out animation it will cancel because this bit of code here says, ‘hey, you’re done’ and then the guy goes back to idling. So what we want to do is add a bit of code that checks to see if we’re the main layer and if they call it the scope or the layer we’re on in the animation is the same as the scope we’re on here. So we’re making sure if we’re playing an animation on the player, we’re getting the animation when it’s finished from the player and not from the vehicle.
So, let’s hit the magic recode button. As recode happens, I want to show you guys a little fun bug that we discovered with visual studio. Apparently we have two structures here and they both have an inner structure, the only difference is that one has a named and one has anonymous. Now when we run this, it should set A to 66 to 777 on both of them, however when we run this we can see poor Robin using anonymous structure sets it to some randomized value which is horrendous because we use that same set up here in the radar data bank and it was causing all sorts of fun crashes because of a compiler issue. The easy fix, of course, give it a name, yay. Bugs.
All right, back to the original bug we have here. So recode is just finished, we put in the new code. Let’s give this a spin, oh we blacked out, and of course it’s playing the animation but we can’t see it. So, let’s try that again, we’ll go in first person this time. All right, we’re blacking out, hey we passed out and then we’ll recover. Yay, we recovered...oh, we hit an asteroid. Now since we’ve, you know, we’ve passed out now we’re recovering the animations are done so then the game code will give you back control of your ship and of course, I’m spinning wildly out of control because during this time I hit an asteroid and just went haywire. Let’s see if I can get control of my ship again, weeee. Nope, looks like I’m going way too fast but it’s kinda cool. Well, the animation now plays hope you guys enjoyed, until next time.
So, as you guys saw we had a little issue where, you know, you’re flying around in your ship, you do too much G’s you’re supposed to pass out and recover but what happened was it instantly recovered and you’re just like holding there. You couldn’t move because the game code still thought you were blacked out but it looked like you were ok. Fixed the code, so now you’ll play the animation and then you’ll play back out and then you’ll get all the controls so the black out and recovers works as expected. Looks pretty good, what do you guys think? All right, til next time, Bugsmasher.