L3DT users' community
Large 3D terrain generator

Importing my H map to TSE, need help

Got a problem or need advice?

Importing my H map to TSE, need help

Postby DeathTwister » Fri May 26, 2006 7:24 pm

Hay all,

Troll Fiddler Wrote:
Hi DT,

The formula for calculating leafsize is

2^treeDepth-1 * leafSize = imageSize

OK, what does that mean? Let's do the treedepth-1 thing first.

You know that when you made your terrain file you had to choose a treedepth? Let's say you chose a treedepth of 6. OK, easy peasy, 6 -1 =5. Or say you had a treedepth of 9. So 9 -1 = 8. OK that's the obvious part. Just get whatever treedepth you specified for your terrain and take one away from it.

Next, 2^ is a shorthand way of saying "2 to the power of." So what this bit means is you multiply two by itself for the number of times you got by doing the treedepth minus one buisness. So if you got 5 as the answer to the treedepth thing, you multiply two by itself 5 times. That is 2x2x2x2x2 which equals 32.

Now, you will already know the size of your texture file. It will be 2048 x 2048, or 1024 x 1024, or whatever size it is.

So following our example above, we have the number 32 worked out if our treedepth was 6. If our image is 1024 then we need to multiply 32 by some number to get 1024. Whatever that number is is your leaf size! Geddit?

In this case the leafsize 32, because 32 x 32 is 1024. If your image file had been 2048 in size then the leafsize would have been 64, as 32 x 64 = 2048.

So to run through it quickly once more.

1) Take one away from your treedepth. Let's say treedepth is 6 so the answer is 5.

2) Multiply 2 by itself for the number of times in the answer from part one. So we multiply two by itself 5 times in this case. Which is 32.

3)Get your texture image size. Let's say it's 2048. We need to multiply the answer from part (2) by some number which will give us 2048. So we need to multiply 32 by 64, which is in fact equal to 2048. How did I get 64? You just have to guesstimate. If you're crap at maths just use a calculator and keep multiplying 32 by increasing numbers until you get 2048 (or whatever size your texture is). You'll soon have most of the basic numbers for leaf sizes figured out.

Hope that helps.

T.


Hay Trollfiddler,

Humm, maybe move this to a new post here I'll make.

. When I tried to import I had the GUI up and have filled in.....

Mesh
size at 1024
square size at 2
error metric at 2
and tree depth at 6 (should be 5?)
and my height range was 2634
texture
Size 1024
Tree depth 6 (should be 5?)
leaf size 32 when calculated. recalc says 64 but still the same crashes.

Here is my problem atm.

When I tried to generate a chunk file, it didn't that I could see anywhere (what dir will it go to?) and when I hit the texture generate button, it flat out crashed TSE Crying or Very sad going to take another look and shot at it while I get help. you guys are great, once I get this down I'll be a monster hahahaha.

I am not at all sure about that size thing? even though that is what I thought I was supposed to do. I had the texture at 4096+ the one pixel, and I did that to the .raw file as well. But I have tried both ways with the extra pixel and without the extra pixel, seems to crash the same here.

Haha at least I am trying to, /chuckles, I'll get this or die trying ROTFL.


DT Twisted Evil
User avatar
DeathTwister
Dearly missed
 
Posts: 562
Joined: Thu Dec 15, 2005 12:30 pm
Location: Klamath, CA.

Re: Importing my H map to TSE, need help

Postby Aaron » Fri May 26, 2006 7:43 pm

DeathTwister wrote:Humm, maybe move this to a new post here I'll make.


Thanks DT, I appreciate it. I was just starting to think the other thread was going off-topic.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Postby DeathTwister » Fri May 26, 2006 9:01 pm

hehe Np there Aaron,

sorry we got sidetracked some.

humm, found some notes and I think I forgot to devide by 65535, shesh, KK OK I try this again, also noticed I think I messed up the texture size as well after reading the notes I found from what 5 weeks ago before I crashed.
Did I mess up anywhere else? probobly as he mumbles to himself trudgeing back into the fight..........

DT :twisted:
User avatar
DeathTwister
Dearly missed
 
Posts: 562
Joined: Thu Dec 15, 2005 12:30 pm
Location: Klamath, CA.

