BUGSMASHERS! Episode 26
Transcript — every row opens the video at that moment
- 00:00:09
hey everyone welcome back to bug Smashers sorry we couldn't do it last week I was at E4 for everyone no that was horrible but I'm going to go to E3 cuz that's going to be fun you wish you were there I'm be there you want to go there we'll meet you there all right let's start the show box speci [Music] hey everyone we're here in my fun little Port Port awesome as you can see everything here is awesome except there's one thing not awesome when I spawn some ships in they seem to be falling through the ground so let's spawn in our Scout ship ship is spawned and I have powers to go
- 00:01:03
through walls because I'm in Port awesome as you can see my awesome ship is no longer awesome and it teleported or spawned inside of the level Joy normally this wouldn't happen in single player but you guys will see this a lot in multiplayer when you spawn a ship sometimes instead of it's spawning on the platform it just spawns inside and then goes so what's happening let's go to the code so when we have a ship and we spawn it uh we get a call back saying that our vehicle is spawned on the server and then we have some code here to look up the landing position and move the ship
- 00:01:52
into the proper position however uh let's use this awesome pencil um if this is the origin of the ship and this is the landing gear and the origin's here I'm going to spawn inside and explode so we have this thing uh right here which is The Landing Pad Helper and the idea is you could have a position right here saying this is where the landing position should be not the spawn origin so going back here instead of spawning here I'll spawn like this only problem is this call back happens after we spawn and what we're doing is we're actually positioning the ship here and then the call back happens then we move it
- 00:02:39
up um not good especially since it may take a little bit before physics physicalize and all of our items get on so we may spawn here an item May pop in and then all of a sudden we're intersecting things exploding not good so instead of putting our position in you know after we spawn um we have to put it in as a prerequirement uh to where we spawn so instead of spawning here we have to spawn at that offset so if our spawn Point's here we need to calculate what our theoretical offset will be which will be right here so we're going to spawn on the top instead on the bottom however we can't do that right away because this bit of code relies on
- 00:03:28
the fact that the vehicle has spawned and we could get that bone position so what we had to do was go in all of our xmls pre-calculate that offset stick it in our implementation XML so that we know how far it off before we even spawn the ship so if we get rid of this lovely code and actually go where we request the spawn uh I have this new fun bits of code that will get the vehicle pams get the spawn loc and it will move the spawn location so if we go here so the going from the top down we're going to set up our vehicle to spawn and we're going to tell it to spawn at this spawn location but we're going to apply an offset where the
- 00:04:20
vehicle pram says hey you need to move this much from the origin of the ship so we take that position and here's our spawn and we're actually going to move it up up so now our new spawn offset is up here and that's what this fun little bit of math will do get our um world Matrix and it will apply the offset in World space so that we get the new location so now when we request our spawn we'll be at the new location instead of teleporting there or spawning here and then moving up so let's do some recode and give it a try yeah all right so we just did a recompile the code so let's fly all the
- 00:05:10
way back into our ship spawning which should be here we are let's respawn no I got to wait 30 seconds luckily I have developer mode and I can cheat with time those seconds go away haha let's request our ship spawn again teleport way up and voila our ship is now in the correct position because we spawn it in the correct position rather than spawn in the incorrect position and then move it back now there is still some bugs where I think it was with the Aurora where after we spawn it it slowly rotates around but that's another whole fun physics thing maybe on another bug
- 00:05:59
Smashers but until then see you guys so we had a little fun bug here with our Landing system you know we were spawning the ship in the ground and then moving him up when we should just spawn him in the correct offset so we hooked up that code made sure that he spawns you know offset correctly and now you won't spawn and see your ship exploded into a billion pieces you will see some fun things like the Aurora twisting around but that's just an issue with the how we're dealing with physics and the the landing and not putting it's a whole another thing probably get to it eventually in a bug Smashers but until next time see you
Transcript from YouTube’s automatic captions — punctuation and Star Citizen jargon are approximate. The video itself is hosted by CIG on the official channel.

