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

Rinnsal
Engineer
Engineer
Posts: 27
Joined: 18 May 2006 10:39
Contact:

Post by Rinnsal »

with the 5105 patch on that version i get 2 errors:

openttd error LNK2001: unresolved external symbol @GenerateTerrainPerlin@8

openttd error LNK2001: unresolved external symbol @ShowGenerateLandscape@4


Any solution to this?

ok, seems i missed to add the 3 tgp files to the solution. after adding them, i get many redefinition errors...
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

Rinnsal wrote:with the 5105 patch on that version i get 2 errors:
Any solution to this?
Yup, I missed the additional files from the VS .vcproj files. (I dont know it well; Im a MingW32 man myself!)
ok, seems i missed to add the 3 tgp files to the solution. after adding them, i get many redefinition errors...
TGP includes 3 new files. It is a "feature" of TortoiseSVN and many other patch systems, that if a new file is added (but is already there), it adds a duplicate copy of the text each time you patch.

Solution is to go into tgp.c, tgp.h, and tgp_gui.c, and delete away the second (third, fourth ;) ) copy. Look for a second $Id marker. All from there is repeat copy.

Alternatively, delete the three files, and repatch. It will definitely be clean then.

This is one of those quirks that once you know of it, you wont get caught again!! :)
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
Rinnsal
Engineer
Engineer
Posts: 27
Joined: 18 May 2006 10:39
Contact:

Post by Rinnsal »

thanks, it works now ;) But i encounter a little problem with it: If I don't use the "Generate" Button in the Terrain generator for a new seed it runs some kind of endless loop.
User avatar
Thief^
Route Supervisor
Route Supervisor
Posts: 469
Joined: 10 Oct 2004 00:11

Post by Thief^ »

In miniIN playing multiplayer with "generate random" crashes if I haven't generated a random map in single player yet...
Also it doesn't come up with the random terrain gui.
Melt with the Shadows,
Embrace your destiny...
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

Rinnsal wrote:thanks, it works now ;) But i encounter a little problem with it: If I don't use the "Generate" Button in the Terrain generator for a new seed it runs some kind of endless loop.
If you mean, it repeats the same terrain for the same seed in the Scenario Generator; that is by design.

If you start a New Game, the seed is randomised every time, and you will get a new terrain each time. In the Scenario Editor, you want something different; to experiment with a terrain, until you get what you want. So it only changes the Random seed, when you click the Random button.

This lets you test "what does this same terrain look like, with lower hills, with more water"... and watch as the terrain changes but based on the same basic look.

However; TGP has a bug which caused a bad amount of desyncing. I have cured this (I think) in my dev version, but havent posted the corrections. That will happen soon.
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 »

Thief^ wrote:In miniIN playing multiplayer with "generate random" crashes if I haven't generated a random map in single player yet...
Also it doesn't come up with the random terrain gui.
Not quite clear what you mean, but Im guessing you mean when setting up a server the gui doesnt appear if you try to start a new network game with TGP.

Yes, not a bug; just not got there yet - Work In Progress and all that. Should not be too difficult - famous last words ;)

However, dedicated servers *are* supported; edit the DS config to have tgen_noise_seed = 0. This will instruct the dedicated server to pick a random seed, and continue. All other settings are also in the config file.
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
Thief^
Route Supervisor
Route Supervisor
Posts: 469
Joined: 10 Oct 2004 00:11

Post by Thief^ »

Yeah, that's what I meant. I also meant that if I don't go generate a map in single-player first picking "random" in the start multiplayer server crashes openttd. It should just randomise a map I think.
Melt with the Shadows,
Embrace your destiny...
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

Thief^ wrote:Yeah, that's what I meant. I also meant that if I don't go generate a map in single-player first picking "random" in the start multiplayer server crashes openttd. It should just randomise a map I think.
Its not happening here; it could have been one of my dodgy maps. If the error was a tile>Tileheight assert, then yes, it will have failed in generation. There are a few bugs in generation to iron out. Im working on them 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
Thief^
Route Supervisor
Route Supervisor
Posts: 469
Joined: 10 Oct 2004 00:11

Post by Thief^ »

I'm obviously not getting my point across. The problem is not the generator, it's starting a multiplayer game without generating a random map in single player first, but picking "random" anyway.

Then again, this could already be fixed and I could be looking like an idiot for using a two-day old build.

EDIT: interesting, before it was doing it every time, now it's not doing it at all. I haven't even updated the exe. Ignore me now, I guess.
Melt with the Shadows,
Embrace your destiny...
MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Post by MeusH »

richk67, maybye it would be better to rename the "random" button to "randomize" as it actually randomizes a seed, not generates a new map
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

Thief^ wrote:I'm obviously not getting my point across. The problem is not the generator, it's starting a multiplayer game without generating a random map in single player first, but picking "random" anyway.

Then again, this could already be fixed and I could be looking like an idiot for using a two-day old build.

