The International Simutrans Forum

 

Author Topic: In development: Realistic Lisbon (Portugal) Citymap  (Read 6840 times)

0 Members and 1 Guest are viewing this topic.

Offline ZéQuimTó

  • *
  • Posts: 37
  • Languages: EN, PT, FR, ES
In development: Realistic Lisbon (Portugal) Citymap
« on: September 09, 2014, 08:11:47 AM »
I created this thread to centralize the discussion regarding the development of a realistic simutrans map representation of Lisbon.

AltTab, regarding the bitmap I told you about, here is an example I made of what would be useful: https://app.box.com/s/pqzm1nuqypsc08bgjm8o
I have packed a .xcf (Gimp) file with all the layers, and the .png file with the final result.
Please note:
  - I rotated the map to make those streets straight
  - Notice the "double street" I used
  - Notice that the diagonal I made has no "diagonal pixels" (just made a diagonal using Gimp's Shift+Click, and then corrected it)

Additionally:
  - You are free to choose the map rotation you think its best for the map
  - You can think about more colors, just tell me what each color means in terms of Simutrans bulding-blocks. Remember to use "color picker" in Gimp, and set the color by selecting the RGB values. If you come up with lots of colors, just keep a table by your side :D
  - Something I was wandering was: use different shades of red to represent urban density. This way, using the smooth pencil would lead to higher house density in the center, and lower on the edges.
  - Use different layers for each thing (like I did in the example), to make things easy for you (altough I only need the flat image)

I will continue coding simutrans, to turn those images into a simutrans map.

Offline AltTab

  • *
  • Posts: 18
  • Languages: PT, EN, ES
Re: In development: Realistic Lisbon (Portugal) Citymap
« Reply #1 on: September 11, 2014, 06:11:31 PM »
sry I was a bit away in the past days.

about having the south margin, well that's going to be hard.

http://i.imgur.com/hHyUcOU.png

Oversized map and/or problems with the bridges. The Ponte Vasco da Gama has 2 turns, which ar not possible to do them here. 25 de Abril would be easier, but then we would have to show only part of the south margin of the Tagus River.

http://i.imgur.com/Aa1NpwJ.png

this would be more "practical"

also when you showed me those images. I have to disagree a bit with the pixel size. the down town blocks should only have 2 or 3 pixels (pixel = size of an individual building)
Also you corrected the angle, but there are several square like blocks in different parts of Lisbon. So it would be good to just have a North faced map (or a NE faced map to keep it straight on map rendering)

Today I won't be able to do anything, probably tomorrow I will have more free time. I'll test my idea on a region (for example a 1km square) and extrapolate the size of any of those maps.

Also I would want to know if it's possible to make the map "upgradable".
For example: if I would made a 1km square and be playable. Then if I would make a new square of 1km it would just be added. For the regions coordinates it could "shiftable".
Example for this example: have 9 squares of city (a 3 by 3 km region), the square X=2, Y=3 would be a landmark. I make 3 squares on the left (making the map a 4 by 3 km region), then I say the Landmark is now on X=3, Y=3. All coords would be updated to the new size, and it would be inserted the new coords (that are on a different file) on that small new region (merging  then both coords on the full map)

Was I clear? It makes sense in my crazy mind. If the size of the square is always limited to a specific size, it wouldn't be that hard (i think).
What do you think of this idea?
If we do this like that we would have a releasable map (but expandable) in a few days. Also it would be easy to do it to new regions.
« Last Edit: September 12, 2014, 02:40:05 PM by AltTab »

Offline ZéQuimTó

  • *
  • Posts: 37
  • Languages: EN, PT, FR, ES
Re: In development: Realistic Lisbon (Portugal) Citymap
« Reply #2 on: September 11, 2014, 10:54:15 PM »
Yeah...no way of making those bridges...

Regarding the second picture, I believe you mistakenly pasted the same one...

Quote
also when you showed me those images. I have to disagree a bit with the pixel size. the down town blocks should only have 2 or 3 pixels (pixel = size of an individual building)
Also you corrected the angle, but there are several square like blocks in different parts of Lisbon. So it would be good to just have a North faced map (or a NE faced map to keep it straight on map rendering)

You should not disagree a bit, you should disagree a lot! :D That was only an example to show you how I wanted the streets. I also think that those buildings should be something like 2*3 pixels.

I also agree with you to use N or NE orientation. Once again, it was just to stress that you may choose the rotation you see fit.

Also I would want to know if it's possible to make the map "upgradable".
For example: if I would made a 1km square and be playable. Then if I would make a new square of 1km it would just be added. For the regions coordinates it could "shiftable".

Not only we can do this, as it is an excellent idea!!! Really!!!
You could do the following: Pick a large map, pick a small tile from it (for example, lets make each tile something like 128*128 (just an example, use the size you see fit) and then work on that tile alone. By picking a very large map in the first place, and cutting tiles only after, would make it easier for you to cut adjacent tiles, without discontinuities.

Anyway, your idea is just awesome.
This way it is even easier to see the results coming out, without having to make a huge map... moreover, when several tiles are finished, players could just select a few of them to make a smaller map.
When I am finished with the code, I will help you making some tiles too! :D

Well, to make this implementable the easy way, I would suggest you to create another .txt file with the following information:
Code: [Select]
mapgen_tilesize = (128, 128)
mapgen_size = (2, 2)
0, 0, heightmap_0x0.ppm, stuffmap_0x0.png, citilist_0x0.txt
0, 1, heightmap_0x1.ppm, stuffmap_0x1.png, citilist_0x1.txt
1, 0, heightmap_1x0.ppm, stuffmap_1x0.png, citilist_1x0.txt
1, 1, heightmap_1x1.ppm, stuffmap_1x1.png, citilist_1x1.txt

This would be used, so that my mapgen code could know the size of each tile (in this case 128*128), that the size of the map is 2*2 tiles (in total 256* 256)
and the filenames for each tile.
Symbolically, this is:
Code: [Select]
mapgen_tilesize = (tile_X_size, tile_Y_size)
mapgen_size = (num_X_tiles, num_Y_tiles)
tile_X_coord, tile_Y_coord, filename_of_tile_heightmap, filename_of_tile_stuff_map, filename_of_citylist

"Stuffmap" is the png we have been talking about. I was going to call it "roadmap", but since it could have more stuff, like houses and green-spaces...you could suggest other names, though.

I see you are using windows...do you know how to compile simutrans on windows? If so, I could share the code as soon as I have something ready, so that you could test it....if not, the only way I see I can share this with you, is for you to install a virtual machine (like virtual box) and install linux within it..

I am still not sure if I will put these things along with simutrans, and make a pull request...I don't know if the community wants this...

Greetings

Offline AltTab

  • *
  • Posts: 18
  • Languages: PT, EN, ES
Re: In development: Realistic Lisbon (Portugal) Citymap
« Reply #3 on: September 12, 2014, 02:48:44 PM »
map link corrected.

I think the community might like this.

about compiling... not really. But I have another computer using a Linux OS. So I can test there. But having a Windows ready version would help me a lot.
After all, today is going to be a bad day, and tomorrow I won't be able to come here. On Sunday I'm going to have a day off so I might get something done by then.

Offline AltTab

  • *
  • Posts: 18
  • Languages: PT, EN, ES
Re: In development: Realistic Lisbon (Portugal) Citymap
« Reply #4 on: September 18, 2014, 05:26:34 PM »
Houston, we have a problem.

I've been trying to make the down-town
1st try- plane lines = horrible, I didn't even try to correct the spaces.
2nd try- lines and pixel by pixel = still horrible
.
.
.
7th try I made pixel by pixel trying to make the downtown after a 45º degree turn (facing NE) = better, but still to far from appealing. It doesn't even look like something a city would have.

I tried to make squares with 3 pixels
this was the result (annex)

Offline ZéQuimTó

  • *
  • Posts: 37
  • Languages: EN, PT, FR, ES
Re: In development: Realistic Lisbon (Portugal) Citymap
« Reply #5 on: September 18, 2014, 10:51:06 PM »
Well, it looks like you are making it too small.
How large would be the final city, at that scale?

I think something smaller than 3000x3000 pixels is too small.
Perhaps those houses would have to be larger than the 2x3 we talked about...
I am almost finishing the code.

Offline AltTab

  • *
  • Posts: 18
  • Languages: PT, EN, ES
Re: In development: Realistic Lisbon (Portugal) Citymap
« Reply #6 on: September 19, 2014, 12:12:52 PM »
with my scale calculations it would be around 1000x1000 (with the rotation it gave me almost 1300) so I can try multiplying by 3. but then the blocks in several "squarish" zones of Lisbon we would have 9x9 blocks, which again becomes a bit unrealistic.

Also if were making this "expandable" making it to big, would make it hard to expand to new zones like Oeiras and  Cascais (with the current scale it would need almost 4000 pixels width, if we multiply by 3 we would have a 12000 pixels map)

Offline ZéQuimTó

  • *
  • Posts: 37
  • Languages: EN, PT, FR, ES
Re: In development: Realistic Lisbon (Portugal) Citymap
« Reply #7 on: September 23, 2014, 02:58:10 AM »
Ok, I nearly finished the code :D

Couldn't resist to share some results. The code already includes relief data, city-list data, and streets. Residential areas still to go.
As a test, I only draw the streets (i.e. no relief map)
I tested it in two scenarios: one with a small city in the centre, and another with a 2M population city. Interesting how the original city-generation algorithm grew urban areas around existing roads :D

Anyway, the scale I used was way too big. Perhaps halving this would be ideal.
Meanwhile, I will try another scales.

Here goes the screenshots:

Original:


Simutrans + small city:


Simutras + huge city:


EDIT:
Here is how your sample looks like:




And just for reference, here are the file formats:

Main file (any extension)
Code: [Select]
tile_size = 100
map_tiles_x = 2
map_tiles_y = 3

reflief_map_offset = -2
tile_features_0_0 =featuremap/tile_0_0.png
tile_features_0_1 =featuremap/tile_0_1.png
tile_features_0_2 =featuremap/tile_0_2.png
tile_features_1_0 =featuremap/tile_1_0.png
tile_features_1_1 =featuremap/tile_1_1.png
tile_features_1_2 =featuremap/tile_1_2.png

tile_relief_0_0 =featuremap/relief_0_0.png
tile_relief_0_1 =featuremap/relief_0_1.png
tile_relief_0_2 =featuremap/relief_0_2.png
tile_relief_1_0 =featuremap/relief_1_0.png
tile_relief_1_1 =featuremap/relief_1_1.png
tile_relief_1_2 =featuremap/relief_1_2.png

tile_cities_0_0 =featuremap/cities_0_0.txt
tile_cities_0_1 =featuremap/cities_0_1.txt
tile_cities_0_2 =featuremap/cities_0_2.txt
tile_cities_1_0 =featuremap/cities_1_0.txt
tile_cities_1_1 =featuremap/cities_1_1.txt
tile_cities_1_2 =featuremap/cities_1_2.txt

The maps are simple png's. The relief map is simpler than original's simutrans. Basically, if you want height "10", just paint it with colour (10, 10, 10). Since there are only positive colours, and simutrans supports negative heights, use "relief_map_offset" to set the height for colour (0, 0, 0).

Regarding city list, it is basically a list composed by the following:
[ city name ], [ population ], [ x ], [ y ]

x and y are within the corresponding tile. The code will make the adequate translation according to the tile's position.
BTW, the numbers in the labels are the X and Y position of the tile.
« Last Edit: September 23, 2014, 03:28:46 AM by ZéQuimTó »

Offline AltTab

  • *
  • Posts: 18
  • Languages: PT, EN, ES
Re: In development: Realistic Lisbon (Portugal) Citymap
« Reply #8 on: September 23, 2014, 03:50:43 PM »
Just realised I tilted my sample the wrong way xD
By trying to put the real render to be facing North I by accident put it facing East.
So I have to move 45º counter clockwise  :P

But it's looking great.
And yep, it's too big (that was my problem). I can try to make 5*5 city blocks. it's not double, but it might do.

Check how the blocks look like. Also look, if the are now heading north.

Offline ZéQuimTó

  • *
  • Posts: 37
  • Languages: EN, PT, FR, ES
Re: In development: Realistic Lisbon (Portugal) Citymap
« Reply #9 on: September 23, 2014, 06:13:28 PM »
Hi, Ill test your sample right away, but just wanted to ask you, please, to save the files in png format. otherwise jpg just adds unwanted artefacts (you may see them if you open the jpg and look closely around black pixels, those pixels are not truly white). Png is lossless, and as so does not add those artefacts.

Cheers!

EDIT:
Could you please try to compile simutrans on linux? That would help you a lot seeing results, as you could test your designs right away.

Offline AltTab

  • *
  • Posts: 18
  • Languages: PT, EN, ES
Re: In development: Realistic Lisbon (Portugal) Citymap
« Reply #10 on: September 24, 2014, 12:54:41 PM »
yeah about that. My linux PC is kinda screwed (due to the POST beeps, sounds like some sort of RAM error, but I have to open it and check what is happening)

About the jpg, I'm terrible sry, I normally save it by default in png, dont know why the hell the default is now on jpg.
And yes I know a lot about those artefacts... unfortunately...