TerraGenesis Patch

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
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

TerraGenesis Patch

Post by richk67 »

Wow... looked in my stocking and Santa had left me this super TerraGenesis patch. :lol: :D

A total replacement of the Generate Terrain routine. This is an implementation of a recursive subdivision method for terrain generation.

In simple words - brand new spanking Random Terrains ... that look good ;)

There are a few quirks.

On a New Game, the grass terrain starts all mud, and over the next month regrows back. I dont understand why really, as the RunTileLoop is called 0x500 times. Works OK in Editor mode. :roll:

In arctic, if you go for Flat or Very flat, then there probably wont be anywhere for the forests to go. The best Arctic terrain IMO is at Hilly, with Medium lakes. Strangely, Mountainous looks less ... err... mountainous. Arctic also deliberately clips the top of the mountains to provide space for forests.

Tropical has its own coding, because of the need to have desert and tropical on the same map. Its hills/mountains are a bit more blocky at the base. You should always get some mountains and some desert. The bias on that is the terrain type you select. Tropical also doesnt respond brilliantly to the water quantity. It always has more water than the other climates.

Can I just say... I HATE OIL REFINERIES. I have spent hours trying to get the terrain to provide Oil-Refinery-friendly spaces. In the end it has been a bit of brute force - I have a routine that places 400 5x5 blank spaces for industries, and have shaved the terrain down at the map edges. It sort of works. One for v2.00.

That all said, here is the patch, and several screenies. Patch should be OK with latest version. Nobody has gone near here for ages. ;)

BTW forgot to say.... Happy Xmas everybody!

[edit 29/12/05]Updated to TerraGenesis v3. Eliminates more micro-islands a bit more efficiently.
Attachments
Arctic. Hilly terrain, Medium lakes.
Arctic. Hilly terrain, Medium lakes.
Unnamed, 17th Feb 1932.png (239.5 KiB) Viewed 1643 times
Tropical. Flat terrain, High lakes.
Tropical. Flat terrain, High lakes.
Unnamed, 7th Feb 1932.png (161.41 KiB) Viewed 1794 times
TerraGenesis_v3.patch
TerraGenesis v3. Eliminates more micro-islands a bit more efficiently. Makes lakes less bitty.
(21.81 KiB) Downloaded 718 times
Last edited by richk67 on 29 Dec 2005 10:23, edited 4 times in total.
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
KING
Traffic Manager
Traffic Manager
Posts: 180
Joined: 12 Dec 2005 08:03

Post by KING »

less water pls. My idea of a good map is no water except at the edges and on temprate mayby a river from one side of the map to the other.
Image
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

KING wrote:less water pls. My idea of a good map is no water except at the edges and on temprate mayby a river from one side of the map to the other.
It doesnt do rivers yet. Less water? Select the lowest of the options. It isnt a "no water" option. I may yet expand the water options to include "No water", and "Islands" as the two extremes.

Im also considering completely reworking how water is added to the map. At the moment, the decision of whether a tile is water or land is actually the first thing that happens. I may change it so that the land is created, and then it is flooded by rivers, fjords, deltas etc.
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Re: Santa's Special: TerraGenesis Patch

Post by Darkvater »

richk67 wrote:On a New Game, the grass terrain starts all mud, and over the next month regrows back. I dont understand why really, as the RunTileLoop is called 0x500 times. Works OK in Editor mode. :roll:
You need to set _generate_world to true before making those land-tiles. Then you end up with green grass. If the only purpose of RunTileLoop is to get the grass 'green', drop it :)
richk67 wrote:In arctic, if you go for Flat or Very flat, then there probably wont be anywhere for the forests to go. The best Arctic terrain IMO is at Hilly, with Medium lakes. Strangely, Mountainous looks less ... err... mountainous. Arctic also deliberately clips the top of the mountains to provide space for forests.
High mountains don't have trees anymore. I think at the very top you are ok if there are no trees around. Of course that decision should be based on the snow_height level variable. The lower it is, the higher the average altitude on the map.
richk67 wrote:Can I just say... I HATE OIL REFINERIES. I have spent hours trying to get the terrain to provide Oil-Refinery-friendly spaces. In the end it has been a bit of brute force - I have a routine that places 400 5x5 blank spaces for industries, and have shaved the terrain down at the map edges. It sort of works. One for v2.00.
I think how the current algorithm does it is try and place an oil refinery somewhere and if it doesn't go (rough terrain), terraform the ground beneath it to make it fit :).

Unfortunately I can't test your patch cause I'm going on holiday in a few hours, this are just opinions, suggestions based on what you wrote.

Merry Christmas :P
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Re: Santa's Special: TerraGenesis Patch

Post by richk67 »

