How much memory does an inactive entity use and how fast are Blitz routines?

Blitz3D Forums/Blitz3D Programming/How much memory does an inactive entity use and how fast are Blitz routines?

Farflame(Posted 2003) [#1]
I have a space RTS game, with several different systems. The ships in the current system will obviously be visible and handled as entities, but what would be the best way of handling the ships in other systems, bearing in mind that they still need to keep 'working'. Would it be better to handle them as invisible entities anyway, or deal with them in software only? I'm thinking that software might be better, because they'd use less memory..... right?

Also, would moving around an entity in software be faster than using moveentity? How fast is moveentity and how fast would a basic software version be? For that matter, anyone got a link to the math showing how to move an entity in 3d?


Ross C(Posted 2003) [#2]
Well, yeah, i suppose moving it in software would be faster, but you'd also need another set of x,y,z, rotx,roty,rotz and other stuff to hold the entities positions and stuff, until it came into view, or became active. Best thing to do is run a few tests yourself to see firsthand what the differences are.


Farflame(Posted 2003) [#3]
Guess so, I was hoping someone had tried it already so I could be lazy and use their experiences :)


Rob(Posted 2003) [#4]
It is far faster and more efficient to use the Blitz entity system.

The only situation where this isn't the case is when you need a particle system, this is where single surface do-it-yourself stuff comes in handy.


Farflame(Posted 2003) [#5]
If that's the case, should I load ALL of my ships into entities, and just hide those in other systems, but still use moveentity etc to move them? I'll try both ways anyway, but I woulda thought software would be better, although I suppose the Blitz code is gonna be pure assembler so maybe not.


Al Mackey(Posted 2003) [#6]
If you use HideEntity() on the ships in the other system, Blitz shouldn't be spending any rendering time thinking about them. Of course, that means that UpdateWorld() operations like collision detection won't be done on them, either.


_PJ_(Posted 2003) [#7]
I would certainly hide all entities NOT in the current system. In fact, I would go so far as to erase the meshes etc from memory.

All you need is some variable information, so the program knows what these other ships are doing as it wont really matter where they are until they become local again.


Pete Rigz(Posted 2003) [#8]
if u want to save memory but still have the advantage of using moveentity etc, then maybe you could use pivots for ships outside the system instead?


Rob(Posted 2003) [#9]
Efficiently working with entities means:

* loading a single mesh and using copyentity - this means only the memory from the first entity is used: the copies do not take up memory and they can be used independantly

* using entityalpha 0 to prevent rendering leads to speed gains yet entities can still collide

* using hideentity will remove the entity from the world (but it will still remain in memory)

So if you had 100 alien ships copied using copyentity, it would still take the memory of a single entity. Thats the main benefit you can get memory wise. Variables really don't take up much. You're going to need hundreds of thousands to burn memory via variables.