Russian Railway Simulator (RRS): first public release

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



Passenger train at the Rostov Glavny station (clickable)







What is an RRS? This is an open cross-platform simulator of rolling stock 1520 mm gauge. The reader will naturally ask the question: โ€œExcuse me, why do I need this project if there are a sufficient number of railway simulators, both commercial and open,?โ€ For the answer to this question, I propose to look under the cat



Project history



Once upon a time, in 2001, Microsoft Train Simulator (MSTS) saw the light of day, spawning a huge community of railway simmers in our country. For the several years this project has existed (until Microsoft abandoned it, doing more interesting things for it, such as bankruptcy of Nokia, etc.), the project has grown in the mass of additions created for it: routes, rolling stock, scenarios.



Based on MSTS, subsequently, a number of other projects were created, such as OpenRails , RTrainSim (RTS) and other add-ons and derivatives. Commercial projects have also appeared, such as the famous Trainz . And everything would be fine, but many railway transport enthusiasts are not satisfied with these products for quite objective reasons - they do not reflect the specifics of the domestic rolling stock, operated and developed in the post-Soviet space. This is especially acute when looking at how train brakes are implemented - in none of these projects there is and will not be a normal implementation of the automatic brakes of the Matrosov system.



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



I myself came to the railway topic in 2007, when I started working at VELNII OJSC as a research fellow, and after defending my dissertation in 2008, I became a senior fellow. Then I got acquainted with the latest achievements at that time in the field of railway simulation games. And what I saw, I did not like, and the ZDSimulator project at that time was not there. Later, I, fascinated by the dynamics of rolling stock, came to Rostov State University of Railway Engineering ( RGUPS ) with the topic of a doctoral dissertation on the dynamics of braking of a freight train. To date, I lead the development of train simulators for railway transport for our university and teach specialized disciplines at the Department of Traction Rolling Stock.



In connection with all of the above, the idea arose of creating a simulator that would allow the developer of the add-on for him to get full control over the physical processes taking place in the rolling stock. Akin to the Orbiter space simulator, for which I once developed an addition in the form of a family of R-7-based carrier rockets. A year ago, I took up this work and went into it with my head. On December 26, 2018, this technological demo was released .



My work was noticed by enthusiasts, and Roman Biryukov (Romych RZhDUZ) , the creator of visual content for ZDsimulator, a well-known in the circles of railway simmers, offered me help and cooperation in the further development of the project. Later, another developer joined us - Alexander Mishchenko (Ulovskii2017 ), the route creator for ZDsimulator. Our collaboration led us to the first release. On 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 the fact 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 - you need basic C ++ development skills. The simulator is written specifically on it, using the GCC compiler and its version of MinGW for the Windows operating system. In addition, it is desirable to introduce the developer to the Qt framework, since many of the concepts from it are at the core of the game's architecture.



However, with due diligence and desire, this project opens up great opportunities for the add-on developer. Rolling stock is implemented in the form of modules based on dynamic libraries. The main structural element in the simulator is a unit of rolling stock , or a mobile unit (PE) - a car (non-self-propelled or as part of a motor train car) or a locomotive section. The API makes it possible to set the torque applied to the wheel pairs of the PE, in response to receiving the angular speed of the wheel pairs, 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 car.



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



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





These subsystems interact with each other through shared memory, implemented on the basis of the QsharedMemory class of the Qt framework. The first demos used IPC based on sockets, and in the future it is planned to return to this technology, given the completion of some parts of the simulator and needs with an eye to the future. The transition to shared memory was, to some extent, a forced measure that has become obsolete.



I will not describe the nuances - many of the ups and downs of the development of this project are already described in my publications on the resource, in particular, I have a rather extensive 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 very far from perfect in terms of rendering quality, and the sim's performance leaves much to be desired. This release has one goal - to acquaint the community of railway transport enthusiasts with the project, outline its capabilities and finally create an open, cross-platform railway simulator with an advanced API for the add-on developer.



Prospects



The prospects are up to you, our dear future users and developers. The project is open, there is an official site where you can download the simulator, with documentation , the composition of which will be continuously updated. There is a project forum , a VK group , and a YouTube channel where you can get the most detailed advice and assistance.



Thanks for your attention!



All Articles