Game Development Community

dev|Pro Game Development Curriculum

More Terrain Revelations

by 000 · 07/15/2010 (3:06 am) · 6 comments



(In my previous blog I discovered that loading (x64) 256x terrain meshes loads 4.5 faster than a single 2048x terrain mesh.)

The fun continues! I don't really mean that sarcastically, well sorta, but I am actually rather enjoying discovering, learning and finding how I can push boundaries a little bit at a time in T3D.

So the plan is simple; lay down (x8) 256x separate terrain meshes making a 2048x long strip. I covered in my previous blog that 2048x is the length I'm shooting for as it takes the player about 4 and a half minutes to cross it (in Gideon speed).

After I wrote my last blog I decided to get to work; my level consists of a similar background, but I wanted some elements in it, such as a few pits, maybe some raised ground and a stream. Realizing that I couldn't just lay down the same terrain mesh and modify the one I wanted (thus reflecting the changes on all I assumed) I decided to copy and rename one of the terrain pieces I finished earlier. I did as such, copy and pasted another terrain and changed the file name to point to the new file. T3D loaded it up just fine and I went on my merry carving way.

After carving out my stream and screwing with the river editor for about 15 minutes (anyone know how I can make the water non-see through with a brown surface colour while still having reflections?) I decided to save my work and reload my level. The level loads up and my first terrain mesh has the same stream carving as my second one! 'Wuuuuuuut' I say to myself as I lean into the screen. A thousand reasons flooded my mind and, for whatever reason, I settled on 'it must have some prior associations to the other file, so it's like it's editing both of them at once'. I was only half right.

I wanted to save my previous terrain mesh, so I deleted the secondary and tried to raise it up and smooth it out. My first attempt was pretty poor, so I exited out of the level, didn't save changed, and reopened the level, but my poor first attempt was still there. 'Wuuuuuuut' I said to myself, leaning back in my chair. 'The terrain must auto update and save itself separate from the level'.

I deleted everything, saved the level, went into where T3D stores the terrain files and deleted all of them. Did you know that even if you don't use a terrain in a level T3D still stores it? First terrain you made? BlankLevel_0.ter, made another terrain for goofing around in? BlankLevel_1.ter, made a blank terrain for some testing? BlankLevel_2.ter. I had probably about 30 terrain files sitting around doing nothing. Thankfully T3D associates them with the level name, but regardless I toasted all of them.

After coming home from work today I decided to give it another crack. I made a new terrain file, did what I wanted, saved the level. Still thinking that copy/paste the other terrain file will cause complications I make a new BlankLevel_0.ter and import it into T3D. I go to start sculpting and I notice something:


If you can't see it very well, the area that I'm trying to modify is flat, but the cursor thinks that there's already raised terrain meshing. I look over to the first file; there's raised terrain in that area. It then dawned on me: if you edit multiple terrain files in the same level, the changes will be reflective on ALL meshes. I needed to test this!:

(The first terrain mesh is on the left, that I wrote 'Hey!' on)

Save, Load Map:

(Both terrain meshes, notice that the stream is carved on the first mesh again)

This changes everything. What this means for me is that I have to make each terrain piece completely outside of it's respective level, then import them and never touch them again as long as other terrain meshes are present in the same level.

The idea request that I had in my last blog: 'Have an option to divide any terrain mesh larger than 256x into smaller 256x meshes for faster loading' would be directly affected by this. Ultimately, you could never, ever, make any adjustments to the terrain mesh after splitting it. It would have to be the absolutely last thing that you do in polishing and finalizing your level, and even in that case it'd be absolutely necessary to have a backup file of the original large mesh just to be on the safe side.

I'm pretty sure at this point I don't think I'll run into any more snags, but you never know! I'll continue to post things as I find and test on. As always, your feedback, questions and comments are welcome!

#1
07/15/2010 (8:37 am)
Nice find ! Seems like a pretty big problem, and pretty much defeats the point of the in game terrain editor for large terrains...

Thanx again for sharing your findings ! Hope the GG staff see this and will solve this issue in future versions (fingers crossed XX)
#2
07/15/2010 (9:54 am)
that is bug....
#3
07/15/2010 (1:30 pm)
Can't reproduce this on mine

added 2 terrains with different names and what ever i do one one isn't on the other

even if i close the game/editor and reopen

maybe ur problem is copying the ter files - must be some name handling inside

make sure u create 2 different terrans (not from same ter file or copy of ter file)
#4
07/15/2010 (2:22 pm)
Hey Luis,

I just did a quick test again to see if maybe it was something that I screwed up, but I replicated it again without fault. Here's the process that I did:

+) Made new level, made terrain for that level: e1forest_0.ter
+) Exit level
+) Made another new level, made terrain for that level: BlankRoom_1.ter
+) Moved BlankRoom_1 from game/tools/art/terrains to art/terrains
+) Opened the first level (e1forest)
+) Copied and pasted the terrain entity in T3D
+) Changed the file name in T3D to point to BlankRoom_1.ter
+) Saved and exit the level
+) Reopen level, start sculpting on e1forest_0.ter
+) Saved and exit the level
+) Reopened the level; both terrain pieces have the same markings on now

Now, I thought maybe that moving the file over would have something to do with it, so I made another new terrain piece and left it in game/tools/art/terrains and imported it into the level. I saved and reloaded the level, the terrain piece in game/tools/art/terrain didn't have the markings, but when I moved my terrain sculpting cursor over the terrain, it raised and lowered as if it did have terrain under it (even thought it was flat). I drew a bit on the terrain, save/exit/load and both terrain pieces had the new markings on them, but the second piece did not having the markings (but still the terrain cursor rose above the flat terrain as if it did).

I wanted to see if the 'invisible' terrain was collidable, so I moved the terrain over (they were side by side), saved/exit/load and I noticed that the raising terrain edit cursor disappeared. I made more markings on the terrain, save/exit/load and they didn't appear on the other terrain! So I started to make high markings, like mountains, save/exit/load and some of it would appear on the other mesh, but not all of it.

I am running Binary 1.0.1.

It's all rather odd, but I've found the pipe I need to take to get the results I want with (currently) the lowest chance of possible issues. Thanks for encouraging me to take another look at it Luis, I may probe deeper into it later on this week! :)
#5
07/15/2010 (2:42 pm)
no problem - hope you get all issues out of the way and find some work pipeline that will suit you

i was experimenting on the non-binary 1.1 beta so might explain different results i got

but like you said look again at it - you might just find a fool-proof work-around for this issue till next version comes out
#6
07/29/2010 (7:13 pm)
Hey Mack, I just stumbled across your blog here. That sounds really frustrating. I tweak terrains all the time. I can't imagine having to save that for last. That would drive me nuts.

Right now I have a bigger problem in TGEA (not T3D) that is also driving me nuts. I have **GIANT** collision holes in the terrain. As in the terrain is rendered, but it has no collision so the player falls through. And they aren't small holes either, like the one I found last night is the size of an entire mountain. I thought at first it was related to the tree replicator. But I just deleted all the trees last night and the terrain still has the collision holes. So I am perplexed as to 1) what is causing it and 2) how to fix it. It's very frustrating.

Anyway.... hope you get your editing bug fixed soon. I'm off searching for a solution to this TGEA terrain collision issue now.