Porting : TGE 1.5.0 -> TGEA 1.7.1 terrains and other things
by Dale Best · in Torque Game Engine Advanced · 09/10/2008 (8:23 am) · 3 replies
Ok, so porting the engine to the new version is going relatively well. Things are looking good, shaders are working well.
The terrain issue : Moving over we are rescaling our terrain in the world. We have a ter file, a datablcok and what not. I have managed to get the existing terrain to be in the new engine, as a legacy terrain.
The problem : Scaling. How would i scale the terrain to 0.45 its size, without touching the source of the engine too much (as we are working around the engine, in our own mod). The entire world, objects buildings, entites etc are scaled its just the terrain is too big. The terrain was made in 3ds, brought into TGE, editted, saved and was ready for action. Using this terrain is the first choice, for now.
Problem 2 : TGE ter -> TGEA Atlas.
Is this possible? The console and the code has functions like atlasExportLegacy which claims to export the existing ter datablock (which it finds) to an atlas file. The breakdown comes in the code, where it looks for the lightmap size to be square and when its not, it asserts. I dont have any lightmaps and dont want any on the terrain per say, so its logical it wont find it. So this option, is outta the for now.
Surely there is a way to save from ter -> atlas. I can see the functions just itching to export the existing but i do have the time to reinvent the wheel. Are there any known tools to do this anywhere?
I have tried a good number of things, and will start trying to recreate the terrain from scratch using l3dt tomorrow morning. For now, i am just curious as to why the scale is still (since a post i saw in 2004) unable to affect the scale of the terrain object in the game engine.
Fuzzy
The terrain issue : Moving over we are rescaling our terrain in the world. We have a ter file, a datablcok and what not. I have managed to get the existing terrain to be in the new engine, as a legacy terrain.
The problem : Scaling. How would i scale the terrain to 0.45 its size, without touching the source of the engine too much (as we are working around the engine, in our own mod). The entire world, objects buildings, entites etc are scaled its just the terrain is too big. The terrain was made in 3ds, brought into TGE, editted, saved and was ready for action. Using this terrain is the first choice, for now.
Problem 2 : TGE ter -> TGEA Atlas.
Is this possible? The console and the code has functions like atlasExportLegacy which claims to export the existing ter datablock (which it finds) to an atlas file. The breakdown comes in the code, where it looks for the lightmap size to be square and when its not, it asserts. I dont have any lightmaps and dont want any on the terrain per say, so its logical it wont find it. So this option, is outta the for now.
Surely there is a way to save from ter -> atlas. I can see the functions just itching to export the existing but i do have the time to reinvent the wheel. Are there any known tools to do this anywhere?
I have tried a good number of things, and will start trying to recreate the terrain from scratch using l3dt tomorrow morning. For now, i am just curious as to why the scale is still (since a post i saw in 2004) unable to affect the scale of the terrain object in the game engine.
Fuzzy
#2
Once the terrain existed in the engine there seemed nothing that would affect its size except the normal, brushes etc. but i cant brush the terrain to 0.45 its size, and the block size makes it hellishly sharp and ugly, not smaller it seems :)
I tried these things.
thanks for the reply, though. any other ideas?
09/11/2008 (1:13 am)
Clearly reading the thread might have helped, but scaling does not affect the terrain, at all. this has been seen along the forums for years. But i have tried the MOST obvious option thanks WilliamOnce the terrain existed in the engine there seemed nothing that would affect its size except the normal, brushes etc. but i cant brush the terrain to 0.45 its size, and the block size makes it hellishly sharp and ugly, not smaller it seems :)
I tried these things.
thanks for the reply, though. any other ideas?
#3
Forgive me. I stopped at "Are there any known tools to do this anywhere?".
I assure you, it's smaller. The sharp and ugly you are seeing is the scaled down version of your terrain. If you have the terrain tiling, un-tile it and set the blockSize to 2, then 8. There is a significant difference in size.
The reason that the scale does not directly affect the size of the terrain is that the legacy terrain requires a power of 2 size in order to work. Scale is still an option since TerrainBlock inherts from SceneObject. In my code base I changed Scale to alter blockSize. It's been ages though and I had forgotten.
As for your second problem: try exportAtlasFromLegacyTER. You will probably run into a file version problem. You can try changing the readable file version to 5 in the engine, or using an older terrain file to export from. It works for me, every time, lightmap or no lightmap (and I can't figure out atlas, so I know I haven't made changes).
09/11/2008 (2:48 am)
Quote:
Clearly reading the thread might have helped, but scaling does not affect the terrain, at all. this has been seen along the forums for years. But i have tried the MOST obvious option thanks William
Forgive me. I stopped at "Are there any known tools to do this anywhere?".
Quote:
and the block size makes it hellishly sharp and ugly, not smaller it seems :)
I assure you, it's smaller. The sharp and ugly you are seeing is the scaled down version of your terrain. If you have the terrain tiling, un-tile it and set the blockSize to 2, then 8. There is a significant difference in size.
The reason that the scale does not directly affect the size of the terrain is that the legacy terrain requires a power of 2 size in order to work. Scale is still an option since TerrainBlock inherts from SceneObject. In my code base I changed Scale to alter blockSize. It's been ages though and I had forgotten.
As for your second problem: try exportAtlasFromLegacyTER. You will probably run into a file version problem. You can try changing the readable file version to 5 in the engine, or using an older terrain file to export from. It works for me, every time, lightmap or no lightmap (and I can't figure out atlas, so I know I haven't made changes).
Torque 3D Owner Avid Gamer