Page 4 of 9

Posted: 26 Apr 2006 20:09
by Loop
richk67 wrote:On a similar vein, I am a little disappointed with how often towns are built just outside the reach of shipping. I may introduce a bias to the town placement that if there is any water within 10 tiles, it moves the town centre to within 3 tiles of the water's edge.
This is a very, very good idea. And a realistic one! Most of the towns were built near some kind of water basins - mostly rivers, but also lakes, ponds etc. And also, when there was a sea/ocean ( :P ) nearby, it was better to build the settlement there (fish, trade).

Posted: 28 Apr 2006 00:08
by richk67
Here is something a little different - TGP with temperate snow.

Its a combination of the TGP patch (r4600) and the Snow In Temperate patch (r4601). Snow in Temperate works properly; it isnt just the graphics. Towns above the snowline need food to grow, tree types adjust to the snow line. Forests use the different snow/temp graphics dependent on the snowline, and some other industries have snowy ground tiles where needed.

Posted: 28 Apr 2006 06:54
by Brianetta
Where does one find food in a temperate climate game?

Posted: 28 Apr 2006 06:56
by sidew
That is my dream... :shock:

Many thanks, richk!

I'll update my italian town patch to latest revision and i'll try combining both...

Posted: 28 Apr 2006 07:40
by AlienDNA
Brianetta wrote:Where does one find food in a temperate climate game?
A valid question indeed. Perhaps it is time to make some work of new industries, so this excellent feature can be implemented.

Posted: 28 Apr 2006 08:46
by Jango
i personally would like to see all the industries in the original game (baring toyland) and maybe all the vehicles too, all within the temperate climate - maybe even with some desert ;)

Posted: 28 Apr 2006 09:15
by richk67
Brianetta wrote:Where does one find food in a temperate climate game?
Oops... oh yeah! Until we get industries in any climate, I'd better remove that bit! Dunno what came over me!

Posted: 28 Apr 2006 09:17
by richk67
Jango wrote:i personally would like to see all the industries in the original game (baring toyland) and maybe all the vehicles too, all within the temperate climate - maybe even with some desert ;)
Unfortunately desert and snow are mutual exclusive.

Posted: 28 Apr 2006 11:21
by Darkvater
richk67 wrote:
Jango wrote:i personally would like to see all the industries in the original game (baring toyland) and maybe all the vehicles too, all within the temperate climate - maybe even with some desert ;)
Unfortunately desert and snow are mutual exclusive.
Yeah, we definitely need an all-climate map :D.
It is true snow/desert are mutually exclusive but the snow/desert bit can just simply be moved seperate and then they won't :). Of course for this to work it needs some more work; a lot more work.

- which climate to identify this new one with?
- probably would break a lot of newgrf stuff
- clean up the mess of industries/cargos
- new graphcs, mainly temperate > desert, temperate > rainforest, snow > rainforest
- probably some few more, but it would be absolutely stunning :D

Posted: 28 Apr 2006 11:59
by bobingabout
Darkvater wrote: - which climate to identify this new one with?
the 5th 1
Darkvater wrote: - probably would break a lot of newgrf stuff
unfortunatly, this is true
Darkvater wrote: - clean up the mess of industries/cargos
you've basicly got 2 options here, but i'd go with the newGRF new industries method, which would mean you need to do the newGRF new industries support.
Darkvater wrote: - new graphcs, mainly temperate > desert, temperate > rainforest, snow > rainforest
for a graphixler, this should be pretty easy actually.
Darkvater wrote:- probably some few more, but it would be absolutely stunning :D
would just be awsome to do it.

Posted: 28 Apr 2006 12:03
by Brianetta
bobingabout wrote:
Darkvater wrote: - which climate to identify this new one with?
the 5th 1
The one for which no newgrfs have been written? I can see that being popular.

Posted: 28 Apr 2006 12:13
by richk67
Darkvater wrote:Of course for this to work it needs some more work; a lot more work.

- which climate to identify this new one with?
- probably would break a lot of newgrf stuff
- clean up the mess of industries/cargos
- new graphcs, mainly temperate > desert, temperate > rainforest, snow > rainforest
- probably some few more, but it would be absolutely stunning :D
And I would then create my USA scenario (2048x1024) which needs every climate from green flatlands and temperate forest, Rocky Mountains in snow with high altitude forests, Cuba & Mexico with tropical forests, deserts for Arizona etc. I have the terrain map, but it desperately needs multi-climate support. I didnt want to populate the map with towns & cities until the map could support more climates.

Newgrf has the problem that many of the newgrfs hard-replace graphics inside the core sets to achieve a pseudo-effect. This OTTD solution would be true extension of the climates, not faking replacement/addition of new industries.

As I see it, there are 3 major task areas:
1) Modify map for desert bits to co-exist with snow. Maybe not too difficult - but would need to carefully add a translator for old games. I will investigate this for TGP4. If I can get desert graphics into the temperate map, then that is getting close to preferred multi-climate effect. (but with restriction that only temperate vehicles & industries are available). It does raise the question of how to decide if some terrain is desert... ok for ScenGen scenarios, where the player can "paint" desert on (especially using my dither tool for delicate feathering of the edges), but in an auto-generated game, the decision is harder to make.
2) Industry graphics already work 100% in all climates. Some graphics though have the ground tile painted in (eg. temperate iron ore mine), so on the "wrong" terrain, the graphic looks odd. The whole arrangement of ground tile and building tile is a mess. For some, there is a proper ground sprite, and a separate building sprite with transparent base. However, some have a fixed-climate base, and some have the building sprite in the ground sprite itself. A mess in other words.

OTTD cargo scheme has hard-coded overlaps, and in my view, best solution is to abandon current OTTD cargo definitions for the TTDP global cargo definitions. A big job, in many areas. However, some of the mechanisms are already in place within the newgrf code to translate from TTDP to OTTD cargos. All we need to do is not convert - but use the TTDP values throughout. Again a translator is required for savegames.
3) Allow multiple vehicle sets to co-exist at the same time. This is a really big and nasty piece - definitely need lots of peter1138's experience here. I have little idea of what knock-on effects this may have, but its the sort of thing that IMO would in itself raise the release a whole point... ie. 0.5.0 to 0.6.0. Big nasty - dont want to think about it. :)

Posted: 28 Apr 2006 12:22
by richk67
bobingabout wrote:
Darkvater wrote: - probably would break a lot of newgrf stuff
unfortunatly, this is true
Shock, horror... newgrf having to catch up with OTTD ... Im sure some people would be pathologically opposed to anything implying OTTD can do more than newgrf! ;) (its a joke ok... not a cue for an argument)
Darkvater wrote: - clean up the mess of industries/cargos
you've basicly got 2 options here, but i'd go with the newGRF new industries method, which would mean you need to do the newGRF new industries support.
Sort of halfway. You change the underlying data structure in OTTD to support & use TTDP cargo types as its default type. This would be sufficient to unblock the industries, and allow them to co-exist. Its not far off already.

Newgrf support is useful, but IMO we should code something that allows a greater breadth of support, within which current newgrf newindustries is enclosed. ie. if newgrf has limits, as long as OTTD supports at minimum those limits, there is no reason why OTTD should not go beyond. eg. IF newgrf newindustries can only allow 128 cargo types, there is no reason why OTTD should limit to that, when 256 is more and provides the minimum. (hypothetical - I dont know what the newgrf limit is - its an example of the principle not the detail). When it comes to limits, I dont see why OTTD should limit itself in any way... we aren't trying to win a competition to see how compact a data structure we can create! (eg. railtype vs. railtypemask - both describe what railtypes there are, but one uses 2x as many bits, but is far more flexible.)

The problem are the vehicles, as you would need to have a combined set of wagons that have all the industry cargo types (why we dont have wagons & cargos in separate grfs to the locos I dont know... its a logical separation IMO).
I have been thinking on this for a while, and if someone wanted to work on the cargo side, I would be happy to extend TGP to provide multi-climates. Any takers?