Postby trollfiddler » Sat May 27, 2006 2:15 pm

Hiya,

Aha! I think I see the problem. It's your mesh that should be one pixel bigger, not the texture. Making the texture bigger and *not* making the mesh bigger would probably cause both imports to crash.

Just to go through some of the items you mentioned :-

[quote]
Meshsize at 1024
square size at 2
error metric at 2
and tree depth at 6 (should be 5?)
and my height range was 2634
texture
Size 1024
Tree depth 6 (should be 5?)
leaf size 32 when calculated. recalc says 64 but still the same crashes.
[/quote]


Your actual mesh should be 1025 in size (that includes the extra pixel) but you have to enter 1024 into the GUI, or into the chunk generation formula if you're not using the GUI.

Your squaresize should be the same as whatever you use as the "heightfield resolution" when creating your new map in L3DT. The default is 10 in L3DT but I usually change it to 1 for my maps. It doesn't really matter what it is as long as you use the same number for the square size in the TSE import GUI.

Error metric and treedepth should be fine the way you have them for your 1024 or 4096 size maps (which in reality will be 1025 and 4097). So leave treedepth as 6. You only need to worry about the "minus one" stuff if you're not using the GUI, and are trying to manually calc the leafsize.

Height range you can check in L3DT by opening
operations/heightmap/change_vert_scale. The "altitude range" is right there in the middle, and that's what I use for the height range in the GUI. Just cancel out when you've read it. There might be an easier way but that's the way I check it.

For the texture, leave it the real size without adding any extra pixel. So if it's 1024 leave it as 1024, and also put 1024 into the GUI. Leave the treedepth the same as you use for the mesh, in your example above it is 6.

I don't understand why the recalc is changing the leafsize on you, it shouldn't unless anything else gets changed. I haven't noticed that myself. It's a fixed formula so the answer should always be the same for a given texture size and treedepth. Maybe it's a bug in the GUI. Just use the first size that gets calculated.

Anyway, hopefully the cause of your problems is that you are increasing the texture by one pixel instead of the mesh. If not, following the above guidelines should get you through. Works for me anyway :-)

<edit>
DT said "humm, found some notes and I think I forgot to devide by 65535"

You don't need to do that if you are using the GUI. The height range replaces the bother of doing that. The division thing is if you use the console command to generate the mesh rather than the GUI. I think the old version of the GUI also needed it, but the version with the height range box doesn't
</edit>

Cheers,

T.
trollfiddler
Luminary
 
Posts: 66
Joined: Tue May 02, 2006 1:53 pm
Location: Mayo, Ireland

Postby DeathTwister » Sat May 27, 2006 3:12 pm

HiYa Trollfiddler,

Thanks so much for getting back to us. Ok let me do this in order, as I have had progress, so I will get it up in order.

Trollfiddler wrote:
Aha! I think I see the problem. It's your mesh that should be one pixel bigger, not the texture. Making the texture bigger and *not* making the mesh bigger would probably cause both imports to crash.


OK, I have added the pixel to both texture and terrain on export so was good there. Sorry I should have said that, And a very good point.

Trollfiddler wrote:
Your actual mesh should be 1025 in size (that includes the extra pixel) but you have to enter 1024 into the GUI, or into the chunk generation formula if you're not using the GUI.


yup did that /smiles.

Trollfiddler wrote:
Your square size should be the same as whatever you use as the "height field resolution" when creating your new map in L3DT. The default is 10 in L3DT but I usually change it to 1 for my maps. It doesn't really matter what it is as long as you use the same number for the square size in the TSE import GUI.


Humm, not sure I understand that one completely, but I'll grock here soon I am sure. you mean to the power of 2 right?
Mesh size at 1024?
square size at 2?

the way I have it now? I see you used a 1, but 2 is ok? errggg...

Trollfiddler wrote:
Error metric and treedepth should be fine the way you have them for your 1024 or 4096 size maps (which in reality will be 1025 and 4097). So leave treedepth as 6. You only need to worry about the "minus one" stuff if you're not using the GUI, and are trying to manually calc the leafsize.


Oh good, I was hoping I had that right.

