PCM.daily banner
21-11-2024 16:46
PCM.daily
Users Online
· Guests Online: 75

· Members Online: 0

· Total Members: 161,771
· Newest Member: cuzzone
View Thread
PCM.daily » Pro Cycling Manager 2006-2020 » Pro Cycling Manager 2015
 Print Thread
Guide: Using Heightmaps
SportingNonsense
The best way to create stages is always from elevation data using GPX files, but the coverage of the .DEM files is limited.

pcmdaily.com/images/zctsmap.png

So how to create stages from other parts of the world?

You can create a stage from 'Nothing' and have to create the entire profile from scratch, but this can be a lot of work. The other option is to create using a heightmap, but nobody has ever really understood how they work, or tried to explain it if they did.

Last week I decided to search around and figure it out, in order to make the Rio Olympics course. After doing my own experimentations, some discussions with Monod, and a bit of guessing that fortunately worked, I have found a method that works. There are limitations with the heightmap feature - Cyanide haven't made it easy to use - but there are ways around those constraints.

So, here is a guide.

Step 1 - The Heightmap

There are a couple of ways to download a heightmap. The easiest, and my preferred method, is using the website https://terrain.party/

This website gives you a shaded blue square which you can drag anywhere in the world. The size of the square can be changed, but it is important that the size you use is 30km.

pcmdaily.com/images/heightguide1.png

Download your chosen area using the button above the size selection. This will give you a zip file containing 4 png files: (ASTER 30m), (Merged), (SRTM3 v4.1), (SRTM30 Plus). The readme file in the download recommends that the Merged image is the best one to use.

Open the .png in Paint.net (or similar software), and save it as .tga.

pcmdaily.com/images/heightguide2.png

You can now load this .tga into the stage editor, through the new file prompt.

pcmdaily.com/images/heightguide3.png

You might find that it loads upside down. If so you will need to go back to Paint.net, rotate the image 180 degrees, save it and reload it.

Step 2 - A wider map

If you are doing some form of circuit race, this first step might be enough, but a lot of races take place in an area wider than 30km x 30km. The reason for the limit per heightmap file of 30km is down to the stage editor. Whatever size heightmap you load into the stage editor it will resize it into a 30km x 30km size. So only by loading a 30km x 30km map can you keep the distances correct.

But there is a solution to this. First, download any additional heightmaps from terrain.party. Do your best to make sure the maps are next to each other, but do not overlap.

pcmdaily.com/images/heightguide4.png

Load each heightmap into it's own stage editor file and on each one draw a series of roads.

First: A road from the bottom right hand corner to the bottom left hand corner
Second: A road from the top left hand corner, which joins the first road at the bottom left hand corner
Third: A road from the top right hand corner, which joins the second road at the top left hand corner

Add route checkpoints, starting from one end and ending at the other.

Then select all 4 road points (hold down CTRL when selecting, to select all at once).

pcmdaily.com/images/heightguide5.png

Select File -> Export Selected Road Network. Leave both boxes ticked, click ok, then save the export.

Now create a new file from 'Nothing'. The terrain size you choose will need to be able to fit your maps. For the Rio course I needed two 30km maps side by side, so the minimum terrain size I had to have was 60000.

Go to File -> Import Road Network. Choose your first road network, and line it up into one of the corners of the map, using the small white road point circles as a guide. Press Import, with all options ticked.

pcmdaily.com/images/heightguide6.png

Save your zcts. Close the stage editor, then re-open the editor and the zcts.

As you can see, the terrain has now all been loaded.

pcmdaily.com/images/heightguide7.png

Now load the next map. Line it up as close as possible to the first one. Keep on going until your 'jigsaw puzzle' map is complete.

Step 3 - Draw the roads

Now you need to draw the road network.

While you cannot use a GPX file in the editor to guide you, you will still need to have a GPX file of your route - or some form of map - and have that open on your GPX website of choice e.g. Bikeroutetoaster, Mapmyride. For the Rio course, I used the Strava recording from Romain Bardet from the recent test event. I recommend viewing the map using a terrain mode.

