Game Development Community

More terrain madness

by Henry Shilling · in Torque X 3D · 07/11/2009 (12:32 pm) · 8 replies

I have found that you can easily add a terrain created with L3DT in the txscene:

<Terrain type="GarageGames.Torque.T3D.XTerrain" name="Terrain">
      <Position>
        <X>0</X>
        <Y>0</Y>
        <Z>0</Z>
      </Position>
      <HorizontalScale>8</HorizontalScale>
      <VerticalScale>1</VerticalScale>
      <Scale>
        <X>8</X>
        <Y>8</Y>
        <Z>1</Z>
      </Scale>
      <Repeat>true</Repeat>
      <RepeatX>true</RepeatX>
      <RepeatY>true</RepeatY>
      <Data type="GarageGames.Torque.T3D.RAWTerrainData">
        <TerrainFilename>dataterrainsnew_terrain.raw</TerrainFilename>
        <LightMapFilename>dataterrainsnew_terrain_LM.jpg</LightMapFilename>
        <TexturePathSubstitution>dataterrains</TexturePathSubstitution>
				<UniqueTextureFilename>dataterrainsnew_terrain_TX.jpg</UniqueTextureFilename>
      </Data>
      <ViewError>2</ViewError>
      <LODError>0.5</LODError>
      <LevelZeroError>0</LevelZeroError>
    </Terrain>


OK coolness it works pretty good. So I open the Torque X 3D Builder, and it will not open. As a matter of fact if I go and edit the scene level data it even changes the names from new_terrain to terrain and loads some default raw terrain.

At this point this is useless. How can I create a terrain and add my objects players etc to my terrain when the 3D scene builder doesn't work with any terrain except the built in defaults? This is really not cool. I guess I can write tons of code, get out pencil and paper and calculate all the coordinates etc, but then why did I pay for this?

I tried importing the terrains into the 3D editor but they don't show up. If I replace the .ter file with a TGE terrain it shows up in the editor. I have not tried making a second level with another TGE terrain yet but I am pretty certain it will not work at this point.




#1
09/14/2009 (8:39 pm)
Has anyone been able to generate a .raw file and make it work in Torque X?
#2
09/18/2009 (11:40 am)
yes i did it, some problems I have :
1) heightmap size should be n^2 ( ter is n^2+1 )
2) using <UniqueTextureFilename>dataterrainsnew_terrain_TX.jpg</UniqueTextureFilename>
not
<TexturePathSubstitution>dataterrains</TexturePathSubstitution>
and the unique texture need to be set to content process but still need to copy always or copy if newer because the engine look for both version .xnb(not sure) and .jpg(debug shows me that just for getting the size)
3) Clipmap texture is not working, but have a fix later :).
#3
11/11/2009 (1:21 pm)
3) Clipmap texture is not working, but have a fix later :).


Do you mind sharing? Or at least pointing me in the right direction? What I am really looking to do is apply a shader material to a L3DT terrain and not use the lightmap created (to static)
#4
11/11/2009 (4:03 pm)
Hey Guys,

Yeah i would love to know if yopu did get the RAW woking, i've got version 3 terr working from L3DT, bt in all fairness it looks naff!

Oh and I read on another post that the 3.1.4 update has sorted RAW?


Thank you!
#5
11/11/2009 (7:13 pm)
See this thread:

http://www.garagegames.com/community/forums/viewthread/93769

#6
11/11/2009 (7:19 pm)
Thanks Henry,

I got the TGE terrain working using L3DT. I did try the RAW method with no luck.

And like you pointed it out, the simple material must be the culprit ;-)

I'll give it ago tomorrow, did it provide better results than the TGE?

#7
11/11/2009 (8:19 pm)
They are different, I like the L3DT because it has a continuous bitmap for the visual, however it is so stretched it looks odd. The TGE was actually very easy, however the tiled look really bothers me, I'd ike to be able to make the tiles larger but do not seem to be able to figure out how to.

#8
11/13/2009 (8:57 am)
Hey Henry,

I got the RAW working fine with code, no luck with the XML though as people around the forums seem to be having trouble with.

The only issuse with the RAW terrian is the physics, my player falls straight through!:-(

I looked back at Johns code and he had:
componentPhysics.CollisionBody.AddCollisionShape(new CollisionXTerrainShape());

this was however commented out? maybe a bug.

Anyway if anyone knows a fix, it would be much appreciated!