|
3 registered members (TipmyPip, JeyKey II, 3run),
7,722
guests, and 1
spider. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Code optimisation / LOD
#9154
05/26/02 02:15
05/26/02 02:15
|
Anonymous
OP
Unregistered
|
Anonymous
OP
Unregistered
|
With interest I read the posts in "code optimisation" in "The Vector Café" forum. But I don't have access to this forum, so I ask here:
Is there a way to define the LOD models? Because I have small clip ranges (4000 - 8000) I normally only need two, for example a house with the interior is LOD0; LOD1, LOD2 and LOD3 are all the same map entity (only the visible outside). A house (the player can't enter) without exterior details is LOD3; LOD0, LOD1 and LOD2 are all the same model with exterior details.
I tried the "old" LOD definition this way:
entity houseA { type = <house_0.wmb>; lod1 = <house_1.wmb>; lod2 = <house_1.wmb>; lod3 = <house_1.wmb>; } But this doesn't work. I find it a little crazy and space consuming, to make 4 models or map entities, and 3 of them are identical.
At the moment, instead of LOD models, I have a lot of running functions in a while(1) loop: If (variableX == 0) {my.invisible = on;} else {my.invisible = off;}
Is this slow?
Thank you for answers. Willi
|
|
|
Re: Code optimisation / LOD
#9155
06/02/02 02:53
06/02/02 02:53
|
Anonymous
OP
Unregistered
|
Anonymous
OP
Unregistered
|
i am only newbie. why you do not calculate the distance between player and your object and then only you need to morph it. So you can easily control LOD by manually. ![[Smile]](images/icons/smile.gif)
|
|
|
Re: Code optimisation / LOD
#9157
06/05/02 05:01
06/05/02 05:01
|
Anonymous
OP
Unregistered
|
Anonymous
OP
Unregistered
|
quote: Dan Silverman: Why make 4 LOD models if you only need 2?
Of course I can create only 2 LOD models, but then it's invisible if the player's distance is more than 1/4 of the clip range.
Here's an example:
This exterior of a house is always the same, but I had to save and build it as house_1.wmb, house_2.wmb and house_3.wmb, so the house is visible as long as it's within the clip range. 
And here's the house_0.wmb with all the interior details: 
If I could define LOD2 = <house_1.wmb> and LOD3 = <house_1.wmb>, I would only need 2 entities instead of 4! In a whole game with a lot of LOD models this makes quite a difference.
The other question I have asked: Does it slow down the script execution remarkably, if I have a lot of running functions in a while(1) loop: If (variableX == 0) {my.invisible = on;} else {my.invisible = off;}
I use this function in many situations instead of LOD entities. But if I use it some hundred times? I once made a function for testing purposes, that started 1000 functions: while(1) {wait(1);} With this 1000 "empty" functions the time for script execution went up 2 ms. I'd like to know, how much time others need for the script execution. In my first level (not yet finished) the time is between 2 and 7 ms.
|
|
|
Re: Code optimisation / LOD
#9158
06/08/02 02:24
06/08/02 02:24
|
Anonymous
OP
Unregistered
|
Anonymous
OP
Unregistered
|
You all must be really happy people. Everyone is happy with LOD as it is. Nobody has problems with frame rate and slowdowns from script execution. Wow! Could you tell me, how you make that?
|
|
|
Re: Code optimisation / LOD
#9163
06/09/02 03:31
06/09/02 03:31
|
Anonymous
OP
Unregistered
|
Anonymous
OP
Unregistered
|
quote: Tobias: If you have only 2 LOD models, why don't you make the clipdist 4 times longer?
That's impossible and makes no sense. If I make the clip range longer, more polys are within the clip range and the frame rate drops.
quote: Dan Silverman: So, if the current method of LOD does not suite you, then program your own.
I don't understand programming. So far, I have made my game with WDL, using the templates as a base and then writing my own code (this was difficult enough for me, but now it works fine). And I don't have a programmer. I'm a one man "team".
Is it so difficult, to allow LOD definitions and give them priority over the engines automatic handling of LOD, if such a definition exists?
quote: Tobias: my.invisible = (variableX == 0);
Thank you very much, Tobias. I didn't know, that I can script this so simple. I have changed my code and it works fine.
|
|
|
|