Dustin Diamond
08-16-2006, 04:24 PM
I have a question that maybe some of you can offer your opinions on. It has to do with performance when using different model/entity combinations.
I have made a model of a landmine to be used in my map. I want the mine to blow up when stepped on, and also when shot. There are 2 ways to do this:
First, i can compile the model as a prop_physics with explosive prop data (like an explosive barrel), so that when you shot it, it blows up. Motion is disabled on the model. That takes care of shooting it, but to make it blow up when you step on it, i have to use a trigger_once that surrounds the model and that sends the input Break to the model. So that works fine. Total Cost = 1 prop_physics + 1 trigger_once.
The second way to accomplish this is to compile the model as a prop_dynamic. Then i surround the model with a func_button brush that is triggered on touch and also on damage. When the button is pressed (meaning when shot or touched), it explodes an env_explosion, disables/kills the model, and kills itself. Total cost = 1 prop_dynamic + 1 func_button + 1 env_explosion.
So my question is, which way is more efficient? Do i save myself an entity, but use a prop_physics? or do i use a prop_dynamic but use an extra entity?
Probably the difference is negligible, but i'm curious. There's no real way to test this, unless i fill up a giant room full of these things to try and get a noticable difference, but I'm not going to do that.
So, which is it?
I have made a model of a landmine to be used in my map. I want the mine to blow up when stepped on, and also when shot. There are 2 ways to do this:
First, i can compile the model as a prop_physics with explosive prop data (like an explosive barrel), so that when you shot it, it blows up. Motion is disabled on the model. That takes care of shooting it, but to make it blow up when you step on it, i have to use a trigger_once that surrounds the model and that sends the input Break to the model. So that works fine. Total Cost = 1 prop_physics + 1 trigger_once.
The second way to accomplish this is to compile the model as a prop_dynamic. Then i surround the model with a func_button brush that is triggered on touch and also on damage. When the button is pressed (meaning when shot or touched), it explodes an env_explosion, disables/kills the model, and kills itself. Total cost = 1 prop_dynamic + 1 func_button + 1 env_explosion.
So my question is, which way is more efficient? Do i save myself an entity, but use a prop_physics? or do i use a prop_dynamic but use an extra entity?
Probably the difference is negligible, but i'm curious. There's no real way to test this, unless i fill up a giant room full of these things to try and get a noticable difference, but I'm not going to do that.
So, which is it?