Forest map format and/or partial generation

Moderators: Uros, OXO, JBr

Post Reply
solidxsnake
Posts: 12
Joined: Sat Apr 18, 2020 10:38 pm

Forest map format and/or partial generation

Post by solidxsnake » Wed Apr 29, 2020 4:14 pm

Can anyone supply information about the actual format of the forest map files? I'd like to be able to modify sections of the forest maps in a single patch without having to regenerate the entire landscape. I'm working on a quite large area (Northeast USA, covering MA, NH, VT and some of CT, 14x16 tiles) so it's unnecessary to generate everything when I'm only making a miniscule change in one patch.

So far I've been successful with this sort of approach for everything besides the forest maps (I'm using custom Python scripts to run GDAL and GIMP to do all my processing of terrain and imagery assets). I hope someone else here has come across a solution to this before I spend any time trying to reverse engineer the format :lol:

Thanks in advance!

User avatar
dgtfer
Posts: 521
Joined: Mon Nov 19, 2007 9:49 am
Location: Marseille - france

Re: Forest map format and/or partial generation

Post by dgtfer » Thu Apr 30, 2020 12:02 am

Each patch is 512x512 pixels, matching textures patches.
trees are coded with an origin located on the right bottom corner, in 8 bits. a value of 0 means no tree, a value of 1 means a spruce-like tree, a value of 2 or more means a broad-leafed tree.
Image

solidxsnake
Posts: 12
Joined: Sat Apr 18, 2020 10:38 pm

Re: Forest map format and/or partial generation

Post by solidxsnake » Tue May 05, 2020 3:05 pm

Thanks! This was great help.

For manual editing, I use GIMP. I first load in the texture .dds patch of the area I want to modify, and resize it to 512x512 if necessary. Then I separately load the .for file using the Raw Image Data import in GIMP. I import it as an indexed image, then modify the colors in the colormap index 1 and 2 to be some usable colors (gray and white typically). At this point, the map should be visible and it will need to be rotated counter-clockwise by 90°, then flipped across the vertical axis. At this point, it should match the texture patch. I copy it over as another layer to the texture patch, modify it by hand as necessary, then copy the final map back to the original raw data import, reverse the transformations (flip along vertical, then rotate 90° clockwise), and re-export it as raw data. Often times GIMP will add in an alpha channel which needs to be removed before exporting. An easy check is to make sure the exported filesize is 256KB.

Post Reply