BUGSMASHERS! Episode 24
Transcript — every row opens the video at that moment
- 00:00:08
hey everyone welcome back to Bug Smasher wow that was bad bug [Music] bashes all right hey everyone we are here in my fancy dcy test level with physics debug on uh um I got a fun little bug that I broke supposedly broke the physics when um items such as this gun down here gets attached to ships uh as you can see all the little gray stuff U that's all the physics meshes and on the weapons and landing gear it's not working yay so the reason why um I was told that this was my bug was uh we
- 00:00:58
started uh I should say started splitting up a lot of our um entity logic into these things called components um originally with cry engine you really just had an entity and then something called a game object extension and you had like all your logic in there and you if you wanted to do the same thing in another entity of another you usually copied and pasted it because that's just how the engine was um now we have this component system where we could build this little bit of logic here that could be used by this entity this entity this entity this send any any end we want so we had um our vehicles and our old items they had a special way of physicalizing or getting physics and doing you know becoming a rigid body and moving around and about
- 00:01:48
however um we had to I should say I had to convert those over to our new physics controller which will handle that uh for anything that uses it but it also allows other components to directly read the physics information and we needed that for the interaction system and for especially for two4 so that way we query um we call them interactions so that you could select certain things but that's for a future thing uh for now I needed to convert everything over to a physics controller and that will handle all the physics the same for every single entity that uses it unfortunately um phone calls serious business so
- 00:02:36
unfortunately um after I checked all of it in and thought everything was working uh I get a fun call from Andrew our QA and he has the most evil laugh there is and as soon as I checked in the code he was like Hey I have this bug I'm like of course you do so here's our good old weapon weapon and here's our Good Old Ship and normally the weapon will have its own physics but when we attach it to something it actually becomes physics of the ship um so the physics controller actually handles that so when you're on your on your own and then when you get attached it Mak sure it goes to the appropriate areas and unfortunately it had nothing to do with my specific physics
- 00:03:27
controller it actually had to something else which is an attachable component and for the longest time um we had special code for things to attach to item ports but because we want to be more generic and we want to attach anything to an item Port um we created this thing called an attachable component if an entity has this it could basically attach to things so now we could have ships attached to item ports in a hanger um we could have players is attached to an item port in a vehicle you could have a clothing thing attached to an item port on a shop you name it and unfortunately this attachable object expects um another component called geometry resource which is
- 00:04:17
another component which handles all the uh asset creation for how it looks so you have a CGA which is like our ship which has like uh bones and stuff so it can animate or or it could be a pure geometry or skin but either way that geometry resource is the the component to handle that and unfortunately um since I add made the uh the item in the vehicle have the physic controller so we could use the interaction system it also now has this attachable component and this area right here get this Flags we search for it so when an so when an attachable um component gets attached
- 00:05:06
onto uh the ship or hanger whatever and there's a thing called an attachment we set certain flags and if there's no flag set like it's not visible then we actually clear the physics because it's you can't see it why have physics it's it's a saves on performance um this is for things like very far away can't really see or if we hide an entity you don't want to crash into a random thing and unfortunately it's returning no visibility e and since our item vehicle aren't using this component yet we're always getting zero because this will be null so what I did is use the default visibility and what this says is if
- 00:05:55
we're in third person first person or during the shadow pass this thing is visible it should have physics and so now if I compile this bad boy Rec hop into the game once recode's done its thing aha recod so we don't have physics yet but once I go to AI physics mode bam look at that physics right right there and right here oh snap because it's visible we have physics and if we move this guy away so he could animate or fall down you could see that the
- 00:06:44
physics actually moved with it woo having fun with physics so as you can see we had a fun little problem when we were trying to componentize our logic um and when I you know added that physics controller and interaction thing it we had no physics so when I got a bug everyone thought it was that big old change cuz I sent out an email turns out it was something completely different but it was still related to a component and all it was was just default Flags getting missed because we didn't have a certain component on our vehicle and item uh so that got resolved and everything's going good and we're going to continue make splitting all of our logic up into these subcomponents so that you know you could have a generic
- 00:07:32
entity and you just slap on whatever type of logic you want and the other benefit of our components is going to be the the ability to multithread all of our updates which is going to be huge especially since we want you know hundreds if not thousands of players on a server you don't want to update the people far over there but you want to update the people close by so you have to be able to decide who gets what updates when how and maybe we could update all of at one time so componentized see you next time
Transcript from YouTube’s automatic captions — punctuation and Star Citizen jargon are approximate. The video itself is hosted by CIG on the official channel.

