HMap features
Introduction
This tutorial will show how to use the Hmap features of SnakeDitor.
To start it, you just have to load in SnakeDitor the 'tuto_lmap_0.snr' file delivered with this documentation.
Track at the beginning of the tutorial
Inserting control points
First of all, activate the 'hmap' tab.
Initial display
Then, we have to add a first control point.
Press the 'Shift' key while clicking on the track (or activate the insertion mode by clicking on the '+' bouton):
A point is created, and the default level is set to 30.
At this point, all the hmap is set to the level 30.
Then, we add a new level point, with the same method:
No, we will increase the height of this new point.
On the left control area, press the 'Ctrl' key, and drag the control point up to the value 150.
The 'Ctrl' key is used to move at the same time the 2 control points.
You should obtain the next images:
The first image shows the area where to move the control point.
Uncheck the 'filling option', in the left part of the screen.
Now, save the file (Ctrl+S), and export it (Ctrl+E) as a TRK file. Verify that the 'hmap' option is checked in the dialog box.
You should also check the 'GeneRally' option to get 'GeneRally' launched at the end of the export.
Export dialog box
After a while, the file is saved, and will be ready to be used by GeneRally (that should also be launched automatically)
Displayed in GeneRally:
-water level=10
-lowest level of the track:30
highest level: 150
Check the 'filling option' in the export dialog box, and export again the track.
New result in GeneRally
Banked corners
Basic features
Now, we will see how to manage banked corners.
Insert 4 new control points like shown in the next screenshot.
The levels of each new point are computed with the height of the current track.
The corner will be fully banked between the level 130 and the level 116.
The area between 132 and 130, and the other area between 116 and 112 will be transitionnal areas.
Select the control point at level 130. Then, move the blue control point, in the left area, until the value 200.
You should get the new display:
Now, select the control point at level 116, and move the blue control point until the value 185.
You should get the new display:
To check the result, you can move you cursor over the middle of the corner (on the big red point in the next screenshot).
Then you can have a look at the left bottom area: it shows that the blue side of the corner is higher that the red side, but just in the corner.
Then, you can see the 2 transitionnal areas: the blue side is decreasing to reach the red side.
And then, outside of the corner, the blue side is exactly the same as the red side, so only one side is visible (the red side in fact).
Now, it is time to check the result in GeneRally.
Save your track, and export it as a TRK file
improvment
We can improve this corner, by adjusting it profile and it length.
Select the control point at level 130, then move the blue tangent control point in the left area.
Do the same thing with the control point at level 116.
Another thing should be done: with this hmap, when the cars leave the corners, the blue side decreases a lot,
and so, the car tends to leave the track with a jump. So to solve that, you just have to increase the length of the second transitionnal area:
move the control point at level 112 to the straigh part of the track.
After exporting to TRK file, we obtain the next result in GeneRally
External editor
At this point, we have seen what SnakeDitor can generate. The generated HMap needs to be improved outside of this software,
to add details outside of the track, in the land.
You can use TrackEditor for example, or you can use a graphic tool like MS Paint or GIMP.
TrackEditor
Load the generated Track in TrackEditor, and add some details by using "HMap adjust" and "HMap smooth".
The second image shows the track loaded in TrackEditor before any modification.
The third image shows the same track after HMap modification
Save the result in a new TRK file (tuto_TE.trk for example).
Result in GeneRally
Now, the point is to load the TrackEditor modifications in SnakeDitor to continue working with SnakeDitor.
Come back in SnakeDitor. Call the "import TRK" feature.
Check the "Hmap" option, and select the track you have modified with TrackEditor.
"Import" dialog box
Then, SnakeDitor will show you the next display:
Some icons were activated:
Before and after import
It is still possible to modify the height of the track: the track height will be put over the Hmap that was imported from TrackEditor.
For example, you can add 3 new control points, and set their level to 12 (under the previous level):
Export the result to a TRK file.
Result in GeneRally
Remark: the lac has dissappear: it is not a bug but a limit.
TrackEditor decreases the Hmap until 0. And 0 is special value for SnakeDitor: 0 is considered as a transparency area (displayed in light blue). So SnakeDitor fills it.
To solve this, you should try to put at least a value of 1 in such areas. It is not easy to do with TrackEditor if the water level is too low.
Graphic tool
It could be interesting to modify Hmap with a graphical tool like Gimp or MS Paint.
To start, we will have to reset the Hmap that was imported from TrackEditor. Click on the button shown in the screenshot:
Now it is time to export only the Hmap. You can export it in a bmp file, and load this file in Gimp.
But the fastest way is too simply make a Ctrl+C (copy the Hmap in the clipboard). Then you just have to make a paste in Gimp.
The size of the exported Hmap is customizable in the settings of SnakeDitor: 64x64 is the real size used in the TRK file. 512x512 is the size of the land map.
To modify the Hmap, it could be very useful to import the lmap too in Gimp, in order to see what you do, and for example, to avoid puting a hole in the middle of the track.
You have to activate the Lmap tab in SnakeDitor. Ctrl+C to copy the Lmap in the clipboard. Then paste it into Gimp, in a new layer. You should erase the green color, to keep only the track.
You should have to resize it to get the same size as the Hmap (64x64 normally).
In Gimp, you can modify the grey values.
When it is ok, you can export the result in a bmp file, but, like above, you can just copy the image in the clipboard (in grey scale mode), and then, you have to paste it in SnakeDitor by clicking on the correct button.
There is no shortcut button for that.
View in Gimp / view in SnakeDitor after being imported
Remark: we don't see the blue area where I put a lac, because, in Gimp, I fill this area with the value 3. So SnakeDitor will not fill it any more.
Like with the import from TrackEditor, it is still possible to modify the height of the track.
Export the result to a TRK file.
Result in GeneRally
Bridge
IMO, a very useful feature is bridge building. It is not very easy to make a bridge manually without having bugs in GeneRally.
You have to load another track: tuto_lmap_7.snr in SnakeDitor
New track to load
This track gets a crossroad. Go to the HMap tab.
At this point, there is nothing special: the road is flat, so no bridge is detected.
We are going to add a bridge: so we will set the level of the road under the bridge, and the level of the road over the bridge.
To do that, add the control points like shown in the next screenshot.
The bridge is aligned in the correct direction.
If you move the mouse near the level 80, you will see the profile of the road: the hole in the profile is the lower road under the bridge.
Export the result to a TRK file.
Result in GeneRally
Remark: it is possible to avoid bridge generation if you uncheck the "bridge" option in the export dialog box.
Finally
Hmap computation takes a lot of time, so when it is ok, you don't have to compute it each time you export the track.
The hmap already stored in the TRK file will remain unchanged.
uncheck the hmap export
Conclusion
I feel that the minimum knowledge was described in this tutorial. I hope this can help people who get confused by all the technical details put in the main documentation.
Enjoy