Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Page 1 of 3 1 2 3
#518432 13/07/14 06:27 PM
Joined: Jul 2014
stranger
OP Offline
stranger
Joined: Jul 2014
Hi.

I wrote a small script to import heightmaps into the editor.
The first test is quite satisfying:
link

The code is a mess but I'll try to clean it up a bit and release it later. Is anyone interested?

Joined: Jul 2014
stranger
Offline
stranger
Joined: Jul 2014
I am very interested! I don't know much about coding but I will give you any feedback I can if I can try it out.

Joined: Jul 2014
T
stranger
Offline
stranger
T
Joined: Jul 2014
Code code code! Very interested here, don't worry if it's a mess - I want to see what people have gleaned about the formats so far...

Joined: Jun 2014
S
apprentice
Offline
apprentice
S
Joined: Jun 2014
I've seen other people call for such a script!
There is definitely potential in this and for those who want to port over terrains from other engines or games or make terrains in different tools, it will be a great aid!
Hopefully Larian will add this natively later on.

tubs #518634 14/07/14 12:06 AM
Joined: Jul 2014
stranger
OP Offline
stranger
Joined: Jul 2014
Here's the link:
https://www.dropbox.com/s/0vmp755fc6g9ped/DOS%20Heightmap%20Tool.zip

If you're a coder, consider this as public domain so feel free to modify it and redistribute at will.

Originally Posted by tubs
I want to see what people have gleaned about the formats so far...

I'm sorry but you're going to be disappointed. My tool just overwrites the part of an existing "terrain.data" that contains the heightmap (this is just the first chunk, actually). The rest of the file that contains texture layers is kept unchanged and is not parsed.

On the other hand, you can find useful information about the PAK and LSB/LSX formats on the wiki:
http://divinity.gamepedia.com/PAK_format
http://divinity.gamepedia.com/LSB_format

Joined: Jul 2014
T
stranger
Offline
stranger
T
Joined: Jul 2014
Originally Posted by Chriskang
I'm sorry but you're going to be disappointed.


Don't worry, I spend my entire life disappointed. wink Cheers for the code!

Joined: Jul 2014
Location: United Kingdom
apprentice
Offline
apprentice
Joined: Jul 2014
Location: United Kingdom
Thanks a lot for the code. This is actually great.

Joined: Jul 2014
stranger
Offline
stranger
Joined: Jul 2014
Thanks for making this tool. I have been trying a few imports but am having a few issues.

After trying your script I was able to get it to work, but the imported terrain seems to have some issue with breaks in the terrain. It is as if the heightmap was only applied to every other 'line' of terrain. I am not sure what is causing this. I tried altering the terrain size to be half as large, but your script doesn't allow for the terrain and heightmap to be incorrectly proportioned (which I think is a good thing assuming it works correctly).

Here is a link to what the profile of the terrain looks like: http://imgur.com/OuQ8gvg

Edit: I think it is worth noting that this happened with the following three heightmaps I tried: http://imgur.com/a/ICmU6#0

Last edited by ITheWestSideI; 15/07/14 03:33 AM.
Joined: Apr 2013
N
addict
Offline
addict
N
Joined: Apr 2013
Originally Posted by Chriskang
On the other hand, you can find useful information about the PAK and LSB/LSX formats on the wiki:
http://divinity.gamepedia.com/PAK_format
http://divinity.gamepedia.com/LSB_format


Updated the pages a bit to fix unknown items in the formats smile

Norbyte #519732 15/07/14 12:05 PM
Joined: Jul 2014
stranger
OP Offline
stranger
Joined: Jul 2014
Originally Posted by ITheWestSideI
It is as if the heightmap was only applied to every other 'line' of terrain. I am not sure what is causing this.

You're right. There was an issue with the ordering of numbers in the chunk.
If you have Visual Studio, all you have to do is swap lines #74 and #76. If you use the compiled version, I'll upload a new zip after work.
My bad, I only tested the tool with square heightmaps (1001x1001, 501x501) and it works fine for those.

Originally Posted by Norbyte
Updated the pages a bit to fix unknown items in the formats smile

Thank you, Norbyte. You're the author of lstools, right? I created the wiki article on LSB format and wrote my own parser without knowing about your tool. I'll probably release my source code in the public domain after a bit of cleanup. I hope you don't mind.

