The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: gerw on October 07, 2008, 09:46:01 PM

Title: [patch] increase map size
Post by: gerw on October 07, 2008, 09:46:01 PM
I spent some time and wrote a patch for simutrans. With the patch you are able to increase the map size in game. It works appropriate only with random maps (and if you not change the map number).

The zip-file contains the patch-file, 2 new gui-files and a sample menuconfig.tab (originally from pakHAJO) - You have to add "dialog_tool[24]" in your menuconfig.tab in order to use this patch.

TODO:
Add forests, cities and industries to the new part of the map.
Title: Re: [patch] increase map size
Post by: z9999 on October 08, 2008, 01:59:06 PM
Good idea.  :)
It would be nice if we could select the direction to enlarge.
[edit] Well... rotating map solved this, and this is the easy way.   ;D

One thing...
Please use only low ascii character for master text to translate.
Title: Re: [patch] increase map size
Post by: gerw on October 08, 2008, 04:20:05 PM
Yeah, it's my brothers idea.

But with a rotated map the calculation of the heightmap must also be "rotated". I will fix this in a new version. I will also fix the "bug" with the master texts.

Is a preview needed? In my opinion it's not so necessary, is it?
Title: Re: [patch] increase map size
Post by: prissi on October 11, 2008, 09:22:07 PM
I think you hagve not done enough. I think you need also to check for stops, which were outside the map beforehand and add them to the planquadrat list of connected stops or passenger will not be able to travelfrom/to this tiles. I.e. the catchment region for each stop must be recalculated. And I am not sure, if the route_t buffer handles this well ingame (I mean the dirty tile list of marker_t.) I have to investigate a little more on this before inclusion.

By the way, there is a formatting rule for simutrans C++ in documentation for a reason ...
Title: Re: [patch] increase map size
Post by: gerw on October 12, 2008, 02:07:51 PM
Quote from: prissi on October 11, 2008, 09:22:07 PM
I think you hagve not done enough. I think you need also to check for stops, which were outside the map beforehand and add them to the planquadrat list of connected stops or passenger will not be able to travelfrom/to this tiles.
Ok, I can't know, which regions of code I have to change, because I don't read it all.
QuoteI.e. the catchment region for each stop must be recalculated.
I will look for this.
QuoteAnd I am not sure, if the route_t buffer handles this well ingame (I mean the dirty tile list of marker_t.) I have to investigate a little more on this before inclusion.
It would be nice, if you can tell me, which parts of the code I have to consider.
QuoteBy the way, there is a formatting rule for simutrans C++ in documentation for a reason ...
Until now I have used my own style, but I will change it.
Title: Re: [patch] increase map size
Post by: prissi on October 12, 2008, 05:51:24 PM
Look for marker_t. It maintains an image of the map, I think, and each bit represents a tile. This must be extended too, otherwise it will cause errors during way search outside the old map ...

And you know the marker for catchment region (boxes resp. transparent areas)? These represent the catchement of a stop. Just recalc them for each stop and you should be save.
Title: Re: [patch] increase map size
Post by: gerw on October 13, 2008, 10:26:50 PM
Bug fixes:
Title: Re: [patch] increase map size
Post by: gerw on October 18, 2008, 07:43:21 PM
I have done my homework, here is a new version ;)

Now increasing the mapsize of a rotated map works properly. So you can extend the map in all 4 directions (with combined increasing and rotating).
Title: Re: [patch] increase map size
Post by: gerw on October 25, 2008, 05:25:40 PM
A new update and it's almost done but the progress bar is flickering when increasing the map size. Prissi, can you tell me why?
Title: Re: [patch] increase map size
Post by: prissi on October 25, 2008, 07:28:16 PM
Sorry, need to have a depper loock at it. However, I am not sure I can do this until sunday.
Title: Re: [patch] increase map size
Post by: gerw on October 26, 2008, 01:36:51 PM
Ok, I've found it! I had to call intr_disable();before increasing the map size. Now everything works fine and also the progress bars was pimped  8)

Should new industries also be added? Any more suggestions?

Todo:
- clean up gui/bigger_map_frame_t.*
- remove map preview
Title: Re: [patch] increase map size
Post by: wernieman on October 26, 2008, 02:22:49 PM
D you need a "deeper test", a nightly? ;o)
Title: Re: [patch] increase map size
Post by: gerw on October 26, 2008, 02:50:14 PM
I think it's a good idea if you include the patch in a seperate nightly.

But you need also a modified menuconf.tab!
Title: Re: [patch] increase map size
Post by: wernieman on October 26, 2008, 05:39:54 PM
mhh .. dou you have?

But not today ... tomorow?
Title: Re: [patch] increase map size
Post by: gerw on October 26, 2008, 05:57:38 PM
You have to add dialog_tool[24]=0 to the menuconfig.tab and you have to add it to some menutoolbar[0][21]=dialog_tool[24]
Title: Re: [patch] increase map size
Post by: gerw on October 26, 2008, 07:27:38 PM
Sorry for the double post but you can't edit and append a file.

Here is an amazing new version, now with preview map and interpolated number of towns estimate.

Any more suggestions?

Edit:
Some strange things happens. When I compile my version (rev 2035 + patch) withDEBUG = 3 in config.default everything works fine. But when I compile it without it then I get a segfault when viewing a schedule (with at least one stop)! I didn't touched the schedule window!

Edit2:
I tried it at an other pc and there even the base rev 2035 without my patch produces a segfault without DEBUG=3. And again with DEBUG=3 it works fine!

Anybody can help me? Or is it just a bug from rev 2035 which is fixed in newer revisions?
Title: Re: [patch] increase map size
Post by: DirrrtyDirk on October 27, 2008, 03:08:37 PM
Quote from: gerw on October 26, 2008, 07:27:38 PM
Sorry for the double post but you can't edit and append a file.

Seems to work here, though...




EDIT:
Yes, it works.
Title: Re: [patch] increase map size
Post by: gerw on October 27, 2008, 03:17:39 PM
Ok. I realized now that there are two modify buttons still working different.
Title: Common patch thread
Post by: gerw on November 10, 2008, 10:05:22 PM
Since I won't open a new thread for each patch I created this one and will post here a thread every now and then.

The first one causes karte_t::init() to call karte_t::enlarge_map() for creating the heightfield etc. So it removes some redundancies and improves the behaviour of the progress bar while enlarging the map size.
Title: Re: Common patch thread
Post by: DirrrtyDirk on November 11, 2008, 12:11:46 AM
Actually people are encouraged to open one thread per issue in other parts of the forum (e.g. help requests, bug reports) so I don't know if it's necessary/good to do it different here. Well, that's for the admins (and developers, well mainly prissi) to decide.
Title: Re: Common patch thread
Post by: jbode on November 11, 2008, 07:42:30 AM
It might be more sensible to create (a) subsection(s) here for finished/included/rejected patches. I agree with Dirk that collection-topics are hard to maintain and lead to too much off-topic and loss of potentially valuable and important content.

Jörg
Title: Re: [patch] increase map size
Post by: prissi on November 11, 2008, 09:22:12 AM
SInce it originall stems from the enlarge map patch, I think it is appropriate to put it here. Otherwise I would suggest a new thread per function or I will get lost fast.
Title: Re: [patch] increase map size
Post by: gerw on November 11, 2008, 09:34:51 AM
Ok. I will do so  :)