Game Development Community

AtlasOldHeightmap Fatal-ISV: Error

by Deception Games · in Torque Game Engine Advanced · 05/02/2007 (9:50 pm) · 8 replies

Ok this error got me puzzled

ERROR "AtlasOldHeightmap::loadRaw16 - unexpected file size is too small. "

Well it continues with more but that is the basic. Tried 2 maps one that is a 1024 and a 4096 and receive the same error.

This my code from my cs script for the 1024 map.

atlasOldGenerateChunkFileFromRaw16(
"terrain_water_demo/data/terrains/heightmap.raw",
1024, 1.0, 0.0017,
"terrain_water_demo/data/terrains/geometry.chu",
1, 2);

Basic is that run my command and then receive the error and torque shuts down.

Here is the last 2 line out the log file

Executing cs/ts1.cs.
Fatal-ISV: (..\engine\atlas\editor\atlasOldHeightfield.cpp @ 41) AtlasOldHeightfield::loadRawU16 - unexpected file size; file is too small. Did you maybe export as 8bit RAW intead of 16bit raw? Or maybe size of RAW is not pow2+1? (ie, 257 instead of 256, 4097 instead of 4096)
DirectInput deactivated.

Know this got be something so small or sitting here in my face and not seeing the answer.


Tried using the torque plugin but believe there got be more that needs to be exported. Is there a tutorial that explains little more in depth?

Any suggestions is most welcome ...Thanks in advanced for any help.

#1
05/03/2007 (3:48 am)
If i remember correctly your geometry has to be in this case 1024+1, that is 1025
it always has to be 1 pixel extra to the normal power of 2.
But the size you enter in your "atlasOldGenerateChunkFileFromRaw16" should be without the extra pixel.

But im sure youll find more detailed descriptions on TDN here
http://tdn.garagegames.com/wiki/TSE/Atlas/Overview
#2
05/03/2007 (6:17 am)
Well tried it both ways with the 1024 and adding the +1.

Check my other script that created for FreeWorld3D that work and there is nothing different. Something about the raw file is what is bugging me here, keep thinking its got be a 8bit not a 16bit
#3
05/03/2007 (9:11 am)
Deception,
It's a raw file, so right click on your .RAW file and select 'Properties'.
The 'Size:' should be 2,101,250 bytes which is 1025 x 1025 x 2.

If the size is 1,050,625 then it is 1025 x 1025 (the right size) but only 8 bits.
If the size is 2,097,152 then it is 1024 x 1024 (the wrong size) but 16 bits(right bit size).
If the size is 1,048,576 then it is 1024 x 1024 (the wrong size) and only 8 bits.
#4
05/03/2007 (9:27 am)
Mary,

Thanks for that wonderful information, that is a good thing to know there. So test the L3DT here at work just to get a idea before get home tonight and look my file. Well the raw file here is 2.00 MB (2,097,152 bytes) so from your information above this is a wrong size file.

If this same case when get home have to contact Arron at Bundysoft.
#5
05/03/2007 (9:36 am)
A height map is just a 2D array of points. To turn it into a terrain surface, you need to connect those points into triangles. In order to have a terrain surface that is 1024 triangles wide, your array of points needs to be 1025 points wide. It's just the way the universe works.
#6
05/03/2007 (1:28 pm)
So waiting for a reply on my thread in the forums on L3DT did a little test.

When I was exporting the .raw file there is a check box to "resize the terrain". So I add a +1 to the number increasing it to 1025, then exported the file.

The results "2.00 MB (2,101,250 bytes)"

So can't wait to get off work and give that a test.

Thanks so much for taking the time to help me understand. Hope that someday be able to do the same.
#7
05/03/2007 (3:39 pm)
Good luck, that should work fine for you.
But realize that any program that creates height maps should automatic create them to the size you specify plus one. It such a fundamental part of height maps. And realize that when they say 'resize' they probably mean interpolate (a word that make me cringe when connected to height maps) from 1024 to 1025.
And of course, keep using the value 1024 in your atlasOldGenerateChunkFileFromRaw16 command.
#8
05/03/2007 (5:14 pm)
Well got home and ran that again and it works. I could used there exporter but rather lease try to learn something.

So now off to create one the many worlds that on my list here. Thanks again for taking the time to help me. Sometimes think we all are moving too fast to slow down and just breathe.

Thanks a million again for all great information! :)