I have a bit of story time for everyone, and a warning not to make a mistake that even payware devs weren't immune from:
Today I spent a bit more time than I should have trying to debug why the main reservior in my locomotives felt so small and the compressor seemed so weak despite me setting the correct volume and correct main res charging rate. So, I went to the Open Rails github repository to search the source code for answers. All the code related to adding and subtracting air from the main res made perfect sense, nothing seemed to indicate that air would be lost in some way, so it had to be something else draining air out of my main res. This led me down the path of investigating how Open Rails decides the volume of the main reservior.
Then it hit me. Open Rails looks for the token "AirBrakesMainResVolume" to determine the main res volume. That's it. There's no alternative, that token is the only thing that says how big the main res is. And I wasn't using that.
I had been programming main res volume as "ORTSAirBrakeMainResVolume" for years, and it's straight up wrong. Doing that just gets ignored and results in the main res being set to the default, pathetically tiny, 0.3 cubic meter size. And if you work like me and assume that is accurate, then you start to make lots of mistakes elsewhere when trying to make things more accurate, inadvertently taking steps that cover up the fact that you gave yourself a stupidly small main res. (In this case, the brake pipe recharge rate was set much lower than realistic in order to not overwhelm the tiny main res.)
But why? How had I been working for years with something that doesn't do what I thought? Well...mostly because other people use ORTSAirBrakeMainResVolume and I assumed that was correct. I started my physics set on the base of Gerry Storey's common.inc set, and Gerry used the wrong code. TrainSimulations has been using the wrong code ever since they started using Open Rails physics (even their newest trains still make this mistake, resulting in the default main res size). Of course, anyone basing reskins off of either of these physics sets will also get it wrong.
Why would they get it wrong? That I do not know. The manual makes mention of the vacuum brakes token "ORTSVacuumBrakesMainResVolume", which might lead someone to assume similar syntax applies for air brakes, but the manual has not a single reference to ORTSAirBrakeMainResVolume (meanwhile, it does reference the correct AirBrakesMainResVolume once in an example .eng file). Searching the internet for "ORTSAirBrakeMainResVolume" gives 3 results from this forum and Elvas tower, which reveals it seems that someone might have mentioned it offhand as an idea for a token to add, but it wasn't actually added. Perhaps other users saw that post and mistakenly assumed the post was talking of a real token rather than a hypothetical one? Doesn't really matter, somehow something small and unofficial was enough 'evidence' for the community to converge on a completely fictional token for years without checking if it actually worked.
In short-it pays to do your own research for Open Rails and real life. If you aren't sure how something works or why it's working the way it does, then go down that rabbit hole. Search the manual, search the source code, don't just trust what other people wrote down without evidence. Getting that deeper understanding requires going deeper, and in this case, you can come out on top with a better product than what you made before.
Also, to those who made this mistake, I can't exactly expect anyone to fix something from 5 years ago (that's where modding comes in) but perhaps the dev team can be convinced to add ORTSAirBrakeMainResVolume to the parser to retroactively fix all this content. In any case, hopefully this story helps everyone make their future projects better than their past projects.
Today I spent a bit more time than I should have trying to debug why the main reservior in my locomotives felt so small and the compressor seemed so weak despite me setting the correct volume and correct main res charging rate. So, I went to the Open Rails github repository to search the source code for answers. All the code related to adding and subtracting air from the main res made perfect sense, nothing seemed to indicate that air would be lost in some way, so it had to be something else draining air out of my main res. This led me down the path of investigating how Open Rails decides the volume of the main reservior.
Then it hit me. Open Rails looks for the token "AirBrakesMainResVolume" to determine the main res volume. That's it. There's no alternative, that token is the only thing that says how big the main res is. And I wasn't using that.
I had been programming main res volume as "ORTSAirBrakeMainResVolume" for years, and it's straight up wrong. Doing that just gets ignored and results in the main res being set to the default, pathetically tiny, 0.3 cubic meter size. And if you work like me and assume that is accurate, then you start to make lots of mistakes elsewhere when trying to make things more accurate, inadvertently taking steps that cover up the fact that you gave yourself a stupidly small main res. (In this case, the brake pipe recharge rate was set much lower than realistic in order to not overwhelm the tiny main res.)
But why? How had I been working for years with something that doesn't do what I thought? Well...mostly because other people use ORTSAirBrakeMainResVolume and I assumed that was correct. I started my physics set on the base of Gerry Storey's common.inc set, and Gerry used the wrong code. TrainSimulations has been using the wrong code ever since they started using Open Rails physics (even their newest trains still make this mistake, resulting in the default main res size). Of course, anyone basing reskins off of either of these physics sets will also get it wrong.
Why would they get it wrong? That I do not know. The manual makes mention of the vacuum brakes token "ORTSVacuumBrakesMainResVolume", which might lead someone to assume similar syntax applies for air brakes, but the manual has not a single reference to ORTSAirBrakeMainResVolume (meanwhile, it does reference the correct AirBrakesMainResVolume once in an example .eng file). Searching the internet for "ORTSAirBrakeMainResVolume" gives 3 results from this forum and Elvas tower, which reveals it seems that someone might have mentioned it offhand as an idea for a token to add, but it wasn't actually added. Perhaps other users saw that post and mistakenly assumed the post was talking of a real token rather than a hypothetical one? Doesn't really matter, somehow something small and unofficial was enough 'evidence' for the community to converge on a completely fictional token for years without checking if it actually worked.
In short-it pays to do your own research for Open Rails and real life. If you aren't sure how something works or why it's working the way it does, then go down that rabbit hole. Search the manual, search the source code, don't just trust what other people wrote down without evidence. Getting that deeper understanding requires going deeper, and in this case, you can come out on top with a better product than what you made before.
Also, to those who made this mistake, I can't exactly expect anyone to fix something from 5 years ago (that's where modding comes in) but perhaps the dev team can be convinced to add ORTSAirBrakeMainResVolume to the parser to retroactively fix all this content. In any case, hopefully this story helps everyone make their future projects better than their past projects.






Comment