VLAK (The Train) Game
Links:
Vlak online: https://makerclass.cz/train-original/
Vlak on Steam: https://store.steampowered.com/app/4122730/VLAK/
Vlak on Wikipedia: https://cs.wikipedia.org/wiki/Vlak_(počítačová_hra)
Vlak on YouTube: https://www.youtube.com/playlist?list=PL84lNp7Gie34PqwHGBN5Ck3pU06tnKAHW
Vlak (The Train) is a freeware game based on the principle of Snake. The aim of the game is to collect all the items, avoid obstacles, and finally pass through the exit gate. I created the game in 1993 under MS-DOS. Game contains 50 scenes. At the time, I did not expect the game to become so popular and well-known. Even today, people still approach me about Train and remember it as a favorite game from their youth.
If you want to port the Train game to other systems or devices, I recommend using the source files from version 2.20 for PicoPad (written in the C programming language) and the graphics files from version 2.10 for Windows (they have a higher resolution, 32x32 pixels).
License: The game is completely freeware and open source - any materials listed here (graphics, sounds, source codes) can be freely used for any purpose, including commercial ones.
was the first version of Vlak for MS-DOS, released on May 29, 1993. We originally distributed it as part of the DOS Manager (DOSMAN) file manager. I created the graphics in the DOS graphics editor Deluxe Paint, and then converted them to "my" format using the ANIMSCR program (screen capture), which is part of the ANIM animation program. The game requires an EGA or VGA graphics card. It uses graphics mode 13 (0x0D, 0Dh), i.e. a resolution of 320x200, 16 colors. Objects are 16x16 pixels in size. The playing area is divided into 20x12 squares, plus an info line 8 lines high. The game source code comments are in Czech, in KEBCS2 (Kamenickych) code. For better readability, I have additionally added the VLAK_WIN1250.ASM file, converted to Windows-1250 code, to the source codes.
I wrote the program in x86 assembler. I used the KONTEXT.COM text editor to edit the program and compiled it with the Turbo Assembler compiler. The result of the compilation was the VLAK.COM program with a size of 39378 bytes. I compressed it with my own compression program PROCOMP.COM (= Program Compressor) and equipped it with POJ.COM, which protects the program against viruses using self-checking. The result was the VLAK.COM program with a size of 13154 bytes.
There are 18 items to collect in the scenes: 1 crystal, 2 crown, 3 tree, 4 apple, 5 cow, 6 cherry, 7 pond, 8 giraffe, 9 ice cream, 10 cake, 11 computer, 12 car, 13 balloon, 14 alarm clock, 15 elephant, 16 bottle of wine, 17 coin, and 18 airplane. The program calibrates itself at startup according to the timer at address 0000h:046Ch (clock with a frequency of 18.20651 Hz, period 0.05492540 seconds, 1573043 pulses per day, derived from a 1193182 Hz crystal after division by 65536; AT Bios uses a period of 1573040). The Cekej() function waits for the specified time in milliseconds and is used for short times (sound). For object animation and train movement, a timer at address 0000h:046Ch is used - one train step and one animation cycle takes 3 timer pulses, i.e. an interval of 165 milliseconds. The game state is not saved - instead, players are shown a password that they can use to return to the last completed scene next time.
Download game Vlak 1.00, with source codes
Vlak 1.0 on GitHub: https://github.com/Panda381/DOS-Progs/tree/main/HRY/VLAK/V100
Game graphics:
After the success of the first version of the game, I decided to release a new version. It was based on user requests to be able to create their own game scenes. Vlak version 2.00, for MS-DOS, was released on May 22, 1995. I wrote it again in x86 assembler. The main difference was that the game was created as a kit that users could modify and edit scenes. The program itself was compiled with Turbo Assembler, creating the file VLAK.EXE, 123715 bytes in size (it contained a lot of free space for loading data). The program was then compressed with LZEXE (an EXE program compressor) into the file VLAK$.EXE, 5918 bytes in size. In addition, the data files VLAK.SCN, containing scene definitions, and VLAK.PCX, containing game graphics, were compressed using the HLPGEN.COM program into the files VLAK$.SCN and VLAK$.PCX.
The game was not launched by directly running the program, but via the VLAK.BAT command file, which launched the game with the command "@vlak$.com vlak$.exe". The HLPRUN.COM program, renamed to VLAK$.COM, was used as the program launcher. When launched, HLPRUN ran the VLAK$.EXE program, specified as a parameter, and monitored the program's access to files. If it detected that the program was opening a file compressed by HLPGEN, it decompressed the loaded data in the background. Thanks to this process, the files of the final game distribution took up only 24176 bytes in total, and yet anyone could modify the game's scenes and graphics without having access to the game's source code. However, to prevent ordinary players from viewing the solutions to scenes and passwords, the instructions were minimized to only recommendations on which command to use to unpack the files, and more detailed information was described in the VLAK.SCN file. The HLP.COM program can also be used to decompress files.
The VLAK.SCN file, when unpacked, is a regular text file (script). The semicolon ';' character indicates a comment line. The first non-empty lines contain text that is printed as a message when the program ends. The message text ends with a dollar sign '$'. Each scene begins with a line containing a 5-character password. This is followed by a line (or more) of macros with the solution to the scene, preceded by an exclamation mark '!'. It contains the letters U, D, L, R to control the direction of movement, ending with the letter 'S' to stop. The solution macro is followed by 12 lines, 20 columns long, with the scene definition. The definition contains the following characters: . nothing, $ locomotive, @ gate, A crystal, B crown, C tree, D apple, E cow, F cherries, G pond, H giraffe, I ice cream, J cake, K computer, L car, M balloon, N alarm clock, O elephant, P wine, Q money, R airplane, S Lemming, T reserve 2, # wall.
The game source code comments are in Czech, in KEBCS2 (Kamenickych) code. For better readability, I have additionally added the VLAK_WIN1250.ASM and VLAK_WIN1250.SCN files, converted to Windows-1250 code, to the source codes.
Another difference from version 1.00 is support for the Hercules graphics card - colors are displayed as shades of gray. In the game, you can press the F1 key to play back the solution to a scene - the solution is played back as a macro from the VLAK.SCN file. The solution to a randomly selected scene is also played back on the start screen when the player is inactive. The last significant difference is the display of random messages when the player crashes.
List of messages (in Windows-1250 code, Czech language)
Download game Vlak 2.00, with source files
Vlak 2.00 on GitHub: https://github.com/Panda381/DOS-Progs/tree/main/HRY/VLAK/V200
Game graphics:
Unofficially, at the suggestion of my daughter, a special version of the game was created, where instead of a locomotive, a cat chased a mouse. However, this version never appeared anywhere:
Vlak version 2.01 was not so much a new version of the game as a mere modification of the files. It was released on May 26, 1995. It was created to improve graphics for monochrome monitors. The VLAK.BAT command file called the DETCARD.COM program, which detected either a color or monochrome display. Depending on the detection result, either the original file with color graphics or a file with limited black-and-white graphics was used for the graphics.
Vlak 2.01 on GitHub: https://github.com/Panda381/DOS-Progs/tree/main/HRY/VLAK/V201
Vlak version 2.10 was created as part of the Gemtree Peter (or Peter on GitHub) application demo programs. It was released together with the first version of Peter 1.00 on Children's Day, June 1, 1999. It was already a Windows version - it requires Windows 95 or higher to run. For these reasons, the program is somewhat larger – 598528 bytes. In addition to being a Windows program, the biggest change is the higher resolution. The DOS version worked at a resolution of 320x200 pixels, while the Windows version uses a resolution of 640x416 pixels and 224 colors. The icons have been enlarged from 16x16 pixels to 32x32 pixels. The game was distributed together with the source code. However, the source code is not in text form, but in the form of structured data. The source code is displayed by opening the program in the Gemtree Peter editor. The game again includes solutions to scenes on the F1 key, but no longer includes messages when a train collides.
Vlak 2.10 on GitHub: https://github.com/Panda381/DOS-Progs/tree/main/HRY/VLAK/V210
Game graphics:
Train to Becherovka was a version of the game created for a competition organized by Becherovka in 2009. The game was released on May 20, 2009. It was created in Macromedia Flash 8 Pro trial. It is therefore a Flash program that requires a Flash player. Today, Flash Player is no longer supported by web browsers, but the game can still be run as an EXE program. The game is available in English and Czech. It supports sending scores to a scoreboard, but this was located on the Becherovka server, and today the score saving function is no longer working.
Download game Train to Becherovka, with source file for the Flash editor
Train to Becherovka on GitHub: https://github.com/Panda381/DOS-Progs/tree/main/HRY/VLAK/BECHER
Vlak version 2.20 is not directly a newer version of the game. It is a port to the PicoPad game console, with a Raspberry Pico RP2040 module and an ST7789 display with a resolution of 320x240 pixels, 16-bit colors. The game uses the original 16-color graphics from Vlak version 2.00, for a resolution of 320x200 pixels. The size of the squares is 16x16 pixels. The advantage of this version is that it is written in the C programming language, making it easily portable to other systems or devices. The game requires the PicoLibSDK library for compilation for PicoPad, but it should be easily replaceable for other systems. The game was released together with the first version of the PicoLibSDK library on March 8, 2023.
Download game Vlak 2.20 for PicoPad, with source files
Vlak 2.20 for PicoPad on GitHub: https://github.com/Panda381/PicoLibSDK/tree/main/PicoPad/GAME/TRAIN

Game graphics:
The game is essentially the same as version 2.20 for PicoPad, differing only in minor details such as a different graphics format. The output is on a VGA monitor, with a resolution of 320x240 pixels, 8 bits per pixel. The game requires the PicoLibSDK library to be compiled for PicoPad.
Download game Vlak for Picoino, with source files
Vlak for Picoino on GitHub: https://github.com/Panda381/PicoLibSDK/tree/main/Picoino/GAME/TRAIN
The game is essentially the same as version 2.20 for PicoPad, differing only in minor details such as control via a USB keyboard. The output is to a VGA monitor, with a resolution of 320x240 pixels, 8 bits per pixel. The game requires the PicoLibSDK library to be compiled for PicoPad.
Download game Vlak for DemoVGA, with source codes
Vlak for DemoVGA on GitHub: https://github.com/Panda381/PicoLibSDK/tree/main/DemoVGA/GAMES/TRAIN
This version of the game was created as a demo game for the PidiPad console. It is a minimalist console with an inexpensive CH32V006E8R6 processor. The software was created by minimizing the code of version 2.20 for PicoPad, adapting it to a smaller resolution of 160x120 pixels and 16 colors. The squares are 8x8 pixels in size. The graphics are not fully 16-color; reduced attribute graphics with a 2x2 pixel cell are used. The output is on a VGA monitor. The game requires the CH32LibSDK library for compilation.
Download game Vlak for PidiPad, with source files
Vlak for PidiPad on GitHub: https://github.com/Panda381/CH32LibSDK/tree/main/Pidipad/Games/Train

