Page 1 of 4 123 ... LastLast
Results 1 to 10 of 36

Thread: Reusing OpenRails physics code for model railways use

  1. #1

    Default Reusing OpenRails physics code for model railways use

    Hi Mark Stafford here.

    Over on the Model Railroad Hobbyist magazine we have been discussing how by leveraging the virtual world modelling as done in applications like Openrails physics open source software. I’m hoping we might be able to massively improve how model railway control and thereby maybe catchup with you lot in the virtual world modellers.
    The trouble is that I have no idea whatsoever as to how I should even start.

    I figure that at least by asking you people maybe you could point me to what the right question is and where I and to whom I should pose my question of how could I possible identify and potential port your physics and engine config files to enhance model railway control.

    Any help would be hugely appreciated.
    Mark Stafford
    A modeller railway nut since I was three years old.

  2. #2

    Default

    Hi again fellow train enthusiasts.

    It has occurred to me that you virtual railroads may have something to gain as much we model railroaders potentially gain from your code.

    A small group of people (Iowa Scale Engineering) have developed an excellent EMD based Diesel engine control stand. This stand has been developed as an open source product that could quite possible be modified under that open source licence to be of benefit to you in the virtual world. It is called a ProtoThrottle and is an excellent hand held radio connected device.
    It has the look and feel of a real diesel console that with effort may be quite suitable for you guys purposes to operate your trains, just as your physics code may have a revolutionary impact in my model railway world (I’m a Aussie, we have railways)

    My involvement is that I’m attempting to re-use the ISE Diesel Throttle as the basis to re-biulding into a viable steam centric hand held radio connected throttle (read controller) that is equally a open source device that if I can work out all the issues may be just as usefull to you.

    This way each arm of the railway enthusiasts could win equally together.
    What do you think, a good trade?
    Mark

  3. #3

    Default

    Hi Mark,
    Quote Originally Posted by Markstaffrld View Post
    A small group of people (Iowa Scale Engineering) have developed an excellent EMD based Diesel engine control stand.
    Quote Originally Posted by Markstaffrld View Post
    My involvement is that I’m attempting to re-use the ISE Diesel Throttle as the basis to re-biulding into a viable steam centric hand held radio connected throttle (read controller) that is equally a open source device that if I can work out all the issues may be just as usefull to you.
    Yes, both could be of interest.

    What do you need to know about the physics model in Open Rails, I wonder? I can guide you through it if you need help.

    In a model railway, you have unrealistic distances, gradients, loco power and train weight so how do you want the train to behave? If you aim for realistic rates of acceleration and braking, I'm thinking that the train will have arrived at the end of the model layout before it reaches its design speed.

    Perhaps you are looking for a compromise which gives a performance which is somewhere between model performance and realistic performance.
    Chris Jakeman


  4. #4

    Default

    Quote Originally Posted by cjakeman View Post
    Hi Mark,




    Yes, both could be of interest.

    What do you need to know about the physics model in Open Rails, I wonder? I can guide you through it if you need help.

    In a model railway, you have unrealistic distances, gradients, loco power and train weight so how do you want the train to behave? If you aim for realistic rates of acceleration and braking, I'm thinking that the train will have arrived at the end of the model layout before it reaches its design speed.

    Perhaps you are looking for a compromise which gives a performance which is somewhere between model performance and realistic performance.
    Goodmorning Chris,
    At this point I don’t know what I don’t know.
    Like, I do know that we (me) want and hanker for more reality. I know that we don’t simulate mass at all well. I know we don’t have locos performance specified in any way. Power output, tractive effort etc etc etc. I know that if you have a train on a sloped track and you let the brakes off the train “should” role down the hill. We do none of that.
    We in model railways are fixcated on our throttle as the be all and end all that starts stops and everything about train control where in reality it controls very little. Outside impacts control how much speed you get out off your train.
    That is what I want to explore.
    I would like to understand how big the code is to do these things, could it fit, what it is written in, is it in discrete libraries.

    In short. I know nothing and I need to start somewhere.

    So yes your right our distances are going to hurt us. But then again they always have.

    So Chris, where and what do you recommend I do from here.

    Mark
    A rarely blind reasonably deaf old guy on a mission of possibilities.

  5. #5

    Default

    Chris,
    On reflection, Is there a concept within Openrails physics that has beginner, intermediate, expert settings that users can taylor their reality settings.

    That sort of approach would possibly allow us model railroader types to ease into dealing with the onrush of new concepts and skill development for driving trains.

    Some new things I’m trying to introduce into Steam ProtoThrottle is having a reverser (Johnson bar) that has a number (4) different cutoff setting in both forward and reverse. Use of these setting are totally new to my lot. Besides the fact that I need the technical issues to be addressed.

    Another fact should be understood is that although I had many years in the software industry (both in a software development team and as a systems architect with IBM) I was never a coder. I also am visually challanged so reading small print is near on impossible. I love my iPad for that reason.

    I think I need to work out if it is viable to get a copy of the engine configuration and physics code onto a pc to try and understand it night be something worthwhile.

    Likewise I suspect your people should have a look at github for the Iowa scale engineering details. Who know we could finish up developing a joint project that satisfies both modelling realities.

    Regards
    Mark Stafford
    Ps if you want to see the model-railway-hobbyist.com blog go to latest posts and look for “Okay steam modellers—what would your ProtoThrottle look like?”

    You may find it interesting

  6. #6
    Join Date
    May 2010
    Location
    Metairie, Louisiana
    Posts
    604

    Default

    Having both experince with Open Rails and HO Scale locomotives, I'm going to try and offer some useful advice. First off, there's no definte easy, medium, or hard mode in OR. There's individual switches than can be set though.

    An important thing with simulation is to tie it to the motor, so it acts certain way. If it's coasting, the motor should still keep moving, slowing down or speeding up depending on the circumstances in question. (For the life of me, I can't get a model locomotive to actually wheelslip. Best idea would be for it to just sit there, and sound like it's in a certain notch.)

    If it's a sound decoder, the sound should be somewhat disconnected from how the locomotive should act. An ESU decoder seems like it would work quite well for this with its "Full Throttle" features.
    Parker B. - A Misplaced Midwesterner.

  7. #7

    Default

    Quote Originally Posted by Markstaffrld View Post
    I would like to understand how big the code is to do these things, could it fit, what it is written in, is it in discrete libraries.
    Open Rails code is written in C# - a language from Microsoft. It's in discrete classes but not libraries and re-purposing the code would be a large task.

    As SD40-2 writes, there is no novice mode. With few exception, everything is as designed to be as realistic as possible. You probably know that all manner of locos (electric, diesel, steam) and brakes (air, vacuum, unbraked) can be simulated and the behaviour of each is specified in text files with a structured format.

    Quote Originally Posted by Markstaffrld View Post
    We in model railways are fixcated on our throttle as the be all and end all that starts stops and everything about train control where in reality it controls very little. Outside impacts control how much speed you get out off your train.
    That is what I want to explore.

    So yes you're right; our distances are going to hurt us. But then again they always have.
    One thought that occurs is that such a controller might be designed for a model world in which physics was deliberately distorted (e.g. a model mile might map to 5 real miles or 10 model hours might map to 1 real hour).
    Chris Jakeman


  8. #8

    Default

    Hi Parker.B
    Ok, switches seem to be an ok option to me. So if a field (say wind) is blank then does the software make the calculation for wind=0 then?

    So in your opinion could that mean that if parameters did something like that then taking the whole physics library could mean that at the start we could dumb the use of every thing down somewhat whislst we learn. Then as new enovators move to improve the experiance then the physics code is there ready and waiting for the next round of improvement.
    Is that a possibility?

    I’m sort of hoping in my nivarna world your code can (already is) distilled into a mean lean tidy code that I could have as maybe an include file where when we do a compile it drags the physics bit back from your repository. But I’m dreaming right, it’s never that easy.

    I do think it is too important a thing for our lot to just grab a copy without it continuing to be maintained by your people. You have a significant body of knowledge that I figure would take us years and years to replicate. Do you see it that way?

    The aim of the ProtoThrottle projects are to heighten driver experiences in sound equipped models. That is not to say that a protoThrottle will not control a decoder only equipped loco but that is not what it is all about. In keeping with that we have had significant internal discussions on the desperate need to brake the nexus between throttle settings and speed of our motors by our decoders.

    I think this is one of these watch this space type of moments. But in the mean time quite a few modellers achieving excellent interim results.
    One such enovators is a friend of mine Linton Towell. Linton has achieved magnificent sound scapes from his models, check his work out on YouTube look for 78towelly, you will not be sorry. Check out his wheel slipping AD60 Garrett slipping. What can I say, the guy is a genius.

    Sorry I got carried away there. Back to physics. I think the time is fast approaching when we will have the capability to utilise physics properly and I figure a start on this aspect of our hobby is long overdue. I’m hoping somehow we can nail this puppy.

    Over to you buddy

    Regards
    Mark

  9. #9
    Join Date
    May 2010
    Location
    Metairie, Louisiana
    Posts
    604

    Default

    Quote Originally Posted by Markstaffrld View Post
    Hi Parker.B
    Ok, switches seem to be an ok option to me. So if a field (say wind) is blank then does the software make the calculation for wind=0 then?
    Yep. One could probably just take that part out if so desired.

    I don't own the code of OR. I'm just trying to figure out how to be a bridge between HO-Scale and V-Scale based on what I know. Nobody really owns the Open Rails code, it's a community project, with everyone contributing in some way.

    I do have some experince with command control in O-Scale, but I don't have any HO scale DCC locomotives at the moment. I do hope to rectify that soon with two ESU decoders mounted into a GP60M and GP60B.

    Thinking about it, I now really want a ProtoThrottle, despite being on the pricey side.

    If anyone wants to know what a ProtoThrottle is, here's the link - http://protothrottle.com/. In short, it's a pint sized control stand for DCC, and it's supposed to simulate more realistic operations, instead of scrolling wheels and pressing buttons on a remote.
    Last edited by SD40-2; 01-10-2019 at 04:39 PM.
    Parker B. - A Misplaced Midwesterner.

  10. #10

    Default

    Goodmorning Chris,
    Our posts passed each other in transit.
    C#. That’s sort of difficult for me personally, I was in a C based development team so I can sort of read C but C# was a bit of a mystery to me. That is not to say in the long term as I am not a coders boot lace so my being ignorant is a by the by. But of more concern is your saying that re-purposing the code will be a large task.

    One small saving grace may finish up being that right now we are only looking at diesel and steam. As far as I’m aware no one is looking at other engine types though in my opinion there would be no real impediment for someone to go there. But I model 1925 vinatage Narrow Gauge so it’s not going to be me. I know nothing of those locos and if truth be know I have enough trouble doing my own little bit.

    Re being as realistic as possible. We already have “smiles”. I don’t know if this is right but I call them “small miles” smiles. And fast clocks are very common. Personally I have no particular need of either as I have a small switching layout with only a short piece of main line that immediately goes into a storage staging area. I’d be quite happy for the train to barely get up to any speed at all before disappearing off stage.

    So dispose my particular use maybe distorting physics could be good thing for most if not all.

    If the re-purposing from c# to c to keep in line with the protothrottle code was to occur then maybe only steam and separately only diesel be looked at in the first instance as one possible way forward. But again I’m not sure how viable that solution could be.

    Regards
    Mark

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •