L3DT users' community
Large 3D terrain generator

Tiles: Overlap and Size

It doesn't hurt to ask...

Tiles: Overlap and Size

Postby nicethugbert » Sat Oct 03, 2009 6:35 pm

Can we have overlap functionality and variable sizes for tiles, uniform for the set?

This would help me in the process of making NWN2 areas in the following way. The NWN2 Toolset has a height and texture map importer, YATT, developed by a member of it's community. One of it's wonderful functions is that it can take an oversized map and make multiple adjoining seamless areas out of it. The problem is that it cannot handle anything more than a 2x2 grid of it's largest areas in this process. The toolset inevitably crashes while doing this. This is a problem for even small volcanic islands as the largest NWN2 areas represent 0.480km^2. Surtsy is 1.4km^2 and barren, as small islands like that tend to be. A 3x3 grid of giant NWN2 areas just barley contains a Surtsey.

But, the functionality I request would allow the splitting of the maps by L3DT which is not prone to crashing. Then the individual maps would be processed by YATT just fine.
nicethugbert
Doyen
 
Posts: 132
Joined: Sat Feb 02, 2008 12:58 pm

Postby Aaron » Sun Oct 04, 2009 2:08 am

Ni Nicethugbert,

This sounds like a job for a script. Which map layers do you want exported, in which file formats, and with what naming convention? What size are tiles? (in terms of pixels)

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

Postby nicethugbert » Sun Oct 04, 2009 8:57 pm

NEAT!

Tiles are 6 pixels wide for height maps, and an extra pixel is added to the total pixel count(for good luck I guess). For texture maps, it's 32 pixels per tile.

NWN2 areas sizes are expressed in multiples of 4 tiles. Every area has an 8 tile border all the way around. So, that's 8 tiles on each side. So, a 32x32 tile area is really 48x48 tiles. A 32x4 tile area is really 48x20 tiles. People routinly discount the borders when reffering to area sizes.

Here is a table with a break down.

To make a 32x32 area tile I use a 768x768 Heightfield size with 0.625 Horizontal scaling and HF/DM ratio of 64. This gives me a 12x12 DM which lines up perfectly with the NWN2 megatiles for a 32x32 area, 1x1 NWN2 megatile = 4x4 NWN2 tiles. This lets me see the border area on all my maps(using image drap on the non-DM maps). Knowing where the borders are, I can put some elevation in them(typically mountains) so the player does not get cornered unexpectedly when running away from a pack of Trolls, for instance. Plus, the dimensions in meters match. I can play with the horizontal scaling for effect. For instance, to get snowy peaks, or for use with the Overland Map feature.

I then adjust the height and texture map sizes on export. It works, somehow.

If need be, an input box to convert L3DT Heightfield Width and Height to YATT Width and Height would be no problem for me. I'm not sure how to factor in the odd size for YATT.

If I use 289x289 Heightfield size, or 288x288,(with whatever horizontal scaling I need) then I have problems getting the DM map to divide usefully.

The height map needs to be bmp, 24 bit greyscale = TRUE. .\YATT_FILES\<section_number>_height.bmp should be a good file name. I'm sure I can find the filename line in the script and edit that. It's the rest of it that's beyond me.

The alphamaps can be png, but, I have only tried them with 8-bit bmp. .\YATT_FILES\<section_number>_<texture_name>.bmp should work.

Thx a ton. :)
nicethugbert
Doyen
 
Posts: 132
Joined: Sat Feb 02, 2008 12:58 pm

Postby nicethugbert » Sun Oct 04, 2009 10:47 pm

Since there is no one set relation between L3DT map sizes and those demanded by YATT, I am willing to define it for the script in an input box.
nicethugbert
Doyen
 
Posts: 132
Joined: Sat Feb 02, 2008 12:58 pm

Postby nicethugbert » Sun Oct 04, 2009 11:22 pm

Since there are 6 pixels per NWN2 tile and 4 NWN2 tiles per NWN2 megatile, there are 24 pixels per NWN2 megatile. I think it's better to work in megatiles because NWN2 maps are actually sized in megatiles, even though NWN2 area modders typically speak in tiles and discount the border.

So, for Yatt Height maps 24 pixels represents 1 megatile. 12 megatiles = 48 tiles, 32 are walkable and 16 are border tiles, i.e., non- walkable. 12x24=288, that is one short of the proper size for YATT height map for a 32x32 NWN2 area. I think, all calculations are made on the basis of 24 pixels, then the extra bit is added last.

For YATT texture maps it's 128 pixels per megatile.

I'm not sure I'm explaining this well enough.
nicethugbert
Doyen
 
Posts: 132
Joined: Sat Feb 02, 2008 12:58 pm

Postby nicethugbert » Sun Oct 04, 2009 11:37 pm

Hmm, YATT map sizes are base 6 and 32DT HF/DM is base 8 ....
Last edited by nicethugbert on Mon Oct 05, 2009 12:21 am, edited 1 time in total.
nicethugbert
Doyen
 
Posts: 132
Joined: Sat Feb 02, 2008 12:58 pm

Postby nicethugbert » Sun Oct 04, 2009 11:50 pm

