Page 5 of 9

Posted: 30 Apr 2006 12:41
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.

Posted: 01 May 2006 15:55
by KUDr
XeryusTC wanted to apply tgpsnow_r4601.patch against my YAPF branch and got tons of errors. So if anybody is interested...

Posted: 01 May 2006 18:15
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. :)

Posted: 01 May 2006 18:57
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).

Posted: 01 May 2006 20:08
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

Posted: 01 May 2006 23:20
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 :)

Posted: 02 May 2006 05:33
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!

Posted: 30 May 2006 05:13
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.

Posted: 30 May 2006 06:40
by WWTBAM
read all of rich's latest posts

Posted: 30 May 2006 08:45
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.

Posted: 30 May 2006 09:17
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.

Posted: 30 May 2006 10:02
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) :)

Posted: 30 May 2006 15:53
by bobingabout
richk67 wrote:love the PHB (pointy-haired boss) :)
he's awsome :P

Posted: 30 May 2006 17:25
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

Posted: 04 Jun 2006 23:53
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 :)

Posted: 05 Jun 2006 00:48
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.)

Posted: 05 Jun 2006 01:11
by Hazelrah
Just have to say, looking good! Three cheers for richk67!

-Hazelrah

Posted: 05 Jun 2006 13:40
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. :)

Posted: 05 Jun 2006 17:12
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!

Posted: 07 Jun 2006 16:24
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.