You will need to use the terrain features, such as inclines and sealines, to help you place the roads in the correct position.

Here's a simplified example of what my Rio roads looked like.

pcmdaily.com/images/heightguide8.png

Step 4 - Adjusting the height

Now we come to the biggest issue with heightmaps. They don't give you the correct height! As with the 30km size limit, this is down to the way Cyanide designed the stage editor.

The proportions are correct, they just don't go high enough. See below a comparison between the editor and Strava (editor has 4 laps of each circuit, Strava has 2 laps). Rather than the highest point of the race being 460m, it is only 150m in the editor.

pcmdaily.com/images/heightguide9.png

So you are going to need to raise the terrain!

First, make sure the 'Snap objects to landscape' option is unticked. When raising the height of a road point, there are two methods.

1. In the 3D tab, drag upwards on the blue upwards arrow.
2. In the Profile View tab, enter your desired new altitude and click enter.

pcmdaily.com/images/heightguide10.png

This will not affect the surrounding terrain however, so you will need to use the terrain tools to raise that land in order to make the landscape look right.

pcmdaily.com/images/heightguide11.png

My tip would be to first use the 'Terrain Rise' tool to raise an area, followed by the second 'Terrain Smooth' tool afterwards to remove the pointyness of what you have just risen. I prefer to raise the whole area small amounts at the time, rather than doing a small area in one go - but you will have to practise and decide on your own method.

It is also up to you on whether you set the road heights first and then the terrain, or to do them at the same time. It would be ideal if you can set up the road heights first, however I find it easier to sort out the roads on climbs when the terrain is already in place - given that it can sometimes be challenging to put the road points in the correct place, with hairpins and such, in order to avoid road overlaps and bad route slopes.

This will take some experimenting on your part and, particularly if it is a larger climb, don't expect to be able to sort it out quickly. Just remember to regularly save the zcts file as you go along!

At the end of it all, hopefully your profile will now accurately replicate the one shown on your GPX route.

pcmdaily.com/images/heightguide12.png

Step 5 - Normal stage making touches

Complete the stage as you would any other. Adding in seas, rivers, cities, forests, isolated objects etc, asjusting road widths, markings and textures, and of course start line, finish line, podium and any sprints.

If you have done a lot of height adjusting, be prepared for a lot of road overlaps and bad route slopes!

Eventually, your stage will be ready to export and be shared on the forum! (Like my Rio RR will be at some point in the next couple of days!!)

pcmdaily.com/images/heightguide13.png

---

And that's the guide. Like I said, it's not the easiest way to make a stage! It is easier than making a race completely from a flat 'Nothing' map as it allows you to get the distances right, and at least gives you an outline of the elevation. And until Cyanide give us more. DEM files, that is about as good as it gets!

Feel free to ask any questions or give feedback on the guide - particularly if you use it to make your own stage!
farm8.staticflickr.com/7458/9357923136_f1e68270f3_n.jpg
 
Ad Bot
Posted on 21-11-2024 16:46
Bot Agent

Posts: Countless
Joined: 23.11.09

IP: None  
samu12
Thanks for this guide! Last time i hadn't got DEM files, y created manually seven islands, and it took a lot of time Smile
i.imgur.com/WN0wa17.png
 
coolrex
instead of terrain party i used this NASA site:

https://gdex.cr.usgs.gov/gdex/
 
Episode1
How do you save something as .tga file? I know it already sounds dumb, but need to ask Rolling Eyes
 
trekbmc
Episode1 wrote:
How do you save something as .tga file? I know it already sounds dumb, but need to ask Rolling Eyes


You need a program like paint.net then you can go save as then tga. Wink



"What done is, is one." - Benji Naesen
 
Episode1
Yeah, there's the problem... I've used paint, but if I save it, there are 5 options, but nowhere tga. I've also saved it as all five of them and also once putting .tga at the back, but stage editor didn't see it...
 
