• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Terrain Generator?

Martes

Privateer
Staff member
Storm Modder
Storm Modeller
Before anything else, there is a relatively small thing I desperately lack for this game and which is possible to create, and it's terrain generator.

Basically, a minimal interface utility to create a low-poly model of a patch (~50 x 50 km, in general, but there should be an option to change the size), of terrain + underwater terrain from SRTM30 data for given geographic coordinates skinned in some very generic textures (I can even get some of them from the game).

I can handle the conversion to cff manually at the moment, the resulting object just has to follow a relatively simple naming and structure convention.
 
Virtual Sailor does a nice thing.
You put a BMP of colour coded graphics in.
And the game engine converts it to a 3D map.

I suppose that's not going to work here though; is it...?
 
In a way that's exactly how it (should) work.
The problem is that there is no engine that does the conversion here. The game contains a number of premade maps, which are built around models in same format as the ships, and these models have to be created outside, as nothing is generated on the fly.

I reproduced this process manually - taking SRTM region tiff to QGIS, creating a heightmap, importing it to Blender and converting it to OBJ with subsequent decimating to lower the triangle count to something sane, but I never got height scaling right:

map_test.png

And even that required a lot of manual cleaning, especially in creating a coastline. The game is very insisting on separating the land and underwater relief, crashing if any of those meshes actually cross the 0 coordinate, even by single vertex.
 
Last edited:
Martes, when I looked at all the maps in AOS2 - all the ones that were include in the list of playable ones - none had any underwater 3-d terrain modeled. They all used flat planes for the uw mesh with a texture that looks like a depth map and many just used a rectangular plane. There were a couple in the pak files with 3-d underwater terrain but they weren't playable at least out of the box.

IIRC in ASO2 PB most if not all were just like AOS2 with no 3-d underwater mesh

Also the .map files have path, shoal and anchor data that are closed polylines plus data for construction of towns and forts. The path data defines the coastlines. Shoals are underwater contours that define depth profiles. They have a default value of 100 but can be changed in the scenario editor. That implies they normally define non intersecting or non interior contours. I haven't checked to see how the contours in the .map file match up with the uw textures. You can take soundings in the game and that probably uses the texture file to generate the data but then why the shoal data in the .map and scenario file?

Max number of shoals you can define is not specified anywhere. The scenario file indicates the number of shoal depths specified in the scenario file and in the shoal section, pairs of shoal id number and depth for the number of shoals specified. Probably can't exceed the number of shoals defined in the .map file specified for the scenario. But I'll have to go back and review some old notes and run some test to see how that was treated.

The anchor data is similar except you can't edit those depths - they are 100. And no data for them in the scenario file.

The sea map in ASO2 (AOS2 PB doesn't have one but accepts the ASO2 sea map) didn't specify any mesh for land or underwater. I can't remember if I ever tried specifying shoals and anchor contours with that map and no uw mesh and texture specified. Something else to investigate.
 
Last edited:
shot0000_9.png shot0001_7.png
I was able to compile a test map that works with the export plugin and in the game. I even showed it in the model thread, but it must have drowned there.

And that's how it looked in blender:

map1.png
The map has to contain several objects to work correctly, and they have to be named under certain convention.
First, all the land goes to object named "poly".
Similarily all the underwater terrain goes to "uw". Those objects will end up in different .cff files and will be combined by the .map config.

Now, both of these objects do not have any collision maps. To make the land "solid" you have to make a simple flat polygon (do not forget to triangulate it on export) on 0-z coordinate, and name it "path". If the map contains islands, all their polygons go to the same object. The path should be a collection of faces, or it will not convert.
In the same manner "anchor" and "shoal" marks places where anchor can be dropped and shoals that can have assigned depth in the scenario editor. The only thing I am not sure is whether there is any support for shoals within shoals.

These objects are turned by the converter to sequence of coordinates written in .map config.

Oh, and remember the whole game is in 1:100 scale, that is 1 unit = 100 m.

PB, a pity, does not have a depth sounding mechanism, so it relies exclusively on graphics to determine and avoid grounding. If you do not specify "uw" in .map, the game accepts it, that's right.

The problem at my side, anyway, is not how to get the map model into the game (I worked that out) but getting the elevation data into a plausible model with minimal manual interference.
 
Last edited:
I finally found a source of elevation data that includes depth:

Tangram Heightmapper

And, very roughly this export:

heightmapper-1595197175985.png
Produces a mesh like this:

mesh1.png mesh2.png
(yes, I know, I fitted a rectangle on a square and didn't bother to properly calculate the heights, but that doesn't matter for the moment)
But can anyone help me to automate this (producing fixed size meshes from given coordinates) and maybe add automatic terrain texture on top of that?
I find that navigating real terrain is much more interesting than the very limited set of maps provided with the game.
 
But can anyone help me to automate this (producing fixed size meshes from given coordinates) and maybe add automatic terrain texture on top of that?
I find that navigating real terrain is much more interesting than the very limited set of maps provided with the game.
Try sending a PM to @JohnV (or perhaps @RobincPC). :doff
 
Back
Top