BlastEntity or maybe NukeEntity

Blitz3D Forums/Blitz3D Programming/BlastEntity or maybe NukeEntity

TeraBit(Posted 2003) [#1]
Hi all,

I've been looking for the fastest way to get rid of an unwanted entity.

Said entity has thousands (oh say 16,000) surfaces, and one poly per surface (although each one has a different brush config).

Fortunately it has no textures. How can I get rid of it quickly?

FreeEntity can take up to thirty seconds to get rid of it! All I want to do is Nuke it from existence! Any ideas?


Rob(Posted 2003) [#2]
is clearsurface then freeentity a faster method?


Michael Reitzenstein(Posted 2003) [#3]
Can't you just HideEntity and never use it again?


LostCargo(Posted 2003) [#4]
that would be memory leak. Bad thing when reinstanciating the same kind of object.. ie particle system.


Rob(Posted 2003) [#5]
I would suggest you keep each as a seperate entity. This way you are able to free them in the background over the course of a few seconds without any noticable lagging.


Al Mackey(Posted 2003) [#6]
Perhaps you can find a way to reduce the number of surfaces? Vertex color maybe?


mrtricks(Posted 2003) [#7]
Can't you delete surfaces one at a time? Then you could do like Rob says.


Michael Reitzenstein(Posted 2003) [#8]
that would be memory leak. Bad thing when reinstanciating the same kind of object.. ie particle system.

Erm, I doubt he needs many 16,000 surface entities!


TeraBit(Posted 2003) [#9]
Hi there,

Funny enough, deleting each surface doesn't take much time (a few seconds). But finally deleting the entity does!

Keeping it is not an option, as I need to load another one straight after.

Vertex colors sounds promising!

Thanks


Ross C(Posted 2003) [#10]
How would vertex color help? I don't know much about this :D (sorry for the semi-hijack)


TeraBit(Posted 2003) [#11]
Since I only need to show colored triangles, I could set up a load of unwelded triangles and set their vertex colors to do the coloring. That way I could do it all a few surfaces unstead of loads.

I have a temporary solution. I clear the surfaces, then reuse the entity for the next model by refilling the surfaces with verts and tris. Any surfaces I don't need are kept blank. This means it's only reallllly slow when I try to shut down.