Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 10/25/26 03:42
Chat Room for Zorro Programmers
by Haitao_Ren. 10/25/26 03:14
Trading Journey
by Haitao_Ren. 10/25/26 03:14
Algorithmic trading course with Zorro
by Haitao_Ren. 10/25/26 03:12
Zorro tutorial ideas?
by Haitao_Ren. 10/25/26 02:47
Zorro plugin for Hyperliquid.xyz
by mayarik. 10/24/26 09:14
Tradestation missing in table of contents
by AndrewAMD. 10/23/26 14:35
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
3 registered members (TipmyPip, JeyKey II, 3run), 7,722 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Haitao_Ren, JimSimons, julienp, julienper, KelleyAbbey
19247 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Code optimisation / LOD #9154
05/26/02 02:15
05/26/02 02:15

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



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

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



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]

Re: Code optimisation / LOD #9156
06/02/02 04:25
06/02/02 04:25
Joined: Jul 2000
Posts: 11,321
Virginia, USA
Dan Silverman Offline
Senior Expert
Dan Silverman  Offline
Senior Expert

Joined: Jul 2000
Posts: 11,321
Virginia, USA
Hi Willy,

Why make 4 LOD models if you only need 2? You can have an LOD_0 model and an LOD_1 model and that is all. The engine supports up to 4, but you do not have to use all 4. So, create only 2 and use only 2.

BTW - As you know, the old school way of doing this nolonger works because the engine does LOD automatically based on the entity name (_0 - _3).


Professional 2D, 3D and Real-Time 3D Content Creation:
HyperGraph Studios
Re: Code optimisation / LOD #9157
06/05/02 05:01
06/05/02 05:01

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



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

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



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 #9159
06/08/02 04:09
06/08/02 04:09
Joined: Aug 2000
Posts: 1,141
Baunatal, Germany
Tobias Offline

Moderator
Tobias  Offline

Moderator

Joined: Aug 2000
Posts: 1,141
Baunatal, Germany
LOD models work fine for me, but I use 4. If you have only 2 LOD models, why don't you make the clipdist 4 times longer?

Scripts are very fast if you avoid bad (slow) scripting. For example

If (variableX == 0) {my.invisible = on;} else {my.invisible = off;}

is much slower than

my.invisible = (variableX == 0);

Nice model, by the way.

Re: Code optimisation / LOD #9160
06/08/02 20:11
06/08/02 20:11
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
I don't want to interrupt this topic, but the code of Tobias is very interesting.

For example: my.visible=1; is the same as my.visible=on; and my.visible=0; is the same as my.visible=off;. In this case I don't understand the code

my.invisible = (variableX == 0);

What does it mean? I saw never such an if-clause. Can you use it also for nestings and how do I use it for it?!

Re: Code optimisation / LOD #9161
06/08/02 20:39
06/08/02 20:39
Joined: Jul 2000
Posts: 11,321
Virginia, USA
Dan Silverman Offline
Senior Expert
Dan Silverman  Offline
Senior Expert

Joined: Jul 2000
Posts: 11,321
Virginia, USA
For a project I am working on the programmer programmed a custom DLL through the SDK to handle LOD in a different manner. So, if the current method of LOD does not suite you, then program your own.


Professional 2D, 3D and Real-Time 3D Content Creation:
HyperGraph Studios
Re: Code optimisation / LOD #9162
06/08/02 21:31
06/08/02 21:31
Joined: Aug 2000
Posts: 1,141
Baunatal, Germany
Tobias Offline

Moderator
Tobias  Offline

Moderator

Joined: Aug 2000
Posts: 1,141
Baunatal, Germany
It is not a if clause, it is a normal expression. It works the same way in C++ so I'm used to it:

(a == b) is 1 when true, and 0 when false.

So my.flag = (a == b) sets the flag ON (1) when the condition is true and sets it OFF (0) otherwise.

Re: Code optimisation / LOD #9163
06/09/02 03:31
06/09/02 03:31

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



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.


Moderated by  HeelX, Spirit 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1