Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide more consist information with var 45 #2521

Closed
DorpsGek opened this issue Jan 10, 2009 · 12 comments
Closed

Provide more consist information with var 45 #2521

DorpsGek opened this issue Jan 10, 2009 · 12 comments
Labels
component: NewGRF This issue is related to NewGRFs flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

George opened the ticket and wrote:

R14922

Wiki says:

Curvature info (var 45)
Format: xxxTxBxF
This returns the amount of curvature between the adjacent wagon pairs. It is useful for train vehicles that normally tilt in curves. The curvature is the difference in direction between the surrounding vehicles:
F = for the front pair (previous wagon to current wagon, 0 if vehicle is first)
B = for the back pair (current wagon to next wagon, 0 if wagon is last)
T = for the triplet (previous wagon to next wagon; is zero in an S-bend)
Possible values ...

I would like to ask to give more information
Format: xttTbBfF
tt,b,f returns the amount of dH between the adjacent wagon pairs. The dH is the difference in height between the surrounding vehicles:
F = for the front pair (previous wagon to current wagon, 0 if vehicle is first)
B = for the back pair (current wagon to next wagon, 0 if wagon is last)
T = for the triplet (previous wagon to next wagon)
Possible values:
Decimal Hex Meaning
-8 [F]8 -8 (T only)
-7 [F]9 -7 (T only)
-6 [F]A -6 (T only)
-5 [F]B -5 (T only)
-4 [F]C -4
-3 [F]D -3
-2 [F]E -2
-1 [F]F -1
0 0 0
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5 (T only)
6 6 6 (T only)
7 7 7 (T only)
8 8 8 (T only)

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/2521
@DorpsGek
Copy link
Member Author

George wrote:

Frosch: Of cause using the new var would be also fine


This comment was imported from FlySpray: https://bugs.openttd.org/task/2521#comment5288

@DorpsGek
Copy link
Member Author

frosch wrote:

I thought a bit about this variable and concluded that it is not very helpful.
I guess I know what you are trying to archieve, but this variable would only help as long as you have only 2 or 3 articulated parts.

So I suggest you a different option:
Variable 9E specifies the z position of a vehicle. By reading that variable for the active vehicle and for the front (i.e. related) vehicle you can calculate a height difference to the front vehicle.

Also when you are going to add that many sprites you might reconsider http://www.tt-forums.net/viewtopic.php?p=662609# p662609

Btw. var 9F speficies the current orientation (0-7) of the vehicle.


This comment was imported from FlySpray: https://bugs.openttd.org/task/2521#comment5290

@DorpsGek
Copy link
Member Author

George wrote:

Frosch:
Unfortunately some RVs are very long - dolphin bus would be 6 parts long. I need information about dH between 3 parts in a row


This comment was imported from FlySpray: https://bugs.openttd.org/task/2521#comment5292

@DorpsGek
Copy link
Member Author

DorpsGek commented Apr 4, 2010

Eddi wrote:

Patch implementing the above (i hope)

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/2521#comment7810

@DorpsGek
Copy link
Member Author

DorpsGek commented Apr 5, 2010

George wrote:

if you need a diff testing please provide a win 32 executable


This comment was imported from FlySpray: https://bugs.openttd.org/task/2521#comment7814

@DorpsGek
Copy link
Member Author

DorpsGek commented Dec 7, 2010

Eddi wrote:

In a previous discussion on IRC it was brought up that maybe a more flexible approach using 60+ vars would be more appropriate, so i have attempted an implementation.

Parameter to the vars is the (signed) position in the chain relative to the current [or front as related object] vehicle. 01 is the next, FF is the previous vehicle.

var 61: DirDifference similar to var 45 (B or F part)
var 62: height difference
var 63: vehicle status (VS_HIDDDEN, VS_STOPPED, etc.) similar to var 80+32

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/2521#comment9229

@DorpsGek
Copy link
Member Author

DorpsGek commented Dec 8, 2010

Terkhen wrote:

You can find a Win32 binary of the patch posted at the previous post here: http://devs.openttd.org/~terkhen/fs_2521/


This comment was imported from FlySpray: https://bugs.openttd.org/task/2521#comment9232

@DorpsGek
Copy link
Member Author

DorpsGek commented Dec 8, 2010

frosch wrote:

Though I am not sure about the general usefulness of these variables :), still some comment:

Variable 61 and 62 seem to waste valuable variable slots. So maybe put the difference wrt. direction, x position, y position and z position in 4 signed bytes of one variable. (format: zzyyxxdd)

And maybe also the hidden flag into bit 7 of the direction component or so... (the other vehicle flags do not seem to be useful at all)


This comment was imported from FlySpray: https://bugs.openttd.org/task/2521#comment9233

@DorpsGek
Copy link
Member Author

Eddi wrote:

updated last patch with var 64 in the format according to proposal by frosch:
xxyyzzhd, where xx, yy and zz (8 bits each) is the (signed) x-difference, d is 4 bits of DirDifference like in var 45, and h is 1 bit of VS_HIDDEN in bit 7 (appropriate mask is \dx00000080)

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/2521#comment9916

@DorpsGek
Copy link
Member Author

Eddi wrote:

next update: var 65 returning the engine-id (like var C6)

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/2521#comment9917

@DorpsGek
Copy link
Member Author

Eddi wrote:

i just noticed that in the original curve_info patch, the line "int bz = (u_p == NULL)" must read "(u_n == NULL)".


This comment was imported from FlySpray: https://bugs.openttd.org/task/2521#comment10082

@DorpsGek
Copy link
Member Author

DorpsGek commented Oct 4, 2011

michi_cc closed the ticket.

Reason for closing: Implemented

In r22997 and r22998.


This comment was imported from FlySpray: https://bugs.openttd.org/task/2521

@DorpsGek DorpsGek closed this as completed Oct 4, 2011
@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) component: NewGRF This issue is related to NewGRFs enhancement labels Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: NewGRF This issue is related to NewGRFs flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant