Generating a city or region from a height map image

You have great tips for other players? Share them here.
User avatar
Lobby
Developer
Reactions:
Posts: 3426
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta
Phone model: S7 edge

Platform

Generating a city or region from a height map image

#1

Post by Lobby » Wed Jun 26, 2019 14:58

Hi, in recent versions of the game you can create cities and regions from height map images. Such images look like that:
Image
The brightness of each pixel determines the height of the corresponding tile in the city. The brightness ranges from 0 to 255, with 10 being the sea level. Dependent on where you have your height maps from you may have to adjust their contrast and brightness. See the entry on Wikipedia for more information about height maps.

You can get real world height map data for example from http://terrain.party/

In order to generate a city from a height map place the height map image file into your TheoTown folder and remember its name. Then go into the game, create a new city, and enter the name of the height map file (including the file ending) into the seed text field. The picture will be scaled to match the selected city size.
image.png
Append #somerandomtext to add some randomness to the map generation in case you are not happy with the result (e.g. the biomes on the map).

The game also allows you to generate a region out of a height map. To do that, use the following scheme for the cr console command:

Code: Select all

cr:{name:"New York",bmp:"ny.png",size:12,maps:[0,0,6, 6,0,6, 0,6,6, 6,6,6]}
See the topic about generating regions for more information about the cr command and how to use it. Note that you have to enable debug mode and experimental features in the setting in order to use the console.
The result :img
image.png
The height map that's used here is a part of New York and was extracted using http://terrain.party/ :img
ny.png
Note how dark the image is because of the lack of hills in New York.

This feature is compatible with all recent versions of the game :66:
However, the version for iOS doesn't support 16 bit (per channel) images right now. This is a special format that is used by some height map creators; you may have to save them with an image program to make them compatible with the game.
...Have a nice stay

User avatar
SomeIndianGuy
Inhabitant of a Conurbation
Reactions:
Posts: 471
Joined: Tue Jun 05, 2018 14:45
Location: Residence of President,Diplomatic District,Central Marzadaqae City,Socialist Republic Of Marzadaqae
Plugins: Show
Version: Beta

Re: Generating a city or region from a height map image

#2

Post by SomeIndianGuy » Wed Jun 26, 2019 20:22

So TT now has incorporated elements from Openttd now?
Nice

User avatar
yusuf8a684
Inhabitant of a Planet
Reactions:
Posts: 1300
Joined: Sun Dec 10, 2017 22:09
Location: Turkiye
Plugins: Show
Phone model: Samsung S5610K

Plugin Creator

Platform

Re: Generating a city or region from a height map image

#3

Post by yusuf8a684 » Wed Jan 22, 2020 18:34


I know quality is bad due to my amateur skills but you can still read the comments to get more information
Last edited by yusuf8a684 on Thu Jan 23, 2020 10:57, edited 2 times in total.
The Internet Addict

I can't define my self time to time... Just do not %100 trust me. Texting that honestly...

Know your friends well, enemies

User avatar
ร˜lsken
Former Bearbear65
Reactions:
Posts: 5200
Joined: Fri Feb 10, 2017 14:53
Plugins: Show
Version: Beta
Phone model: Samsung S10

Platform

Plugin Creator

Re: Generating a city or region from a height map image

#4

Post by ร˜lsken » Thu Jan 23, 2020 0:05

BBcode not working?
ImageJust my opinion

User avatar
CommanderABab
AB
Reactions:
Posts: 8432
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: Generating a city or region from a height map image

#5

Post by CommanderABab » Thu Jan 23, 2020 0:10

No, he added the

Code: Select all

&t=8s
at the end.
826!826Currently using beta 826. 826 What's new? :)
diagonal road tool!!
:)

Telegram - t.me/
๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธCommander๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ

ormishen
Settler
Reactions:
Posts: 4
Joined: Wed Mar 11, 2020 14:08
Plugins: Show

Re: Generating a city or region from a height map image

#6

Post by ormishen » Wed Mar 11, 2020 15:30

Hey!

Really been trying to get a map based on my hometown of Stockholm. I've figured out how to download a map but when I go to add it in theotown the game freezes.

I'm playing on a MacBook FYI.

Any advice?

User avatar
CommanderABab
AB
Reactions:
Posts: 8432
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: Generating a city or region from a height map image

#7

Post by CommanderABab » Wed Mar 11, 2020 18:51

ormishen wrote: โ†‘
Wed Mar 11, 2020 15:30
Hey!

Really been trying to get a map based on my hometown of Stockholm. I've figured out how to download a map but when I go to add it in theotown the game freezes.

I'm playing on a MacBook FYI.

Any advice?
What size is the image?
You might have to reduce the size in a graphics program if it is very large.
826!826Currently using beta 826. 826 What's new? :)
diagonal road tool!!
:)

Telegram - t.me/
๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธCommander๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ

ormishen
Settler
Reactions:
Posts: 4
Joined: Wed Mar 11, 2020 14:08
Plugins: Show

Re: Generating a city or region from a height map image

#8

Post by ormishen » Wed Mar 11, 2020 21:35

CommanderABab wrote: โ†‘
Wed Mar 11, 2020 18:51
ormishen wrote: โ†‘
Wed Mar 11, 2020 15:30
Hey!