I'm not sure I said this. Although I tried to. The maps overlap. The border for this map is walkable for the next map and the border for the next map is walkable for this map. So, it's a 4 megatile overlap between maps. 2 megatile border all around the set of maps just like a single map. The overlap is complicating this for me.
nicethugbert
Doyen
 
Posts: 132
Joined: Sat Feb 02, 2008 12:58 pm

Postby Aaron » Wed Oct 07, 2009 11:00 am

Hi Nicethugbert,

My my, that is a messy terrain system. I'm not sure I can follow all the tile system stuff at this time of night, so I'll have to come back to that later.

I think the issue of design map size / DM/HF ratios need not be considered further in this discussion. The script can always crop / resize the maps to suit.

The issue of overlap can also be ignored for the moment, since that can easily be added later.

So, cutting to the chase, you want the heightifled and alpha maps cut into tiles. How many pixels do you want in each tile?

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

Postby nicethugbert » Thu Oct 08, 2009 1:08 am

Yes, I'm not satisfied with my explanation either, or my understanding of the problem.

Since the YATT tile sizes are fixed. The problem is to chop L3DT maps down to YATT files.

Since NWN2 map size increments are really done on the order of NWN2 megatiles. I think that is the increment that matters. 24 pixels on a YATT Height map represents one NWN2 megatile. For YATT texture maps it's 128 pixels per NWN2 megatile.

So, what's required is to find how many NWN2 megatiles an L3DT map is intended to represent. So, the script will first figure out how many NWN2 megatiles an L3DT map is intended to represent. Then it will chop the map up accordingly. Right now it seems easier, to me, to just input the information for step one. At least, I can experiment with it and save you from having to listen to me ramble. Hehhehheh.
nicethugbert
Doyen
 
Posts: 132
Joined: Sat Feb 02, 2008 12:58 pm

Postby Aaron » Thu Oct 08, 2009 10:51 am

Hi Nicethugbert,

The problem is to chop L3DT maps down to YATT files.


I assure you that is absolutely trivial once I know what tile sizes to use, what offsets to use, and exactly which maps to use.

24 pixels on a YATT Height map represents one NWN2 megatile.


Okay, so I export the heightmap as a set of overlapping 24x24 pixel greyscale bitmap tiles in 24-bit precision. Good-O.

For YATT texture maps it's 128 pixels per NWN2 megatile.


Okay, textures as bitmaps too, 128x128 pixels, and I'll sort out the alignment and resolution issues later.

What about alpha maps? Same as heightfield?

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

Postby nicethugbert » Thu Oct 08, 2009 4:52 pm

Correct, except, I'm not getting my terminology straight. What YATT calls a Texture map, L3DT calls an Alpha map. The tiles I was referring to are NWN2 tiles which are not L3DT tiles. There are no mosiacs in NWN2 areas. We want to chop L3DT Height and Alpha maps into L3DT mosiacs(or smaller maps if I'm not using the term mosiac correctly) sized so that YATT converts them into the expected NWN2 areas.

What's needed to get the process started is a way to input the correct L3DT to YATT ratios. The denominators are always fixed, 24 for the Height map and 128 for the Alpha maps, HF/24 and Alpha/128.

Or, it is even easier yet, to just code HF/24 and Alpha/128 and be done with it. The user can just deal with the standard controls. It could be very useful to input the HF and Alpha numbers because one can have good reason to use smaller maps. They are faster and too much steep ground detail makes movement a nightmare in NWN2. But, it's not necessary to have user input in order to work on the overlaps.

Is there access to image drapes in zeoscript? If there is, then, an image drape can be used to display the expected divisions. If it works out, then I expect that it will display NWN2 area boundaries in L3DT and it will provide an interactive method which is the only method most people have any patience for.

But, as a first attempt, HF/24 and Alpha/128 are workable, at the very least.

The one thing to keep in mind, for the export, is that when it is time to do the actual export, 1 has to be added to the pixel count of the exporting height map segment/mosiac/tile/thingy. This extra bit does not play a part in calculating the divisions. It's just a resize on export to size + 1.
nicethugbert
Doyen
 
Posts: 132
Joined: Sat Feb 02, 2008 12:58 pm

Postby nicethugbert » Fri Oct 09, 2009 1:59 pm

I was playing around with some numbers and I think I'll need to input a scaling factor for HF/24 and Alpha/128. Using a scaling factor, I can set up L3DT to produce the results I need then I can scale it for proper export.

To make an L3DT map to convert into a max sized NWN2 area I use 768x768 Height map, 0.625 Horizontal scaling, and HF/DM of 64. This makes my DM correspond to my NWN2 map on a 1 DM pixel to 1 NWN2 megatile ratio. I then use the DM map as an image drape. This allows me to see my area in L3DT to some extent. I can then see what parts of my area will be impassable or not. It lets me know where to put mountains, etc., and which maps will be unplayable, all from L3DT, without having to wait to import the map into NWN2.

So, I think what I'm asking the script to do is:
1) Input scaling factor.
2) Divide the maps into submaps
3) Export the submaps.
nicethugbert
Doyen
 
Posts: 132
Joined: Sat Feb 02, 2008 12:58 pm


Return to Feature requests

Who is online

Users browsing this forum: No registered users and 3 guests