Darkvater wrote: You need to set _generate_world to true before making those land-tiles. Then you end up with green grass. If the only purpose of RunTileLoop is to get the grass 'green', drop it :)
Okies... I'll add _generate_world to the next iteration.
Darkvater wrote:High mountains don't have trees anymore. I think at the very top you are ok if there are no trees around. Of course that decision should be based on the snow_height level variable. The lower it is, the higher the average altitude on the map.
They dont? Oh. But what about the forests? Are they still restricted to > snow_line?
Darkvater wrote:I think how the current algorithm does it is try and place an oil refinery somewhere and if it doesn't go (rough terrain), terraform the ground beneath it to make it fit :).
Nice. Hope it does. I'll check.
Darkvater wrote:Unfortunately I can't test your patch cause I'm going on holiday in a few hours, this are just opinions, suggestions based on what you wrote.

Merry Christmas :P
Lucky you cant test it... it has a bug in the patch file. (Remind me to test the patch *before* uploading it to the forum! ;) ). Ive now updated the patch file - please download again from the OP.
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Re: Santa's Special: TerraGenesis Patch

Post by Darkvater »

richk67 wrote:
Darkvater wrote:High mountains don't have trees anymore. I think at the very top you are ok if there are no trees around. Of course that decision should be based on the snow_height level variable. The lower it is, the higher the average altitude on the map.
They dont? Oh. But what about the forests? Are they still restricted to > snow_line?
Have you ever seen trees in the Alps at a +2500m altitude? I was just comparing it to 'real life' :).
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
User avatar
Gorre
Transport Coordinator
Transport Coordinator
Posts: 322
Joined: 03 Jan 2004 10:28
Location: Somewhere over the rainbow
Contact:

Post by Gorre »

And have you ever seen any industries, large cities and so here too?
User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1518
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Post by SirkoZ »

Please add the revised (as talked about in the above posts) version of this patch to the integrated_nightly_build and release it as soon as possible so we can extensively test it. ;-)
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

SirkoZ wrote:Please add the revised (as talked about in the above posts) version of this patch to the integrated_nightly_build and release it as soon as possible so we can extensively test it. ;-)
My thoughts exactly. Im going to ditch what I'd done for IN... with a new 2090 patch, and a new PNGmap patch, there are a lot of useful changes.
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1518
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Post by SirkoZ »

Nice!

Well - please - do include my 3 patches - I don't think you're going to have any problems integrating them and they are well configurable now.
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Re: Santa's Special: TerraGenesis Patch

Post by richk67 »

Darkvater wrote:
richk67 wrote:On a New Game, the grass terrain starts all mud, and over the next month regrows back. I dont understand why really, as the RunTileLoop is called 0x500 times. Works OK in Editor mode. :roll:
You need to set _generate_world to true before making those land-tiles. Then you end up with green grass. If the only purpose of RunTileLoop is to get the grass 'green', drop it :)
Turns out I was setting .m5 of each modified tile to 0. Should have been setting it to 3. All sorted and working in v3 now.
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Post by MeusH »

Rocks on the peaks of the highest mountains and rocks scattered on the ground in the groups would be much better IMO
Also, would it include the tree-plant patch that plants trees in more realistic groups?
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

MeusH wrote:Rocks on the peaks of the highest mountains and rocks scattered on the ground in the groups would be much better IMO
Also, would it include the tree-plant patch that plants trees in more realistic groups?
Interesting idea re rocks. Yes, the TG patch does include the tree clumping patch too.
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
User avatar
Jim Starluck
Traffic Manager
Traffic Manager
Posts: 135
Joined: 26 Jun 2005 20:12
Location: Cincinnati, OH
Contact:

Post by Jim Starluck »

Any particular reason this hasn't been added to the trunk yet?
If at first you don't succeed, get a bigger locomotive and try again.
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

Jim Starluck wrote:Any particular reason this hasn't been added to the trunk yet?
:lol: it wont be for the moment, but if you look at the plans for v0.5, it has been added there. There is a fair bit of development work to go before then, and I havent had chance to do any yet.

BTW - have you found the patch useful? Does it give you good maps to play? Please let me know. Feedback always help develop it better.
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
User avatar
bobingabout
Tycoon
Tycoon
Posts: 1850
Joined: 21 May 2005 15:10
Location: Hull, England

Post by bobingabout »

most things that do get added only get added once complete :P ... some things just don't get added...
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.

[/url]
User avatar
Jim Starluck
Traffic Manager
Traffic Manager
Posts: 135
Joined: 26 Jun 2005 20:12
Location: Cincinnati, OH
Contact:

Post by Jim Starluck »

richk67 wrote:
Jim Starluck wrote:Any particular reason this hasn't been added to the trunk yet?
:lol: it wont be for the moment, but if you look at the plans for v0.5, it has been added there. There is a fair bit of development work to go before then, and I havent had chance to do any yet.

BTW - have you found the patch useful? Does it give you good maps to play? Please let me know. Feedback always help develop it better.
I haven't been able to use it much...I'm not a coding-type person so I don't know how to add .patch files to the game.

I fiddled around with the Integrated Nightly (which oddly enough is missing some of the things that the actual Nightly has, like articulated locomotive support), and the terrain looked much nicer than the default...which is why I asked.
If at first you don't succeed, get a bigger locomotive and try again.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 5 guests