Auteur Sujet: Elevation on maps  (Lu 34020 fois)

Hors ligne Marbot

  • Lieutenant
  • **
  • Messages: 74
Elevation on maps
« le: 23 février 2010, 20:10:38 pm »
Hello,
I have talked about this topic on another thread, but it was not really the best place.
The way the map editor works is that you have to design by hand the elevation map. However, I have some maps where data is already digitised and I would like to import directly the data to avoid doing it twice. The elevation data take the form of complete triangulations of the battlefields where I can have the ground elevation at any position, which means it should be easy to adapt the import to the LG format. Am I right to say that the .txt file in the map directory is where the elevations are stored and each number is the average height of a "pixel" of the map?
If so I would just need the size of that pixel and to know how elevations are converted to be able to do that import.
I also have the localisation of all the main features (road villages, farms...), but is seems harder to import straight away since the other files seem to be binary.

Any iformation on that matter would be very much appreciated.

Regards

Hors ligne Hook

  • Chevalier d'HistWar
  • Modérateurs
  • Général de Brigade
  • ****
  • Messages: 1752
Re : Elevation on maps
« Réponse #1 le: 23 février 2010, 20:30:05 pm »
The text file, GroundV4.txt, appears to be a code for what each terrain cell contains, or other information, but it is not the elevation.

HighV4.hgh is the elevations in meters.  The maps are always 100 by 75 cells, so each number represents the elevation of one corner of each map cell, as there are 101 by 76 cells in the HighV4.hgh file.  The format is binary, two bytes per cell, with low order byte first, and the elevations are in meters above a zero reference elevation which won't be sea level. 

For example, Austerlitz uses about 200 meters above sea level for the zero reference elevation.  The lowest elevation in the Austerlitz map is 0, or 200 meters above sea level, and Pratzen Heights is about elevation 80-90, or 280-290 meters above sea level.

Negative numbers here represent rivers, lakes, and marshes. 

Citer
However, I have some maps where data is already digitised and I would like to import directly the data to avoid doing it twice.

If you can show me the format of this data, I might be able to help with a program to convert it to a HighV4.hgh file.

Hook

Hors ligne Marbot

  • Lieutenant
  • **
  • Messages: 74
Re : Elevation on maps
« Réponse #2 le: 23 février 2010, 22:50:11 pm »
Hello Hook,

Thanks for your answer. Attached is typically the kind of file I can generate. It is what I made for the Waterloo Napoleon's last battle series for the battle of quatre-bras. It is very similar in principle to the LG file, the difference being that it is not binary. If of help I could also put commas to separate the different elevations. Instead of a number I can put anything more suitable like the modified elevation. The other thing I can do is to simply generate a .CSV type file with i,j,z. One set of coordinates for 1 line.
Will it be possible later on in the map editor to put a picture in the background to help digitise locations of the main features like, houses, rivers, forests etc...?

Regards

Hors ligne Hook

  • Chevalier d'HistWar
  • Modérateurs
  • Général de Brigade
  • ****
  • Messages: 1752
Re : Re : Elevation on maps
« Réponse #3 le: 23 février 2010, 23:00:59 pm »
Will it be possible later on in the map editor to put a picture in the background to help digitise locations of the main features like, houses, rivers, forests etc...?

You can already do that. :)  Instructions are in the manual in book 2.  A few people have already tried it.  You can even use these in the game itself, from what I understand.  I'm waiting for someone to find a good period map to use there.

I can work with whatever format you have, and the simpler the better as I'd have to reformat it anyway. 

Do you know what the lowest and highest elevations are in meters in that map you attached?

Hook

Hors ligne Hook

  • Chevalier d'HistWar
  • Modérateurs
  • Général de Brigade
  • ****
  • Messages: 1752
Re : Elevation on maps
« Réponse #4 le: 24 février 2010, 15:10:45 pm »
Here is what your elevation map looks  like in the game.  The contours are 5 meters.  This will fit in a 10 km or larger map, but the 6km map uses a different scale.

Let me know if this is going in the right direction.

Hook

Hors ligne Marbot

  • Lieutenant
  • **
  • Messages: 74
Re : Elevation on maps
« Réponse #5 le: 24 février 2010, 18:50:46 pm »
Hello Hook,

Thanks for your input, This is looking good as you can see from the map attached.
I am going to give you the true elevation and adapt the file to the 101/76 scale.

Cheers

Hors ligne Hook

  • Chevalier d'HistWar
  • Modérateurs
  • Général de Brigade
  • ****
  • Messages: 1752
Re : Elevation on maps
« Réponse #6 le: 24 février 2010, 19:39:50 pm »
That map is about 5 km wide.  If you want to put this on a 6 km map,  the dimensions are 61 by 46.  If you're making a 10 km map or larger, use 101 by 76.

You can use whatever symbols you wish for the elevations.  Using a to z might be better than the numbers and letters.  Use however many letters you need, just tell me how much elevation each one represents.  If your elevations are to the meter, use a-z then A-Z and 0-9, or any ascii sequence that's easy to translate to a number.

Hook

Hors ligne Marbot

  • Lieutenant
  • **
  • Messages: 74
