Game Development Community

Fatal: AtlasFile::CreateNew - unknown TOC type

by Jesse McKinney · in Torque Game Engine Advanced · 07/01/2006 (10:56 pm) · 49 replies

Im on the final step of the Atlas 2 terrain creation, and keep getting the following fatal when I go to make my final atlas file

Fatal in in engine\atlas\core\atlasfile.cpp
AtlasFile::CreateNew - unknown TOC type

The commands I used to get to this step

1) atlasGenerateTextureTOCFromLargeJPEG("base/Data/Terrains/FrostBitePaintMap.jpg", 4, "base/Data/Terrains/FrostBiteNew.atlas")
2) importOldAtlasCHU("base/Data/Terrains/FrostBiteHeightMap.chu", "base/Data/Terrains/FrostBiteHeightMap.atlas") 
3) atlasGenerateUniqueTerrain("base/Data/Terrains/FrostBite.atlas", "base/Data/Terrains/FrostBiteHeightMap.atlas", "base/Data/Terrains/FrostBiteNew.atlas")
on the third command it crashes with the above fatal, here is the console dump
==>importOldAtlasCHU("base/Data/Terrains/FrostBiteHeightMap.chu", "base/Data/Terrains/FrostBiteHeightMap.atlas");
importOldAtlasCHU - opened 'base/Data/Terrains/FrostBiteHeightMap.chu' for conversion.
importOldAtlasCHU - created new Atlas file 'base/Data/Terrains/FrostBiteHeightMap.atlas'
importOldAtlasCHU - Atlas file initialized, converting...
importOldAtlasCHU - Headers read, remapping chunks...
importOldAtlasCHU - Importing geometry chunks...
importOldAtlasCHU -    level 4 chunks...
importOldAtlasCHU -    level 3 chunks...
importOldAtlasCHU -    level 2 chunks...
importOldAtlasCHU -    level 1 chunks...
importOldAtlasCHU -    level 0 chunks...
AtlasFile::waitForPendingWrites - Waiting for pending output to finish.
AtlasFile (12d8e0) - Waiting for write IO to finish...
AtlasFile::waitForPendingWrites - Done!
importOldAtlasCHU - Done
AtlasFile::waitForPendingWrites - Waiting for pending output to finish.
AtlasFile::waitForPendingWrites - Done!
==>atlasGenerateUniqueTerrain("base/Data/Terrains/FrostBite.atlas", "base/Data/Terrains/FrostBiteHeightMap.atlas", "base/Data/Terrains/FrostBiteNew.atlas");
atlasGenerateUniqueTerrain - getting ready to generate a terrain with a unique schema...
   o Opening 'base/Data/Terrains/FrostBiteHeightMap.atlas' for geometry...
AtlasFile::load - loading Atlas resource 2dc615c with base/Data/Terrains/FrostBiteHeightMap.atlas
   o Opening 'base/Data/Terrains/FrostBiteNew.atlas' for texture data...
AtlasFile::load - loading Atlas resource 2e5f78c with base/Data/Terrains/FrostBiteNew.atlas
   o Locating geometry TOC...
   o Locating texture TOC...
   o Copying & registering geometry TOC...
   o Copying & registering texture TOC...
   o Registering config TOC...
   o Creating atlas file 'base/Data/Terrains/FrostBite.atlas'...
TOC Type for Atlas is: Geom 
TOC Type for Atlas is: Tex 
TOC Type for Atlas is: (null)

Looks like it cant write the terrain out to the final atlas file. Any help would be appreciated.
Page «Previous 1 2 3 Last »
#1
07/01/2006 (11:04 pm)
Note: the TOC Type for Atlas console log was something I added so we could see which TOC was coming back invalid.

Looks like the Config TOC isn't getting registered but all of the code looked in order, so :(
#2
07/02/2006 (11:49 am)
Yup, looks like the config TOC is not being registered properly. Does atlasClassFactory.cpp have appropriate entries for Config TOCs in it? When it prints NULL, what class IS being referenced?
#3
07/02/2006 (12:06 pm)
Let me make some changes to the source to log what class it is actually coming back with, at that point. We haven't touched atlasClassFactory for anything at all, so, lemme check this out
#4
07/02/2006 (12:07 pm)
If you're not tracking this with the debugger you're wasting your time - probably by a factor of ten more than it would take to do it in the debugger.
#5
07/02/2006 (12:26 pm)
Yep, about to begin testing it with the debugger, I just like to make Jessie do all of the work
#6
07/02/2006 (1:55 pm)
Ran thru the debugger and getTOCName(AtlasTOC *toc) is showing that toc is AtlasResourceConfigTOC classed, but its still not casting to it properly...
#7
07/02/2006 (1:57 pm)
Can you post a dump of toc?
#8
07/02/2006 (2:02 pm)
Yeppers:

-		toc	0x0199b578 {mAreConfigsLoaded=false }	AtlasTOC *
-		[AtlasResourceConfigTOC]	{mAreConfigsLoaded=false }	AtlasResourceConfigTOC
-		AtlasResourceTOC<AtlasResourceConfigStub>	{mLoadQueue={...} mVersion=4294967295 }	AtlasResourceTOC<AtlasResourceConfigStub>
+		AtlasBaseTOC<AtlasResourceConfigStub>	{mStubs=0x032acccc mStubCount=1 }	AtlasBaseTOC<AtlasResourceConfigStub>
+		mLoadQueue	{mElementCount=0 mArraySize=0 mArray=0x00000000 ...}	Vector<AtlasResourceConfigStub *>
		mVersion	4294967295	unsigned int
		mAreConfigsLoaded	false	bool
#9
07/02/2006 (2:04 pm)
Well... that's very weird. Do you have RTTI turned on in the compile settings?
#10
07/02/2006 (2:07 pm)
Yes it is on, that I see.. Does it need to be off? I don't recall it ever being set any differently, so not sure
#11
07/02/2006 (2:08 pm)
It needs to be on. But as to why dynamic_cast<> wouldn't be succeeding when the debugger recognizes it as a given type, is not immediately obvious to me! :)
#12
07/02/2006 (2:20 pm)
Well, did a couple more things but nothing that was of interest. I am beginning to wonder if its related to VS2005 or possibly some other compiler setting that is causing some issues somewheres..
#13
07/02/2006 (4:27 pm)
If you find any leads, let me know. I don't know either what might be broken here - and if anyone else encounters this problem, I hope they post here. It might be some brokenness specific to your system/codebase.
#14
07/02/2006 (6:56 pm)
Yep, although we have no changes to Atlas side of things.. or even the renderer sides so not sure what would break it in codebase, especially since its obviously coming thru "okay" according to the debugger.. but need others to exhibit similiar/same problems first before can narrow it down
#15
07/02/2006 (8:51 pm)
@Byte - I was just trying to create terrains and got the same error on the last step. Here is the console dump
==>atlasGenerateUniqueTerrain("myfps/data/terrains/terrain1.atlas","myfps/data/terrains/geometry.atlas","myfps/data/terrains/texture.atlas");
atlasGenerateUniqueTerrain - getting ready to generate a terrain with a unique schema...
   o Opening 'myfps/data/terrains/geometry.atlas' for geometry...
AtlasFile::load - loading Atlas resource 14dd370 with myfps/data/terrains/geometry.atlas
   o Opening 'myfps/data/terrains/texture.atlas' for texture data...
AtlasFile::load - loading Atlas resource 14dd5f0 with myfps/data/terrains/texture.atlas
   o Locating geometry TOC...
   o Locating texture TOC...
   o Copying & registering geometry TOC...
   o Copying & registering texture TOC...
   o Registering config TOC...
   o Creating atlas file 'myfps/data/terrains/terrain1.atlas'...
Fatal-ISV: (..\engine\atlas\core\atlasFile.cpp @ 111) AtlasFile::createNew - unknown TOC type!

I am using Visual Studio 2005 Pro.
#16
07/03/2006 (6:09 am)
Great! At least I know its not just us, so it would seem there could be an issue with Visual Studio 2005 and how the casting is failing...
#17
07/03/2006 (6:28 pm)
Ben:

else if(dynamic_cast<AtlasResourceTOC<AtlasResourceConfigStub>*>(toc))

Is that a safe replacement for:

else if(dynamic_cast<AtlasResourceConfigTOC*>(toc))


I was able to get it to go on thru "properly" and did some other checking to make sure it wouldn't catch Geometry or Texture TOCs and it didn't seem to...

this is the end result

o Preparing for Atlas IO...
   o Generating texture schema configuration chunk...
   o Copying geometry chunks...
Fatal-ISV: (..\engine\atlas\core\atlasChunk.cpp @ 100) AtlasChunk::readFromStream - (sent3) invalid chunk tail sentinel!
Fatal: (..\engine\atlas\resource\atlasGeomChunk.cpp @ 423) AtlasGeomChunk::read - invalid colFlag!
AtlasGeomChunk::read - unknown collision flag!
Fatal-ISV: (..\engine\atlas\resource\atlasGeomChunk.cpp @ 453) AtlasGeomChunk::read - invalid post collision sentinel!
   - Copied 341 chunks via copyChunksToTOC, stream len approx. 45385791 bytes
   o Copying texture chunks...
