Game Development Community

Atlas functions not found (1.8.1)

by Eric Thomas Patton · in Torque Game Engine Advanced · 06/11/2009 (12:14 am) · 29 replies

im using 1.8.1 and i'm aware that there are issues, but i couldn't find any threads on this one. I went into the project.conf file and un-commented the includeModule for atlas and then ran the generateProjects.bat like i read in another thread.

when i attempt to use any atlas command, it tells me "Unable to find function 'whatever the function is'."
like when i try to use the atlasOldGenerateChunkFileFromRaw16() function it can't seem to find it.

i'm really sorry if there has already been a thread about this, but I have been tinkering with it the entire day and have looked all over the place for an answer that is already there for this, but it just ended in frustration.

is there something else i'm supposed to do to get this to work? i purchased L3DT Pro and was rather excited to use it with the atlas2 plugin, but can't get atlas to do anything to try it out =/

i appreciate any help on this, thanks!

Eric
Page «Previous 1 2
#1
06/11/2009 (7:42 am)
I just tried the method you described and it seems to work fine.

Did you re-compile your project after you made the changes?

Open the project and see if there are atlas related files in the solution explorer.
If they are not there then there not being compiled into you project.
#2
06/11/2009 (11:28 am)
that was the problem, as usual i forgot to compile

i'm having another problem now though. when i attempt to finally generate the terrain after making the geometry.atlas and the tex.atlas i get this in the console:

"atlasGenerateUniqueTerrain - getting ready to generate a terrain with a unique schema...
o Opening 'scriptsAndAssets/data/terrains/deleteme/geom.atlas' for geometry...
ResourceObject::construct: NULL resource create function for 'geom.atlas'.
AtlasFile::load - cannot open atlas file 'scriptsAndAssets/data/terrains/deleteme/geom.atlas'.
atlasGenerateUniqueTerrain - unable to open 'scriptsAndAssets/data/terrains/deleteme/geom.atlas' for input!"



i've checked the paths and they are all correct, can't seem to figure out why it's not working.
#3
06/11/2009 (12:15 pm)
Read this to solve your problem.

TGEA 1.8.0 BUG Atlas Terrain failed wrtiting bitmap

The fix is on the second page.
#4
06/11/2009 (12:22 pm)
I didn't read your post entirely before I posted.
Sorry.

That info appears unrelated to your problem.

Could you post your atlas creation script as well as the console.log.

It will help me figure out what the problem is.
#5
06/11/2009 (4:12 pm)

How did you add the Atlas files? Did you add them manually or did you include the Atlas module from the project definitions and re-ran the project generator?

I may be wrong but it looks as though the compile went without TORQUE_ATLAS and thus the ".atlas" resource type didn't get registered.
#6
06/11/2009 (4:22 pm)
Quote:im using 1.8.1 and i'm aware that there are issues, but i couldn't find any threads on this one. I went into the project.conf file and un-commented the includeModule for atlas and then ran the generateProjects.bat like i read in another thread.
#7
06/11/2009 (4:32 pm)
Maybe gameFunctions.cpp didn't get recompiled for whatever reason. Still, the problem most probably is that the resource creation function didn't get registered. Make sure TORQUE_ATLAS is defined, recompile gameFunctions.cpp, and link.
#8
06/11/2009 (6:17 pm)
here is the script for generating the atlas files:

//This script was generated by the L3DTio_Atlas2 plugin for L3DT
//For more info, please see <http://www.bundysoft.com/wiki/doku.php?id=plugins:fileio:L3DTio_Atlas2>
enableWinConsole(true);
setLogMode(6);
cls();
echo("Starting Atlas Build!nn");

// make geometry CHU and atlas
atlasOldGenerateChunkFileFromRaw16("scriptsAndAssets/data/terrains/deleteme/HF.raw", 512, 10.000000, 0.000000, "scriptsAndAssets/data/terrains/deleteme/HF.chu", 2.500000, 4);
importOldAtlasCHU("scriptsAndAssets/data/terrains/deleteme/HF.chu", "scriptsAndAssets/data/terrains/deleteme/geom.atlas");

// make texture map atlas
//atlasGenerateTextureTOCFromTiles(8, "scriptsAndAssets/data/terrains/deleteme/TX/TX_x%dy%d", "scriptsAndAssets/data/terrains/deleteme/tex.atlas", 0);
atlasGenerateTextureTOCFromLargeJPEG("scriptsAndAssets/data/terrains/village.jpg", 3, "scriptsAndAssets/data/terrains/deleteme/tex.atlas"); 
// make unique textured atlas
atlasGenerateUniqueTerrain("scriptsAndAssets/data/terrains/village.atlas", "scriptsAndAssets/data/terrains/deleteme/geom.atlas", "scriptsAndAssets/data/terrains/deleteme/tex.atlas");

echo("Build complete!");
quit();


the "atlasGenerateTextureTOCFromTiles" part that i commented out caused the entire game to crash so i exported the terrain as a jpg and used the "atlasGenerateTextureTOCFromLargeJPEG" instead.
#9
06/11/2009 (6:19 pm)
and here is the latest console.log with the information relevant to the scripts:


