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

Vehicles: vars to check power and weight of vehicle/consist required #6004

Closed
DorpsGek opened this issue May 3, 2014 · 16 comments
Closed

Vehicles: vars to check power and weight of vehicle/consist required #6004

DorpsGek opened this issue May 3, 2014 · 16 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

DorpsGek commented May 3, 2014

George opened the ticket and wrote:

r26438

I could not make vars E8 and E4 work (http://marcin.ttdpatch.net/sv1codec/TTD-locations.html# _VehicleArray), so I suppose they are for TTDP only.
Because of that I need vars for current consist/vehicle power and weight (http://newgrf-specs.tt-wiki.net/wiki/NML:Vehicles# Vehicle_variables), as we have current_max_speed for example.

Reported version: trunk
Operating system: All


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

DorpsGek commented May 3, 2014

frosch wrote:

Var E4 is available for trains. Mind it's only valid for the front vehicle.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6004#comment13273

@DorpsGek
Copy link
Member Author

DorpsGek commented May 3, 2014

frosch wrote:

Actually, it's F4, not E4.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6004#comment13274

@DorpsGek
Copy link
Member Author

DorpsGek commented May 3, 2014

frosch wrote:

While OTTD actually support var F4, TTDP does not. That page from Marcin must refer to some ancient TTDP. Current TTDP has these variables:
http://projects.tt-forums.net/projects/ttdpatch/repository/entry/trunk/inc/veh.inc# L70

As such even OTTD is wrong in supporting F4. Please don't use Marcin's site.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6004#comment13275

@DorpsGek
Copy link
Member Author

DorpsGek commented May 3, 2014

George wrote:

Anyway an NML property to check weight and power (even for head engine only) is necessary


This comment was imported from FlySpray: https://bugs.openttd.org/task/6004#comment13276

@DorpsGek
Copy link
Member Author

DorpsGek commented May 3, 2014

George wrote:

BTW, it would be also nice to know, if a train is accelerating or breaking.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6004#comment13279

@DorpsGek
Copy link
Member Author

DorpsGek commented May 3, 2014

mb wrote:

BTW, it would be also nice to know, if a train is accelerating or breaking.

Acceleration is given by TTD var 0x37 (0xB7).


This comment was imported from FlySpray: https://bugs.openttd.org/task/6004#comment13281

@DorpsGek
Copy link
Member Author

DorpsGek commented May 3, 2014

George wrote:

I can't find any information that it can be negative (breaking)


This comment was imported from FlySpray: https://bugs.openttd.org/task/6004#comment13283

@DorpsGek
Copy link
Member Author

DorpsGek commented May 3, 2014

frosch wrote:

Variable 4C "current_max_speed" was added for that purpose. (which can be compared to "current_speed")
It can be used to identify whether a vehicle is idling at max speed resp. is braking or whether it tries to accelerate.

IIRC there is already some vehicle set which uses that var for running cost, likely a pikka set. Or was it snail?


This comment was imported from FlySpray: https://bugs.openttd.org/task/6004#comment13284

@DorpsGek
Copy link
Member Author

DorpsGek commented May 3, 2014

George wrote:

does it mean current max speed in stations is 0?
In case it is 60 kmh how can I recognise that a train is breaking from 60 to 0 kmh?


This comment was imported from FlySpray: https://bugs.openttd.org/task/6004#comment13285

@DorpsGek
Copy link
Member Author

DorpsGek commented May 3, 2014

frosch wrote:

It is also affected by slowing down in stations.
However, it does not reach zero. Wrt. stopping (also at signals or due to breakdowns) you have to check the current speed for zero.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6004#comment13286

@DorpsGek
Copy link
Member Author

DorpsGek commented May 4, 2014

George wrote:

So if current_max_speed < current_speed -> the train is breaking?


This comment was imported from FlySpray: https://bugs.openttd.org/task/6004#comment13287

@DorpsGek
Copy link
Member Author

DorpsGek commented May 4, 2014

frosch wrote:

In theory yes, but practically "braking" does not exist. In most cases braking is almost instant.
So practically there are only these cases:
"current_speed == 0" -> vehicle is waiting
"current_speed != 0 && current_speed < current_max_speed" -> vehicle is accelerating
"current_speed >= current_max_speed" -> vehicle is idling at speed limit


This comment was imported from FlySpray: https://bugs.openttd.org/task/6004#comment13288

@DorpsGek
Copy link
Member Author

DorpsGek commented May 4, 2014

George wrote:

And when would the patch be added?
http://www.informatik.uni-halle.de/~krause/var4X_weight.patch


This comment was imported from FlySpray: https://bugs.openttd.org/task/6004#comment13290

@DorpsGek
Copy link
Member Author

George wrote:

4 months and no result in adding a simple patch???
Please provide the required vars


This comment was imported from FlySpray: https://bugs.openttd.org/task/6004#comment13566

@DorpsGek
Copy link
Member Author

frosch wrote:

Fine then, here's the list of stuff that needs to be done:
- Check when the variable changes values.
- Check what stuff (e.g. cached train variables) needs invalidating, when NewGRF decide to use weight to change properties.
- Check what advanced settings influence weight (e.g. freight weight modifier), whether they are changeable in multiplayer, and whether it is worth to forbid changing them.
- Check the use case 'running cost', whether the result is actually well-defined when using weight, or whether it depends on circular/different evaluation order.

All in all, likely 10 hours of work left.

(Personally, I do not consider a complex 'running costs' mechanics, that is most likely un-noticable in-game, worth the effort. But that's only my opinion.)


This comment was imported from FlySpray: https://bugs.openttd.org/task/6004#comment13567

@DorpsGek
Copy link
Member Author

andythenorth wrote:

Message from George via forums pm: this is a low priority. "As frosch wrote, complex RC is hard... But in case it is done I'd like to use it"


This comment was imported from FlySpray: https://bugs.openttd.org/task/6004#comment14675

@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) Vehicles labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

2 participants