Upcoming Events! Community Event Calendar

Bugsmashers: Episode 34 Written Wednesday 12th of October 2016 at 02:30pm by NYXT

It’s the Bugsmashers! after Citizencon! Let’s see what Mark Abent has in store for us..

TL;DR (Too Long; Didn't Read)

As is with any information on our transcripts and summaries, everything posted is subject to change by CIG and in some cases may not always be 100% accurate at the time. While we strive for accuracy, mistakes do happen so please let us know if you find something amiss that we didn’t catch. Enjoy the show!

  • The bug: When a tire on the rover explodes, it is meant to fall off and roll around with physics - in this bug, it instead chose to float away.
  • This was caused by the mass not being provided to the function calculating the geometry. It was attempting to calculate it instead.
  • A quick change to the interface, the function and the calling code and the mass was being provided.
  • Mark then blows up the tire again and everything works as expected.

Full Transcript

Mark Abent (MA): Hey everyone and welcome to Bugsmashers! Hope you guys enjoyed Citizencon, I know I did, it was fun meeting and greeting you guys - I can’t wait to do it again. Today we got a special bug for you today - it’s a little bug we had to deal with before showing you guys that demo. So let’s take a look.

Hey everyone, we’re here in this fancy level - look how wonderful it is, it’s beautiful. But we have here a Rover and in case you guys didn’t see the demo, you basically would fly in the Constellation, land down, go in the rover then head out into the oblivion. And sometime later you would actually get ambushed and your front wheel would just pop off from an explosion - boom! - then you get out and shoot all the baddies.

So, it actually didn’t look like that the very first time the designers set it up - in fact it looked quite strange and I have here the test conditions of what it looked like - so let’s see what happens when the explosion happens and then the front wheel is support to fall off. I’m going to hit the magical button. Boom! Not quite what the designers had in mind, I don’t think they expected the tire to float off into oblivion - kinda magical but not what we wanted. Ah, lovely, lovely, lovely.

Let’s jump into code and see what’s happening. So over here we’re into the magical bits of code - we’re in this thing called “VehiclePartBase” - it’s basically the common code that all of our parts have - if you have a wheel, if you have a wing, if you have a cockpit - all the part code that is common with those things are in here and this specific section of code handles when a part gets detached - you can have multiple parts get detached and we stick ‘em onto a debris piece and they’re supposed to bounce around, tumble, all which way, and this particular bit of code will handle offsets - so if we have two different debris pieces they kinda get a little to the left, a little bit to the right and they are centered here so they tumble correctly.

Or if you have one that sticks out the origin like the tire so it’s supposed to wobble as it should. Once we get passed that part, we basically physicalize those pieces onto a specific slot on that entity and when it gets this part it actually goes through the entities, goes through the physical proxy - which is like our game code handler for the physics, it’s one step before our physics engine - and inside of here - boo - this “UpdateSlotGeometry” - you are supposed to send it a mass, otherwise it tries to compute it based on properties set inside like max, these things are actually supposed to be automatically computed - they actually are in other sections of code but this particular area where you are actually modifying or updating - if you don’t already have mass defined it tries to get it from the properties of the max - which is a problem because we want the things to be dynamically determined. Now we already have that mass to determine what that wheel is supposed to be - so rather it determining what it should be when we already know what it is, we’ll just pass that mass in.

We’ll have to change the interface a little bit so that we can add a mass - we’ll make the default negative one so it acts like it should in other situations, or what it was in other situations - so once we add the mass through the interface, we want to send it to the physics proxy and hopefully with that said and done - we should see our wheel kind of tumble. I know, I know, it’s floating off into the oblivion was nice but designers don’t like that very much. Right, we hit ‘recode’, there’s a wait and see what happens. Alright so we hit ‘recode’, let’s see what happens when the tire falls off. Ah ha! It acts like it should. Woo! Physics. We can move it around and everything, yeah, higher physics! Well, hope you guys enjoyed that fun bug.

So as you guys saw, we had a little case of the wheel floating away into oblivion - not quite what the designers wanted - but it was kinda cool. The same thing you guys were seeing in the current build where you blow up a ship and some debris acts strange or stays still - it was just because they were getting no mass - it was an easy fix.

So hope you guys enjoyed and hope you guys see the- those floating debris’ are gone. Until next time, bam!