Index out of bounds" error with Atlas2 terrain...
by Jack Stone · in Torque Game Engine Advanced · 07/29/2006 (8:42 pm) · 4 replies
I'm trying to create Atlas2 terrain with the 3.5 release and Im having this error pop up once I enter the mission.
The terrain seems to be being created ok, Ive followed all the steps.
Once I enter the mission, I can see the terrain, textures are showing up perfectly, etc, and it starts changing shape as it always does in the first few seconds after the mission starts.
The problem is that after a few steps I get this:
(In atlasbasetoc.h)
AtlasBaseTOC::getStub - index out of bounds!
This is frustrating since I can see my terrain, and it looks absolutely perfect! None of the other bugs mentioned with the 3.5 release.
I did a search and havent found anything similiar to this, but I am pretty sure my Atlas terrain is ok.
As a test, I manually generated the terrain in the terrain and water demo, (used the functions, not just copied over the atlas file) and it worked with no problems at all.
I also tried creating the terrain twice, with different settings in the original .chu file, but I got the same result.
JS
The terrain seems to be being created ok, Ive followed all the steps.
Once I enter the mission, I can see the terrain, textures are showing up perfectly, etc, and it starts changing shape as it always does in the first few seconds after the mission starts.
The problem is that after a few steps I get this:
(In atlasbasetoc.h)
AtlasBaseTOC::getStub - index out of bounds!
This is frustrating since I can see my terrain, and it looks absolutely perfect! None of the other bugs mentioned with the 3.5 release.
I did a search and havent found anything similiar to this, but I am pretty sure my Atlas terrain is ok.
As a test, I manually generated the terrain in the terrain and water demo, (used the functions, not just copied over the atlas file) and it worked with no problems at all.
I also tried creating the terrain twice, with different settings in the original .chu file, but I got the same result.
JS
#2
I looked at the piece of code causing the assert, and it fairly simple:
AssertFatal(nodeID < mStubCount, "AtlasBaseTOC::getStub - index out of bounds!");
mStubCount = 0 at this particular point, so it asserting is nodeID is equal to a negative value, which makes sense. (This piece of code is supposed to "get the stub for a give position in the quadtree" and it obviously cant have a negative stub)
I cant figure out what would cause a negative value though...
I mean it generates the terrain fine, and the just stop and asserts. So it seems to start fine, and then become negative at some point during the terrain initialisation.
Ill keep looking in the code...
BTW if I do comment out the assert, some of the terrain goes white, some goes see-through, and I get a "This application has encounterd a problem and needs to close" error.
JS
07/30/2006 (9:23 am)
I tried both, and It didnt make any difference.I looked at the piece of code causing the assert, and it fairly simple:
AssertFatal(nodeID < mStubCount, "AtlasBaseTOC::getStub - index out of bounds!");
mStubCount = 0 at this particular point, so it asserting is nodeID is equal to a negative value, which makes sense. (This piece of code is supposed to "get the stub for a give position in the quadtree" and it obviously cant have a negative stub)
I cant figure out what would cause a negative value though...
I mean it generates the terrain fine, and the just stop and asserts. So it seems to start fine, and then become negative at some point during the terrain initialisation.
Ill keep looking in the code...
BTW if I do comment out the assert, some of the terrain goes white, some goes see-through, and I get a "This application has encounterd a problem and needs to close" error.
JS
#3
07/30/2006 (9:41 am)
Its likely Jack that you have a different quadtree depth for the texture and the terrain. I think that is something I saw myself last week. Might not be the exact one, but try it just in case.
#4
JS
07/30/2006 (12:42 pm)
That was it Phil! Thanks a lot, I owe you one. I probably should have realised that they should be the same, but I have like 2 weeks left till I have to get a concept demo done and I have so much stuff to do. Thanks again.JS
Torque Owner Stefan Lundmark