Renderworld oddity

Blitz3D Forums/Blitz3D Programming/Renderworld oddity

Caligula(Posted 2003) [#1]
Does anyone have any idea what could be wrong if the Debugger stops on the Renderworld Command with a "Runtime Error - Memory Access Violation"?

I am running a Blitz3D program that keeps experiencing random crashes - always with the Renderworld line highlighted in the Debugger. Sometimes it runs for 10 minutes before the crash, other times it happens very soon. I have tried both tweened and non-tweened versions, but both have the same result.

There are about 10 animated b3d entities animating during program execution, and I have checked all the variables at the time of the crash - everything looks ok (no strange values or nulls). I tested on WinXP and Win98 (with GeForce2 and Geforce3 video cards) with the exact same problem. The project is pretty big, but I will try to isolate the problem section of code to try and duplicate the error with a smaller example.

At this point I am completely stumped, so any suggestions would be greatly appreciated!


big10p(Posted 2003) [#2]
The only thing I can think might cause such an error would be if one or more of your entity's internal data is getting corrupted. Are you manually manipulating the verts/tris/surfaces of your entities in-code? Maybe there's a slight incompatibility in the way you're importing the animated models into B3D. I'm just guessing really - I've not got round to using animated models yet; I still don't actually know how to use a 3D modeller! :o

BTW, have you tried running using a graphics mode with a different res & bit depth? Just a thought.

Anyway, best of luck squashing that bug.

-big10p


jhocking(Posted 2003) [#3]
Friggin weird. Memory access errors are normally due to using a handle after the entity has been freed but that doesn't apply to RenderWorld. I'ld really be curious to see this code.


Gabriel(Posted 2003) [#4]
Hehe.. A memory access violation on RenderWorld drove me nuts. Couldn't imagine what would do it.

The answer was quite simple ( in my case. ) I was rendering a surface with more than the maximum number of triangles. Can't remember offhand how many that is, but it's in the region of 40,000.

Might be your problem. Might not. But that's the kind of thing that can cause a memory access violation on RenderWorld.


Caligula(Posted 2003) [#5]
Thanks for the responses guys!

I think I found the problem. It seems to have been related to an animation counter that I had tracking animtime. One of the animation files I was working with had 198 frames, so I assumed the counter would run 0-197. (One of the death sequences was 190 to 197). Something must be wrong with frame 197, because when I changed the animation to stop at 196, the Renderworld problem went away.

I guess Renderworld didn't like the last frame for some reason. Since there are 3 other Death sequences in the complete animation, the same animation did not always play at the same time, which was why the problem was happening sporadically. I isolated the sequences one by one, and finally the bad frame became obvious. The odd thing is that I can play the entire animation back in one continuous loop through frame 197 and it doesn't cause problems.

Anyway, my bloodshot eyes need some rest - Thanks again!


Litobyte(Posted 2003) [#6]
Yes, it often returns access violation errors if you mess around with animated files (eg: play a frame which is not there or such).