Importing/exporting heightmap

Not about OpenMW? Just about Morrowind in general? Have some random babble? Kindly direct it here.
onionland
Posts: 61
Joined: 29 Jul 2014, 00:43

Importing/exporting heightmap

Post by onionland » 06 Sep 2014, 05:55

1. Is there any other way to export the heightmap than using Annwyn?

2. Is there any way to get heightmaps working in opencs? Preferably as loose files.

User avatar
psi29a
Posts: 4604
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: Importing/exporting heightmap

Post by psi29a » 06 Sep 2014, 07:08

Currently not, but it is coming... right Zini? :P

User avatar
Zini
Posts: 5536
Joined: 06 Aug 2011, 15:16

Re: Importing/exporting heightmap

Post by Zini » 06 Sep 2014, 09:13

Eventually.

onionland
Posts: 61
Joined: 29 Jul 2014, 00:43

Re: Importing/exporting heightmap

Post by onionland » 07 Sep 2014, 01:16

I'm glad to hear that it's being worked on, I look forward to being able to make more use of opencs.

silentthief
Posts: 368
Joined: 18 Apr 2013, 01:20
Location: Currently traversing the Ascadian Isles

Re: Importing/exporting heightmap

Post by silentthief » 07 Sep 2014, 04:34

This would be awesome. To have ability to import/export heightmaps would eliminate any reliance on the 3rd party program, tesannwyn.

I have a couple of follow up questions, about a couple of other programs that would be awesome to have thier functionality as well. Any chance we could add similar functionality that these 3rd party programs have:

* tesfaith
this program allows mod makers to cut, copy, and paste ALL references from one cell to another. This means you can move land and all objects, load doors, entrances and exits from anywhere to anywhere else. You could transplant Seyda Neen in the middle of Mournhold, if you so choose; or delete the cells that hold Balmora. You could relocate Solstheim to the opposite corner of Vardenfell. details:
http://projectmanager.f2s.com/morrowind/TESfaith.html
http://timeslip.users.sourceforge.net/morrow.html

* Yacoby's mesh generator
Kind of a mis-nomer, as it doesn't "generate" new meshes, but instead this program helps to automate object placement across your landscape, by setting placement percentages for objects to be placed on certain textures. more details here:
http://forums.bethsoft.com/topic/147762 ... ator-help/
https://github.com/Yacoby/mw-mesh-gen

* GenMods/Random Dungeon Generator
These programs make random dungeons based upon a set of rules/options. Im bringing up these programs (and the one above, the mesh genereator), not necessarily to fully automate the creation of the world, but to cut down on the amount of work it takes to make a new world, complete with new lands and new dungeons. details:
http://tesalliance.org/forums/index.php ... 15-genmod/
http://tesalliance.org/forums/index.php ... generator/

---

I understand that this is a LOT of request detail. I hope we have functionality for these kinds of things to help people make new worlds. I do not think that generating just random is the way to go, but it sure could help in cutting down the sheer size of the work that it takes.

ST
"Hurry, hurry! Last boat to Solstheim! Until the next one. Hah-ha-hah."

User avatar
psi29a
Posts: 4604
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: Importing/exporting heightmap

Post by psi29a » 07 Sep 2014, 07:46

tesfaith and tesannwyn are written by the same guy: Lightwave
http://www.oceanlightwave.com/morrowind/

I've been contact with him over the years and the result is that he managed to port tesannwyn to linux and is now in the process of opensourcing the TES3 bits.

The idea is to either turn this into a lib that OpenCS could use or just implement it directly into OpenCS.

I just hope the code drops sooner than later. ;)

Lightwave
Posts: 5
Joined: 20 Sep 2012, 10:43

Re: Importing/exporting heightmap

Post by Lightwave » 13 Sep 2014, 22:09

Sorry guys, complicated personal life and I haven't done anything on TESAnnwyn since January 2011. I've sanitized the code a bit (read a lot!) and just emailed a copy of a TES3 only version to psi29a who's been nicely asking me every few months if I'm still alive. :)

TESfaith (2002) and TESAnnwyn (2006) were entirely written in C on Linux, I used to work on all images and games files using Linux as it was slicker to develop, compare and hack game files, that's one why they remained cross-platform console programs. It's all been written using vi in an xterm. :roll: I guess I figured that if anyone wanted they could bolt a GUI and call TESAnnwyn with the options in the background, rather than reinvent the backend wheel. TESfaith was always GNU open source and was included with all distributions of the program. I don't really have a problem with anyone seeing the full source code for TESAnnwyn, it was just so untidy to look at the code, so many extraneous hacks for various features and heaps of global variables that it needed a lot of reorganizing, it's more the embarrassment of a messy project than anything, though I admit I wanted a direct handle on it too whilst I was still actively working on it.

Heightmap importing and exporting for TES3 is really quite straightforward compared to TES4 once you understand the values are just gradient offsets to each other. There was no documentation for the file format when I decoded it years ago - hence why the source was yucky as I was developing and testing on the fly, decoding both the Oblivion and Morrowind formats and adding lots of features - some of which turned out to be bad ideas due to game engine limitations (like 'LOD2', full quality LOD meshes for Oblivion, the game engine couldn't handle it).

If anyone wishes for any additions to the program or wants the TES3 version of the source code, let me know. It doesn't use any third party libraries so is nicely self contained and relaitvely easy to compile on any platform, and if you wanted to create a library out of it there's an example in the README of how to implement a hook (hardcoding options then calling the routine to either Import or Export a heightmap with VCLR and texture placement map).

Thanks,

Lightwave

onionland
Posts: 61
Joined: 29 Jul 2014, 00:43

Re: Importing/exporting heightmap

Post by onionland » 14 Sep 2014, 02:56

Wow, and here comes Lightwave himself, that is awesome.

With the integration of TESAnnwyn, opencs really will be starting to come together as an integral part in mw modding.
I'm looking forward to seeing your implementation Psi, and also any sort of cooperation with Lightwave, and the members of the openmw team that may come.

Edit:Fixing the structure of the text to be a bit clearer.

User avatar
psi29a
Posts: 4604
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: Importing/exporting heightmap

Post by psi29a » 14 Sep 2014, 09:11

Thanks Lightwave! :D

Am I correct in understanding that your gift to community is GPL or is it another license, like MIT/Expat or BSD?

Do you have an github account? If you do, how do you feel about co-maintaining it with us?

@Zini and @Scrawl
I was not sure what is best here:
1) Keep software "as-is" (maintenance releases as another OpenMW project) and we use bits and pieces for OpenCS directly.
2) Rewrite it to be a library that OpenCS can link to and use.

User avatar
Zini
Posts: 5536
Joined: 06 Aug 2011, 15:16

Re: Importing/exporting heightmap

Post by Zini » 14 Sep 2014, 10:08

I am not sure if a direct integration into OpenCS is possible (different data models and such). However we really need an OpenCS integration. It might boil down to having the code as a reference available when writing the respective OpenCS features and maybe re-using some (or a lot) of the code.
Anyway, we are not at the point of tackling these features yet. It would be best if the code could be put up on github.

Post Reply