Subliminal
Bugsmashers

Star Citizen: Bugsmashers - Episode 30

10 August 201600:08:34168 linesWatch on YouTube ↗

Transcript — every row opens the video at that moment

  1. 00:00:06

    [Music] Hey everyone, welcome back to Bug Smashers. But before we begin, I got a small riddle for you. If I fix a bug, but there was no jur for the bug, did the bug even exist? Bug smashes. Hey everyone, we are here in another fancy dancy test level and we have a fun bug where if we're in the buggy um on a normal plane, everything is fine. But as soon as we have gravity um that's not aligned to the standard

  2. 00:00:57

    world Z, you know, Z down, uh we get some fun issues with the view. So, let's take a look at that. So, if I pop in third person, oh no, all the shenanigans. uh this buggy code was written with the assumption that um the world Z was always pointing down. But if you have, you know, let's see, you have something like I have here where we have a uh gravity box pointing 45° to the side and not world Z down, uh the code just goes bonkers because it makes assumptions that it shouldn't be making. So, let's pop out, turn our free cam off. All right. Uh, so hop into our legacy

  3. 00:01:50

    buggy code. Um, this particular view or this vehicle seat view is for the buggy or basically any um, what do you call it? Uh, driving vehicles. And what it does is as you're driving, uh, I can show you, hop in. So, as you're driving, it kind of wants to keep the view towards the Whoa. No, I flew off. Ah, I have to increase gravity. The shenanigans game design. All right. Always something. There we go. Increase our bounding box. There we go. All right. Back to the

  4. 00:02:44

    buggy. Um, what this view tries to do is as you're moving, it tries to center the view behind you or towards where roughly the velocity is. So, if I'm moving this way, it tries to rotate you behind. And if I back up, it will try to, you know, go behind my uh buggy. Uh it's mostly so that you could see roughly where you're driving towards. Um if it always was behind you or in one particular view, you could hit a wall and not know why. So it's a pretty nice fun thing. And of course, you could move around. Um but then if you let go of the mouse, it will try to reorient itself. And because it's assuming that fun um Z down issue, we get all sorts of alignment stuff when we

  5. 00:03:33

    have gravity that's not in the same alignment as the world, especially for planets where you know you're going to have a sphere and the Z the gravity is always going to be relative to the um the planet. So we can't always assume world Z down. So, we had uh Chad Zamzo create a nifty little fix where if I uncomment this, he basically has this thing called a gravity rotation. And it's a matrix he's using to figure out u if all the code here before assume that Z down. So, if we're going to assume that all the code is going to stay like that, but we're going to have a rotation. this uh grab rot basically says all right we assume this is all the way Z down but we're going to move it

  6. 00:04:22

    this way uh this is what this little grav uh rotation gives us. So it's like all right we could keep the code that everything's sound but we're going to assume that we can modify our gravity so this guy says what our offset is. So, what we can do if we trace all the areas that use this new thing, u we could get our velocity and then check to see what our um rotation is going to be and use that um to determine, you know, how we're flying along the axis and do all sorts of fun little updates. So uh he transforms you know the velocity the angular momentum and if we pop down

  7. 00:05:14

    uh where is it in here the second thing he finally does is it's at the very end but uh we shoot a ray trace. So given that that we have transformed I could use my little fun little car. So if the Z's pointing this way and then we rotate it this way, we apply the offset to the whole view and we even apply it to when we do trace lines so that if you're against the wall, you know, it will bump into it in the correct location and rotate according to that um uh gravity bounce. So, if we pop back in with his fun fix recode, what's cool is since he's using the gravity straight from physics, this will

  8. 00:06:01

    work if you're in a buggy that's driving inside of a constellation or a bigger ship, if you're on a planet, if you have a gravity box, it will just work depending upon what our fun gravity is. So, back to our nonworld uh Z-Gravity. Hop back in. Turn on our car. Go to third person. And voila. As we move around, uh, he applies the offset. So everything works just as expected. You know, the code assumes everything was Z down. But because he's now applying that offset, everything gets lined up correctly. the position, the rotation, and even the speed. So, as you're

  9. 00:06:49

    zooming by, the camera will pan towards your velocity. And if you back up, it will go the opposite way. Of course, it's limited by um some par parameters by the designers, but it works as expected. The beauty of this is if you're on a planet and if you're going around and around, it aligns up correctly with the gravity. So, as you go around, your camera is stuck to the vehicle as it should. Well, hope you guys enjoyed. I'm going to fly off into outer space. So, the buggy had some buggy code uh where it assumed that the gravity was always pointing Z down. So, if you rotated the gravity so it faces this way instead of down, the camera just goes ballistic because it's

  10. 00:07:37

    still assuming it's down. And uh good old Chad had a little nifty fix where he figured out what the actual gravity was. So even though it assumed this way for the code, we could find the offset and then apply the offset to the velocity, the angular velocity, basically everything that was needed that the camera assumes and rotates around. And he just applied that offset to it. Worked like a charm. The buggy is no longer buggy. And oh, that's never going to get old. And now everything works as expected and you can drive around the planet or even weird crazy gravity vectors and the camera stays behind like it should. Hope you guys enjoyed. Until the next buggy bug.

Transcript from YouTube’s automatic captions — punctuation and Star Citizen jargon are approximate. The video itself is hosted by CIG on the official channel.

Squadron 42

LiveSQ42 Launch Subathon

$2,094of $3,000

Getting Sub to Manchester for the Squadron 42 launch

Next giveawaySubscriber Store pick
$6.27to go