Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Page 1 of 3 1 2 3
Joined: Jul 2014
C
member
OP Offline
member
C
Joined: Jul 2014
Introduction
========
A tool written in C# to import grayscale heightmaps in DO:S and DO:S 2. There is also functionality for L3DT in the DO:S version but support for that has ended and there is no way to know if it still works like it did four years ago.

Current version
==========
V2.1.1

Download
=======
https://github.com/Celludriel/DOS_Terrain_Importer/files/1337059/DosTerrainImporter_v2.zip

Installation
========
Just unzip the zip file in a convenient folder and open up Dos_Terrain_Importer.exe. This program is safe and can be checked by the community on my open source github. The .net framework is needed to make the program run, although this is installed on a lot of computers by default now. Should it not work try downloading the latest version of the .net framework runtime

Usage
=====

Step 1: create a heightmap
-------------------------------
- Create a bmp file with dimensions (patchsize*33) x (patchsize*33).
- Draw your heightmap with greyscale tints where 0 is the lowest point and 255 is the highest point. I have experimented with different bit depts but saving as a 16 bit image seems to be the safest safe.

Step 2: create a terrain in divinity engine 2
--------------------------------------------------
- Create a new terrain in the level you are working on and make sure the patch size is the size you used in the formula determining the width and height of your heightmap
- Save your terrain in the engine
- Go to your divinity original sin 2 install directory and navigate to your project where your terrain is saved. fe:
\Data\Editor\Mods\Godlings_7ffdb20a-bb9e-4ca6-a3d3-46a3d0c650d3\Levels\ImportTest100x100\Terrains
- Notice the presence of a .data file with a uuid in front

Step 3: doing the import
-----------------------------
- Open up the importer
- press the DO:S 2 button
- Browse for the .data file you just created
- Browse for the bitmap heightmap file you created
- Enter the min height, this is the height the black 0 value will be at
- Enter the max height, this is the height the white 255 value will be at
- Press generate. Generating the terrain is a destructive operation for all the heightmap data, once you press it all previous terrain changes will be overwritten by the new heightmap data.

Step 4: Reload the level
----------------------------
- Go back to divinity engine 2 and choose reload level in the file menu. You should now see the imported heightmap terrain.

Last edited by Celludriel; 27/09/17 12:34 PM.
Joined: Jun 2013
addict
Offline
addict
Joined: Jun 2013
Sounds great, thanks a lot hehe


Un chemin de 1000 lieues commence par un premier pas.

Project:
Steam workshop Frontiere
Joined: Dec 2013
old hand
Offline
old hand
Joined: Dec 2013
Thank you! I'm grabbing it now and will post any results from it. I would highly recommend adding this to the Community Page Submission section of the wiki if you have the time!


DOS2 Mods: Happily Emmie After and The Noisy Crypt

Steam Workshop
Nexus Mods
Joined: Dec 2013
old hand
Offline
old hand
Joined: Dec 2013
Also, might be good to add a README file in your zipped archive that has the notes you posted here on how to use. smile


DOS2 Mods: Happily Emmie After and The Noisy Crypt

Steam Workshop
Nexus Mods
Joined: Jul 2014
C
member
OP Offline
member
C
Joined: Jul 2014
Originally Posted by Windemere
Thank you! I'm grabbing it now and will post any results from it. I would highly recommend adding this to the Community Page Submission section of the wiki if you have the time!


experiment with it first, maybe you'll find some bugs that I need to fix. I'm still puzzled why I can't make perfect vertical walls though. There must be some explanation for it maybe because it all works with triangles I don't know yet.

Originally Posted by Windemere
Also, might be good to add a README file in your zipped archive that has the notes you posted here on
how to use. smile


Will do in a bit when I'm a bit less busy smile

Last edited by Celludriel; 26/09/17 01:01 PM.
Joined: Jun 2017
apprentice
Offline
apprentice
Joined: Jun 2017
Good job Celludriel!

Originally Posted by Celludriel

Step 2: create a terrain in divinity engine 2
--------------------------------------------------
- Create a new terrain in the level you are working on and make sure the patch size is the size you used in the formula determining the width and height of your heightmap
- Save your terrain in the engine
- Go to your divinity original sin 2 install directory and navigate to your project where your terrain is saved. fe:
\Data\Editor\Mods\Godlings_7ffdb20a-bb9e-4ca6-a3d3-46a3d0c650d3\Levels\ImportTest100x100\Terrains
- Notice the presence of a .patch file with a uuid in front



I have a lot of patch files created in my terrain folder. In this case I tried selecting the first one but it doesn't work.

Tested with a 8x8 terrain.

Last edited by Rada Torment; 26/09/17 01:49 PM.
Joined: Jul 2014
C
member
OP Offline
member
C
Joined: Jul 2014
Originally Posted by Rada Torment
Good job Celludriel!

I have a lot of patch files created in my terrain folder. In this case I tried selecting the first one but it doesn't work.

Tested with a 8x8 terrain.


Can you get me the terrain patch and data file together with your heightmap ? I'll try to reproduce why it wouldn't work for you.

Also make sure you are in the \Data\Editor\Mods directory. I made the mistake not being in the Editor folder the first time and it didn't seem to work either then.

Also each terrain gets an unique UUID, that long weird text thing. You should be able to find that in the divinity editor as well if you click on the properties of your terrain. Make sure you pick that file.

