Game Development Community

To many shapes causing a lot of lag

by Alexander B · in Torque Game Engine · 09/20/2009 (8:16 am) · 8 replies

I have an ok computer but im let down by my 3.00GHZ pentium 4. I am upgrading soon but for now I just have to get a long.

Anyway I am making a forest map that has heaps of trees in it. And the game just lags like hell when looking at the forest. How do i get rid of the lag? Can i break up the level in 2 bits if possible or is there a better way?

Thanks in advance :)

#1
09/20/2009 (9:50 am)
Do a search here for "Ben Garney's Forest Kit". It has some minor bugs, some of which have fixes in the thread. What it does is basicly allow you to tell tge to place X number of trees on This texture. It works great and will stop the lag.
#2
09/20/2009 (9:51 am)
Your first port of call should always be LODing models.
Don't stick individual models in, use a ShapeReplicator.

Also, isn't there a Forest Kit Resource for TGE? Do a search of the resources section and TDN for Ben Garney's Forest Kit.

And then split your level into 2 levels if you want.

slow on the draw again!
#3
09/20/2009 (10:15 am)
I can't use the forest resource as I already have the forest level done. What is a shapeReplicator tho and thanks for the replys. If you can please talk to me on msn or on the GG irc. I will be on all night. My msn is bruneman@hotmail.com
#4
09/20/2009 (10:42 am)
ShapeReplicator replicates a shape, much akin to the Forest Resource, they're in the editor.

Creating instances of objects uses a lot more processing power than replicating that object many times within a single replicator instance.

May I suggest reading the docs.
www.garagegames.com/documentation
and how to build levels and use the tools - like Replicators.
tdn.garagegames.com/wiki/WorldBuilding/Getting_Started
#5
09/20/2009 (2:17 pm)
> Creating instances of objects uses a lot more processing power than replicating that object many times within a single replicator instance.

why ?
#6
09/20/2009 (4:36 pm)
@Orion
I have no idea why - I'm not a programmer, but after much testing having it appears that it does.

If I have one HUGE model, it is cheaper (performance-wise) than segrementing that same model into various sections as individual models. They have the same polycount, but the singular instance gives better performance.

Hence doing the same via a replicator rather than x number of individual models gives better performance.

I can only summize that the instancing of indivual objects creates a greater load on the processor.

Having said that, the same sort of tests which I had previously with both TGE and TGEA, don't seem to have too much difference in T3D.
#7
09/21/2009 (1:41 am)
Correct me if I'm wrong, but having read a useful thread about replicators a while back, I'm going to try and summarize what info I got from the thread.

I believe that instead of having "Tree1 - Tree158" and checking each info for various reasons (LOD, Fade, Collision and etc),
It is easier performance wise to check "TreeReplicator" for that info as the info in the Replicators is indexed and easier to access,
Where as Individual shapes are completely differant Objects and require more info and time to get that info that is readily available with the Replicator.

All-in-all I think it comes down to what Steve said:
Quote:
If I have one HUGE model, it is cheaper (performance-wise) than segrementing that same model into various sections as individual models. They have the same polycount, but the singular instance gives better performance.

BTW: I would Highly suggest using the Replicator over Shapes for Anything that can be used successfully with the replicators.(Rocks, .dts plants, Trees and etc.)

P.S. Hope it helped, try searching "Replicator" and you may find the thread I was "trying" to summarize.
#8
09/21/2009 (4:38 pm)
huh, interesting, thanks for the replies guys.