Search Results

train

Train Game

I like railroading games because they have a certain amount of simulation in them and railroading is an interesting topic to me. My idea was to add much more realistic train handling to my game. The existing games all have one fatal flaw; they do not handle empty…

Continue reading
Computers & Programming

Another Train Dilemma

What is the best way to detect that I have reached a waypoint and possible passed it? I currently manage the waypoints in a way that works well when the train stops at one. The train constantly adjusts it’s deceleration to make it stop at the right spot…

Continue reading
Computers & Programming

Tale of Two Trains

I managed to change the one global train object into a list. I had two trains running for a moment and it was cool. This led to all kinds of other headaches. The drawing code is crappy and needs to be more modular. There is also no good…

Continue reading
Computers & Programming

What is a Train?

I was working last night on train routing and came across a serious dilemma; if a train splits in two, there is a new train that didn’t exist when the player first set routing information for the original train. What about a train that is created that has…

Continue reading
Computers & Programming

Video of a Working Train

The code is still far from optimal but the track network traversal and linear distance computations are working correctly. I haven’t tested a train with cars facing in both forward and reverse directions but the code is all written to handle it. It’s a lot of code for…

Continue reading
Computers & Programming

Working Single Unit Train

I have a working sample of the code I mentioned in an older blog post. I have a self-propelled train car that moves along any unending track layout. When the front wheels of the train car passes over a turnout, a random choice is made by this train…

Continue reading
Computers & Programming

Railroad Train Movement

I wrote some code and then had an epiphany. A minor one but one that made me realize I had approached something in the wrong way. It was not much code and can be reused with the new idea. First, the requirement is that the train move in…

Continue reading