Fatal-ISV: (..\engine\atlas\core\atlasChunk.cpp @ 100) AtlasChunk::readFromStream - (sent3) invalid chunk tail sentinel!
Fatal: (..\engine\gfx\bitmapPng.cpp @ 40) Png Read catastrophic error!
Last message repeated 1 times
Fatal-ISV: (..\engine\gfx\bitmapPng.cpp @ 85) Error reading PNG file:
#18
07/04/2006 (2:21 pm)
That is a safe & correct change (the dynamic_cast) and one I'm merging in. Will go out to CVS soonish.

... Whoa, I just checked my code and I have AtlasResourceConfigTOC there, not the other type. This is strange.
#19
07/05/2006 (9:03 am)
I got a bunch of "bad sentinel" errors when I tried to create an Atlas2 out of my (previously functional) Atlas1 files. One weird one was the JPG, which would die (bad sentinel) when I tried to convert with a Tree Depth of 3 (which is what I used for the TQT file) but it seemed to work with a Depth of 4.

I know this general description doesn't help very much. I'll try to post some details later.
#20
07/06/2006 (9:03 am)
Here's the console dump of all the conversion functions.
Generating chunked geometry (depth=4, baseMaxError=50.000000)
   o Calculating activation levels...
      - done.
   o Propagating activation levels...
      - done.
   o Writing file header...
      - done.
   o Generating empty TOC...
      - done.
   o Generating meshes...
AtlasOldActivationHeightfield::generateNodeData - Min exceeded! May have paging issues!
AtlasOldActivationHeightfield::generateNodeData - Max exceeded! May have paging issues!
AtlasOldActivationHeightfield::generateNodeData - Max exceeded! May have paging issues!
AtlasOldActivationHeightfield::generateNodeData - Max exceeded! May have paging issues!
AtlasOldActivationHeightfield::generateNodeData - Max exceeded! May have paging issues!
AtlasOldActivationHeightfield::generateNodeData - Max exceeded! May have paging issues!
      - done.
=== Chunk Statistics ===\
\===== Level    Count    Avg. Size
            0          64      10111.937500
            1          16      39943.937500
            2           4      87079.500000
            3           1      154059.000000
========================================
                chunks:         85
           input verts:   67108864
          output verts:     196045

       avg verts/chunk:       2306
          output bytes:       3173
      bytes/input vert:       0.00
     bytes/output vert:       0.02
        real triangles:    1788644
