Subliminal
Bugsmashers

Star Citizen: Bugsmashers! - Star Marine Respawns

1 February 201700:05:46127 linesWatch on YouTube ↗

Transcript — every row opens the video at that moment

  1. 00:00:06

    [Music] Hey everyone, welcome to Bug Smashers. I'm your host, Mark Amit. I'm a gameplay programmer here at CI Los Angeles and I'm here to show you some bugs that we smashed. And let's take a look. bug smashes. So, this bug is when you're having fun playing arena there, I'm sorry, Star Marine, and you're having a fun time shooting and all a sudden your game pauses or if you die and you revive, your game pauses. So, what's happening? Well, well, we have our character here. And as you can see, what we have is we

  2. 00:00:59

    have his body and then we have uh his face and then his hands. And those hands and face, they're called um skins. Uh so we have a skeleton, which is his body, and then we have skins and a face, which are still the same thing. They get attached to his skeleton, and they become embedded. and those ext they're extra bits of geometry that get uh tangled into making what he is. And his skeleton is preloaded and it stays in memory until there's no longer needed and then it'll eventually unload. His skins, on the other hand, they're constantly loaded and unloaded every time you revive or respawn as a character. And that's what's causing these big performance drops because we have to unload it and then reload it.

  3. 00:01:46

    unload it, then reload it rather than keeping it there in memory. Uh, so what we've done is added a resource caching for skins just like all our other geometry so that we don't have to get this stall. So let's see what that stall looks like. So if I kill this guy and I revive on this guy, I can no longer move the mouse because he's stalling loading the other guy. And as you can see, it can be quite severe on some machines. In other instances, it could be a few milliseconds. On this guy, it's a full couple seconds. So, let's go into the code. And we have this thing called a global resource skin, which is what uh we made to preload skins. And what we want to do

  4. 00:02:35

    is enable it. So what this does is um anytime there's a skin resource either through data forge or through XMLs it will load this particular thing um which will know that it's a skin resource and on load it will load our skin once and then anytime we use it we'll add and release rough counts and the idea is when we die we have our ragd doll which will u bump the ref count up. We revive. We have the player which bumps the ref count up to one and then the ragd doll goes away which releases one of the um counts and we still have one count so we don't have a stall. And eventually when the player and the ragd doll go away because while the player

  5. 00:03:23

    left and there's no one using his face or his head it removes the resource because it's not needed anymore. So let's recode and see what happens. par. So, back into the game and we'll kill this guy. And as we take time to respawn, uh, funny enough, uh, before we were doing this, uh, fix, we actually stuck in a bunch of the heads in the level as a temporary fix so that all the heads would be loaded, uh, so it wouldn't cause any stalls until code was ready. Uh, once code was ready, we remove the heads and then now we have a proper code fix. So, we respawn. And as you can see, I'm able to move around just fine. There's a slight uh delay, but it's not as bad as it was

  6. 00:04:11

    before because we're actually keeping the head in memory or the skins in memory until we're not muted anymore. So, when you die and respawn, die and respawn, it won't have to load them because they're already there in memory. Well, hope you guys enjoyed. So, as you guys saw, we had a little fun bug where if you player dies and then he revives, he'll completely stall for a few seconds. Depending upon your machine, it could be like nothing. Or if you have a slow hard drive, it could take seconds and which really gets frustrating because you want to get back into the battle kicking ass or just dying again. Uh, so what happened is well, we have way to pre-cache a bunch of geometry and things like the player's body or a skeleton. uh that gets preloaded and it stays around. So when he dies and revives, it's it's there. So

  7. 00:04:59

    it just makes a copy. But this hands and face, they don't. So when you die and revive, it has to reload them again, which causes to stall. So all it was is we just had to add a little bit of pre-loading so those skins stay intact. So when you die and revive, it knows to just plop them back there and not load a whole big resource hoging thing. Well, hope you guys enjoyed. Till next time. Thank you for watching. So, if you want to keep up with the latest and greatest in 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