Terrain in torque x 2.0
by Alyson Balzer · in Torque X 2D · 05/31/2008 (7:09 pm) · 6 replies
Hi, I am trying to create my own terrain in torqueX 2.0, currently i got the default .ter loaded, and in my levelData.txscene I have it like:
data/terrains/terrain.ter
data/terrains/lightmap.png
data/terrains
now say I wanted my own new terrain, i exported my own .ter through tge per say, and saved in the terrains folder as terrain1.ter, then under the levelData.txscene, i put in:
data/terrains/terrain1.ter
That dosn't work,
So, I switched to
data/terrains/terrain.raw
however, that dosn't work even i have a 16 bit raw file, with 257x257 size.. it still give me the error of
the grid size must be size + 1.... which it is...
Any idea?
Thanks.
now say I wanted my own new terrain, i exported my own .ter through tge per say, and saved in the terrains folder as terrain1.ter, then under the levelData.txscene, i put in:
That dosn't work,
So, I switched to
however, that dosn't work even i have a 16 bit raw file, with 257x257 size.. it still give me the error of
the grid size must be size + 1.... which it is...
Any idea?
Thanks.
#2
I don't have tge for modifie the terrain, it didn't come with the torqueX pro 2.0 bundle, so there is no way i could have generated the right .ter file. so the other way around was for me to get .raw to work, and as you can see, i did all the steps you told through the 1.5 beta version, but some how it's not working for 2.0 version. if you could try the 2.0 version, put up a nice tutorial for the 2.0 version, that did be nice.
Thanks.
06/01/2008 (7:18 am)
Yeah, the .ter file was generated using terragen or worldmachine, later on i find out that it dosn't suppor the torque x .ter file, I also checked out the other post you had with L3DT tutorial, i tried the method there using RAW, however it crashed, sometimes it shows the terrain for like 0.5 second in beginning of the debugging, then it crashes. I don't have tge for modifie the terrain, it didn't come with the torqueX pro 2.0 bundle, so there is no way i could have generated the right .ter file. so the other way around was for me to get .raw to work, and as you can see, i did all the steps you told through the 1.5 beta version, but some how it's not working for 2.0 version. if you could try the 2.0 version, put up a nice tutorial for the 2.0 version, that did be nice.
Thanks.
#3
John K.
06/01/2008 (8:51 am)
I'll check on that and find out what's going on. The L3DT path to bringing in RAW files is supposed to work, but it sounds like something is broken. I'll take a look.John K.
#4
Sounds like the same thing I am seeing, which I contacted you several months ago about after working through your notes.
If its the same error, sounds like it is, it seems to be related to the XNA error ("The operation was aborted. You may not modify a resource that has been set on a device, or after it has been used within a tiling bracket."), discussed in this thread...
http://www.garagegames.com/mg/forums/result.thread.php?qt=74056
I've tried the various workarounds discussed, but doesnt seem to help with the RAW terrain issue.
I've since gone back to using TGE demo to create the terrains as this seems to work OK.
06/02/2008 (8:14 pm)
John,Sounds like the same thing I am seeing, which I contacted you several months ago about after working through your notes.
If its the same error, sounds like it is, it seems to be related to the XNA error ("The operation was aborted. You may not modify a resource that has been set on a device, or after it has been used within a tiling bracket."), discussed in this thread...
http://www.garagegames.com/mg/forums/result.thread.php?qt=74056
I've tried the various workarounds discussed, but doesnt seem to help with the RAW terrain issue.
I've since gone back to using TGE demo to create the terrains as this seems to work OK.
#5
John K.
06/02/2008 (11:42 pm)
Hi Steve, it looks like there is an already initialized clipmap texture buffer is being re-written to and that's tripping the XNA exception. An engine code change needs to be made to fix it. These 'tiling-bracket' bugs introduced in XNA 2.0 are a real pain in the rear. I'll keep looking into it and post a code fix.John K.
#6
06/28/2008 (4:38 pm)
I started using .RAW terrain files in terragen also, and came upon the same bug. The only way I could get the .raw terrains to work is to modify the code in the load of an RawTerrainData to not add one to the size of the terrain and then decrement the size because of the later code in the same method extending the data array to support the 256 plus one. Then there is that clip map issue. If I tell the XTerrain to use a material outside of the data section of the terrain then it doesn't crash anymore. But the next issue is that the terrain for some reason does not collide with anything and all objects fall through the terrain. I do have a rigid component on the Terrain and it is being created, but all objects fall through. The hacks I put in place are definately not a solution but it got me past the point of it not running. It would be great to know when all these fixes are in place. Thanks.
Associate John Kanalakis
EnvyGames
Are you willing to email me your .ter file? I can try giving it a shot. My email address is listed on my profile page. But overall, it sounds like you are doing the right things.
John K.