Game Development Community

Problem generating .CHU files....

by Jack Stone · in Torque Game Engine Advanced · 12/02/2005 (12:34 pm) · 3 replies

I am having a problem getting my numbers right for .CHU file generation. I tried using script, and Neo Binedell's GUI. I can generate .TQT files no problem.
I am using L3DT to generate a .RAW file. I used this tutorial: http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=8584 Everything went fine there, and I ended up with a 1024 X 102 .raw file. I resized it to 1025 X 1025 in Paint shopt pro, and used the generateChunkFIleFromRaw16 function. When I use the sample numbers in the TSE documentation, (substituting 1024 for 4096):



generateChunkFileFromRaw16(
"TESTBase/data/terrains/RAW3.raw",
1024, 2.0, 1.0 / 256.0,
"TESTBase/data/terrains/DATA.chu", 2.0, 6);



}


I get the following console:

Generating chunked geometry (depth=6, baseMaxError=2.000000)
o Calculating activation levels...
- done.
o Propagating activation levels...
- done.
o Writing file header...
- done.
o Generating empty TOC...
- done.

If I use enable win console, I get soemthing about creating a mesh, but that never says "done" under it.
I usually get either a blank RAW3.chu file, or one which is 50kb, and cant be loaded. Ive used a debug and a release build, same error. TSE stops responding, but I left it for a significant period of time before I close it, so its not just taking a while.

Ive searched the forum, and Im pretty sure its just my numbers that are wrong, but Ive tried several combinations, and they all give the same error. Not sure if its because im using 1024 for my terrain size and the TSE docs use 4096.
Any help would be appreciated, thanks.

JS

#1
12/09/2005 (7:35 pm)
I had the same problem at one time, and I think it was due to either having a raw file that was not square -OR- I had a raw file that was actually 4096 instead of 4097 (I was creating the raw file with another program). I made a note to myself about the problem so that I would not do it again, but I can't find the note. If I do, I'll post an update...
#2
12/09/2005 (7:59 pm)
When I read your name, I first thought it was a prank or something, because you have the exact same name as my Maths lecturer!
I actually *just* got this working an hour or so ago! I spent a while researching signed and unsigned numbers, after reading that it needs an unsigned .RAW file, but it turns out I had been using 16 bit unsigned all along. Anyway, I made a new .RAW file, and a new set of numbers, and its seems ok now. Must have just misread somethign that last time.
Thanks for your help.
Jack
#3
12/10/2005 (8:23 pm)
Ok I can now make terrain files with atlas, and I'm just playing around with numbers to get it looking ok, however It seems that only half of my terrain forms when I load the mission. When I go into the game, half my terrain forms perfectly, then theres this vertical block, and the rest of the terrain is just completly flat, no defomation at all. I tried various .Raw files, and several combinations of values when generating the files, but I still only get half my terrain forming.
I tried various sizes of terrain too.
Any ideas?
JS