New map features

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

User avatar
JGR
Tycoon
Tycoon
Posts: 2560
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: New map features

Post by JGR »

As much as it'd be better to solely use newgrf properties, as this feature would only exist in non-trunk versions, it seems unrealistic to expect any significant subset of past or future newgrf authors to choose to implement it. Having some sort of fallback such as allowing bridges over roofless stations is probably necessary for the feature to be of practical use with newgrf stations.
Ex TTDPatch Coder
Patch Pack, Github
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: New map features

Post by Eddi »

i think adding this property should have been done years ago, so NewGRF authors could have had time to prepare. it's not like the discussion is new or anything...

also, there isn't really something in the way of adding this to trunk, as the NewGRF thing is the only real issue holding it back.
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

cirdan wrote:Alternatively, we can also tell users not to use a tall rail station tile under a bridge? It is not as if the particular station tile choice has any impact on gameplay, right? Is there any NewGRF out there that only offers roofed tiles?
Eddi wrote:I would really like this to be done properly with a NewGRF property similar to bridge height for objects.

this means, any existing NewGRF stations would be excluded from having bridges over them. relying on the fallback graphics type is not reliable, and any hacks involving sprite height or stuff are nonsense.
JGR wrote: As much as it'd be better to solely use newgrf properties, as this feature would only exist in non-trunk versions, it seems unrealistic to expect any significant subset of past or future newgrf authors to choose to implement it. Having some sort of fallback such as allowing bridges over roofless stations is probably necessary for the feature to be of practical use with newgrf stations.
Eddi wrote:i think adding this property should have been done years ago, so NewGRF authors could have had time to prepare. it's not like the discussion is new or anything...

also, there isn't really something in the way of adding this to trunk, as the NewGRF thing is the only real issue holding it back.
wallyweb wrote:Caveat Emptor - Buyer beware:
Allow bridge building at any level.
Considering the above suggestions as well as HackaLittleBit's, kamnet's, Quast65's and Streckenläufer's thoughts and questions, how about the following? ...
For evaluation purposes, code a NMF diff/patch that allows any level bridge over road, rail and sea stations, waypoints, buoys and depots with a warning in the diff/patch release post that the feature is for player evaluation and is not saved game safe pending the development of a proper NewGRF Specification.
This will give everybody a chance to see and comment upon what works and what does not work from a graphical point of view and give Cirdan an opportunity to resolve any coding bugs.

Once a NewGRF Specification has been done and tested, it can be included in the default station hard code. Authors of existing GRFs can then decide whether to update their code with this property. Authors of future GRFs will have access to this property right out of the box.

At the risk of being cast into an eternal flame, may I suggest inluding bridges over bridges as well? I am having some interesting thoughts of the possibilities.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: New map features

Post by planetmaker »

JGR wrote:As much as it'd be better to solely use newgrf properties, as this feature would only exist in non-trunk versions, it seems unrealistic to expect any significant subset of past or future newgrf authors to choose to implement it. Having some sort of fallback such as allowing bridges over roofless stations is probably necessary for the feature to be of practical use with newgrf stations.
Implementing an additional propertyA which defines the height of the building and whether bridges are allowed over it in new NewGRFs is not a big deal. So if the specs should be created in a reasonable manner, I would expect it to stick and be picked up. Starting with "evaluation hacks" on the other hand is a sure way to bad results and will make sure people rather not spend time on implementing it.
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: New map features

Post by HackaLittleBit »

Image
Just a pic to illustrate all the problems.

1 Pillars through ceiling.
2 Bridges with and without pillars.
3 Distance between pillars.
4 Roof height of building.
5 Tiles with and without roof.

Did I forget something?
Attachments
s3.png
s3.png (86.68 KiB) Viewed 956 times
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: New map features

Post by cirdan »

JGR wrote:As much as it'd be better to solely use newgrf properties, as this feature would only exist in non-trunk versions, it seems unrealistic to expect any significant subset of past or future newgrf authors to choose to implement it. Having some sort of fallback such as allowing bridges over roofless stations is probably necessary for the feature to be of practical use with newgrf stations.
I too think that this is the way forward, at least for now.
wallyweb wrote:Considering the above suggestions as well as HackaLittleBit's, kamnet's, Quast65's and Streckenläufer's thoughts and questions, how about the following? ...
For evaluation purposes, code a NMF diff/patch that allows any level bridge over road, rail and sea stations, waypoints, buoys and depots with a warning in the diff/patch release post that the feature is for player evaluation and is not saved game safe pending the development of a proper NewGRF Specification.
This will give everybody a chance to see and comment upon what works and what does not work from a graphical point of view and give Cirdan an opportunity to resolve any coding bugs.
See below. Note that savegame compatibility is not a problem, as the format is not changed. If you build a bridge that we later disallow, you will be stuck with a bridge that may look ugly and cannot be rebuilt, but that is all.
wallyweb wrote:At the risk of being cast into an eternal flame, may I suggest inluding bridges over bridges as well? I am having some interesting thoughts of the possibilities.
When I designed my new map array, I deliberately reserved 4 bits in each bridgeable tile so that we could have overcrossing bridges with signals. Then again, having room for them in the map array is only the beginning.

