Well I perhaps got the most bizarre and questionably *coolest* error I've ever seen. Definitely unwanted, and almost as confusing as it is interesting.
What happens is that when I switched to using skybox code for my backdrop (the exact same code from Mark's castle demo in the Blitz3D demo program) there is this occasional error that happens.
What happens is that every single polygon in the game goes awry. It looks like all of the polygons are trying to connect to each other, totally screwing up everything.
e.g. it appears as if one of the polygons from my players weapons is connecting with the polygon of an asteroid. Sometimes the enemies remain perfectly unaltered, other times they too try to connect with each other...
My HUD (3d using quads) also flickers in and out as if every surface on it is also being suddenly switched
e.g. the hud image I have for health becomes the image I have for radar, and they all flicker in and out and constantly change.
Seeing as the error only occurs with this skybox code, perhaps someone could tell me if there are any known errors or complications that would cause this. Also, perhaps somebody knows what is occuring based on the effects I described? I'm still not sure exactly WHAT is happening, so how can I possible debug it...
Here is the skybox code
So now I'm stuck. I've tried checking if it was a framerate issue, because it appears that WHATEVER is causing this is also killing the framerate down to around 3Hz. However, I managed to get the older version, using a skysphere for the backdrop, to get the game down to 2Hz and the error does not occur.
Is there anything that COULD cause an error like this? I'm in a desperate search for leads right now because I have 11000 lines of code and I'd rather not do a full code review if I don't have to.
What happens is that when I switched to using skybox code for my backdrop (the exact same code from Mark's castle demo in the Blitz3D demo program) there is this occasional error that happens.
What happens is that every single polygon in the game goes awry. It looks like all of the polygons are trying to connect to each other, totally screwing up everything.
e.g. it appears as if one of the polygons from my players weapons is connecting with the polygon of an asteroid. Sometimes the enemies remain perfectly unaltered, other times they too try to connect with each other...
My HUD (3d using quads) also flickers in and out as if every surface on it is also being suddenly switched
e.g. the hud image I have for health becomes the image I have for radar, and they all flicker in and out and constantly change.
Seeing as the error only occurs with this skybox code, perhaps someone could tell me if there are any known errors or complications that would cause this. Also, perhaps somebody knows what is occuring based on the effects I described? I'm still not sure exactly WHAT is happening, so how can I possible debug it...
Here is the skybox code
Function LoadSkyBox.SkyBox( file$ ) ;--------------------------- ;Code provided by Mark Silby ;--------------------------- m=CreateMesh(User\EnvironHandle) ;front face b=LoadBrush( file$+"_FR.jpg",1 ) s=CreateSurface( m,b ) AddVertex s,-1,+1,-1,0,0:AddVertex s,+1,+1,-1,1,0 AddVertex s,+1,-1,-1,1,1:AddVertex s,-1,-1,-1,0,1 AddTriangle s,0,1,2:AddTriangle s,0,2,3: FreeBrush b ;right face b=LoadBrush( file$+"_LF.jpg",1 ) s=CreateSurface( m,b ) AddVertex s,+1,+1,-1,0,0:AddVertex s,+1,+1,+1,1,0 AddVertex s,+1,-1,+1,1,1:AddVertex s,+1,-1,-1,0,1 AddTriangle s,0,1,2:AddTriangle s,0,2,3 FreeBrush b ;back face b=LoadBrush( file$+"_BK.jpg",1 ) s=CreateSurface( m,b ) AddVertex s,+1,+1,+1,0,0:AddVertex s,-1,+1,+1,1,0 AddVertex s,-1,-1,+1,1,1:AddVertex s,+1,-1,+1,0,1 AddTriangle s,0,1,2:AddTriangle s,0,2,3 FreeBrush b ;left face b=LoadBrush( file$+"_RT.jpg",1 ) s=CreateSurface( m,b ) AddVertex s,-1,+1,+1,0,0:AddVertex s,-1,+1,-1,1,0 AddVertex s,-1,-1,-1,1,1:AddVertex s,-1,-1,+1,0,1 AddTriangle s,0,1,2:AddTriangle s,0,2,3 FreeBrush b ;top face b=LoadBrush( file$+"_UP.jpg",1 ) s=CreateSurface( m,b ) AddVertex s,-1,+1,+1,0,1:AddVertex s,+1,+1,+1,0,0 AddVertex s,+1,+1,-1,1,0:AddVertex s,-1,+1,-1,1,1 AddTriangle s,0,1,2:AddTriangle s,0,2,3 FreeBrush b ;bottom face b=LoadBrush( file$+"_DN.jpg",1 ) s=CreateSurface( m,b ) AddVertex s,-1,-1,-1,1,0:AddVertex s,+1,-1,-1,1,1 AddVertex s,+1,-1,+1,0,1:AddVertex s,-1,-1,+1,0,0 AddTriangle s,0,1,2:AddTriangle s,0,2,3 FreeBrush b ScaleMesh m,400,400,400 FlipMesh m EntityFX m,1 EntityOrder m, 2 ;Draw before everthing so that environs aren't obscured by this Sky.Skybox = New Skybox Sky\mesh = m Sky\File$ = File$ Return Sky End Function
So now I'm stuck. I've tried checking if it was a framerate issue, because it appears that WHATEVER is causing this is also killing the framerate down to around 3Hz. However, I managed to get the older version, using a skysphere for the backdrop, to get the game down to 2Hz and the error does not occur.
Is there anything that COULD cause an error like this? I'm in a desperate search for leads right now because I have 11000 lines of code and I'd rather not do a full code review if I don't have to.