==>atlasOldGenerateChunkFileFromRaw16("scriptsAndAssets/data/terrains/deleteme/HF.raw", 512, 10.000000, 0.000000, "scriptsAndAssets/data/terrains/deleteme/HF.chu", 2.500000, 4);
Generating chunked geometry (depth=4, baseMaxError=2.500000)
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!
- done.
=== Chunk Statistics ===
===== Level Count Avg. Size
0 64 12.000000
1 16 12.000000
2 4 12.000000
3 1 12.000000
========================================
chunks: 85
input verts: 262144
output verts: 81

avg verts/chunk: 1
NOTE: verts/chunk is low; for higher poly throughput consider setting the tree depth to 3 and reprocessing.
output bytes: 3173
bytes/input vert: 0.01
bytes/output vert: 39.17
real triangles: 1020
Window focus status changed: focus: 0
Using background sleep time: 25
DirectInput deactivated.
Activating DirectInput...
Window focus status changed: focus: 1
==>importOldAtlasCHU("scriptsAndAssets/data/terrains/deleteme/HF.chu", "scriptsAndAssets/data/terrains/deleteme/geom.atlas");
AtlasDeferredFile::ensureStreamWritable - switching file into writable mode... This may cause a crash if you have other copies of Torque accessing it!
importOldAtlasCHU - created new Atlas file 'scriptsAndAssets/data/terrains/deleteme/geom.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::waitForPendingWrites - Done!
importOldAtlasCHU - import OK!
AtlasFile::waitForPendingWrites - Waiting for pending output to finish.
AtlasFile::waitForPendingWrites - Done!
Window focus status changed: focus: 0
Using background sleep time: 25
DirectInput deactivated.
Activating DirectInput...
Window focus status changed: focus: 1
Window focus status changed: focus: 0
Using background sleep time: 25
DirectInput deactivated.
Activating DirectInput...
Window focus status changed: focus: 1
#10
06/11/2009 (6:20 pm)
==>atlasGenerateTextureTOCFromLargeJPEG("scriptsAndAssets/data/terrains/village.jpg", 3, "scriptsAndAssets/data/terrains/deleteme/tex.atlas");
atlasGenerateTextureTOCFromLargeJPEG - Successfully opened JPEG 'scriptsAndAssets/data/terrains/village.jpg' for reading.
atlasGenerateTextureTOCFromLargeJPEG - Image is 4096px (hopefully square!).
atlasGenerateTextureTOCFromLargeJPEG - Tree depth of 3 mandates 4 tiles on a side.
atlasGenerateTextureTOCFromLargeJPEG - Therefore, tiles are 1024px wide.
AtlasDeferredFile::ensureStreamWritable - switching file into writable mode... This may cause a crash if you have other copies of Torque accessing it!
atlasGenerateTextureTOCFromLargeJPEG - Atlas file 'scriptsAndAssets/data/terrains/deleteme/tex.atlas' created!
atlasGenerateTextureTOCFromLargeJPEG - Initialized Atlas threads, now importing texture data...
atlasGenerateTextureTOCFromLargeJPEG - Allocating ~12288 kb of JPEG decompression working area...
atlasGenerateTextureTOCFromLargeJPEG - Generating 1024px by 1024px leaf tiles...
- processing row 0...
- processing row 1...
- processing row 2...
- processing row 3...
atlasGenerateTextureTOCFromLargeJPEG - Now generating rest of quadtree...
generating (1 @ 0, 0) from (2 @ 0, 0), (2 @ 0, 1), (2 @ 1, 0), (2 @ 1, 1)
generating (1 @ 0, 1) from (2 @ 0, 2), (2 @ 0, 3), (2 @ 1, 2), (2 @ 1, 3)
generating (1 @ 1, 0) from (2 @ 2, 0), (2 @ 2, 1), (2 @ 3, 0), (2 @ 3, 1)
generating (1 @ 1, 1) from (2 @ 2, 2), (2 @ 2, 3), (2 @ 3, 2), (2 @ 3, 3)
generating (0 @ 0, 0) from (1 @ 0, 0), (1 @ 0, 1), (1 @ 1, 0), (1 @ 1, 1)
AtlasFile::waitForPendingWrites - Waiting for pending output to finish.
AtlasFile::waitForPendingWrites - Done!
atlasGenerateTextureTOCFromLargeJPEG - Done.
AtlasFile::waitForPendingWrites - Waiting for pending output to finish.
AtlasFile::waitForPendingWrites - Done!
Window focus status changed: focus: 0
Using background sleep time: 25
Win32Window::WindowProc - resetting device due to window size change.
Window focus status changed: focus: 1
Window focus status changed: focus: 0
Using background sleep time: 25
DirectInput deactivated.
Activating DirectInput...
Window focus status changed: focus: 1
==>atlasGenerateUniqueTerrain("scriptsAndAssets/data/terrains/village.atlas", "scriptsAndAssets/data/terrains/deleteme/geom.atlas", "scriptsAndAssets/data/terrains/deleteme/tex.atlas");
atlasGenerateUniqueTerrain - getting ready to generate a terrain with a unique schema...
o Opening 'scriptsAndAssets/data/terrains/deleteme/geom.atlas' for geometry...
ResourceObject::construct: NULL resource create function for 'geom.atlas'.
AtlasFile::load - cannot open atlas file 'scriptsAndAssets/data/terrains/deleteme/geom.atlas'.
atlasGenerateUniqueTerrain - unable to open 'scriptsAndAssets/data/terrains/deleteme/geom.atlas' for input!