Here is a new version of the patch. It allows bridges over buoys (an oversight in my first patch) and over rail stations and waypoints:
  • For standard rail station tiles, the bridge deck must be 4 levels higher than the station for roofed tiles, 2 levels higher for the station building tile and at any height above for standard non-roofed tiles.
  • For standard waypoints, the bridge deck must be 3 levels higher than the waypoint.
  • For custom rail station and waypoint tiles, you can build a bridge at any height, for testing purposes.
Please test and report what you find. The values for standard tiles are the minimum required to avoid glitches, but that is all the testing that I have done. Please test your favourite NewGRFs, so that we can reach a consensus on what to do with them and whether to extend the spec for this.
Attachments
station-bridge.diff
Patch; apply with -p1
(21.27 KiB) Downloaded 82 times
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

cirdan wrote:Here is a new version of the patch. It allows bridges over buoys (an oversight in my first patch) and over rail stations and waypoints:
  • For standard rail station tiles, the bridge deck must be 4 levels higher than the station for roofed tiles, 2 levels higher for the station building tile and at any height above for standard non-roofed tiles.
  • For standard waypoints, the bridge deck must be 3 levels higher than the waypoint.
  • For custom rail station and waypoint tiles, you can build a bridge at any height, for testing purposes.
Please test and report what you find. The values for standard tiles are the minimum required to avoid glitches, but that is all the testing that I have done. Please test your favourite NewGRFs, so that we can reach a consensus on what to do with them and whether to extend the spec for this.
:bow:


Here is the unguaranteed Win32 binary 2nd Edition pathched to the current NMF push:
OpenTTD-NMF-bridge-test-g2505861bM-Win32-2nd-Edition.7z
THIS IS THE 2ND EDITION
(5.46 MiB) Downloaded 89 times
Happy Testing. :D
Timeflyer
Traffic Manager
Traffic Manager
Posts: 156
Joined: 29 Feb 2016 15:24

Re: New map features

Post by Timeflyer »

would be very very very very nice to have the Houseplacing in the map editor !!!!

This would be more than awesome for most map-creating people !!!!
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: New map features

Post by cirdan »

wallyweb wrote:Here is the unguaranteed Win32 binary 2nd Edition patched to the current NMF push:
Thank you, as always.
Timeflyer wrote:would be very very very very nice to have the Houseplacing in the map editor !!!!

This would be more than awesome for most map-creating people !!!!
Err, have you actually tried? It should already be there.
Timeflyer
Traffic Manager
Traffic Manager
Posts: 156
Joined: 29 Feb 2016 15:24

Re: New map features

Post by Timeflyer »

Err, have you actually tried? It should already be there.
would be nice to have this ONE in a STABLE VERSION !!!! That's waht i mean
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: New map features

Post by HackaLittleBit »

Timeflyer wrote:would be nice to have this ONE in a STABLE VERSION !!!! That's waht i mean
Why do CAPITAL LETTERS so annoy us?
It would be more helpful if you would point out what is not stable in Cirdan's branche!
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: New map features

Post by HackaLittleBit »

Just some testing.

Code: Select all

uint gfx = layout[platform * plat_len + offset];
uint check_bridge = (statspec != NULL) ? 1 :  (gfx < 2 ? 1 : gfx < 4 ? 2 : 4);
check_bridge is always 1 with newgrf correct?
Att. Ore unloader station 0.1 has moving crane.

Awesome graphics by the way. :)

Image
Attachments
st3.png
(653.87 KiB) Not downloaded yet
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: New map features

Post by HackaLittleBit »

planetmaker wrote: Implementing an additional propertyA which defines the height of the building and whether bridges are allowed over it in new NewGRFs is not a big deal. So if the specs should be created in a reasonable manner, I would expect it to stick and be picked up. Starting with "evaluation hacks" on the other hand is a sure way to bad results and will make sure people rather not spend time on implementing it.
just a preliminary proposal.
Some things may be missing.
But it is food for thought.
I hope it makes sense.
Note, I do not know newgrf's inner workings.

Byte for buildings

Code: Select all

7 6 5 4 3 2 1 0

0  : Bridge construction allowed. (no yes)
1  : Bridge pillars on north side allowed. (no yes)
2  : Bridge pillars on south side allowed. (no yes) 
     If both north and south are zero, no pillars allowed.
     If both north and south are one, tile handles pillars unconditional.	 
