Russian Railway Simulator (RRS): first public release

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

Passenger train at Rostov Glavny station (clickable)

Russian Railway Simulator (RRS): first public release

What is RRS? It is an open cross-platform simulator for rolling stock of the 1520 mm gauge. The reader may reasonably ask, "Wait, what is the purpose of this project, if there are enough railway-themed simulators, both commercial and open?" To answer this question, I invite you to read on.

Project history

Once upon a time, in 2001, Microsoft Train Simulator (MSTS), which gave rise to a huge community of rail simmers in our country, saw the light of day. During the several years that this project existed (until Microsoft abandoned it to focus on more interesting things for them, like bankrupting Nokia, etc.), the project amassed a plethora of add-ons created for it: routes, rolling stock, scenarios.

Based on MSTS, several other projects were subsequently created, such as OpenRails, RTrainSim (RTS) and various other add-ons and derivatives. There were also commercial projects, such as the famous Trainz.Everything would be fine, but many railway enthusiasts are dissatisfied with these products for quite objective reasons — they do not reflect the specifics of the domestic rolling stock that is operated and developed in the post-Soviet space. This is particularly evident when looking at how train brakes are implemented — none of the mentioned projects have a proper implementation of automatic brakes of the Matrosov system, nor will they.

In the not-so-distant 2008, another project appeared — ZDSimulator, developed by Vyacheslav Usov. This project is remarkable in that it takes into account and corrects the aforementioned shortcomings, while initially oriented towards Russian gauge rolling stock. But there is one big "but" — the project is proprietary and closed, architecturally not allowing for the integration of one's own rolling stock.

I first came to railway themes in 2007 when I started working at OJSC VNIIM, in the position of a research associate, and after defending my PhD thesis in 2008 — as a senior research associate. That was when I became acquainted with the latest achievements in the field of railway simulation games. What I saw did not appeal to me, and at that time the ZDSimulator project did not yet exist. Later, captivated by the dynamics of rolling stock, I joined the Rostov State Transport University (RSTU) with a doctoral thesis topic on the dynamics of freight train braking. Today, I lead the development of training complexes for railway transport at our university and teach specialized subjects in the department of 'Traction Rolling Stock'.

In light of all the above, the idea of creating a simulator arose, which would allow the addon developer to gain complete control over the physical processes occurring in the rolling stock. Similar to the space simulator Orbiter, for which I had previously developed an addon in the form of a family of launch vehicles based on the R-7. A year ago, I undertook this project and fully immersed myself in it. On December 26, 2018, this technological demo.

was released. My work was noticed by enthusiasts, and a well-known figure in the railway simulation community and creator of visual content for ZDsimulator, Roman Biryukov (Romych RZHDUZ) offered me assistance and collaboration in further developing the project. Later, another developer joined us — Alexander Mishchenko (Ulovskii2017), creator of routes for ZDsimulator. Our collaborative effort led us to the first release. The video shows an overview of how the game looks at its first release.

Play video

Features of the RRS simulator

First and foremost, it features an open software architecture. Not to mention that the simulator's code is open, there is an API and SDK aimed at developers of third-party addons. The entry barrier is quite high — basic skills in C++ development are required. The simulator is written in C++, using the GCC compiler and its MinGW variant for the Windows operating system. Additionally, familiarity with the Qt framework is advisable, as many concepts from it are fundamental to the game's architecture.

However, with proper diligence and desire, this project opens up huge opportunities for add-on developers. The rolling stock is implemented as modules based on dynamic libraries. The main structural element in the simulator is the unit of rolling stock, or a rolling unit (RU) — a carriage (non-self-propelled or within a multiple unit train) or a locomotive section. The API allows for setting the torque applied to the wheel pairs of the RU, receiving in response the angular velocity of the wheel pairs, as well as external parameters like voltage and current type in the contact network. The simulator knows nothing more and does not want to, leaving the physics of the internal equipment's operation to the developer of the specific locomotive or carriage.

It's easy to guess that such a relatively low-level approach allows the implementation of the most minute details of the locomotive scheme. Moreover, the simulator package includes a set of standard equipment installed on domestic rolling stock: the driver's cabin crane No. 395, air distributor No. 242, auxiliary brake crane No. 254, and other elements of the braking equipment. The add-on developer only needs to connect these elements in the pneumatic scheme of the specific locomotive or carriage. Additionally, there is an API for creating custom equipment blocks.

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

  • simulator — the TrainEngine 2 physics engine. It implements the physics of train movement, taking into account numerous external factors, considers the interaction of rolling units through coupling devices, and processes data coming from external modules that implement the physics of rolling stock equipment.
  • viewer — a graphical subsystem that visualizes train movement, built on the basis of the graphics engine OpenSceneGraph

These subsystems interact with each other through shared memory implemented using the QSharedMemory class of the Qt framework. The initial demo versions used IPC based on sockets, and in the future, a return to this technology is planned, considering the refinement of certain parts of the simulator and future needs. The transition to shared memory was somewhat of a forced measure that has outlived its usefulness.

I won't go into details — many of the twists and turns in the development of this project have already been described in my publications on the resource, particularly I have quite an extensive tutorial series on the OpenSceneGraph engine, which actually stemmed from the practical experience gained from this project.

Things in the project are not as smooth as I would like. In particular, the graphics subsystem is quite far from perfection regarding rendering quality, and the simulator's performance leaves much to be desired. This release has one goal — to introduce the community of railway transport enthusiasts to the project, outline its capabilities, and finally create an open, cross-platform railway simulator with an advanced API for developers of add-ons.

Prospects

The prospects depend on you, our dear future users and developers. The project is open, existing the official website, where you can download the simulator, with documentation, a collection that will be continuously updated. There is forum project, a VK group, and YouTube channel, where you can get the most detailed consultation and assistance.

Thank you for your attention!

Source: habr.com

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster