Рет қаралды 232
Video without DMI interface inserted is here: • Autopilot game screen
With the help of my HTML5 DMI engine and customised TSW2_Controller(this one is available open-source as GPL), the TSW can now be played automatically.
The engine adjusts the speed itself not to exceed the speed limit. Although I haven't implemented braking calculation algorithm yet, in this video, the train made a VERY NICE stop. I was very shocked too.
Note that during this video, I haven't touched anything on my keyboard. Everything was controlled by autopilot system.
The autopilot data can be read below accelerometer in DMI interface. Each text is 'Mode', 'Operation', 'Controller Position' respectively.
The driver chooses the mode for AP to follow. Then, the mode controls which operation to run and at which speed. Read the timeline for more details. Controller position from 0 to 100 means throttle, while negative numbers are brakes. It's the final calculated value passed to customised TSW2_Controller.
The process is like:
1. Driver selects mode
2. Mode runs operation. Operation has parameter. For example, speed operation has two parameters of min/max speed.
3. Operation calculates appropriate controller position. It works based on internal state. (like coasting, accel, decel of speed operation)
4. TSW2_Controller passes the position to the game
Timeline:
0:00 DMI b749
0:15 Autopilot departure
0:24 AutoDrive mode, Speed operation, 5-10 km/h, 42% Power
0:25 AutoDrive mode changes the operation to Speed 35-40. Speed operation sets 81% Power. The power increases as does the speed.
0:34 Speed operation reduces power
0:40 Speed operation enters coasting state
1:36 Speed operation enters brake state, soon followed by coasting
1:47 Speed operation enters power state
2:53 AutoDrive mode sets new Speed operation with slower speeds, as the train approaches stop point. This is a temporary code before I implement braking calculation, although it performed REALLY well.
3:18 Train is about to stop
3:25 Performance breakdown