Joined: Apr 2013
N
addict
Offline
addict
N
Joined: Apr 2013
Originally Posted by Chriskang

Thank you, Norbyte. You're the author of lstools, right?

Yeah.

Originally Posted by Chriskang
I created the wiki article on LSB format and wrote my own parser without knowing about your tool. I'll probably release my source code in the public domain after a bit of cleanup. I hope you don't mind.


No problem, it's a public wiki after all smile

Joined: Dec 2013
old hand
Offline
old hand
Joined: Dec 2013
Thanks so much. Britannia happened today. smile

[img]http://i.imgur.com/q7torwU.jpg?1[/img]


DOS2 Mods: Happily Emmie After and The Noisy Crypt

Steam Workshop
Nexus Mods
Joined: Jul 2014
stranger
OP Offline
stranger
Joined: Jul 2014
Originally Posted by Chriskang
If you use the compiled version, I'll upload a new zip after work.


File updated. Same link as before:
https://www.dropbox.com/s/0vmp755fc6g9ped/DOS%20Heightmap%20Tool.zip

Joined: Jul 2014
stranger
Offline
stranger
Joined: Jul 2014
Working great! Good job. http://imgur.com/a/u9b0c#0

Joined: Jul 2014
K
stranger
Offline
stranger
K
Joined: Jul 2014
I'm unable to get this tool to work. I have the latest version, and after following all the steps, when I open my level again the terrain is unmodified.

I have used 500x500, 1000x800 (as the example in the tool states) and 800x800 terrains.

I resize my heightmap correctly (251x251 for the 500x500 terrain, etc). I tried PNG, BMP, JPEG. I tried modifying the 'Height of black/white pixels' in the tool.

Nothing so far has resulted in anything showing up in the editor once I reopen it.

Do I need to do anything to the terrain besides creating a new level, creating a terrain with a base material and saving?

Joined: Jul 2014
Location: Poland
X
stranger
Offline
stranger
X
Joined: Jul 2014
Location: Poland
Have same problem and no idea why it's like that... but I feel in the air the solution have to be so simple I will embarrassed to hear it laugh

Joined: Jul 2014
K
stranger
Offline
stranger
K
Joined: Jul 2014
Was there a patch recently that maybe broke it?

Chriskang, are you still able to import using your tool?

Could anyone here supply one of the heightmaps they successfully used? Maybe it's a tiny detail about certain formats or something.

Joined: Jul 2014
C
member
Offline
member
C
Joined: Jul 2014
Great effort you beat me to it. I was looking to create the very same tool. I did kinda the same for NWN2. I might be able to import an L3DT file and make a height map out of it. Just need to find some time to get my visual studio working again since the license has expired. If we can figure out the texture layers, I can go a step further and use the climates files of L3DT to texture the terrain as well.

Last edited by Celludriel; 22/07/14 01:24 PM.
Kilrogg #525374 22/07/14 05:07 PM
Joined: Jul 2014
stranger
OP Offline
stranger
Joined: Jul 2014
Originally Posted by Kilrogg
Nothing so far has resulted in anything showing up in the editor once I reopen it.

Do I need to do anything to the terrain besides creating a new level, creating a terrain with a base material and saving?


The editor copies the "terrain.data" file in several different locations. The "original" version that is open by the editor and copied everywhere else is here:
\Divinity - Original Sin\Data\Editor\Mods\ModName\Levels\LevelName\Terrains
You should NOT edit the copy that is here:
\Divinity - Original Sin\Data\Mods\ModName\Levels\LevelName\Terrains

Joined: Jul 2014
C
member
Offline
member
C
Joined: Jul 2014
Chris,

it seems you figured out most of the terrain.data format. Did you document it somewhere ? I'm currently trying to write an import of a HF2 file from L3DT. The difference with a bitmap is that in the HF2 file I have all x,y coordinates with float data of their height in meters.

My biggest challenge is to convert those real life meters into a scale for DOS. I also am trying to find out why your bitmap needed to be width and height +1, I presume it has something to do with the data format of the .data file. So that's why I would love to see some documentation somewhere on it smile

Last edited by Celludriel; 25/07/14 05:43 PM.
Page 1 of 3 1 2 3

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5