345: Amount of extra z-levels to add, before bridge construction is allowed. (7 levels)
     Or height in z-levels of structure.
67 : Reserved.
Byte for bridges

Code: Select all

7 6 5 4 3 2 1 0

0  : Bridge can be build over buildings. (no yes)
1  : Has pillars. (no yes)
234: Max length of middle section bridge = 7 tiles or more. 
56 : Min length of middle section + 1 = 1 .. 4 tiles
     Zero means bridge has no middle sections.
7  : Minimum z-level nescessary of bridge deck to clear roof top's. (zero or one)

User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

The image below demonstrates that the player does have default bridge options where the pillars do not penetrate the roof of the hall.
NMF Bridge Test - Default - Small.png
NMF Bridge Test - Default - Small.png (396.18 KiB) Viewed 956 times
Loading the TBRS GRF seen below shows the player has even more options to pick from.
NMF Bridge Test - TBRS - Small.png
NMF Bridge Test - TBRS - Small.png (412.89 KiB) Viewed 956 times
The attached save game shows almost all the default bridges.
NMF Bridge Test - Default, 24th Sep 2000.7z
(7.54 KiB) Downloaded 93 times
Now load TBRS into that game and see what happens.

Bridge pillars vary greatly in quantity, shape and positioning. It would be a nightmare to work up code to control them from another GRF such as stations.
If anything, to provide the player with more choice, the number of defined bridges (13) should be increased or multiple bridge sets should be allowed.
I no longer think that "allow bridge" and "bridge height" should be added to station properties. The images and saved game demonstrate that the player has a wealth of choices to explore. Until quantum computing comes to TTDX/OTTD, only the stupid AI needs guidance. As much as politicians and the Illuminati wish we were, humans are not AI ... (yet :cry: ).
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: New map features

Post by HackaLittleBit »

Another solution could be giving a preview of bridge to be build + button to actually construct.

Player selects site to construct bridge and then selects a bridge in option box.
The bridge is shown as preview on the selected site.
Only when player clicks 'build' button, the action is completed.
Attachments
build.PNG
build.PNG (67.53 KiB) Viewed 3365 times
User avatar
JGR
Tycoon
Tycoon
Posts: 2560
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: New map features

Post by JGR »

HackaLittleBit wrote:Byte for bridges

Code: Select all

7 6 5 4 3 2 1 0
234: Max length of middle section bridge = 7 tiles or more. 
56 : Min length of middle section + 1 = 1 .. 4 tiles
     Zero means bridge has no middle sections.
I don't really follow this bit, the bridge tile layout and length restrictions are already defined in the GRF spec.
There's no need to specify them again by a separate mechanism unless you're implying adjusting the bridge tile layout to match the restrictions of tiles underneath?

Also more generally, memory isn't *that* scarce and I don't think it's necessary to be that tight-fisted with bit allocations within the GRF interface. Some level of future-proofing is generally prudent to avoid creating future maintenance work for yourself.
Ex TTDPatch Coder
Patch Pack, Github
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: New map features

Post by HackaLittleBit »

JGR wrote: unless you're implying adjusting the bridge tile layout to match the restrictions of tiles underneath?
Sort of.
If you look at the pic you can see that bridge 3 and 4 only differ at the middle section.
If you would know before building the bridge, the size of that middle section or available middle sections you would be able to say if bridge would put pillars or not on station.
Bridge 1 has a middle section of 2 or 3.
The idea was to give info to the routine of available length of middle sections, to give as little interference as possible to the underlying structures.(houses stations etc.)
I don't know if this is possible.
Correct me if I am wrong, but for example bridge 4 with a middle span of 5 or 7 tiles would be awesome.
Just brain storming. :)
Attachments
br.png
br.png (113.58 KiB) Viewed 3337 times
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

HackaLittleBit wrote:Another solution could be giving a preview of bridge to be build + button to actually construct.
I like this. :D
HackaLittleBit wrote:I don't know if this is possible.
Correct me if I am wrong, but for example bridge 4 with a middle span of 5 or 7 tiles would be awesome.
Just brain storming. :)
The possibilities are here.
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: New map features

Post by HackaLittleBit »

wallyweb wrote:The possibilities are here.
Thanks.
Attachments
br.png
br.png (144.07 KiB) Viewed 3302 times
User avatar
HackaLittleBit
Director
Director
Posts: 550
Joined: 10 Dec 2008 16:08
Location: tile 0x0000

Re: New map features

Post by HackaLittleBit »

And other solution.
Substituting sections of bridge with BRIDGE_PIECE_MIDDLE_EVEN.
Image
Attachments
long1.png
long1.png (169.77 KiB) Viewed 956 times
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 43 guests