TGEA1.7.1 Terrain hightmap also busted
by Caylo Gypsyblood · in Torque Game Engine Advanced · 01/17/2009 (6:39 pm) · 42 replies
I downloaded the Torque Game Engine Advanced 1.7.1 SDK and following along with the first Terrain Editing Tutorials Series:"Part One: Creating and Adding a Heightmap" can not import the hightmap .png file correctly. Im using the hightmap .png from ..\Torque\TGEA_1_7_1\GameExamples\T3D\game\scriptsAndAssets\data\terrains\heightmaps folder, and am running the demp .exe from ..\Torque\TGEA_1_7_1\GameExamples\T3D\game .
Could someone else take a few moments and verify this also?
Could someone else take a few moments and verify this also?
#2
When i import a terrain hightmap it builds the terrain mesh offset quite a distance from the edge of the hightmap .PNG file.

01/17/2009 (9:16 pm)
Thanks Jaimi,When i import a terrain hightmap it builds the terrain mesh offset quite a distance from the edge of the hightmap .PNG file.

#3
01/18/2009 (1:22 am)
Caylo, I ran into that as well. I'm not sure how to fix it, but it is quite annoying.
#4
01/18/2009 (1:23 am)
Jaimi, there used to be a heightmaps folder that they had to be in. That was in TGE, not TGEA afaik. Now I think they just have to be in the folder structure.
#5
01/18/2009 (6:50 am)
Did you look at the png in an image editor? Looking at the screenshot, it looks like there is a band of dark along two sides, which would create that canyon there. If it exists in the image, then a bit of image editing to get rid of it would fix the issue.
#6
Two things:
1. Ted is correct, there is a frame around that picture in the PNG File. This will cause the trough that you see on the edge of the terrain.
2. That heightmap (Terrain.png) is 512x512, and is designed for the megaterrain, not for the individual terrain segment. You need a 256x256 for standard terrain. If you are using a MegaTerrain, you should probably not be using the terraform editor.
01/18/2009 (7:42 am)
@Caylo:Two things:
1. Ted is correct, there is a frame around that picture in the PNG File. This will cause the trough that you see on the edge of the terrain.
2. That heightmap (Terrain.png) is 512x512, and is designed for the megaterrain, not for the individual terrain segment. You need a 256x256 for standard terrain. If you are using a MegaTerrain, you should probably not be using the terraform editor.
#7
The Terrain Heightmap Operations works just fine so long as your texture is the right sizes already indicated up above. I think that what you are seeing as off centered in your heightmap preview is caused by location of camera and the Mission Area, which is only emphasized by using the MegaTerrain heightmap (512x512), which also does indeed have that border on it, instead of a legacy heightmap (256 X 256).
01/18/2009 (11:33 am)
Quote:Then, I added a Bitmap operation, and selected the grayscale PNG file. This PNG file was 256x256, and 32bit color (but it was all gray anyway). The PNG file was located inside my project directory (This used to matter, don't know if it still does). Then hit apply.Location doesn't seem to matter, however I have noticed that sometimes the load file dialog doesn't always load the heightmap the first time.
The Terrain Heightmap Operations works just fine so long as your texture is the right sizes already indicated up above. I think that what you are seeing as off centered in your heightmap preview is caused by location of camera and the Mission Area, which is only emphasized by using the MegaTerrain heightmap (512x512), which also does indeed have that border on it, instead of a legacy heightmap (256 X 256).
#8
It is a bit unfortunate that the bitmap does not tile exactly into the same coordinates as the terrain block.
01/18/2009 (1:01 pm)
Having a tiling bitmap helps prevent the "line cutting through terrain" issue. Not really a perfect fix I know. It is a bit unfortunate that the bitmap does not tile exactly into the same coordinates as the terrain block.
#9
01/18/2009 (1:38 pm)
Even with a 256x256 heightmap, the tile is offset.
#10
This is the type of bug that keep TORQUE out of the AAA engine lineup. I have used AAA engines for development work, and the only bugs you will find are NEW features that are currently being implemented. Most bugs are fixed within hours or a few days, with constant updates/fixes- even on the weekends.
I can expect it to take a long time, or even NEVER to fix a bug in a dirty little FREE or open source engine. But when you pay money for something you expect it to work as advertised. I understand that for the small price Torque license currently have, there is no way anyone should expect the QA that $50,000+ engines offer, or even an $500 engeine. But i keep reading how GG want to take Torque to a higher ground, and im sorry to say- i know people walking on higher ground who find it appalling and funny when i talk about my experiences with Torque. And truly now, TGEA is upto 1.8 would not one expect it to have all the old TGE bugs fixed and the old TGE functions fully working? Am i wrong to think that by TGEA1.8 even the basic TGEA functions would be fully working?
This is not a judgment, but an observation. If i did not like the idea behind GG and Torque i would not have stuck with it. Torque is what i play with for fun, and every time i start thinking of building something REAL with Torque, im quickly reminded that it is not truly a serious engine, and i wonder if it truly wants to be.
01/18/2009 (2:47 pm)
What im trying to do is rebuild my TGE1.5 project in TGEA. I have precise designed high maps that i need to import what is not working with TGEA1.8 or TGEA1.7. This is the type of bug that keep TORQUE out of the AAA engine lineup. I have used AAA engines for development work, and the only bugs you will find are NEW features that are currently being implemented. Most bugs are fixed within hours or a few days, with constant updates/fixes- even on the weekends.
I can expect it to take a long time, or even NEVER to fix a bug in a dirty little FREE or open source engine. But when you pay money for something you expect it to work as advertised. I understand that for the small price Torque license currently have, there is no way anyone should expect the QA that $50,000+ engines offer, or even an $500 engeine. But i keep reading how GG want to take Torque to a higher ground, and im sorry to say- i know people walking on higher ground who find it appalling and funny when i talk about my experiences with Torque. And truly now, TGEA is upto 1.8 would not one expect it to have all the old TGE bugs fixed and the old TGE functions fully working? Am i wrong to think that by TGEA1.8 even the basic TGEA functions would be fully working?
This is not a judgment, but an observation. If i did not like the idea behind GG and Torque i would not have stuck with it. Torque is what i play with for fun, and every time i start thinking of building something REAL with Torque, im quickly reminded that it is not truly a serious engine, and i wonder if it truly wants to be.
#11
01/18/2009 (3:42 pm)
Caylo, I'm on your side here. Heightmaps are just as broken for me. ;)
#12
* Legacy terrain uses a 256 X 256 texture area for it's heightmap.
* Mega-terrain uses a 512 X 512 texture area for it's heightmap.
* Location of the heightmap for import doesn't seem to matter.
* Grayscale or RGB color heightmaps seem to work equally well.
* The offset you mentioned is related to the camera position that the terrain offset was saved at in the New Mission Template. Move your camera and the positional offset of your heightmap changes.
* The border/seams in your screenshot is due to the grid that is marked on the default Mega-terrain heightmap - if the texture in question was seamless you would not see them. Again turn off tiling and you will see that the edges of the terrain block directly correspond to the heightmap.

I just tested 5 different heightmaps before I posted this. The only bug I have found is that when you first select the heightmap from the terrain Operation dropdown box you have to then select it again on the Terraform Editor panel where it says "Choose". If it's not working for you then reason stands to say that something is wrong with your particular heightmap image.
01/18/2009 (4:06 pm)
But what bug? How is it busted? Several people have disputed your observation and reported that it works just fine. I've imported every single terrain heightmap I used in TGE to TGEa 1.7.1, created several Mega-Terrains, and not had any problems. I actually came to prefer Atlas terrains but that's another story.* Legacy terrain uses a 256 X 256 texture area for it's heightmap.
* Mega-terrain uses a 512 X 512 texture area for it's heightmap.
* Location of the heightmap for import doesn't seem to matter.
* Grayscale or RGB color heightmaps seem to work equally well.
* The offset you mentioned is related to the camera position that the terrain offset was saved at in the New Mission Template. Move your camera and the positional offset of your heightmap changes.
* The border/seams in your screenshot is due to the grid that is marked on the default Mega-terrain heightmap - if the texture in question was seamless you would not see them. Again turn off tiling and you will see that the edges of the terrain block directly correspond to the heightmap.

I just tested 5 different heightmaps before I posted this. The only bug I have found is that when you first select the heightmap from the terrain Operation dropdown box you have to then select it again on the Terraform Editor panel where it says "Choose". If it's not working for you then reason stands to say that something is wrong with your particular heightmap image.
#13
This occurs with 256x256 or 512x512 heighmaps. The tiling of the heighmap should coincide with the tiling of the terrain block.
This may or may not be related, but how do you know if you're using mega terrains?
01/18/2009 (4:23 pm)
Michael, that is not so. In the "preview" window, the white lines are the edges of the terrain block. If I go to 0,0,0 the white lines line up perfectly with the preview window. However, there is still an offset of the heightmap. You can see this pretty clearly in the screenshot Caylo posted. Notice the white line (the edge of the terrain block). Then look below it, and notice that the heightmap tiles some distance beneath that white line.This occurs with 256x256 or 512x512 heighmaps. The tiling of the heighmap should coincide with the tiling of the terrain block.
This may or may not be related, but how do you know if you're using mega terrains?
#14
01/18/2009 (4:33 pm)
Just notice something else. If I save the mission after applying a heightmap, and then re-open the mission, the heightmap aligns with the terrain block "boundary" in the preview window. However, it still tiles at the wrong location. This is also with terrain tiling turned off.
#15
- This image was taken after the mission was saved and reloaded.
01/18/2009 (4:39 pm)
This odd tiling offset only appears to occur on the north and east sides of the map.
- This image was taken after the mission was saved and reloaded.
#16
What i do (that dont work any time i do it..), is open any of the TGEA1.7.1 example game, F11 menu option FILE>NEW MISSION. F9 for Terraform Editor, pick BITMAP and load my old TGEworking hightmap... Im following exactly like it is done in Terrain Editing Tutorials Series:"Part One: Creating and Adding a Heightmap"
I dont even want to work in 1.7.1, but was expecting to just build me .ter files with 1.7.1 for use in 1.8, and i cant even do that...
01/18/2009 (4:53 pm)
If the preview white lines effected the terrain hightmap, they would create hills, not valleys. What i do (that dont work any time i do it..), is open any of the TGEA1.7.1 example game, F11 menu option FILE>NEW MISSION. F9 for Terraform Editor, pick BITMAP and load my old TGEworking hightmap... Im following exactly like it is done in Terrain Editing Tutorials Series:"Part One: Creating and Adding a Heightmap"
I dont even want to work in 1.7.1, but was expecting to just build me .ter files with 1.7.1 for use in 1.8, and i cant even do that...
#17
- This image shows what the preview looks like before the mission is saved and reloaded.
01/18/2009 (5:03 pm)
The preview white lines don't affect the heightmap; they display the boundary of the terrain block. I'm doing exactly what you're doing, and I'm getting the same result. ;)
- This image shows what the preview looks like before the mission is saved and reloaded.
#18
EDIT: removed erroneous assumptions (wild guesses) based on insufficient information. Problem resolved at a later time.
01/18/2009 (5:28 pm)
The white lines on the preview window are the edges of the terrain block, the heightmap itself, I didn't say that caused the tiling error, but the heightfield preview window does scroll based upon camera position. EDIT: removed erroneous assumptions (wild guesses) based on insufficient information. Problem resolved at a later time.
#19
EDIT:
Use the example pic Michael post above; the place where the red arrow is pointing SHOULD be the outside edge of the terrain mesh.
01/18/2009 (5:45 pm)
The problem is not a questing of tiling terrain, or even the border around any terrain hightmap. Its a problem of the hightmap terrain mesh being built at an offset, none of the terrain hightmap corners are actually AT the terrain MESH corners. EDIT:
Use the example pic Michael post above; the place where the red arrow is pointing SHOULD be the outside edge of the terrain mesh.
#20
Notice in my first screenshot how the terrain just drops off before the edge of the terrain block (which is the green boundary in the main window). Then compare it to the heightmap in the preview window. It doesn't jive.
I understand the need to create my heightmaps seamlessly if I want the terrain to tile seamlessly. However, that is not what I am trying to do in this example. Terrain tiling is turned off, as you can see in the main window in both of my screenshots.
Oddly enough, if I go to the southwest corner of the map, the terrain is generated properly there.
01/18/2009 (5:50 pm)
Michael, terrain tiling is off, and my terrain does have an offset. You can see it right there in my first screenshot. Well, Caylo said it better than me...the terrain mesh is being built at an offset (several units down, and several units to the left of the northeast corner, as you can see in my screenshots).Notice in my first screenshot how the terrain just drops off before the edge of the terrain block (which is the green boundary in the main window). Then compare it to the heightmap in the preview window. It doesn't jive.
I understand the need to create my heightmaps seamlessly if I want the terrain to tile seamlessly. However, that is not what I am trying to do in this example. Terrain tiling is turned off, as you can see in the main window in both of my screenshots.
Oddly enough, if I go to the southwest corner of the map, the terrain is generated properly there.
Associate Jaimi McEntire
King of Flapjacks
Went into the terrain terraform editor.
Edited the "General" operation, and set my Min to 50, and my range to 245, and water level percent to 0 meters.
Then, I added a Bitmap operation, and selected the grayscale PNG file. This PNG file was 256x256, and 32bit color (but it was all gray anyway). The PNG file was located inside my project directory (This used to matter, don't know if it still does). Then hit apply.