TerraGenesis Perlin

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:

Post by richk67 »

Darkvater wrote:I've had some thinking about the progress window. Apart from doing any threads anything else is really hacky. What you can do however is use a global variable-counter, for example _terrain_generation that is incremented after a certain part is done (eg towns/industries/terrain/whatever). After each section you return control to the main game so the gameloop, etc is run. This causes any dirty blocks to be drawn and you are safe.

All you need to add is a GM_GENERATOR or similar _game_mode. I think that is a doable solution apart from threading the whole thing.
I think I will park this for now; I dont want to spend time trying to add a wishlist feature, and not have TGP ready for 0.5.0 inclusion. I will keep the code Ive done so far in a backup version, and resurrect it later. Thanks for all your help.
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
KUDr
OpenTTD Developer
OpenTTD Developer
Posts: 219
Joined: 11 Jan 2006 21:36
Location: Czech Republic

Post by KUDr »

XeryusTC wanted to apply tgpsnow_r4601.patch against my YAPF branch and got tons of errors. So if anybody is interested...
Attachments
tgpsnow_r4647.patch
Apply this against /branch/yapf (r4647)
(46.87 KiB) Downloaded 254 times
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

KUDr wrote:XeryusTC wanted to apply tgpsnow_r4601.patch against my YAPF branch and got tons of errors. So if anybody is interested...
It compiles fine against trunk. I'll worry about getting it compiled with YAPF when YAPF is in trunk. :)
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
KUDr
OpenTTD Developer
OpenTTD Developer
Posts: 219
Joined: 11 Jan 2006 21:36
Location: Czech Republic

Post by KUDr »

richk67: what difference it would make? The YAPF is synced with trunk periodically (last sync with trunk r4626). But that tgpsnow_r4647.patch is against YAPF. So when YAPF will be in trunk, it should be the same (or similar).
User avatar
XeryusTC
Tycoon
Tycoon
Posts: 15415
Joined: 02 May 2005 11:05
Skype: XeryusTC
Location: localhost

Post by XeryusTC »

KUDr wrote:XeryusTC wanted to apply tgpsnow_r4601.patch against my YAPF branch and got tons of errors. So if anybody is interested...
/me starts hailing KUDr
You made it possible to use two of my favorite non-trunk features in OTTD :D. Thank you verry much! :D
Don't panic - My YouTube channel - Follow me on twitter (@XeryusTC) - Play Tribes: Ascend - Tired of Dropbox? Try SpiderOak (use this link and we both get 1GB extra space)
Image
OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone
Image Image Image Image Image Image Image
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

KUDr wrote:richk67: what difference it would make? The YAPF is synced with trunk periodically (last sync with trunk r4626). But that tgpsnow_r4647.patch is against YAPF. So when YAPF will be in trunk, it should be the same (or similar).
My main concern was with the "tons of [unidentified, unspecified] errors"... please dont make me panic... TGP needs to be ready for 0.5.0 :)
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
KUDr
OpenTTD Developer
OpenTTD Developer
Posts: 219
Joined: 11 Jan 2006 21:36
Location: Czech Republic

Post by KUDr »

richk67: sorry, next time i will express more carefully. I just wanted to share the result of the hard work merging YAPF with pached 4601. I think tgp works fine with YAPF now. I use it too and I like it. Good work!
pshemko
Engineer
Engineer
Posts: 104
Joined: 24 Sep 2004 02:43
Location: Aotearoa (New Zealand)

Post by pshemko »

What are the chances of incorporating perlin generator into the trunk? I know that there are some problems with the snowline, but this is probably not as important as the generator.
User avatar
WWTBAM
Moderator
Moderator
Posts: 3689
Joined: 02 Apr 2005 07:01
Location: Sydney NSW Antipodea
Contact:

Post by WWTBAM »

read all of rich's latest posts
Formerly known as r0b0t_b0y2003, robotboy, roboboy and beclawat. The best place to get the most recent nightly builds of TTDPatch is: http://roboboy.users.tt-forums.net/TTDPatch/nightlies/
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

pshemko wrote:What are the chances of incorporating perlin generator into the trunk? I know that there are some problems with the snowline, but this is probably not as important as the generator.
No problems with snowline last time I checked ;) However, there are some problems with the smaller maps - 64x64 can often produce an ocean with no land; and then OTTD crashes as it cannot place a town. I may incorporate the old TerraGenesis (which uses a different method), as it produced good small maps.

I also need to create a more comprehensive gui - but once that is done, then it should be ready for 0.5.0 inclusion.
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

Post by Darkvater »

When fixing stuff in the branch, DO clearly label and seperate them. Eg do not mix TG fixes with airports (just an example). This will really help when merging back in.
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:

Post by richk67 »

Darkvater wrote:When fixing stuff in the branch, DO clearly label and seperate them. Eg do not mix TG fixes with airports (just an example). This will really help when merging back in.
Didnt think I had! I am keeping my MiniIN and TGP developments separate; although when I update TGP, I then import the changes into my MiniIN branch.

