Question about loading meshes and performance

Blitz3D Forums/Blitz3D Beginners Area/Question about loading meshes and performance

bootsbrisket(Posted 2006) [#1]
I am making a first person game in a haunted house.
Is it better in terms of the graphics performance to load meshes just before the player (camera) can "see" them, for instance just before a player enters a room where these objects are located, and then use something like FreeEntity to dump them again once the player has left and can no longer see them, or do the number of meshes/textures etc. only have an effect on performance for the duration they actually appear on the screen anyway. In other words, do meshes/textures that are loaded but currently hidden from view slow down the game? (Assuming they are inanimate like furniture etc.)
In addition to inanimate objects like furniture, I have a doll that drifts through the air randomly in one of the rooms, will the code responsible for making the doll float around/change direction slow down the game even when the doll can't be seen? Should I make it move only if it can be seen (using EntityVisible perhaps)?


Bobysait(Posted 2006) [#2]
best way is loading them and hide them.
But it means you need more memory to store them.

You can notice, 'freeing entity' can make several incident with the memory, sometime can crash on Renderworld. Depends on my how many entity you load/free, and it occures sometimes freeze during the load.

What you can use, as you are in an haunted house, is Separated rooms !
lock the doors, and only show the content when door is open.
Only update what you can see => corridors and opened room. don't update the doll until you're on the good room.

You can store each room in an array, and all medias will be stored in an other array.
Use the position of your camera to know which cell you'll check in the array to show the room.

Like this, wherever you go, you'll have only corridors and one or two rooms showed.


bootsbrisket(Posted 2006) [#3]
Thanks for the information and the advice! Very helpful!


(tu) sinu(Posted 2006) [#4]
Also try having a base mesh for each type of entity/enemy and copyentity that for ones which appear often which means you will only do a loadanimmesh/loadmesh once for each mesh required.