Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Sun May 26, 2013 1:13 am

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Sun May 06, 2012 11:30 am 
Offline
Tycoon
Tycoon

Joined: Wed Apr 27, 2005 7:09 am
Posts: 4398
In MariCo, I have lots of objects which are buildable both on land and water. For these ones it´d be advantageous to be able to know whether they´re built on land or on water, simply to avoid cluttering the GUI and to spare object-IDs.

However, in TTDPatch/OTTD, it is not possible to obtain that information, neither by var41 (tile information) nor var62 (land info of nearby tiles: checking the landscape class), simply because the former lacks this information, and the latter is changed to class 0a (object) when the object is built.

Therefore, I´d like to propose to enhance the terrain type part of var41 (4 bits) by adding terrain type "water" (8), either for all objects (and industry tiles?) built on water, or only for objects built on water including a water groundtile.

Any objections or alternative ideas?

regards
Michael

_________________
Image


Top
 Profile  
 
PostPosted: Sun May 06, 2012 11:45 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 6980
Location: Sol d
Make simply use of the waterclass bits in the nearby terrain type, identical to industry tiles variable 0x60 with relative offset 0,0.
EDIT: for objects, it's variable 0x62. 0x41 might even contain that info, too.

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML


Top
 Profile  
 
PostPosted: Sun May 06, 2012 11:58 am 
Offline
Tycoon
Tycoon

Joined: Wed Apr 27, 2005 7:09 am
Posts: 4398
planetmaker wrote:
Make simply use of the waterclass bits in the nearby terrain type, identical to industry tiles variable 0x60 with relative offset 0,0.
EDIT: for objects, it's variable 0x62. 0x41 might even contain that info, too.

As explained above, that does not work. As soon as the object is placed that information is lost.

regards
Michael

_________________
Image


Top
 Profile  
 
PostPosted: Sun May 06, 2012 12:06 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 6980
Location: Sol d
As shown in the attached screenshot: it does. Use bits 5 and 6 of the 'bb' field. Checking bit 1 is NOT sufficient.


Attachments:
Eslund Transport, 1999-01-20.png [64.34 KiB]
Downloaded 2 times

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Top
 Profile  
 
PostPosted: Sun May 06, 2012 12:40 pm 
Offline
Tycoon
Tycoon

Joined: Wed Apr 27, 2005 7:09 am
Posts: 4398
planetmaker wrote:
[...] Use bits 5 and 6 of the 'bb' field.

Well, yes. But using "water classes" is more like a workaround in this case, because the higher-ranking entity (bit1 - "the tile has water on it") does not work if being overbuilt. To my knowledge, bits 5 .. 6 have only been introduced to further distinguish the type of water, if available at all. IMO, it makes no sense if the bit which means "tile has water on it" doesn´t report any water, but the subordinate bits report "water is sea/canal/river".

Wouldn´t it be a clean implementation to have water reported in either var41 or by bit1 in var62 if available at all? And leave var62/60 bits 5 .. 6 for further narrowing it down?

regards
Michael

_________________
Image


Top
 Profile  
 
PostPosted: Sun May 06, 2012 12:47 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 6980
Location: Sol d
Consider bits 5...6 have been introduced to actually report the type of water more consistently than before, including whether there is water at all. You can use them exclusively to check for the presence of water (!= 0) and the type (actual value).

Changing the meaning and behaviour of the other bits, especially bit 1, as you suggested would have broken (some) existing (industry) NewGRFs.

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML


Top
 Profile  
 
PostPosted: Sun May 06, 2012 2:44 pm 
Offline
Tycoon
Tycoon

Joined: Wed Apr 27, 2005 7:09 am
Posts: 4398
planetmaker wrote:
Consider bits 5...6 have been introduced to actually report the type of water more consistently than before, including whether there is water at all.

IMO, this is something like a "hack". In fact, it seems that unfortunately nobody ever noticed the lack of such a check (i.e., outside a CB). But to have more than one var for the same thing, with both reporting different facts is something which needs getting used to, to say the least.

planetmaker wrote:
Changing the meaning and behaviour of the other bits, especially bit 1, as you suggested would have broken (some) existing (industry) NewGRFs.

I don´t think so. Both of my proposals would be downward compatible. W/r to var41 (I would have prefered that solution), bit 4 hasn´t been in use at all, and w/r to var60/62 bit1, there´s no real use for it in this context, except checking it when in a CB (i.e. before object/industry tile is actually being built), so no problem with older sets.


Anyway, thanks for your response.

regards
Michael

_________________
Image


Top
 Profile  
 
PostPosted: Sun May 06, 2012 7:58 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Wed Dec 20, 2006 1:31 pm
Posts: 680
Location: Aschaffenburg
Industry tile variable 60 says: (important part emphasised)
* Bit 1: The tile has water on it. This flag is set for coasts as well. If you need a full water tile, check the slope data as well. If it's zero (flat tile), the tile is fully watered.
* Bit 5-6: Water class: 0 - undefined / land; 1 - sea; 2 - canal; 3 - river. This is not the same as bit 1, as e.g. an industry tile can have a water class but has bit 1 unset.

So, bit 1 is meant to identify real plain water and nearby coasts. The water class otoh is exactly meant for your purpose to identify the water-ness of a tile, independent of its "tile class".

_________________
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB © 2000-2013 phpBB Group

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2013.
Hosted by Zernebok Hosting.