I dont think the MiniIN source should be used to update trunk. Although there are currently no MiniIN TGP-specific mods, I would rather the upload come from my TGP dev source, which is kept synced with trunk anyway.

[edit] BTW - love the PHB (pointy-haired boss) :)
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 »

richk67 wrote:love the PHB (pointy-haired boss) :)
he's awsome :P
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.

[/url]
MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Post by MeusH »

bobingabout wrote:
richk67 wrote:love the PHB (pointy-haired boss) :)
he's awsome :P
Yeah, DV is awesome :D

So do Rich67's patches
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

Here is a new patch for TGP, fixing an awkward bug in the industry placement algoirthm. Please extensively test it with all sorts of nasty situations.

The seed is now a uint, which gives a massive improvement in the terrain variety. (If you test the old one a lot, you will notice there tends to be a valley along the leading diagonal!)

The best thing in this version tho: MOUNTAIN TOPS... yes, shouting from them!! I found a way to scale the generated terrain to fit better. On mountainous, the terrain can go all the way to level 15. On Hilly, it can go to level 12/13.

This has given a step-change in the quality of terrain coming out of it; arctic landscapes with snow just look awesome!

Have fun... I am now working on the gui. I have reorganised it into its own file, and this will make it easier to maintain. This is now the only major issue before I nag DV to let it into trunk :)
Attachments
TerraGenesisPerlin_v3p_5105.patch
TGP against r5105.
(53.75 KiB) Downloaded 290 times
improved terrain
improved terrain
tgp2.png (23.87 KiB) Viewed 5202 times
A mountain peak
A mountain peak
screenshot #6.png (73.44 KiB) Viewed 1670 times
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
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

Just another quick screenshot; this time from the MiniIN branch with new TGP included. This is a random peak; the only editing Ive done is to clear some trees to make the peak obvious. (Maybe that should be one of the next mods; an upper tree-line, above which only snow.)
Attachments
Gatfingfield Transport, 20th Jul 2010.png
Gatfingfield Transport, 20th Jul 2010.png (172.94 KiB) Viewed 1706 times
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
Hazelrah
Traffic Manager
Traffic Manager
Posts: 196
Joined: 13 Apr 2005 05:41

Post by Hazelrah »

Just have to say, looking good! Three cheers for richk67!

-Hazelrah
User avatar
White Rabbit
Tycoon
Tycoon
Posts: 1734
Joined: 22 Jun 2005 19:15

Post by White Rabbit »

I'd still like to see a mix of peaks and plateaus though. It may not make sense that there are plateau's everywhere, but they do exist and can add to the gameplay.

EDIT: Ah...a nice palindromic post number. :)
Image
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

White Rabbit wrote:I'd still like to see a mix of peaks and plateaus though. It may not make sense that there are plateau's everywhere, but they do exist and can add to the gameplay.

EDIT: Ah...a nice palindromic post number. :)
Some do occur "naturally" now anyway, and also ridges, spurs, etc... I would LOVE to have terrain that could change more than one level; TGP would then immediately have cliffs as well!
Attachments
A nice river I spotted :)
A nice river I spotted :)
TGP2, 17th Jan 1955.png (54.98 KiB) Viewed 5058 times
Plateau
Plateau
TGP3, 24th Jan 1955.png (49.9 KiB) Viewed 5056 times
Mountain plateau with spur
Mountain plateau with spur
TGP, 17th Jan 1955.png (45.11 KiB) Viewed 5057 times
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
3D_Grabber
Engineer
Engineer
Posts: 6
Joined: 06 Jun 2006 21:58
Location: Zürich, Switzerland

Post by 3D_Grabber »

Great work! Looks awesome!
...Starting at halfway across the map (diagonally), the maximum terrain height is reduced steadily (its actually a COSine wave), until the terrain is lower and flatter...
Good idea, I would suggest to place the "bump" of the cosine in the center of the map (distance from center as parameter). I guess this would produce more continent kind of landscapes. Mountaineous regions in the center and "sandy" deserts (beaches?) at the edges. Maybe add some little input parameter to tweak the effect ( Cos( p*x ) ). This could also prevent the land from appearing to be "cut off" by the map edges, as one can see on your screenshot in the above post. I would like to have this option for all maps, not just tropical.
I just don't like the diagonal effect, it looks unnatural. In the current release random generator it look really bad.

Speaking "I wanna this, I wanna that": Heightmaps Import pleeeez! Go to simtropolis.com an see the thousands of heightmaps uploaded by users. It's so fun to play real-life scenarios. User DaleStan seems to have a well working patch. Why not join forces with him and place a little import button in your gui? The good thing about heigthmaps is that you can use satallite images, any gfx or fractal prog to generate them, i.e. many more features you can ever implement here.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 17 guests