It is possible to enlarge an existing savegame (map)?

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
andres1555
Engineer
Engineer
Posts: 35
Joined: 03 Sep 2018 20:24

It is possible to enlarge an existing savegame (map)?

Post by andres1555 » 15 May 2019 01:04

Well...thats the question. For example. Is there any posibility to enlarge a map from 512x512 to 1024x512. If any tile has a coded position, there could be a way to enlarge the number of tiles from the last. This means that an existing map could onle be enlarged in only one cardinal point.

I'm delirious? say that if you think so.

User avatar
SciFurz
Engineer
Engineer
Posts: 78
Joined: 13 Oct 2018 16:33
Contact:

Re: It is possible to enlarge an existing savegame (map)?

Post by SciFurz » 15 May 2019 07:31

Technically it seems possible. Every flat tile could be copied to a 2 by 2 (or larger) block as if it was enlarging a picture.
The problems are sloped tiles and all the objects on the tile like roads/rails, houses, etcetera. That needs some serious work to get the desired result.

In other words, start off with a large map or better, create a map with the editor and place towns and industries manually if you feel there are too much of those, or too close together.
Tinkering in the code in between writing mostly naughty stuff.
See https://www.patreon.com/scifurz

User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9292
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: It is possible to enlarge an existing savegame (map)?

Post by planetmaker » 15 May 2019 08:15

Tiles have sequential numbers. The map size is only used to determine their drawing position. So yes, in principle you can write a conversion to change size when you know the previous map. But you will need to take care to not forget any tile references (especially vehicles etc). Enlargement in on direction (dunno which right now) might be easy as it wouldn't mean that you need to adjust any tile info.

Eddi
Tycoon
Tycoon
Posts: 7414
Joined: 17 Jan 2007 00:14

Re: It is possible to enlarge an existing savegame (map)?

Post by Eddi » 15 May 2019 10:41

tiles are stored in this pattern: (example 4x4 map)

Code: Select all

     0    Y
    /  4
X  /  /  8
  /  /  /  12
 /  /  /  /
3  /  /  /
  7  /  /
   11  /
     15
so if you want to add tiles in Y direction, you can simply add more rows (and move the last original row, which is invisible VOID tiles, to the new end of the map)
if you want to add tiles in X direction, you must make a cut at each row, insert the new tiles (again, moving the last original VOID tile to the new end), and renumber any existing tile reference (like sign or vehicle positions)
You might not exactly be interested in Ferion, but if you are, have fun :)

Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 3 guests