Last edited by Celludriel; 26/09/17 03:15 PM.
Joined: Jun 2017
apprentice
Offline
apprentice
Joined: Jun 2017
Yes, the path is correct but I have lots of patch files (64 files for a 8x8 terrain).

The editor crashed when I click "reload level", so the files were modified but something is broken. Maybe 8x8 is too big? or my bmp has something wrong.

I sent you a pm with files.

Last edited by Rada Torment; 26/09/17 04:22 PM.
Joined: Jul 2014
C
member
OP Offline
member
C
Joined: Jul 2014
oh I see, you are right if you go bigger there are multiple patch files ... damn it all. This makes it way more complex then anticipated.

Once again Larian violated the KISS principle. I have to rethink everything now ... I'm guessing each 1x1 is a patch file. Not sure yet I have to think about this.

Joined: Jun 2017
apprentice
Offline
apprentice
Joined: Jun 2017
Yes, it seems like the terrain composed of these patchs (like plots) and generate one patch file for each of these segments.

Well, we are here to help and test things smile just patience now.

Joined: Jul 2014
C
member
OP Offline
member
C
Joined: Jul 2014
I just did a test, by using my same heightmap for a 1x1 patch for all the patch files

[Linked Image]

So it is as I feared and you said so as well they cut up the terrain for each patch. This complicates things quite a bit. That means I need to cut up the heightmap on parsing and then pick which patch files to update and hope I pick the right order as well.

I also have to determine how many patch files there are based on the size of the bitmap. This is a major rewrite from the code from something simple to something more elaborate frown

Joined: Jun 2013
addict
Offline
addict
Joined: Jun 2013
Keep faith, and thanks for your hard work already.


Un chemin de 1000 lieues commence par un premier pas.

Project:
Steam workshop Frontiere
Joined: Sep 2017
M
member
Offline
member
M
Joined: Sep 2017
Hi, i just dont get why would i use it at all? Sorry for that lame question but i dont get it :-)

Joined: Jul 2014
C
member
OP Offline
member
C
Joined: Jul 2014
A lot has to do with cutting your workload in half. By drafting an idea you have for a terrain first on a simple 2D greyscale image, using some other tools you can get some very good results. One of the things DO:S E suffers vs NWN is that it takes way to long to create new content due to some of the clunkyness of the UI. That's how I feel at least.

They offer a GM mode in DO:S 2 which is a great great feature. But if a GM needs three months to prepare a 4 hour DM session it's also a failure. I'm trying to find out tools that will cut a GM's workload drastically so this time the DO:S 2 content generating doesn't stop to a grinding halt after just a few weeks ... like last time ... So I have a clear goal in mind with all I'm doing here

For more information about heightmap manipulation.

https://en.wikipedia.org/wiki/Heightmap

Joined: Sep 2017
M
member
Offline
member
M
Joined: Sep 2017
Great spirit and motivation you show :) thx for headsup

Joined: Jul 2014
C
member
OP Offline
member
C
Joined: Jul 2014
I think I fixed it. I made an attempt with a 2x2 patch which translated to a 66px x 66px bitmap.

Heightmap:
[img:center]http://users.telenet.be/sunspot/dos/patch66x66.bmp[/img]

Result:
[Linked Image]


more testing is probably needed and I have to make a new release, but this is looking well.

UPDATE
=====
OP updated with the new release and usage updated as well. Take note you now have to use the DATA file no longer the patch file.

Currenlty only use square terrains, there is still a problem with 2x1 or 1x2. It has something to do with how X and Y are mirrored and reversed in the patch file vs the bitmap file and it's giving me a headache.

Last edited by Celludriel; 27/09/17 09:21 AM.
Joined: Jul 2014
enthusiast
Offline
enthusiast
Joined: Jul 2014
Wow, that is amazing: In 3 seconds i made a volcano. (4x4 patch) Nothing nice so far but really fast and much better base than fiddling 1 hour with terrain shaping tools:
[Linked Image]

Is there a good height map data bank? Where you find stuff like Minas Tirith or whatsoever..?

EDIT:

This island setup was also super fast and smooth. Seems like BMP really has to be 16bit (mustnt 24bit)
[Linked Image]

Last edited by morez; 27/09/17 11:38 AM.
Joined: Jul 2014
C
member
OP Offline
member
C
Joined: Jul 2014
Nice work, seems it is working as expected so far. I also fixed that you can't use none square setups. I just need to make a release and make a build for it.

First I need food and a movie though. Have been working on this since I woke up this morning. I'll make sure to release it later today. For now you can experiment with the current version smile

Glad it is paying of for you !

Joined: Sep 2017
W
stranger
Offline
stranger
W
Joined: Sep 2017
Awesome tool, thank you for that :)

Will this override existing terrain paints and layers? I'd like to improve the heightmap and apply the changes to the terrain agian. If this works, exporting an existing terrain to bitmap to change and reimport it would be awesome, too.

Joined: Jul 2014
C
member
OP Offline
member
C
Joined: Jul 2014
Originally Posted by Wambo
Awesome tool, thank you for that smile

Will this override existing terrain paints and layers? I'd like to improve the heightmap and apply the changes to the terrain agian. If this works, exporting an existing terrain to bitmap to change and reimport it would be awesome, too.


It only overwrites the heightmap data in the patch files, I suggest you make a backup of your work, and then try it. I think it should work

Page 1 of 3 1 2 3

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