Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, The_Judge, Grant), 898 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
framerate #131696
05/24/07 18:09
05/24/07 18:09
Joined: Apr 2006
Posts: 329
M
molotov Offline OP
Senior Member
molotov  Offline OP
Senior Member
M

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 Offline
User
tompo  Offline
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: tompo] #131698
05/24/07 19:08
05/24/07 19:08
Joined: Jul 2006
Posts: 511
Germany,NRW
KMS Offline
User
KMS  Offline
User

Joined: Jul 2006
Posts: 511
Germany,NRW
I think the same.Could it be,that is not all of your action? It seems that you are producing all the time entities or call always a function.
The other mistake:Making a entity invisible,your fps will not getting better.Vou have to ent_remove it or minor to ent_purge it.Ent_purge is better,if your entity will be visible once again.If you don't need the entity again,remove AND ent_purge it!
Ent_purge remove the entities memory of your grafical card.Excuse my bad english!


You need full animated lowpoly-fishes?Look at
http://www.projekt-3d.de/pages/shop2pag.html
Re: framerate [Re: KMS] #131699
05/24/07 19:33
05/24/07 19:33
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Quote:

The other mistake:Making a entity invisible,your fps will not getting better.




That's not correct. If an entity is invisible it doesn't need to be included in the clipping and culling process. That saves time. Purging or removing saves only additionally memory.


Always learn from history, to be sure you make the same mistakes again...
Re: framerate [Re: Uhrwerk] #131700
05/24/07 19:39
05/24/07 19:39
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
Looking AUM62 Workshop, George has a solution to
eliminate door close/open (entity visible/invisible)
very often problem.

Re: framerate [Re: vlau] #131701
05/25/07 07:29
05/25/07 07:29
Joined: Apr 2006
Posts: 329
M
molotov Offline OP
Senior Member
molotov  Offline OP
Senior Member
M

Joined: Apr 2006
Posts: 329
Thanks everybody for your fast reply's. I solved it, it was indeed that the function was called in another function his while loop. What made it be called non-stop.

Tompo; I'm also using fog and camera.clip_far, the three methods together works really great.

KMS & Zeitwerk; Zietwerk is right, a entity that becomes invisible does influence the framerate because it doesn't need to be renderd anymore.

Anyway, thanks everybody.

Re: framerate [Re: molotov] #131702
05/27/07 06:43
05/27/07 06:43
Joined: Aug 2006
Posts: 128
Papua New Guinea
I
Impaler Offline
Member
Impaler  Offline
Member
I

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).
Re: framerate [Re: Impaler] #131703
05/27/07 11:00
05/27/07 11:00
Joined: Apr 2006
Posts: 329
M
molotov Offline OP
Senior Member
molotov  Offline OP
Senior Member
M

Joined: Apr 2006
Posts: 329
Hey Impaler, in theory it should work and so far for me it gives great results. My plan is to make a huge outdoor world, kinda Grand theft auto like. But my land is at the moment still small. Also the above three methods are good for creating large worlds but you need more function to really get it working. When my game is further developed I will post a demo.

By the way I'm curious to your city maybe you can show some images.


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