Russian Railway Simulator (RRS): first public release

The long-awaited day has come when I can finally present this development. The project was started exactly one year ago, on September 1, 2018, at least in RRS repositories on Gtihub the first commit has exactly that date.

Passenger train at Rostov Glavny station (clickable)

Russian Railway Simulator (RRS): first public release

What is RRS? This is an open cross-platform simulator of 1520 mm gauge rolling stock. The reader will naturally ask the question: β€œExcuse me, but what is this project for, if there are enough simulators of the railway theme, both commercial and open?” For an answer to this question, I propose to look under the cat

Project History

Once upon a time, in 2001, saw the light Microsoft Train Simulator (MSTS), which gave rise to a huge community of railway simmers in our country. For several years that this project existed (until Microsoft abandoned it, doing more interesting things for it, such as the bankruptcy of Nokia, etc.), the project was overgrown with a mass of add-ons created for it: routes, rolling stock, scenarios.

On the basis of MSTS, subsequently, a number of other projects were created, such as openrails, RTrainSim (RTS) and other additions and derivatives. There were also commercial projects, such as the famous trainz. And everything would be fine, but many fans of railway transport are not satisfied with these products for quite objective reasons - they in no way reflect the specifics of the domestic rolling stock operated and developed in the post-Soviet space. This is especially acute when looking at how the train brakes are implemented - in none of the listed projects there is and will not be a normal implementation of automatic brakes of the Matrosov system.

In the distant already, 2008, another project appeared - ZDSimulator, developed by Vyacheslav Usov. The project is remarkable in that it takes into account and corrects the above shortcomings, while initially focusing on Russian gauge rolling stock. But there is one big "but" - the project is proprietary and closed, architecturally not allowing the introduction of its own rolling stock into it.

I myself came to the railway topic in 2007, when I started working in OJSC VELNII, as a researcher, and after defending his Ph.D. thesis in 2008 - a senior researcher. At the same time, I got acquainted with the latest achievements in the field of railway simulation games at that time. And I didn’t like what I saw, and there was no ZDSimulator project at that time. In the future, I, carried away by the dynamics of the rolling stock, came to the Rostov State University of Communications (RSTU) with the topic of a doctoral dissertation on the dynamics of braking of a freight train. Today I manage the development of railway transport simulators for our university and teach specialized disciplines at the Department of Traction Rolling Stock.

In connection with all of the above, the idea arose to create a simulator that would allow the developer of the add-on for him to gain full control over the physical processes occurring in the rolling stock. Akin to the space simulator Orbiter, for which I once developed an add-on in the form of a family of launch vehicles based on the R-7. A year ago, I took this job and threw myself into it. December 26, 2018 saw the light of day here this tech demo.

My work was noticed by enthusiasts, and well-known in the circles of railway simmers, the creator of visual content for ZDsimulator Roman Biryukov (Romych RZHDUZ) offered me help and cooperation in the further development of the project. Later, another developer joined us - Alexander Mishchenko (Ulovskii2017), route creator for ZDsimulator. Our collaboration led us to the first release. In the video - some overview of how the game looks to its first release

RRS simulator features

First of all, it is an open software architecture. Not to mention that the simulator code is open, there is an API and SDK aimed at developers of third-party add-ons to it. The entry threshold is quite high - basic C++ development skills are required. The simulator is written on it, using the GCC compiler and its MinGW variant for the Windows operating system. In addition, familiarity of the developer with the Qt framework is desirable, since many of the concepts from it underlie the architecture of the game.

However, with due diligence and desire, this project opens up huge opportunities for the add-on developer. Rolling stock is implemented as modules based on dynamic libraries. The main structural element in the simulator is a rolling stock unit, or mobile unit (PU) - a wagon (non-self-propelled or as part of a multi-unit train) or a section of a locomotive. The API makes it possible to set the torque applied to the wheelsets of the PU, in response to receiving the angular velocity of the wheelsets, as well as external parameters, such as voltage and type of current in the contact network. The simulator knows nothing more and does not want to know, which leaves the physics of the operation of internal equipment on the conscience of the developer of a particular locomotive or wagon.

It is easy to guess that such a relatively low-level approach makes it possible to implement the smallest nuances of the locomotive circuit. In addition, the simulator package includes a set of standard equipment installed on domestic rolling stock: a train driver's crane, conv. No. 395, air distributor conv. No. 242, auxiliary brake valve conv. No. 254 and other elements of brake equipment. The add-on developer only needs to connect these elements into the pneumatic circuit of a particular locomotive or wagon. In addition, there is an API for creating your own equipment blocks.

Architecturally, RRS is built on the interaction of two main processes

  • simulator β€” the physical engine of train dynamics TrainEngine 2. Implements the physics of train movement, taking into account many external factors, taking into account the interaction of moving units through coupling devices, processes data coming from external modules that implement the physics of the rolling stock equipment
  • viewer - a graphic subsystem that performs visualization of the movement of the train, built on the basis of a graphics engine OpenSceneGraph

These subsystems interact with each other through a shared memory implemented on the basis of the QSharedMemory class of the Qt framework. The first demos used socket-based IPC, and a return to this technology is planned in the future, given the refinement of some parts of the simulator and the needs with an eye to the future. The transition to shared memory was, to some extent, a forced measure that has outlived its usefulness.

I will not describe the nuances - many of the ups and downs of the development of this project have already been described in my publications on the resource, in particular, I have a rather extensive a series of tutorials on the OpenSceneGraph engine, which grew out of the practice of working on this project.

In the project, not everything is as smooth as we would like. In particular, the graphics subsystem is far from perfect in terms of rendering quality, and the Sim's performance leaves much to be desired. This release has one goal - to introduce the project to the rail transport community, outline its capabilities and finally create an open, cross-platform rail simulator with an advanced API for the add-on developer.

Prospects

The future depends on you, our dear future users and developers. The project is open official sitewhere you can download the simulator, from documentation, the composition of which will be continuously replenished. Exists forum project VK groupand YouTube channelwhere you can get the most detailed advice and assistance.

Thank you for attention!

Source: habr.com

Add a comment