Patch: Better Map Borders (r13631)
Moderator: OpenTTD Developers
- CommanderZ
- Tycoon
- Posts: 1872
- Joined: 07 Apr 2008 18:29
- Location: Czech Republic
- Contact:
Patch: Better Map Borders (r13631)
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.
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.
Re: Patch: Better Map Borders
Very nice 

Re: Patch: Better Map Borders
Beautiful! That first one in particular is stunning! 

PathZilla - A networking AI - Now with tram support.
- CommanderZ
- Tycoon
- Posts: 1872
- Joined: 07 Apr 2008 18:29
- Location: Czech Republic
- Contact:
Re: Patch: Better Map Borders
Thanks guys!
Here is the patch and an executable. I tried to clean the code up as much as possible.
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
-
- Tycoon
- Posts: 1656
- Joined: 08 Jun 2007 08:00
Re: Patch: Better Map Borders (r13191)
Build failed with BuildOTTD..
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
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
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
- CommanderZ
- Tycoon
- Posts: 1872
- Joined: 07 Apr 2008 18:29
- Location: Czech Republic
- Contact:
Re: Patch: Better Map Borders (r13191)
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.Game crashes every time I try to change random seed
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).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
- CommanderZ
- Tycoon
- Posts: 1872
- Joined: 07 Apr 2008 18:29
- Location: Czech Republic
- Contact:
Re: Patch: Better Map Borders (r13191)
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.
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
- CommanderZ
- Tycoon
- Posts: 1872
- Joined: 07 Apr 2008 18:29
- Location: Czech Republic
- Contact:
Re: Patch: Better Map Borders (r13631)
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.
Re: Patch: Better Map Borders (r13631)
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 

-
- Chairman
- Posts: 776
- Joined: 20 Jan 2007 12:08
- Location: Germany
Re: Patch: Better Map Borders (r13631)
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
- CommanderZ
- Tycoon
- Posts: 1872
- Joined: 07 Apr 2008 18:29
- Location: Czech Republic
- Contact:
Re: Patch: Better Map Borders (r13631)
They do, just compare them with maps generated by unmodded TGPattached screens don't explain anything either

Phil: Okay, I replaced the post with the flyspray text

Re: Patch: Better Map Borders (r13631)
I still don't get it 
Perhaps two screens "with" and "without".
Also, what exactly is meant by map borders? The shore?

Perhaps two screens "with" and "without".
Also, what exactly is meant by map borders? The shore?
- CommanderZ
- Tycoon
- Posts: 1872
- Joined: 07 Apr 2008 18:29
- Location: Czech Republic
- Contact:
Re: Patch: Better Map Borders (r13631)
Map outer shoreline. In unmodded TGP the shoreline is very craggy and unnatural, my patch improves it.
Who is online
Users browsing this forum: Baidu [Spider] and 7 guests