Subliminal
Bugsmashers

Star Citizen: Bugsmashers! - Will You Be My Crash?

14 February 201800:09:02223 linesWatch on YouTube ↗

Transcript — every row opens the video at that moment

  1. 00:00:16

    Hey everyone, welcome to Bug Smashers. I'm your host Mark Gabut. Let's get smashing. Bug Smashers! Everyone, we are here in my fancy dancy test level and we have a fun item port crash when things get destroyed. Uh it's kind of weird to replicate it. However, we have a nice little user example right here. Uh some designers were setting up the 600i and they accidentally left in these anim objects inside of the object container. They're not real people, they're just fake geometry. Um the inside of the ship is of course a object container, which means we load in the outer shell of the vehicle and then we have this object container, which is like a mini level that we load inside of it. And that's all this fancy stuff that you see in here. And what's cool is um

  2. 00:01:06

    it allows you to have a ship and work on it and do all sorts of cool setups and then we stream it in. It's pretty nifty. Now, when we're in the editor, um the fun little editor that we're in, we have the option to go into this thing called game mode, which is if I hit control G, we go in game mode and we play the game as if it were real. And if I hit escape, I go back into editing mode. And unfortunately, when I go into game mode, I am going to crash. Woo! And I'm crashing on one of those anim objects. Um do do do we could go right here. So, we're deleting. Let's see what anim object we're deleting. We're deleting an anim object. That's class. Do do do do do somewhere he has a name. There it goes. Anim object 003.

  3. 00:01:54

    So, when this guy gets deleted, um so we have uh the vehicle, we're going in game, we're removing the inside and bringing in a new one because during game play and editing, things might change and we need to refresh the state. And we start deleting all the stuff inside of it, the anim object, little guy, is crashing trying to delete its item ports. That's all the gear that you see on the top of them. What's weird about this is uh where are you? Da da da da. So, the item ports container, here we are. We're in the deconstructor of the item port container. So, this means when this object is getting deleted, this is the very last thing that gets called before the memory gets wiped. And it has a list of item ports. As you

  4. 00:02:42

    can see, it's kind of destroying them right here. And unfortunately, when it destroys them at this point, um any listeners listening for them is going to start accessing those um item ports and item port containers. However, it's in the deconstructor, so when you access that stuff, things go wonky and you end up, well, crashing. Um so, what we have installed earlier is do do do do do do do do do do do do do do do do do do do do do do somewhere in the events. I like scrolling, so I'm going to scroll scroll scroll. Where are you, events? There we are. We have this event. So, when we mark the entity for delete, we could do some actual nice cleanup. Then, we could delete the entity sometime uh later. Um so, we're going to try to find out why this

  5. 00:03:31

    isn't working and instead it's cleaning up the entities in the deconstructor. So, let me pause it. And using that entity name, we are going to add some uh some code everywhere to do some debug breaks to track down what in the world's happening. So, let me write this guy down. Do do do. I'm going to this guy's name. And this is not production code. This is pure debug code to track down the order of all the shenanigans. So, I'm going to add a debug break anytime we get an anim object three and we're removing the item ports. And then we're also going to do it anytime we add item ports. And hopefully we could track down the sequence of events. And we'll add

  6. 00:04:20

    one in the Oh, we can't add one there because the name doesn't exist. But we could add one right before it gets deleted. And done. Shazam. So, let's code all things. All right. So, I'm back in the editor. I'm going to put some debug breaks everywhere. Let's hop back in the game and see what's happening. So, first thing we get is when we go into game mode, we are getting the right call. We're deleting this thing. So, the vehicle's getting rid of the object. container, deleting all the entities inside of it. So, the interior's going away. And our anim object is getting rid of all of its item ports in the correct sequence. Which means if it deletes it here and it gets it somewhere else, something must be adding them at another time. And of course, there it is.

  7. 00:05:08

    So, we deleted them all because our entity's getting deleted. However, some fun editor code seems to be messing with us. Let's see what's happening now. Oh, nope, not yet. This is the new one coming in. All right. Continue on. New one is Actually, what is this guy? Ah. We're sending events to everyone. So, what's happening is we deleted our entity, getting rid of his item ports. Switching in and out of game mode causes a system-wide event to reset. And when this entity gets told to

  8. 00:05:58

    reset, he basically fixes himself back up, adds all the item ports again because fun Lua, and then gets deleted the next frame because we're now going to get now I'm done. We have item ports. And then we can end up crashing because um we have item ports and deleting in the destructor. So, yeah, fun times. Delete the entity, get rid of the item ports at the right event, get a system-wide event saying, "Hey, reset because we're in the editor going in and out of game mode." Add all the item ports back only to get destroyed again and cause mayhem. So, what we want to do is in our system-wide event, technically we only care about resetting all the

  9. 00:06:46

    events that are hand-placed in the level and not dynamically spawned. So, we hand-placed a vehicle, it needs to reset. But the object container that it creates doesn't need to get reset cuz the vehicle handles that. So, the easy fun little fix is if we're removing this entity, just don't broadcast this specific event system to all the entities. Now, let's code up again and see how that works out. All right, we're back in the scene, brought down my three or 600i, that's two 300s. Um going to hop into the game. And we're deleting the old object

  10. 00:07:33

    container, getting rid of all the entities, getting rid of our anim object. It's getting rid of all its item ports. And then this is the new guy getting created. Do do do. Hello new guy. Here's our old one. Ah, give me my mouse. There's my mouse. Let's double-check the memory. We have no item ports. Sweet. Continue on and I'm in the game. And of course, my 600i just falls down cuz I had it in the gravity volume. And yeah. I think that sets the mood. Until next time. Hope you guys enjoyed. Oh, so as you guys saw, we had a fun little crash where unfortunately, we had some back-end legacy code that was trying to refresh the entity state that caused all sorts

  11. 00:08:20

    of havoc. So, when you dropped in and out of um the editing mode, it just exploded and crashed everywhere. Well, we hooked up the code so it would only make those modifications if it was a entity that was placed down inside the level and not one that was dynamically spawned. Hope you guys enjoyed. Until next time. Thank you for watching. So, if you want to keep up with the latest and greatest in the Star Citizen and Squadron 42's development, please follow us on our social media channels. See you soon.

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