Game graphics:
![]()
Train for TweetyBoy is another reduced version of the game, for the TweetyBoy console, based on the original version 2.20 for PicoPad, adapted to a smaller resolution of 160x80 pixels and 16 colors. The squares are 8x6 pixels in size. The game requires the CH32LibSDK library for compilation.
Download game Vlak for TweetyBoy, with source files
Vlak for TweetyBoy on GitHub: https://github.com/Panda381/CH32LibSDK/tree/main/Tweetyboy/Games/Train

Game graphics:
![]()
A reduced version of the game for BabyPad and BabyPC consoles, resolution 160x120 pixels, black and white output to a VGA monitor. The size of the squares is 8x8 pixels. The game requires the CH32LibSDK library for compilation.
Download game Vlak for BabyPad, with source files
Download game Vlak for BabyPC, with source files
Vlak for BabyPad on GitHub: https://github.com/Panda381/CH32LibSDK/tree/main/Babypad/Games/Train
Vlak for BabyPC on GitHub: https://github.com/Panda381/CH32LibSDK/tree/main/Babypc/Games/Train
Game graphics:
![]()
A reduced version of the game for BabyBoy, BeatleBoyPad, and PidiBoy consoles, with a resolution of 128x64, black and white. The size of the squares is 6x5 pixels. The game requires the CH32LibSDK library for compilation.
Download game Vlak for BabyBoy, with source files
Download game Vlak for BeatleBoyPad, with source files
Download game Vlak for PidiBoy, with source files
Vlak for BabyBoy on GitHub: https://github.com/Panda381/CH32LibSDK/tree/main/Babyboy/Games/Train
Vlak for BeatleBoyPad on GitHub: https://github.com/Panda381/CH32LibSDK/tree/main/Beatleboypad/CH32V002/Train
Vlak for PidiBoy on GitHub: https://github.com/Panda381/CH32LibSDK/tree/main/Pidiboy/Games/Train
Game graphics:
![]()
Macros with solutions of the levels: MACRO.TXT
0: intro ... Solve of levels on YouTube
The train never got an official release as a standalone game. That's why, a few years ago, at the request of users, I released a multi-edition of Gema Soft/Gemtree programs as the last official distribution of my software from our former company. In addition to the DOS Manager and Gemtree Peter programs, the distribution also included a floppy disk with the Vlak game. Today, all packages have already been distributed among collectors, but most of the materials used to produce them are available on GitHub: https://github.com/Panda381/DOS-Progs.
The image of the 1.44MB floppy disk with the game Vlak can be found in the file VLAK.DSK. The image can be written to a floppy disk using, for example, the DOS Manager program, disk copy function. The file contents of the floppy disks are in the folder https://github.com/Panda381/DOS-Progs/tree/main/!DISKETY/VLAK. The graphic template for printing the floppy disk label can be found in the FD_VLAK.PNG file. I printed the graphic templates on self-adhesive paper for CD labels, in A4 format. The BOX-VLAK.png file contains graphics for printing the floppy disk cover. I printed it on "hammered cardstock".

I edited almost all DOS programs in the KonText text editor. Originally, it was the ConText v2.2 editor by German author (c) 1989 DMV Software - Matthias Uphoff. I really liked the editor because it was easy to use and had a lot of features. I remade the editor into Czech and reprogrammed the drivers for the display. Above all, I created a driver that also enabled text video mode, which made KonText an excellent and fast editor, suitable even for writing program source code. To this end, I also improved some of its functions. For example, there was a handy function for bookmarks in the file, which allowed you to quickly and conveniently jump between different places in the written program. After agreement with the original company, we distributed KonText on the Czech market. To this day, I believe that at that time there was no better text editor for writing not only programs, but also formatted text (and I am comparing it even with the then popular T602).
Download Czech version of the KonText editor for DOS
KonText on GitHub: https://github.com/Panda381/DOS-Progs/tree/main/KONTEXT
Vlak online: https://makerclass.cz/train-original/
Vlak on Steam: https://store.steampowered.com/app/4122730/VLAK/
... I will add foreign clones of the game Vlak here later.
Miroslav Nemecek