Trollfiddler wrote:
Height range you can check in L3DT by opening
operations/heightmap/change_vert_scale. The "altitude range" is right there in the middle, and that's what I use for the height range in the GUI. Just cancel out when you've read it. There might be an easier way but that's the way I check it.


Got a nifty trick from Neo in the GG forum on his GUI, hes great BTW. So he showed me in L3DT it was so I found found where Aaron stashed the gui to calculate the bugger :roll: :idea:

Trollfiddler wrote:
For the texture, leave it the real size without adding any extra pixel. So if it's 1024 leave it as 1024, and also put 1024 into the GUI. Leave the treedepth the same as you use for the mesh, in your example above it is 6.


I have done that to both, humm, you mean make the terrain size show the extra pixel and not the texture size as actual? getting confused here maybe. in this case for now it is 4096 for texture size as I wanted better rez in game with the texture, so making it bigger then the terrain, right?

Trollfiddler wrote:
I don't understand why the recall is changing the leafsize on you, it shouldn't unless anything else gets changed. I haven't noticed that myself. It's a fixed formula so the answer should always be the same for a given texture size and treedepth. Maybe it's a bug in the GUI. Just use the first size that gets calculated.


Oh that was me changing the tree depth and texture size trying to make it work, my bad, then I would try and recalc. So that was me.

Trollfiddler wrote:
Your actual mesh should be 1025 in size (that includes the extra pixel) but you have to enter 1024 into the GUI, or into the chunk generation formula if you're not using the GUI.


Chuckles, yup if you put in the wrong math it don't like it.

Well actually some of all this has been the TSE milestone 3 we have. It all compiled great when we did it, but it wouldn't make a chunk and the texture crashed so fast to the desktop when hitting the process button that we figured it maybe was the build as we know the GUI works great.

So we put it in TSE milestone 2 and I have been able to generate a chunk file now WOOT, but now the texture button when I hit Process it don't do a thing:cry: and I am so close to. Here is a screen shot of the texture editor, and I will take a closer look at what you are saying. hehe I am so close now, once I get this figured out I will be one happy artist :lol: :lol: :lol: 8) 8) 8) .
Image

Here is also a screen of the chunk I did get to generate for me, but have no idea why the texture does not generate?
Image

So I am at kinda loggerhead now. Will reread this post and see what I am missing still. But for sure part of it was the version of TSE we have on version 3. the rest will work itself out I am sure. Thanks for the help and yes, I just about have it I think, or at least getting there. dang got to go to the store and buy some more Excedrin to get my headache down some from working with all of this, at least I got some sleep last night ROTFL.

DT :twisted:
User avatar
DeathTwister
Dearly missed
 
Posts: 562
Joined: Thu Dec 15, 2005 12:30 pm
Location: Klamath, CA.

Postby trollfiddler » Sat May 27, 2006 8:17 pm

Hi again,

The screen shot of your texture GUI looks fine, that should work perfectly. There must be something wrong with your build or the texture itself. The texture should *NOT UNDER ANY CIRCUMSTANCES* have an extra pixel added to it. It should be the exact size you want, say 4096.

Are there any errors at the bottom of your console.log file? It's in the same directory as your TSE exe file. You should have something like this near the bottom of the file

path: ~/data/terrains/
calb: nxATCDDoSetInputFile
spec: *.jpg
path: *
leafsize: 64
NX::AtlasCreateDlg: running texture import...
NX::AtlasCreateDlg: game1/data/terrains/working/ring of peaks/2048-v.jpg
Allocating ~384 kb of JPEG decompression working area...
Generating 32x32 leaf tiles...
Done!


There might be a few more lines after it just logging the fact that you have quit from TSE, stuff to do with Atlas.

As for the square size, you can imagine that as the size of the segments your terrain is made up from. So if you chose a square size of one, then your map will be a particular size, but if you choose a square size of ten then the map will be ten times bigger as far as the game engine is concerned. It doesn't have to be a power of 2, it can be any size. The only thing is to make sure that whatever you choose as the heightfield resolution for your map in L3DT is what you put into the GUI as the square size. It won't blow up the import if you have the square size wrong, but the terrain may look strange in TSE.

Enough already, I'm sure you get the drift. If you are still having problems after keeping your texture the correct size, let me know if there's any errors in your log file!