EDIT: interesting, before it was doing it every time, now it's not doing it at all. I haven't even updated the exe. Ignore me now, I guess.
It would be really handy to know what the error was though. If it happens again, let me know.

If I delete the config.cfg file, then try your test, the noise seed is zero. This is a special value that tells the generator to pick a random number anyway, so that a dedicated server can get a random map without having to have a dialog box. This bit is pretty crash-proof.

Most likely, you had some unlucky generations that hit the tile < Tileheight bug. Im hunting it.
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 »

Im trying to come up with ideas for the TGP generation screen in both the NewGame and ScenGen versions....

Current ideas:

Items to add to both:
  • No. of towns, no. of industries,
    Use TerraGenesis / Traditional map
    Snow Line Height

Items to add to just ScenGen version:
  • Generate as NewGame which has checkboxes for:
    Towns, Industries, Trees, Rocks, Lighthouses, Transmitters
    Max Terrain height - some people want the TGP coastlines, but with an ultra-flat terrain; this would apply a maximum height. You would be warned if the height selected drops below the expected maximum for the terrain type. ie. 15 for Mountainous, 12 for hilly, ~8 for Flat, ~5 for Very Flat

ScenGenMap Specials:
  • Flat height 1 fill - no map gen, just raises all tiles to height 1
    No water - generates a TGP map, but then raises all water to height 1
Any other ideas??
Attachments
The current ScenGen screen
The current ScenGen screen
screenshot #8.png (16.97 KiB) Viewed 4073 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 »

To do list (and general ideas):
  • Bias transmitters to hills, bias lighthouses to headlands.
    Experiment with regional industries; clump together 2/3rds of an industry type within 1/4 of the map radius of first placed industry. So on a 512 map, 2/3rds of coal must be within 128 radius of the first coal.
    Bias towns > 500 pop towards water if there is any water within radius 8-10.
    Tone down the "Build Random Industries" to only build a few industries, rather than the plague it currently builds. If you need more, just click the button a few more times.
    Have the "Build Random Towns" build towns of the size indicated on the selection panel. Currently it just builds a totally random set of town sizes.
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
pshemko
Engineer
Engineer
Posts: 104
Joined: 24 Sep 2004 02:43
Location: Aotearoa (New Zealand)

Post by pshemko »

All your sugestions sound great. I have just one more :-)
With the 'automagic' placement of towns/industries is it possible to take the 'land area' into the equation? I like playing archipelagos (sea level - high) which results in relatively small land mass, with all the towns and industries crammed toghether. When you add 'very rough' and 'mountainous' you get an amazing maze :-) (even with number of tows/industries to low/low).
I like your patch very much, especially after latest corrections - with real peaks :-)
User avatar
Wolf01
Tycoon
Tycoon
Posts: 2016
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Post by Wolf01 »

what about changing the snow limit when in scenario editor instead of remake the whole map?
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

Wolf01 wrote:what about changing the snow limit when in scenario editor instead of remake the whole map?
Ive not looked into it, but I think its not entirely straightforward. This is really a feature for the Snow In Temp patch, rather than TGP. Also, the town buildings are picked depending on the snow line; so its quite important to get it right first time.
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 »

Here is an update with a couple of bugfixes; not all the ones listed in the thread tho... so dont nag me about not having fixed "your" problem.

The pic shows the new (and IMO) improved Generate Terrain screen, now with the Town & Industry selectors on it.

Others will follow soon(ish).
Attachments
TerraGenesisPerlin_v3r_5227.patch
TGP updated to r5227
(56.58 KiB) Downloaded 264 times
New Generate Terrain screen.
New Generate Terrain screen.
screenshot #9.png (17.38 KiB) Viewed 3973 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
thepizzaking
Traffic Manager
Traffic Manager
Posts: 198
Joined: 08 Aug 2005 07:47
Location: Melbourne, Victoria, Australia
Contact:

Post by thepizzaking »

Just being pedantic here, but as the english.txt file is for UK english, the STR_RANDOM should be 'Randomise', not 'Randomize'
I'm A Cobra (or so the rumours go) :)
Get OpenTTD, It's awesome!!
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

thepizzaking wrote:Just being pedantic here, but as the english.txt file is for UK english, the STR_RANDOM should be 'Randomise', not 'Randomize'
I think the OED currently has both as acceptable; but you can bet your bottom dollar (not euro or pound) that if I had used Randomise, someone would have said "Its spelt Randomize". I knew I couldnt win on it (why did you think I had Random in the first place ;) ).

I suppose since there is an american.txt, then I can have it in the English version as Randomise (my preference), and the Yanks can convert it :)
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
Brianetta
Tycoon
Tycoon
Posts: 2567
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Post by Brianetta »

In British English, randomize is historically correct, but either are fine in the UK today - according to the OED. Still, the spirit of Webster should live on - the American language is different from the British language not by accident, but design. Something symbolic to do with the independance of the colony, so I believe. So, let's be nice and spell it with an s. (:
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 11 guests