Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Joey, flink, AndrewAMD), 1,226 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Alternatives to LOD #140754
07/12/07 20:01
07/12/07 20:01
Joined: Nov 2003
Posts: 1,659
San Francisco
JetpackMonkey Offline OP
Serious User
JetpackMonkey  Offline OP
Serious User

Joined: Nov 2003
Posts: 1,659
San Francisco
Hey!

I'm looking for a c-script alternative to LOD.. the idea is that the objects fade out as you get away from them, eventually going to invisible = on when their alpha = 0, and their passable switched on.. would this save fps? or would it be better to fade it out, morph the entity into a simple invisible cube? I guess the crux of this question is-- when invisible and passable are switched on, are the savings in fps substantial? Does anyone know the answer to this?

Thanks!

Re: Alternatives to LOD [Re: JetpackMonkey] #140755
07/12/07 22:22
07/12/07 22:22
Joined: May 2006
Posts: 69
Canada
L
Leaf Offline
Junior Member
Leaf  Offline
Junior Member
L

Joined: May 2006
Posts: 69
Canada
Im working on a script that clipps the tree models off at a certian distance, then makes loads sprites in place of the models. Then my LOD just clips out the sprites.

Just invent the ">" for the sprites. What I did was double place the a Model then a Sprite on top on on another. SO at long range there is a sprite and close range its a model. It works great and saves alot of framerate for outdoor levels! Also it is very hard to tell the transition from model to sprite at long range. What I did was place the Model, took a screen shot, imported in to my PSP7, and saved it as a sprite (.pcx) and then imported that into WED and applied my sprite behavor:)


ACTION clip_models {



while(1)
{
if(vec_dist(my.x,player.x) > 500)
{
my.invisible = on;
} else {
my.invisible = off;
}
wait(1);
}




}



But what your looking for has just been mentioned to me by NEM's in a post of mine:
http://www.coniserver.net/ubbthreads/showflat.php/Cat/0/Number/768033/an/0/page/0#Post768033

I've tested tthe script and it does fade out when your within a certain distance. You could just remove the scaleing stuff.

Quote:


function fade_tree()
{
my.scale_x=8;//just my scale values here
my.scale_y=8;
my.scale_z=8;

while(1)
{
my.transparent = on;
my.passable = on;

if(vec_dist(player.x, my.x) < 3000)
{

my.alpha -= 2*time_step;
if (my.scale_x > 3)//more of my scaling stuff
{
my.scale_x += 0.5 * time;
my.scale_y = my.scale_x;
my.scale_z = my.scale_x;
}
}

if(vec_dist(player.x, my.x) > 3000)
{

if(my.alpha < 99)
{

my.alpha += 2*time_step;


if (my.scale_x > 8)//same ol same old
{
my.scale_x =8;
my.scale_y = my.scale_x;
my.scale_z = my.scale_x;
}
}
if(my.alpha > 90)
{
my.transparent = off;
}

}



wait(1);
}
}

action world_tree
{

my.polygon = on;
plant_object();// saves manual placement by leaving in the air
fade_tree();


}





Last edited by Leaf; 07/12/07 22:29.
Re: Alternatives to LOD [Re: Leaf] #140756
07/13/07 12:17
07/13/07 12:17
Joined: Jan 2007
Posts: 651
Germany
R
RedPhoenix Offline
User
RedPhoenix  Offline
User
R

Joined: Jan 2007
Posts: 651
Germany
I think best is to fade them out but don't just set invisible then, but save their position in an array, and delete them. A global action then controls this array and recreates the models when the player comes nearer. With this system you save the time models consume through their functions and collision detection even if invisible is set. Disadvantage is, that your global function also consumes time (depending how fast you want your level to be actualised)


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | 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