BTW, this all works fine for me in M3.

T.
trollfiddler
Luminary
 
Posts: 66
Joined: Tue May 02, 2006 1:53 pm
Location: Mayo, Ireland

Postby DeathTwister » Sun May 28, 2006 1:48 pm

Hay Trollfiddler,

Ok yours looks allot different then ours does. here is an exert from our console log. Doh, Shon said hit the tilde key and I was able to look at it, Doh, feel stupid sometimes, but I am learning.

Quote from our console log:
*** Load Main Menu
path: ~/data/terrains/
calb: nxATCDDoSetInputFile
spec: *.raw
path: *
path: ~/data/terrains/
calb: nxATCDDoSetInputFile
spec: *.jpg
path: *
leafsize: 128
NX::AtlasCreateDlg: running texture import...
NX::AtlasCreateDlg: common/ui/VG1f_TX.jpg
AtlasTQTFile::createTQT - Invalid treeDepth/tileSize (2 ^ (6 - 1) * 128 != 4097)
Done!

NX::AtlasCreateDlg: running texture import...
NX::AtlasCreateDlg: common/ui/VG1f_TX.jpg
AtlasTQTFile::createTQT - Invalid treeDepth/tileSize (2 ^ (6 - 1) * 128 != 4097)
Done!
NX::AtlasCreateDlg: running texture import...
NX::AtlasCreateDlg: common/ui/VG1f_TX.jpg
AtlasTQTFile::createTQT - Invalid treeDepth/tileSize (2 ^ (6 - 1) * 128 != 4097)
Done!
leafsize: 256
NX::AtlasCreateDlg: running texture import...
NX::AtlasCreateDlg: common/ui/VG1f_TX.jpg
AtlasTQTFile::createTQT - Invalid treeDepth/tileSize (2 ^ (5 - 1) * 256 != 4097)
Done!
leafsize: 128


Not sure what I am doing wrong, unless the mesh that I imported was actually 1025 not 1024, but I put in the fields 1024. Shesh this is getting real complicated here. I am sure it is simple once I get this figured out, but getting that headache ahain :oops: changed the texture back to 4096 and still get that error above.

Thanks for the help Trollfiddler, your the best. I feel I am so close, but no cigar yet. Hehe I hope ya see this soon, so I can get this puppy in, can redo terrain If I have to so no biggy.

DT :twisted:
User avatar
DeathTwister
Dearly missed
 
Posts: 562
Joined: Thu Dec 15, 2005 12:30 pm
Location: Klamath, CA.

Postby trollfiddler » Sun May 28, 2006 5:01 pm

Hi DT,

OK, the problem is that you are entering 4097 for the texture size. Your texture itself must be a power of two, so it should be 4096. You should also enter 4096 as the texture size in your GUI.

Forget all about the mesh, that has nothing to do with the texture, and anyway you already have that imported.

So :-

1)Make a texture 4096 x 4096 in size
2)In the GUI put 4096 as the texture size.

That will work. What you are trying to do at the
moment is import a texture that is not a power of two.
trollfiddler
Luminary
 
Posts: 66
Joined: Tue May 02, 2006 1:53 pm
Location: Mayo, Ireland

Postby Aaron » Mon May 29, 2006 3:30 am

Hello Trollfidder and DeathTwister,

Can I suggest we turn this thread into a tutorial in the wiki? It might make this information a bit easier to find for anyone that has this problem in the future. I've created a page for 'importing maps into TSE' and copied across the bits of the thread that I understand, but since I don't have TSE I don't know all that's involved. Any contributions would be greatly appreciated.

Best regards,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Postby trollfiddler » Mon May 29, 2006 9:35 am

Hi Aaron,

I tried to do this this morning, unfortunately the page seems to be read-only even when I am logged in. There is no edit button visible to me. Might just be a permissions thing on your server I guess, or it could be me being stupid.

Let me know if you fix it or if I'm missing something.

Thanks,

T.
trollfiddler
Luminary
 
Posts: 66
Joined: Tue May 02, 2006 1:53 pm
Location: Mayo, Ireland

Postby Aaron » Mon May 29, 2006 1:02 pm

Hi Trollfiddler,

