Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Object Exclusion

Author
Message
kklouzal
15
Years of Service
User Offline
Joined: 15th May 2009
Location: Arizona
Posted: 27th Feb 2010 17:24 Edited at: 27th Feb 2010 20:09
BlockManager.h


Main.cpp


I can't quite figure out why my code doesnt work BUT I have narrowed it down to the area that is triggering it.
This code from the main.cpp's SetupWorld() Function

You can remove the for loop and manually set B to any number between 1000 and 2000 and it works just fine, put the for loop back in there and it throws an exception. I've been pouring over this for 3 days


The world is setup by creating one large square out of 10x10x10 little squares, the ExclusionCheck looks at each block individually and it's 6 surrounding blocks, if all 6 surrounding blocks are present it hide's the block it was looking at since the player can't see it and that dramatically reduces poly count in my game. If someone has a better way of doing this than mine please do say

Exception:

Disassembly:
I hope that helps.

EDIT: I solved the problem, it was when i initialized the variable int SurroundingBlock[5], i thought that would give me array places between 0-5. but actually it only made it 0-4 so i increased the size of the array by 1 and no more problems!

Add me to your MSN!
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 27th Feb 2010 20:25
You've done exactly the same thing with your PosX, PosY, PosZ and Used arrays too. Check your constructor.

kklouzal
15
Years of Service
User Offline
Joined: 15th May 2009
Location: Arizona
Posted: 27th Feb 2010 20:45 Edited at: 27th Feb 2010 20:48
Yeah i've since increased the arrays to 100,000 to support a much larger collection of blocks. The only problem now is that:
doesnt exclude the proper blocks I suppose ill have to play with it some.

Add me to your MSN!

Login to post a reply

Server time is: 2024-11-19 15:26:57
Your offset time is: 2024-11-19 15:26:57