Really been trying to get a map based on my hometown of Stockholm. I've figured out how to download a map but when I go to add it in theotown the game freezes.

I'm playing on a MacBook FYI.

Any advice?
What size is the image?
You might have to reduce the size in a graphics program if it is very large.
I tried a couple of different. But the one I have right now which i want is 317k. It shouldn't be too big I think. I can share it here. https://imgshare.io/images/2020/03/11/sthlm.png
Last edited by ormishen on Thu Mar 12, 2020 9:38, edited 1 time in total.

User avatar
CommanderABab
AB
Reactions:
Posts: 8432
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: Generating a city or region from a height map image

#9

Post by CommanderABab » Wed Mar 11, 2020 22:04

ormishen wrote: โ†‘
Wed Mar 11, 2020 21:35
CommanderABab wrote: โ†‘
Wed Mar 11, 2020 18:51
ormishen wrote: โ†‘
Wed Mar 11, 2020 15:30
Hey!

Really been trying to get a map based on my hometown of Stockholm. I've figured out how to download a map but when I go to add it in theotown the game freezes.

I'm playing on a MacBook FYI.

Any advice?
What size is the image?
You might have to reduce the size in a graphics program if it is very large.
I tried a couple of different. But the one I have right now which i want is 317k. It shouldn't be too big I think. I can share it here.
https://imgshare.io/images/2020/03/11/sthlm.png
826!826Currently using beta 826. 826 What's new? :)
diagonal road tool!!
:)

Telegram - t.me/
๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธCommander๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ

ormishen
Settler
Reactions:
Posts: 4
Joined: Wed Mar 11, 2020 14:08
Plugins: Show

Re: Generating a city or region from a height map image

#10

Post by ormishen » Thu Mar 12, 2020 14:50

CommanderABab wrote: โ†‘
Wed Mar 11, 2020 22:04
ormishen wrote: โ†‘
Wed Mar 11, 2020 21:35
CommanderABab wrote: โ†‘
Wed Mar 11, 2020 18:51


What size is the image?
You might have to reduce the size in a graphics program if it is very large.
I tried a couple of different. But the one I have right now which i want is 317k. It shouldn't be too big I think. I can share it here.
https://imgshare.io/images/2020/03/11/sthlm.png

Did you forget to write anything?

If it works for somebody else, is it possible to provide a seed based on the height map?

User avatar
Bevise
Micy's Assistant
Reactions:
Posts: 184
Joined: Thu Feb 27, 2020 15:39
Location: Pearl Island, Vietnam
Plugins: Show
Version: Beta
Phone model: 1280

Plugin Creator

Platform

Re: Generating a city or region from a height map image

#11

Post by Bevise » Wed Apr 22, 2020 5:21

How to create a single region with the same shape as the heightmap. :?:
:evil: You know, Bevise is not my real name, but ... who cares about that?
  • Comment your role-play flag and name here:
    Go

User avatar
CommanderABab
AB
Reactions:
Posts: 8432
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: Generating a city or region from a height map image

#12

Post by CommanderABab » Wed Apr 22, 2020 18:13

See the first post. :)
826!826Currently using beta 826. 826 What's new? :)
diagonal road tool!!
:)

Telegram - t.me/
๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธCommander๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ

User avatar
CommanderABab
AB
Reactions:
Posts: 8432
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: Generating a city or region from a height map image

#13

Post by CommanderABab » Wed Apr 22, 2020 18:15

Lobby wrote: โ†‘
Wed Jun 26, 2019 14:58
Hi, in recent versions of the game you can create cities and regions from height map images. Such images look like that:
Image
The brightness of each pixel determines the height of the corresponding tile in the city. The brightness ranges from 0 to 255, with 10 being the sea level. Dependent on where you have your height maps from you may have to adjust their contrast and brightness. See the entry on Wikipedia for more information about height maps.

You can get real world height map data for example from http://terrain.party/

In order to generate a city from a height map place the height map image file into your TheoTown folder and remember its name. Then go into the game, create a new city, and enter the name of the height map file (including the file ending) into the seed text field. The picture will be scaled to match the selected city size.
image.png
Append #somerandomtext to add some randomness to the map generation in case you are not happy with the result (e.g. the biomes on the map).

The game also allows you to generate a region out of a height map. To do that, use the following scheme for the cr console command:

Code: Select all

cr:{name:"New York",bmp:"ny.png",size:12,maps:[0,0,6, 6,0,6, 0,6,6, 6,6,6]}
See the topic about generating regions for more information about the cr command and how to use it. Note that you have to enable debug mode and experimental features in the setting in order to use the console.
The result :img
image.png

The height map that's used here is a part of New York and was extracted using http://terrain.party/ :img
ny.png
Note how dark the image is because of the lack of hills in New York.

This feature is compatible with all recent versions of the game :66:
However, the version for iOS doesn't support 16 bit (per channel) images right now. This is a special format that is used by some height map creators; you may have to save them with an image program to make them compatible with the game.
826!826Currently using beta 826. 826 What's new? :)
diagonal road tool!!
:)

Telegram - t.me/
๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธCommander๐Ÿ†Ž๏ธ๐Ÿ†Ž๏ธ

Post Reply Previous topicNext topic

Return to โ€œTips and Tricksโ€

Who is online

Users browsing this forum: No registered users and 2 guests

๏ปฟ