Station variable 41 not acting as expected

Got a problem with TTDPatch? Get help here.

Moderator: TTDPatch Moderators

Post Reply
User avatar
Oracle
Tycoon
Tycoon
Posts: 2138
Joined: 22 May 2003 09:59

Station variable 41 not acting as expected

Post by Oracle »

I've been experimenting with quite a complex usage of station variable 41 and it doesn't seem to be giving the results I'd expect. According to the description in this thread, TTDPatch sets up virtual "fences" around tiles. However, what I'm seeing doesn't agree with my interpretation of that.

Looking at the attached image, I have built a 5 platform x 7 tile station and then overbuilt a single tile at platform 3 tile 7 (using the numbering scheme from the image). I would expect the lines in red to represent the "fences", with platform 4 tile 1 of the right-hand image "seeing" no difference from before, as it is still the same distance from virtual fences in all four directions. However, from the way that the station is coded, it is clear that platforms 3 to 5 of the right-hand station think that they are in a three-platform station, not the five platforms I expect (and would prefer to see). I would also expect platform 5 tile 7 to think that it was in a 2x7 station but it too thinks that it is in a 3-platform station.

Is this a bug or is the scheme more complicated than I'm thinking?
Attachments
stationvariable41.png
stationvariable41.png (39.67 KiB) Viewed 1639 times
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

The fences are directional, and those of the wrong direction are ignored in the counting. So, looking at tile 7 it looks like this:

Code: Select all

|| = platform
|> = left fence
<| = right fence

|>  ||    ||  |>  || <|  ||     || <|
   1/3    2/3    1/1    2/3    3/3
Var.41 always searches for the closest left and right fences of the right orientation, so platform one counts three platforms to the left left-oriented fence, and is therefore 1/3.
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

Now that I thought about it a bit, it wouldn't be hard to change it such that overbuilding always constructs the fences on the other side too, so that you get

Code: Select all

|>  ||    || <|>  || <|> ||     || <| 
   1/2    2/2    1/1    1/2    2/2
That would change how var.41 works, and it might break MB's newstations (or it might fix them, I don't know). Would that be a good idea?
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
User avatar
Oracle
Tycoon
Tycoon
Posts: 2138
Joined: 22 May 2003 09:59

Post by Oracle »

Patchman wrote:Would that be a good idea?
In a few ways it would make more sense, but I'm not sure that it would necessarily help with my situation. What size station would the top-right tile then think it was in? I see several obvious sizes - 2x7, 2x6, 3x6, 5x6 and possibly more.
On a different note, I was going to suggest that tiles "look" orthogonally to find their nearest fences - i.e. they should look in all four directions, which would give the size of the "station" and the tile's position within. I have no idea how hard this would be to do (I tried glancing in the source but it meant absolutely nothing to me) but I think it would make the most sense overall. Again, what this would do to MB's newstations I don't know.
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

Oracle wrote:In a few ways it would make more sense, but I'm not sure that it would necessarily help with my situation. What size station would the top-right tile then think it was in? I see several obvious sizes - 2x7, 2x6, 3x6, 5x6 and possibly more.
Tile 1, platform 5 would see 5x7. Tile 7, platform 5 would see 2x7 (instead of 3x7 as it is now).
On a different note, I was going to suggest that tiles "look" orthogonally to find their nearest fences - i.e. they should look in all four directions, which would give the size of the "station" and the tile's position within.
That's what it does now. Only, the fences are perhaps not what one would expect when using overbuilding.
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
User avatar
Oracle
Tycoon
Tycoon
Posts: 2138
Joined: 22 May 2003 09:59

Post by Oracle »

Hmm. Now I'm confused, I'm afraid. I originally assumed it worked like that and so posted this thread. My observations just don't seem to agree with that scheme.
Looking at the image in the first post, that station is currently coded so that the station building itself only appears on platforms 1 and 2 (counted from the left) of a station with 3 or more platforms. Therefore tile 1 platform 4 of the right-hand station in that image thinks that it is tile 1 on platform 2, not on platform 4 as I would expect. Hence I'm confused.

Sorry for continuing to trouble you...
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

Now you're confused me too. If you mean tile 7 platform 4 not tile 1, then in your first post you wrote that this tile thinks it's on platform 2 in a 3x7 station. That's what I wrote above too. Only if my proposed changes are implemented would it think it's on platform 1 of a 2x7 station.

Either way, tile 1 platform 4 should always see itself on platform 4 of a 5x7 station as you write in your first post.
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
User avatar
Oracle
Tycoon
Tycoon
Posts: 2138
Joined: 22 May 2003 09:59

Post by Oracle »

Sorry about this...
Patchman wrote:Either way, tile 1 platform 4 should always see itself on platform 4 of a 5x7 station as you write in your first post.
Yes. But my problem is that I'm confident that it doesn't.
I made the attached newstat2.grf last night to test this. If you build a 5 platform x 4 tile (or smaller) "Station 1" (default station class) in the y-direction then it shows the platform number in yellow and the tile number in white, using the numbering scheme from my first post.
"Station 2" is similar except that it shows the total number of platforms (as seen by variable 41) in white (with no number for 5 or more platforms).

Therefore the image shows that, after building the single tile on platform 3 tile 4, platform 3 tile 1 now thinks that it is platform 1 tile 1 of a 3-platform station, which isn't what it should be - i.e. variable 41 seems to be behaving incorrectly.
Attachments
newstat2.grf
(64.5 KiB) Downloaded 57 times
var41.png
var41.png (32.93 KiB) Viewed 1496 times
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

OK, that's a bug. I guess the counting code is not resetting itself to the starting point for each direction. Will check it out.
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
Post Reply

Return to “Problems with TTDPatch”

Who is online

Users browsing this forum: No registered users and 9 guests