Game stops drawing correctly

Started by
3 comments, last by coderWalker 13 years, 1 month ago
If I leave my game running (about 4mins) all of a sudden it will stop drawing correctly. All the colors go away only thing that remains are the
outlines and the fog. The program doesn't stop however I can still move and hear sounds just video doesnt look right. If I move
or minimize it then bring it back the video never draws to the window again.

Anyone know what could cause this?

1min in:
bug8.png

4min in:
bug9.png
If this post was helpful please +1 or like it !

Webstrand
Advertisement
Nothing in OpenGL is directly related to timers.
This means the bug is not really directly part of your graphics core but probably something elsewhere in your engine that cascades into this result.

Check the accuracy on your timers.
If you are running your game in microsecond units (as you should), you obviously need to store the time in an unsigned 64-bit type (unsigned long long or unsigned __int64).
You are probably already doing this.
But if you are using ::QueryPerformanceCounter() then you have to be careful how you convert the returned value to microseconds.
If you multiply by 1000000ULL and then divide by ::QueryPerformanceFrequency(), you will overrun your 64 bits fairly quickly.
You need to store the temporary result into a 96-bit integer when you multiply by 1000000ULL.

Additionally, you may need to set the thread affinity or process affinity to avoid BIOS bugs on some hardware.
http://msdn.microsoft.com/en-us/library/ms644904(v=vs.85).aspx

This may not be related to your problem at all, but it is impossible to tell since it is definitely some part of your engine and no one has any way of knowing the details of your engine but you.


By the way my coworker plays that game.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Perhaps you are creating textures or vbo non stop and you run out of vram. Use a debugger http://www.opengl.org/wiki/Debugging_Tools
such as

GLIntercept
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
As V-man said, it's likely a memory issue. My best guess (from not looking at any code) is that you are allocating some memory every single frame, and not cleaning up after yourself. Are you recreating the array that holds your vertices/texcoords every frame, or are you using VBO's?

On a side note, if you are trying to render as many cubes as the actual Minecraft, I strongly suggest using VBO's, octrees, and enough culling that you are eliminating about 95% of the map if you aren't already.

Are you making a MC clone because you think yours will be better, or because you want to prove to someone that you are capable? I'd hope it's the latter.

As V-man said, it's likely a memory issue. My best guess (from not looking at any code) is that you are allocating some memory every single frame, and not cleaning up after yourself. Are you recreating the array that holds your vertices/texcoords every frame, or are you using VBO's?

On a side note, if you are trying to render as many cubes as the actual Minecraft, I strongly suggest using VBO's, octrees, and enough culling that you are eliminating about 95% of the map if you aren't already.

Are you making a MC clone because you think yours will be better, or because you want to prove to someone that you are capable? I'd hope it's the latter.


This is not a clone, it does use a textured voxel engine though. Mine will not have crafting or mining. Mine will be more about puzzles, block physics (fire spreading, water being proportional), and also have RPG elements.

Also, yes I am culling about 96% of the world
However I am not using VBO's.
(below player green square and white boxes show line of sight)
bug10.png
If this post was helpful please +1 or like it !

Webstrand

This topic is closed to new replies.

Advertisement