|
|
framerate
#131696
05/24/07 18:09
05/24/07 18:09
|
Joined: Apr 2006
Posts: 329
molotov
OP
Senior Member
|
OP
Senior Member
Joined: Apr 2006
Posts: 329
|
action building { while (1) { if (vec_dist(my.x,crawler.x) <= 5500) // the object is close enough to be visible? { my.invisible = off; // then show it! } else { my.invisible = on; // now hide the entity in order to increase the frame rate } wait(1); } }
I use the above code to make buildings invisible when the player is far away. When I move around a lot, the building becomes visible and invisible a lot of times, and after some time the framerate drops a lot. And if you wait longer I get a error that says "too many functions". Can someone tell me how I can change this function so that it doesn't affect the framerate and the amount of functions.
Thanks anyway, Molotov.
Last edited by molotov; 05/24/07 18:10.
|
|
|
Re: framerate
[Re: molotov]
#131697
05/24/07 18:17
05/24/07 18:17
|
Joined: Mar 2007
Posts: 776 Poor village - Poland ;)
tompo
User
|
User
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
|
I think that problem is not with this function... this one looks good. Stay in one place and pres F11 and look at running functions... if still growing... you have endless loop or some function is calling non stop. Maybe this function is starting everytime in some reason... serch your code. BTW... why You are not using a fog or camera.clip_far?
Last edited by tompo; 05/24/07 18:24.
Never say never.
|
|
|
Re: framerate
[Re: molotov]
#131702
05/27/07 06:43
05/27/07 06:43
|
Joined: Aug 2006
Posts: 128 Papua New Guinea
Impaler
Member
|
Member
Joined: Aug 2006
Posts: 128
Papua New Guinea
|
does that mean that you can have an almost infinite size level by making far-away objects invisible? I have a city made of map entities, and they really slow down the rendering time, so that would help heaps.
Murphey's Law: << if anything can go wrong, it will >> (Murphey was an optimist).
|
|
|
|