trekbmc
paint.net and paint are different things (I've made this mistake before as well Pfft) https://www.getpai...nload.html



"What done is, is one." - Benji Naesen
 
Episode1
trekbmc wrote:
paint.net and paint are different things (I've made this mistake before as well Pfft) https://www.getpai...nload.html


-_________- wow. Pfft
 
SportingNonsense
coolrex wrote:
instead of terrain party i used this NASA site:

https://gdex.cr.usgs.gov/gdex/


As far as I can see, there is no easy way to select a 30km x 30km area on that site, so I wouldn't recommend using it. If the map area you download is not that size, you will get incorrect distances in the editor.
farm8.staticflickr.com/7458/9357923136_f1e68270f3_n.jpg
 
coolrex
SportingNonsense wrote:
coolrex wrote:
instead of terrain party i used this NASA site:

https://gdex.cr.usgs.gov/gdex/


As far as I can see, there is no easy way to select a 30km x 30km area on that site, so I wouldn't recommend using it. If the map area you download is not that size, you will get incorrect distances in the editor.


yeah ok, but it is more accurate then the other site.
 
SportingNonsense
Well no, it's not going to more accurate if the distances are wrong Pfft
farm8.staticflickr.com/7458/9357923136_f1e68270f3_n.jpg
 
Margh Norway
Great investigative work, thanks for the tutorial!
Will give it a try, at least for a short circuit.
 
mpardo
This is very interesting. It is a shame that the altitudes don't quite reflect the real world but I tried downloading one of the heightmaps and in the readme file they mention that the file was manipulated to overcome some limitation in Cities: Skylines. It could well be the case that a bit of manipulation of the heightmap itself leads to the correct altitudes.
 
manindemaan
thanks SN for this awesome tutorial !


mpardo wrote:
This is very interesting. It is a shame that the altitudes don't quite reflect the real world but I tried downloading one of the heightmaps and in the readme file they mention that the file was manipulated to overcome some limitation in Cities: Skylines. It could well be the case that a bit of manipulation of the heightmap itself leads to the correct altitudes.


The problem is in the way the StageEditor reads heightmap files. Those files are in tga format and have values from 0 to 255 for every pixel. Usually, 255 should be 8000m or some arbitrary max value, but in the StageEditor, a pixel value of 255 will be used as 255 meter above sea level. There should be some gain, but it isn't.
If you could change the values in the image that might work, but it is no simple ascii code...

The thing you mentioned is that in city areas the height values are reduced slightly to match the ground level, rather than the level of the top of buildings. When the underlying data is generated by the return time of reflected signals then those signals are reflected by roofs of buildings instead of the ground and therefore return wrong height values.
 
mpardo
Yes, I know what you mean. I was thinking along the lines of testing whether we can use a 16 bit palette instead of an 8 bit normal RGB (that might be why the limit is at 255 meters). I am not initiated in image processing, so it would probably take me a long while to do something usable but maybe worth giving it a go.
 
Margh Norway
I used this technique some time ago to see how it works. Tutorial is well-written, I had no issues following the steps. As stated by SN it is less handy to make mountain stages this way (due to the incorrect height problem), but I started a stage on Barbuda (highest point 40m) where using heightmaps seems the convenient way to go.

One thing I just recognized is that there is an okayish way to replace the gpx for route purposes. As the files you get from terrain.party are .png you can virtually draw the route right on the pic. I opened the file with windows paint and used the pencil tool, saved and then converted it into tga-format.

i1056.photobucket.com/albums/t361/MarghNorway/barbuda_route_zpsndvne9si.jpg


As the drawing creates a notch in the landscape it seems best to draw thin and use a color with less contrast to the dark heightmap image. Otherwise you may need to smooth or flatten the parts where your route is going after you've created the roads.

i1056.photobucket.com/albums/t361/MarghNorway/barbuda_SE_zpsnpozr0vi.jpg


On a less serious note it opens up many new possibilities to know you can create a stage from any pic you want... e.g. climb Mt. Cartman Smile

i1056.photobucket.com/albums/t361/MarghNorway/cartman_zps1wlium18.jpg

 
togo95
I was doing the stage 6 of Vuelta Mexico and played a bit with this method. I figured out a way to get the correct elevation scale. However, it only works because the whole stage happens between altitude of 2650 and 2750, i.e. the difference is less than 255. If that is the case you can do the following:


1. Download the elevation file for the area you are interested in from here and install VTBuilder.

2. Get coordinates for some 30km x 30km square. In VTBuilder, import the elevation data (Ctrl+I). Then use the coordinates for Area Tool -> Numeric Values. Save this selection as a new layer using Area Tool -> Sample elevation
(tbh I didn't actually get the coordinates, I just used the terrain.party to guess where I should cut the map and it worked fine).

3. Open this saved layer in a new project. Use Elevation -> Fill in unknown areas. Now if you want to keep elevation info for the altitude between X and X+255, then remove elevation range for the values "0 X" and set unknown areas to X. Similiarly remove elevation range for the values "X+255 10000" and set unknown areas to X+255.

4. Save the elevation data using Elevation -> Export to... (I used bitmap) and convert it to tga.

5. Now you can load it to stage editor like in SN's method. For some reason when I did it, the terrain was a bit terraced (maybe forgot to check "Floating point" instead of "Integer" when sampling elevation or it can be something else). It only took a minute to repair that by smoothing the terrain though. Eventually I raised the bits of the landscape that were cut off (I didn't need to lower anything).


It isn't ideal by any means, but for the case of circuit races it works well. Maybe someone will be able to improve on this even further Smile
 
emre99
coolrex wrote:
Actually a great question. you know if you do bigger then 30x30, it becomes 30x30.
does the stage editor converts area's lower then 30x30 also to 30x30? so that you can create for example monaco easier, but bigger in scale?


nice to see you back on the forum
#FREELANDA #FREELIA MISSION ACCOMPLISHED

emre99's stages
Thread of the Week : Tour of California 2014
-Official PCM World Cup 2016, 10th best keirin player in the world Wink
PCM.daily Awards : 2 Nominee 0 Award Pfft
Daily Song Contest WINNER! With Foals - Mountain at my Gates with Greece!
1 like 1 girlfriend
''I call you the stage god. You are the stage god.'' -baseballover312, 15.07.2016
 
Leon40
Monaco ? Grin

nsa38.casimages.com/img/2016/04/17/160417045308160792.jpg
nsa37.casimages.com/img/2016/04/17/16041704530926755.jpg
pcmdaily.com/images/mg/PCMdailyAwards2018/stagemaker.png
pcmdaily.com/files/Awards2017/stagemaker.png
[url=https://legruppetto.com/forum/viewtopic.php?f=70&t=2912]My topic on
nsa39.casimages.com/img/2018/01/14/180114120348932911.png[/url]
 
coolrex
Leon40 wrote:
Monaco ? Grin

nsa38.casimages.com/img/2016/04/17/160417045308160792.jpg
nsa37.casimages.com/img/2016/04/17/16041704530926755.jpg


Well ok that's nice, but what i ment to say is, that if its get bigger, you can make the city more realistic and maybe create the Monaco Grand Prix much easier.
or is it possible with just your cities that you (just?) made?
 
Jump to Forum:
Login
Username

Password



Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Latest content
Screenshots
Best rider
Best rider
Cycling Manager Online: Tour de France
Fantasy Betting
Current bets:
No bets available.
Best gamblers:
bullet fighti... 18,376 PCM$
bullet df_Trek 17,374 PCM$
bullet Marcovdw 15,345 PCM$
bullet jseadog1 13,552 PCM$
bullet baseba... 10,439 PCM$

bullet Main Fantasy Betting page
bullet Rankings: Top 100
ManGame Betting
Current bets:
No bets available.
Best gamblers:
bullet Ollfardh 21,890 PCM$
bullet df_Trek 15,520 PCM$
bullet Marcovdw 14,800 PCM$
bullet jseadog1 13,500 PCM$
bullet baseball... 7,332 PCM$

bullet Main MG Betting page
bullet Get weekly MG PCM$
bullet Rankings: Top 100
Render time: 0.31 seconds