(had to split it into 2 posts, was too large)
#11
06/11/2009 (6:27 pm)
Quote: Make sure TORQUE_ATLAS is defined, recompile gameFunctions.cpp, and link.

i did a search and only found 2 occurences of TORQUE_ATLAS:

#ifdef TORQUE_ATLAS
   gResourceManager->registerExtension(".atlas", constructAtlasFileResource);
#endif

and

#ifdef TORQUE_ATLAS
extern ResourceInstance *constructAtlasFileResource(Stream &stream);
#endif

i'm not sure how to tell if it's defined or not from those


edit: i did recompile the file and it still is giving the same error
#12
06/11/2009 (6:27 pm)
I think Rene Damm may be right.
Open the project properties editor and see if TORQUE_ATLAS is defined in the C++/Preprocessors definitions.
#13
06/11/2009 (6:29 pm)
Quote: I think Rene Damm may be right.
Open the project properties editor and see if TORQUE_ATLAS is defined in the C++/Preprocessors defines.

yeah, it's defined there
#14
06/11/2009 (6:34 pm)
Strange. Did you do a recompile of gameFunctions.cpp and relink?

Would be most strange if the problem then still persisted.

//EDIT: just saw your edit :)

//BTW: Visual Studio grays out regions it doesn't compile, so it should be easy to tell whether the code gets compiled or not.

Anyways, just remove the #ifdefs and do another recompile (and link, of course). The resource creation function should then be there. If not...
#15
06/11/2009 (6:39 pm)
Quote:i'm not sure how to tell if it's defined or not from those

If you are looking at this block of code in VS
ifdef TORQUE_ATLAS  
#    gResourceManager->registerExtension(".atlas", constructAtlasFileResource);  
 endif

if TORQUE_ATLAS is not defined correctly then the code between the ifdef and endif will be grayed out.
#16
06/11/2009 (6:46 pm)
Rene:
maybe that is the problem, i'm not sure how to relink and have honestly not even heard of it before. when you said it before i assumed you meant to link to you the results on here lol

Bill:
yeah, the code isn't grayed out so it must be defined



edit: it seems that it links when i build the solution anyway in VS 2008, after recompiling it, it has a link process that happens
#17
06/11/2009 (6:49 pm)

When you have recompiled the single file with the context menu in VS and then chosen Run from within the IDE, it'll do the relink automatically.

Linking is the step after compilation that brings together the individual compiled files into an executable or link library.
#18
06/11/2009 (6:51 pm)
i'm going to attempt to rebuild all just in case and try it again, this is so strange
#19
06/11/2009 (7:17 pm)
i'm not sure if it was rebuilding the entire engine or removing the #ifdef, but it is 'working' now.

the commands all work, but now nothing happens after i use them. I'm assuming i was supposed to type those 4 commands sequentially into the console while i'm in my mission editor:

atlasOldGenerateChunkFileFromRaw16("scriptsAndAssets/data/terrains/deleteme/HF.raw", 512, 10.000000, 0.000000, "scriptsAndAssets/data/terrains/deleteme/HF.chu", 2.500000, 4);

importOldAtlasCHU("scriptsAndAssets/data/terrains/deleteme/HF.chu", "scriptsAndAssets/data/terrains/deleteme/geom.atlas");

atlasGenerateTextureTOCFromLargeJPEG("scriptsAndAssets/data/terrains/village.jpg", 3, "scriptsAndAssets/data/terrains/deleteme/tex.atlas");

atlasGenerateUniqueTerrain("scriptsAndAssets/data/terrains/village.atlas", "scriptsAndAssets/data/terrains/deleteme/geom.atlas", "scriptsAndAssets/data/terrains/deleteme/tex.atlas");



but after they finish executing, the terrain stays as the same basic one that comes with the new missions.

there has to be something that i am doing wrong now that the commands are all working. any suggestions? i followed this tutorial:

http://tdn.garagegames.com/wiki/TSE/Atlas/Create_a_Terrain/L3DT

and at the bottom where it says to add the myTerrain datablock to the mission file, i assume i am supposed to do something with the "village.atlas" file that was created with the last command, but i'm not entirely sure what.


oh and by the way, thank you both so much for taking the time to help me, i really appreciate it a ton. sorry for being such a noob lol XD
#20
06/11/2009 (7:36 pm)

The commands you've run only generate an Atlas file. As you've correctly assumed, you need to bring it into the scene. Simply delete the existing Atlas terrain and create a new one with your newly generated Atlas file.

IIRC changing the atlasFile property of an existing AtlasInstance is not correctly handled by the code.
Page «Previous 1 2