Re : Elevation on maps
« Réponse #7 le: 24 février 2010, 22:45:24 pm »
Hello Hook,

The map I have of the battlefield for quatre bras is quite small (4km*3km) so instead I am giving you the Waterloo one which fits very well.
I have coded the elevation from a to z as suggested. Lowest is a at 70m and highest is z at 161 the increment is therefore 3.64 m.

I have tried to use the "carte utilisateur" Menu in the map editor, but nothing happened when clicking on it.

Cheers

Hors ligne Hook

  • Chevalier d'HistWar
  • Modérateurs
  • Général de Brigade
  • ****
  • Messages: 1752
Re : Elevation on maps
« Réponse #8 le: 25 février 2010, 04:55:25 am »
Here is the converted Waterloo height map.  I had to duplicate one row of numbers on the right, two on the left, and one each on the top and bottom to make the size 101 by 76.  This shouldn't have much effect on the actual map.

The letters used were a through u, so I used a scale factor of 4.5 to get the correct elevations.  This is trivial to change, so if you want me to use another scale factor, let me know.

Note that the HighV4.hgh file will not work for a 6 km map, only for 10 km or larger.

Hook

Hors ligne Hook

  • Chevalier d'HistWar
  • Modérateurs
  • Général de Brigade
  • ****
  • Messages: 1752
Re : Elevation on maps
« Réponse #9 le: 25 février 2010, 05:13:35 am »
Here is the same map using your suggested 3.64 scale factor.

Hook

Hors ligne Broadsword

  • Capitaine
  • **
  • Messages: 110
Re : Elevation on maps
« Réponse #10 le: 25 février 2010, 05:48:27 am »
It has been fascinating to watch you two work out this system for creating more precise heightmaps.
I can't wait to see the results of this in a scenario.
But also: Once you have it figured out, could someone post the step-by step process in a simple, "for dummies" fashion, so that the rest of us might eventually be able to make custom terrain for HW:LG this way?
That would be great.

Hors ligne glaude1955

  • Major
  • ***
  • Messages: 616
Re : Elevation on maps
« Réponse #11 le: 25 février 2010, 12:13:56 pm »
Superbe travail, impressionnant.
Nous sommes preneur d'un tutoriel... ;)

Superb work, impressive. 
We are taker of a tutorial...

Yves

Hors ligne Hook

  • Chevalier d'HistWar
  • Modérateurs
  • Général de Brigade
  • ****
  • Messages: 1752
Re : Elevation on maps
« Réponse #12 le: 25 février 2010, 15:50:22 pm »
If it's not obvious, you can use the HighV4.hgh file in the game now.

Make a new 10 km map and save it, then exit the map editor.  Unzip one of the HighV4.hgh files and copy it into map folder.  If your new map is called Waterloo, the folder will be called Waterloo in the Map folder.  Overwrite the HighV4.hgh file that is already there.  Reopen the map editor and select Waterloo, and the height data will be there.  If you save the map now, it will create the CARTE2D.BMP file.

You can add terrain features as you wish... it doesn't have to be the actual Waterloo battlefield.  While you can't add rivers at this point, you can add lakes and marshes, and everything else.

There may be a way to add rivers, but I'll have to experiment with that a bit.  No guarantees just yet.

Once I've got the program to convert text height files in the format that Marbot has provided polished sufficiently, I'll post it if there is sufficient interest.  Basically, you just drag the text file on top of the program icon and it produces a proper HighV4.hgh file for you.  Creating that text file may be somewhat more difficult. :)

Marbot, if you want I can provide the C source code I use, so that you can create the files directly yourself, or I can send you a copy of the program I use.  Feel free to get in touch any time.

Hook

Hors ligne Marbot

  • Lieutenant
  • **
  • Messages: 74
Re : Elevation on maps
« Réponse #13 le: 25 février 2010, 20:05:33 pm »
Hello,

Sorry for the mistakes, they should all be fixed in the attached file. The scale factor has slightly changed to 3.5m.
I would love to use your program. Can you adjust the scale factor in it? I am also interested by the code but a don't have a compiler. I used to do some C a few years back at Uni...

Regarding the way I create these points is unfortunately not straighforward as I am using a software dedicated to do some geology work and that is fully 3D. I just digitise the elevation lines at their correct elevation using a picture of the map correctly georeferenced in the background and then I create a triangulation (3D surface) of the whole map. I create a grid of all the points required for LG and then I project them onto the triangulation. I use the export function to have a list of all the points which I can then import into Excel and after a few transformations the final map given to Hook is made.

I can help anyone  to build the topography for a scenario as long as a topographical map of the area is available.

Hors ligne Hook

  • Chevalier d'HistWar
  • Modérateurs
  • Général de Brigade
  • ****
  • Messages: 1752
Re : Elevation on maps
« Réponse #14 le: 25 février 2010, 22:58:39 pm »
Latest version.  The map seems to have shifted a bit. :) 

Elevations displayed are 10 meters.  This is selected by the game and can't be specified.

There used to be a free download for Microsoft Visual C++.  I'm looking for it while I upload these files.

Hook