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: 48
Joined: 03 Sep 2018 20:24

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

Post by andres1555 »

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
Traffic Manager
Traffic Manager
Posts: 154
Joined: 13 Oct 2018 16:33
Contact:

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

Post by SciFurz »

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 http://scifurz.wordpress.com/
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

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

Post by planetmaker »

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: 8258
Joined: 17 Jan 2007 00:14

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

Post by Eddi »

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)
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 10 guests