Oops, sorry for that. It seems that phpBB changed their MySQL backend, and the dokuwiki bridge code hasn't been fully hacked to work with it yet. The upshot is that forum members are not automatically wiki members at the moment, so I've manually added you to the list of editors for that page.

I'll start hacking the php/MySQL to get it to work again for everyone.

EDIT: Fixed! Everyone should be able to login and edit the wiki now.

Aaron.
Last edited by Aaron on Mon May 29, 2006 1:41 pm, edited 1 time in total.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Postby DeathTwister » Mon May 29, 2006 1:07 pm

Hay TF,

OK I have made my texture 4096 (was 4097 at one time) and this keeps doing this to me and I get that the texture is 4097 in the TSE GUI, DOh, this is so frustrating for me atm. I'm buggered and am about ready to walk away and go for a long walk, haha :lol:.

The tutorial is a great idea and I suggested it on GG to Neo when we do get this worked out, would be sweet.

At this point I am thinking my comp is buggered somehow. My texture is 4096 and can't figure out why it says it is 4097??? Have checked it like 5 times now in and out of photoshop and that error keeps coming up. It seems to have a mind of it's own. I even tried restarting comp inc as it got caught up in the ram cache somehow :cry: I could swear I have it now, but I don't, I hate comps sometimes ROTFL:roll: haha.

Humm, maybe I go out to my other 64 bit comp and try this on that mashine there, maybe this computer one is goobered somehow, since it is my internet comp???? worth a try I gues to make sure it ain't the computer I am working on at least.
Something ain't right in Denmark for sure. If anyone from Denmark, sorry about the crack, it is just an expression here in the states and have no idea how that one got started tehe. Probobly goes back a few hundred years and would be good reading to know how that one did get started.

DT :twisted:
User avatar
DeathTwister
Dearly missed
 
Posts: 562
Joined: Thu Dec 15, 2005 12:30 pm
Location: Klamath, CA.

Postby DeathTwister » Mon May 29, 2006 1:52 pm

Hay Aaron,

Oops, sorry for that. It seems that phpBB changed their MySQL backend, and the dokuwiki bridge code hasn't been fully hacked to work with it yet. The upshot is that forum members are not automatically wiki members at the moment, so I've manually added you to the list of editors for that page.

I'll start hacking the php/MySQL to get it to work again for everyone.

EDIT: Fixed! Everyone should be able to login and edit the wiki now.


WOW that was quick, you the man Aaron.

DT
User avatar
DeathTwister
Dearly missed
 
Posts: 562
Joined: Thu Dec 15, 2005 12:30 pm
Location: Klamath, CA.

Postby Aaron » Mon May 29, 2006 1:58 pm

DeathTwister wrote:Something ain't right in Denmark for sure. If anyone from Denmark, sorry about the crack, it is just an expression here in the states and have no idea how that one got started tehe. Probobly goes back a few hundred years and would be good reading to know how that one did get started.


Hamlet, Shakespeare:

"Something is rotten in the state of Denmark."

Written around 1600.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Postby DeathTwister » Mon May 29, 2006 2:54 pm

Hay Aaron,

Aaron Wrote:
Hamlet, Shakespeare:

"Something is rotten in the state of Denmark."

Written around 1600.


Ahhh very KEWL, and yaya I should have known that, did just forgot it..I am a Thespian at heart and been around plays all my life.


BACK TO SUBJECT:
OK WEEEEEEEE------ YAYAYAYAYAYAYAYAYya WOOO HOO I got it........

OK I had figured out it had to be me somehow as I had to be missing something. I was right, somehow I had (misplaced/copied to a wrong dir) to the wrong place, and while I changed the one I thought was the one I saw in the drop down menu, it wasn't it was in another dir at the root, one up from where I thought it was somehow. I am sure it was my bad ROTFL. So after I changed that 4097 to 4096 all went well. From here on in it will be tweaking all the way I am sure.

DT :twisted:
User avatar
DeathTwister
Dearly missed
 
Posts: 562
Joined: Thu Dec 15, 2005 12:30 pm
Location: Klamath, CA.

Next

Return to Help and support

Who is online

Users browsing this forum: No registered users and 13 guests

cron