==>importOldAtlasCHU("Visions/data/terrains/Jerusalem.chu", "Visions/data/terrains/JerusalemGM.atlas");
importOldAtlasCHU - opened 'Visions/data/terrains/Jerusalem.chu' for conversion.
importOldAtlasCHU - created new Atlas file 'Visions/data/terrains/JerusalemGM.atlas'
importOldAtlasCHU - Atlas file initialized, converting...
importOldAtlasCHU - Headers read, remapping chunks...
importOldAtlasCHU - Importing geometry chunks...
importOldAtlasCHU -    level 3 chunks...
importOldAtlasCHU -    level 2 chunks...
importOldAtlasCHU -    level 1 chunks...
importOldAtlasCHU -    level 0 chunks...
AtlasFile::waitForPendingWrites - Waiting for pending output to finish.
AtlasFile (12d7e4) - Waiting for write IO to finish...
AtlasFile (12d7e4) - Waiting for write IO to finish...
AtlasFile::waitForPendingWrites - Done!
importOldAtlasCHU - Done
AtlasFile::waitForPendingWrites - Waiting for pending output to finish.
AtlasFile::waitForPendingWrites - Done!
==>atlasGenerateTextureTOCFromLargeJPEG("Visions/data/terrains/JerusalemArea8192B.jpg", 4, "Visions/data/terrains/JerusalemTX.atlas");
atlasGenerateTextureTOCFromLargeJPEG - Successfully opened JPEG 'Visions/data/terrains/JerusalemArea8192B.jpg' for reading.
atlasGenerateTextureTOCFromLargeJPEG - Image is 8192px (hopefully square!).
atlasGenerateTextureTOCFromLargeJPEG - Tree depth of 4 mandates 8 tiles on a side.
atlasGenerateTextureTOCFromLargeJPEG - Therefore, tiles are 1024px wide.
atlasGenerateTextureTOCFromLargeJPEG - Atlas file 'Visions/data/terrains/JerusalemTX.atlas' created!
atlasGenerateTextureTOCFromLargeJPEG - Initialized Atlas threads, now importing texture data...
atlasGenerateTextureTOCFromLargeJPEG - Allocating ~24576 kb of JPEG decompression working area...
atlasGenerateTextureTOCFromLargeJPEG - Generating 1024px by 1024px leaf tiles...
atlasGenerateTextureTOCFromLargeJPEG - Now generating rest of quadtree...
 generating (2 @ 0, 0) from (3 @ 0, 0), (3 @ 0, 1), (3 @ 1, 1), (3 @ 1, 0)
 generating (2 @ 0, 1) from (3 @ 0, 2), (3 @ 0, 3), (3 @ 1, 3), (3 @ 1, 2)
 generating (2 @ 0, 2) from (3 @ 0, 4), (3 @ 0, 5), (3 @ 1, 5), (3 @ 1, 4)
 generating (2 @ 0, 3) from (3 @ 0, 6), (3 @ 0, 7), (3 @ 1, 7), (3 @ 1, 6)
 generating (2 @ 1, 0) from (3 @ 2, 0), (3 @ 2, 1), (3 @ 3, 1), (3 @ 3, 0)
 generating (2 @ 1, 1) from (3 @ 2, 2), (3 @ 2, 3), (3 @ 3, 3), (3 @ 3, 2)
 generating (2 @ 1, 2) from (3 @ 2, 4), (3 @ 2, 5), (3 @ 3, 5), (3 @ 3, 4)
 generating (2 @ 1, 3) from (3 @ 2, 6), (3 @ 2, 7), (3 @ 3, 7), (3 @ 3, 6)
 generating (2 @ 2, 0) from (3 @ 4, 0), (3 @ 4, 1), (3 @ 5, 1), (3 @ 5, 0)
 generating (2 @ 2, 1) from (3 @ 4, 2), (3 @ 4, 3), (3 @ 5, 3), (3 @ 5, 2)
 generating (2 @ 2, 2) from (3 @ 4, 4), (3 @ 4, 5), (3 @ 5, 5), (3 @ 5, 4)
 generating (2 @ 2, 3) from (3 @ 4, 6), (3 @ 4, 7), (3 @ 5, 7), (3 @ 5, 6)
 generating (2 @ 3, 0) from (3 @ 6, 0), (3 @ 6, 1), (3 @ 7, 1), (3 @ 7, 0)
 generating (2 @ 3, 1) from (3 @ 6, 2), (3 @ 6, 3), (3 @ 7, 3), (3 @ 7, 2)
 generating (2 @ 3, 2) from (3 @ 6, 4), (3 @ 6, 5), (3 @ 7, 5), (3 @ 7, 4)
 generating (2 @ 3, 3) from (3 @ 6, 6), (3 @ 6, 7), (3 @ 7, 7), (3 @ 7, 6)
 generating (1 @ 0, 0) from (2 @ 0, 0), (2 @ 0, 1), (2 @ 1, 1), (2 @ 1, 0)
 generating (1 @ 0, 1) from (2 @ 0, 2), (2 @ 0, 3), (2 @ 1, 3), (2 @ 1, 2)
 generating (1 @ 1, 0) from (2 @ 2, 0), (2 @ 2, 1), (2 @ 3, 1), (2 @ 3, 0)
 generating (1 @ 1, 1) from (2 @ 2, 2), (2 @ 2, 3), (2 @ 3, 3), (2 @ 3, 2)
 generating (0 @ 0, 0) from (1 @ 0, 0), (1 @ 0, 1), (1 @ 1, 1), (1 @ 1, 0)
AtlasFile::waitForPendingWrites - Waiting for pending output to finish.
AtlasFile::waitForPendingWrites - Done!
atlasGenerateTextureTOCFromLargeJPEG - Done.
AtlasFile::waitForPendingWrites - Waiting for pending output to finish.
AtlasFile::waitForPendingWrites - Done!
==>atlasGenerateUniqueTerrain("Visions/data/terrains/Jerusalem.atlas", "Visions/data/terrains/JerusalemGM.atlas", "Visions/data/terrains/JerusalemTX.atlas");
atlasGenerateUniqueTerrain - getting ready to generate a terrain with a unique schema...
   o Opening 'Visions/data/terrains/JerusalemGM.atlas' for geometry...
AtlasFile::load - loading Atlas resource 2e43d60 with Visions/data/terrains/JerusalemGM.atlas
   o Opening 'Visions/data/terrains/JerusalemTX.atlas' for texture data...
AtlasFile::load - loading Atlas resource 2ee4780 with Visions/data/terrains/JerusalemTX.atlas
   o Locating geometry TOC...
   o Locating texture TOC...
   o Copying & registering geometry TOC...
   o Copying & registering texture TOC...
   o Registering config TOC...
   o Creating atlas file 'Visions/data/terrains/Jerusalem.atlas'...
   o Preparing for Atlas IO...
   o Generating texture schema configuration chunk...
   o Copying geometry chunks...
Page «Previous 1 2 3 Last »