Posted: 28 Apr 2006 14:21
by SpecialK
richk67 wrote:
Jango wrote:i personally would like to see all the industries in the original game (baring toyland) and maybe all the vehicles too, all within the temperate climate - maybe even with some desert ;)
Unfortunately desert and snow are mutual exclusive.
You, my good friend, have obviously not been to the mountains outside of Phoenix or Salt Lake or eastern Oregon any of the western high desert states. It snows there, heavily, even down to the desert floor.

Posted: 28 Apr 2006 15:32
by richk67
SpecialK wrote:
Unfortunately desert and snow are mutual exclusive.
You, my good friend, have obviously not been to the mountains outside of Phoenix or Salt Lake or eastern Oregon any of the western high desert states. It snows there, heavily, even down to the desert floor.
True, nor to the Tibet Plateau, or the Gobi Desert. I was meaning "in OTTD currently" desert and snow are mutually exclusive - they actually use the same bits in the map array!

Posted: 28 Apr 2006 17:31
by DaleStan
richk67 wrote:When it comes to limits, I dont see why OTTD should limit itself in any way... we aren't trying to win a competition to see how compact a data structure we can create! (eg. railtype vs. railtypemask - both describe what railtypes there are, but one uses 2x as many bits, but is far more flexible.)
It seems to me that you can pack 256 rail types into 8 bits, but a railtypemask for 256 types will require something slightly more than 16 bits. Did you possibly mean 2^x bits?

Exponential increase is a substantially different matter than geometric increase.
richk67 wrote:(why we dont have wagons & cargos in separate grfs to the locos I dont know... its a logical separation IMO).
No, it's not.
Take, for example, the Hiawatha: Image or the Daylight: Image
Where do the wagon sprites go? With the engine, or with all the other sprites for that wagon?

Posted: 28 Apr 2006 19:10
by richk67
Note to self: dont respond to Dale-baiting.... nope, cant not do.
DaleStan wrote:It seems to me that you can pack 256 rail types into 8 bits, but a railtypemask for 256 types will require something slightly more than 16 bits. Did you possibly mean 2^x bits?
No, I meant specifically that OTTD currently has RailType with 4 values 0=rail,1=elec,2=mono,3=mag. But RailTypeMask does a bit mapped version so you can have "rail+elec". RailType represented in 2 bits, RailTypeMask in 4 bits. Last time I checked 4=2x2. I made no inference beyond that to higher levels of bitmapping.
richk67 wrote:(why we dont have wagons & cargos in separate grfs to the locos I dont know... its a logical separation IMO).
Why do I have to specify everything to the Nth degree for the pedants. I KNEW someone would go "what about dedicated rakes?" Well, duh! You keep dedicated rakes together; I think a coal wagon is a separate quantity to a loco; to me they are logically separate. Clearly MUs, and passenger coaches in general, are closely related to their MPU. To me, a passenger coach is a coach, not a wagon.

The ONLY example I know of of "freight" wagons that are in dedicated rakes are the Chunnel car-ferry trains. And no doubt someone else will argue that differently.

I would separate: mineral wagons, goods wagons, etc. etc. from motive power. Only coaches in fixed rakes with the motive power make any sense in with the locos. This would then give more flexibility as you could have different freight wagons, loads, etc., with the same locos. No doubt the answer is Jesus, err I mean Newgrf.

(And some poor bugger will have to code the support for it... )

Bug

Posted: 29 Apr 2006 15:47
by bruce89
I have found a bug, when you are in the landscape generation dialog, and you choose toyland, the water in the background game turns teal. This is with r4593M - Integrated build.
edit --- It's actually the background sample game at the start that is affected.

Re: Bug

Posted: 29 Apr 2006 21:20
by richk67
bruce89 wrote:I have found a bug, when you are in the landscape generation dialog, and you choose toyland, the water in the background game turns teal. This is with r4593M - Integrated build.
Its meant to. It is the standard graphic for Toyland water... and people wonder why no-one plays toyland ;)

Posted: 30 Apr 2006 12:15
by Darkvater
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.