Patch: Better Map Borders (r13631)

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
User avatar
CommanderZ
Tycoon
Tycoon
Posts: 1872
Joined: 07 Apr 2008 18:29
Location: Czech Republic
Contact:

Patch: Better Map Borders (r13631)

Post by CommanderZ »

This patch changes the way how the TGP calculates map borders to make them smoother fit with the terrain and look more natural.

Most functions in tgp.cpp had to be altered to make this possible. The file now in my opinion much better follows the coding style. The alternations to other files are minimal (only one integer changed in unmovable_cmd.cpp).

The patch works for all map sizes and settings (the 64*64 maps are very similiar to those created with TGP though).

EDIT:

I'm no longer posting new versions here as they usually contain only coding style improvements and little bug fixes, please see my BugSpray thread for the latest version.
Attachments
BMB 1024 temperate hilly very smooth high water.png
The best shot so far. I love how this map came out.
(415.73 KiB) Downloaded 2553 times
BMB 256 temperate flat very rough very low water.png
A very rough terrain. Looks great too.
(720.25 KiB) Downloaded 1853 times
BMB 64 arctic flat very rough very low water.png
I told you very small maps are still crappy.
(728.59 KiB) Downloaded 1726 times
Last edited by CommanderZ on 22 Sep 2008 12:57, edited 6 times in total.
Mchl
Director
Director
Posts: 611
Joined: 05 Jan 2007 15:50
Location: Poland
Contact:

Re: Patch: Better Map Borders

Post by Mchl »

Very nice :)
User avatar
Zutty
Director
Director
Posts: 565
Joined: 22 Jan 2008 16:33

Re: Patch: Better Map Borders

Post by Zutty »

Beautiful! That first one in particular is stunning! :)
PathZilla - A networking AI - Now with tram support.
User avatar
CommanderZ
Tycoon
Tycoon
Posts: 1872
Joined: 07 Apr 2008 18:29
Location: Czech Republic
Contact:

Re: Patch: Better Map Borders

Post by CommanderZ »

Thanks guys!

Here is the patch and an executable. I tried to clean the code up as much as possible.
Attachments
openttd.7z
Modded openttd.exe executable for Win32. Use with r13191 files
(710.26 KiB) Downloaded 231 times
bmb_080604.patch
Patch file for r13191. I guess it will be applicable on much wider spectrum of revisions since devs AFAIK did no changes to tgp.cpp (the only changed file) for pretty long time.
(24.05 KiB) Downloaded 230 times
LordAzamath
Tycoon
Tycoon
Posts: 1656
Joined: 08 Jun 2007 08:00

Re: Patch: Better Map Borders (r13191)

Post by LordAzamath »

Build failed with BuildOTTD..

Code: Select all

can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: tgp.cpp
|===================================================================
|--- tgp.cpp	(Revision 13191)
|+++ tgp.cpp	(working copy)
--------------------------
No file to patch.  Skipping patch.
15 out of 15 hunks ignored
I just loaded the patch and put force revision to patch option and compiled

EDIT: Used the binary provided here.. Game crashes every time I try to change random seed, the "Random" button works though and it makes a map
I'll test more..

Yet Another Edit:
I think that your patch somehow screws the random seed.. I took the official trunk and put the same seed in the generator as your patch gave me.. And the maps differ completely
patched.png
Very nice borders, I admit
(96.09 KiB) Downloaded 365 times
unpatched.png
r13374 with the same settings as the patched screenshot
(118.8 KiB) Downloaded 301 times
PS: And I stopped the propaganda to support Dave Worley since he got a nice new red hat now.[/color]
I know I have a BBCode error in my signature but I really cba to fix it.
User avatar
CommanderZ
Tycoon
Tycoon
Posts: 1872
Joined: 07 Apr 2008 18:29
Location: Czech Republic
Contact:

Re: Patch: Better Map Borders (r13191)

Post by CommanderZ »

Game crashes every time I try to change random seed
Thanks for reporting. That's strange...I have no clue why. I will try to compile pure SVN source with my MSVC...maybe it screws it.
I think that your patch somehow screws the random seed.. I took the official trunk and put the same seed in the generator as your patch gave me.. And the maps differ completely
This is expected. I did a lot of changes to noise generation functions (none of them should affect the result though) and - what is more important - the seed is used to generate second set of random numbers for a second height map, which is then substracted from the original one (only in map border areas, of course).
User avatar
CommanderZ
Tycoon
Tycoon
Posts: 1872
Joined: 07 Apr 2008 18:29
Location: Czech Republic
Contact:

Re: Patch: Better Map Borders (r13191)

Post by CommanderZ »

Update time!

News:
- updated to r13631
- improved appearance of very small maps. Performance of this patch is now at least very similiar to unpatched TerraGenesis, but in most cases is vastky better.
- fixed the "lighthouse bug"
- the bug with random seed crash is also solved (not by me thoughy, it was fixed in r13508 by developers)

Patch and win32 executable attached (built with MSVC++ 2008 Express).

I hope the patch file as alright this time.
Attachments
bmb_080726.diff
Pacth file against revision 13631
(26.24 KiB) Downloaded 241 times
OTTD-win32-BMB080726-r13631.7z
Patched r13631 win32 ready-to-use executable
(1.88 MiB) Downloaded 195 times
User avatar
CommanderZ
Tycoon
Tycoon
Posts: 1872
Joined: 07 Apr 2008 18:29
Location: Czech Republic
Contact:

Re: Patch: Better Map Borders (r13631)

Post by CommanderZ »

I'm no longer posting new versions here as they usually contain only coding style improvements and little bug fixes, please see my BugSpray thread for the latest version.
User avatar
Octopuss
Traffic Manager
Traffic Manager
Posts: 135
Joined: 08 Mar 2004 20:20
Location: Czech republic

Re: Patch: Better Map Borders (r13631)

Post by Octopuss »

Can you explain what exactly this patch does? I can't seem to understand the point and the attached screens don't explain anything either :)
PhilSophus
Chairman
Chairman
Posts: 776
Joined: 20 Jan 2007 12:08
Location: Germany

Re: Patch: Better Map Borders (r13631)

Post by PhilSophus »

I had the same problem when reading this topic. However, the flyspray entry is much clearer.
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
User avatar
CommanderZ
Tycoon
Tycoon
Posts: 1872
Joined: 07 Apr 2008 18:29
Location: Czech Republic
Contact:

Re: Patch: Better Map Borders (r13631)

Post by CommanderZ »

attached screens don't explain anything either
They do, just compare them with maps generated by unmodded TGP :)

Phil: Okay, I replaced the post with the flyspray text :)
User avatar
Octopuss
Traffic Manager
Traffic Manager
Posts: 135
Joined: 08 Mar 2004 20:20
Location: Czech republic

Re: Patch: Better Map Borders (r13631)

Post by Octopuss »

I still don't get it :D
Perhaps two screens "with" and "without".
Also, what exactly is meant by map borders? The shore?
User avatar
CommanderZ
Tycoon
Tycoon
Posts: 1872
Joined: 07 Apr 2008 18:29
Location: Czech Republic
Contact:

Re: Patch: Better Map Borders (r13631)

Post by CommanderZ »

Map outer shoreline. In unmodded TGP the shoreline is very craggy and unnatural, my patch improves it.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Ahrefs [Bot] and 8 guests