Frame-rate issues (of a strange sort)

BlitzMax Forums/MiniB3D Module/Frame-rate issues (of a strange sort)

TheTophatDemon(Posted 2014) [#1]
OK, so I'm making a Wolfenstein clone thing, and what I have going on is I am loading individual cubes as walls from a level file. This is fine, the framerate stays at about 60. Then I try to put in a floor, which are individual & infinitely flat cubes for each space within the level that doesn't have a wall on it. This also works fine.
When I do the same for the ceiling, though, the framerate is about 20 (Even though I set up a system where floors and walls outside of view aren't rendered). The weird thing is that eventually the framerate suddenly boots back up to 60! Sometimes it's instant and other times it takes forever. I know the floor method isn't the most efficient. I could probably replace it with a big plane and forget about it, but I'm curious as to why the framerate eventually becomes 60 again?


RemiD(Posted 2014) [#2]
2 possible causes of slowdown >>

Too many meshes intersect with others meshes.
or/and
Too many surfaces in the scene.


Solutions :
Clean meshes which do not intersect with others meshes
and
Combine the surfaces of static meshes which will not be modified, in 1 surface or the least amount of surfaces possible, and keep in mind to preferably combine the surfaces by zone so that you can also use the automatic non rendering of surfaces out of the field of view of the camera.


Oh ! Let me add another possible cause of slowdown :
If your mesh editor export a badly optimised mesh with more vertices than what is necessary. I have had this issue and it was difficult to find what was the problem.


TheTophatDemon(Posted 2014) [#3]
Well, ok. I had already replaced it with a giant plane anyways. BTW, I did not use a mesh editor to make the level or the tiles. I loaded it from a text file like
11111111
10000001
10000001
10000001
10000001
11111111
and used CreateCube() when a "1" is read.
Plus, like I said, the game sped up after a while.

But thanks for the reply, I've already got everything in order now.