Someone please explain Physbox

MadDog31

Newbie
Joined
Aug 8, 2003
Messages
78
Reaction score
0
Hey all,

I've searched, searched and did more searching and I can't find any good tutorials or articles explaining in-depth how the physbox works. When I mean in-depth, I don't mean a complete historical background or anything...just looking for a great explanation of it, how it works, and how it ties in with the surroundings.

I did a tutorial yesterday and even though it worked the first time through, I can't seem to figure out how or why the platform needs to be a physbox. I'm sure it HAS to be, but I'm looking for the why it has to be.

I'd like to do something somewhat similar to what we all saw in the E3 video, when the player went into that huge room, shot the shelf out that had all those barrels on it, and they all fell down, rattling through the poles sticking out of the wall. Whenever I tried setting the shelf as physbox, it ends up on the ground to start the map. Any ideas on that?

Any explaination would be awesome!

Ian

PS...I've already checked the SDK and can't find anything there...
 
If you want physics to apply to a model you use props_physics (or one of it's variants). If you want physics to apply to a brush or group of brushes you use func_physbox. The reason it needs to be a physbox in this situation is so that it reacts correctly when the func_breakables are shot out beneath it. If it wasn't a physbox it would just stay suspended as if by magic.

Also the reason it ends up on the floor is because the physics system is very "touchy" and things can fall when they aren't supposed to sometimes. With physbox (and most entities) you can actually place them somewhat above where they are supposed to be and when you run it they will be lowered to where they are supposed to be automatically. Hope that makes sense.
 
Ok so let me summarize just to make sure:

Entities - prop_physics (or its variants of course)
Brushes - physbox

So technically I can make a physbox breakable too in case I want to blast it w/ explosives, etc. Interesting. Could you technically tie that brush to an entity and give it prop_physics that way too? I'll have to experiement around with that.

As for placement, that seems kinda quirky but I'll have to try that too. I just tried a lame shelf w/ a barrel on it but that didn't seem to work...I'd look over and the shelf is already on the ground...haha. My breakable shelf arm was good though.

Thank you for your clarification JFry, you summed up in a few short sentences what I spent most of my damn day trying to figure out!

If anybody else wants to add to this, feel free. Any tips on the shelf thing?

Ian
 
Well... you sorta got it. func_physbox is a brush-based entity, which is different from a simple world brush.

You can edit the properties of a func_physbox to behave like a func_breakable, while retaining its physics.

Also you may notice some entities have a 'parent' field. Using this you can tie entities to their parent entities. For example you could give a func_physbox a 'name' of "box" and a light_dynamic a 'parent' of "box", and you would have a box that would cast light and you could kick it around or what have you. Kind of a strange example I guess.

As for the shelf thing, I guess just try to make the supports for it larger and more stable. Also try moving the shelf up a few units so it doesn't sit on the supports in hammer. This may or may not help, but it is the only thing I can think of really.
 
I pretty much only use func_Physbox's for msot of my things.(Onless im taking somtin from blizzard then I use an entity).
It's pretty simple to use and well very easy to learn.

I have a question, since there are Dynamic Lights(which I have used), then technically could those use less space than a regular light. Since dynamic lights can have alot of things changed(Like apperance)(because there dynamic). Since there dynamic that would mean there computed in real time and not precomputed right? Thus using less space?
Overall does the dynamic light entity use less space than the light entity.

I've set up a map that has some physics used in it.
(All based on func_physbox)
I pretty much had a square piece of wood held up by 4 rectangle pieces of wood(kinda high). Then I had a piece of wood slanted to get up to it(also affected by physics). I had another thing affected by physics to. Overall just was a small map so I could get use to the physics.
I could post it on here (compiled or uncompiled) if you wanted me to.
 
JFry - thanks for further explanation, and that's actually not a bad example. So you're saying w/ a light, if it had the parent of that box and it moved, the light would follow it b/c of that relationship between the two.

Mineral - Interesting you talked about that. I wouldn't mind you posting that file on here if you could...either version would work, although uncompiled would allow me to see how you set it up. Either way would be really cool!

I'll have to toy around w/ more physics as I go along...I have this gun feeling that it's going to be an ongoing learning process because with physics, you can have a ton of different stuff going on. Right now I'm working on making moving doors, and once I complete that, I'll add more to my scene dealing w/ physics. I'd really like trying to get that shelf working...it would be cool.
 
I am having a problem using my func_physbox, whenver I create any func_physbox i can run direclty through it like it wasnt there, any help?
 
Back
Top