Russian Railway Magnate

People are still making stuff for the Sinclair related machines. Tell us about new games and other software that runs on the Spectrum, ZX80/ZX81, Pentagon and Next.
Post Reply
Andrew771
Drutt
Posts: 42
Joined: Mon May 04, 2020 9:59 pm
Location: Moscow, Russia

Russian Railway Magnate

Post by Andrew771 »

I present my new game: "Russian Railway Magnate" - a turn-based economic strategy: https://zx-pk.ru/threads/31770-russian- ... gnate.html
You are a railroad tycoon who competes with two other tycoons (a computer plays for them). Your goal is to connect as many cities of the Russian Empire as possible to your railway network and prevent others from doing so, eventually becoming a monopolist. Building and maintaining a network is costly. Each city gives an income depending on the amount of cargo in it, as well as your established tariff for transportation. If one city is attached to several tycoons, then all the income from the city goes to the tycoon, who has a lower tariff. If the tariffs are the same, then the income is divided equally.
Game for 48k. There are two versions: Russian and English. And also a bonus track - not included in the game music due to lack of space. The author of the music is the composer of the 19th century Mikhail Glinka. The code and graphics are mine. 80% of the code is written in ZX Like Pascal cross-compiler.

Image
Coder of ZXOOM, Euphoria 2D, ZX Like Pascal, Russian Railway Magnate...
User avatar
PeterJ
Site Admin
Posts: 6873
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Russian Railway Magnate

Post by PeterJ »

I'm just loving that we have members of the Russian scene with us. Thank you for joining us!
akeley
Dynamite Dan
Posts: 1043
Joined: Sat Feb 01, 2020 5:47 pm

Re: Russian Railway Magnate

Post by akeley »

Amazing news! I like action games, but we really need more strategy/RPGs on the ZX too. Bonus points for the Russian setting, makes it even more interesting.
User avatar
Alessandro
Dynamite Dan
Posts: 1910
Joined: Wed Nov 15, 2017 11:10 am
Location: Messina, Italy
Contact:

Re: Russian Railway Magnate

Post by Alessandro »

The game is actually simpler than it sounds - basically you need to connect cities in the most efficient way to avoid wild expenses, and try not to be cornered by your opponents - but interesting nonetheless. I am having a go with Kaganovich because he and Witte were the only characters I ever heard of :lol: We definitely need more titles like this one.

Edit: I won the game :D I did it not only by blocking the opponent's expansion in my network, but also by keeping an eye on the opponent's tariffs, so that by lowering mine of 1 each turn the income from contested cities went into my pockets. I noticed that the computer seems to go as low as 20, then raises the tariff back to 30 each time. A sort of attrition war, but it helped me in the long run.
Andrew771
Drutt
Posts: 42
Joined: Mon May 04, 2020 9:59 pm
Location: Moscow, Russia

Re: Russian Railway Magnate

Post by Andrew771 »

Price war, as in real life. :) I also play on such a strategy.
Coder of ZXOOM, Euphoria 2D, ZX Like Pascal, Russian Railway Magnate...
Andrew771
Drutt
Posts: 42
Joined: Mon May 04, 2020 9:59 pm
Location: Moscow, Russia

Re: Russian Railway Magnate

Post by Andrew771 »

Alessandro wrote: Sun May 10, 2020 10:59 pm I noticed that the computer seems to go as low as 20, then raises the tariff back to 30 each time. A sort of attrition war, but it helped me in the long run.
The algorithm calculates the optimal price for the adversary at which he has the maximum income. There may be any minimum price. When I played, the price was 7. If it drops too low, then it is no longer profitable to lower it further, so it rises to a maximum of 30.
Coder of ZXOOM, Euphoria 2D, ZX Like Pascal, Russian Railway Magnate...
User avatar
PeterJ
Site Admin
Posts: 6873
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Russian Railway Magnate

Post by PeterJ »

[mention]Andrew771[/mention],

Please could you provide more detail on 'ZX Like Pascal'? I've not heard of this before? I used Pascal at College and am.aware of the HiSoft version.

Edit: Just seen your thread here. Is there any English language documentation by any chance?

https://zx-pk.ru/threads/24967-zx-like-pascal.html
Andrew771
Drutt
Posts: 42
Joined: Mon May 04, 2020 9:59 pm
Location: Moscow, Russia

Re: Russian Railway Magnate

Post by Andrew771 »

I'm just doing documentation in English for ZX Like Pascal. In Russian is in the archive at the link you provided.
Here I will write briefly.
Supported:

Font for 4x8 characters (64 symbols per string)

Types:
byte
word
string[N] (N=1..255)
1- and 2-dimensional arrays of byte and word
1-dimensional arrays of string[N]

Constants: numeric 0..65535

Arithmetic expressions with:
+
-
*
/ (div)
% (mod)
( )
Random(x)

String expressions with concatenation

Standard operators supported:
:=, write(ln), read(ln), case, clrscr, delay, for-to-downto, gotoXY, if-then-else, randomize, readkey(key1,key2) (no standard realization), repeat-until, textbackground, textcolor, while-do, asm(procedure_name)

Operators for color setting:
border(x)
color(x) - x=attribute byte (flash+bright+paper+ink)

Operators for sprites:
SpritePutClear(sprite_name,color,x,y)
SpritePutAnd(sprite_name,color,x,y)
SpritePutOr(sprite_name,color,x,y)
SpritePutXor(sprite_name,color,x,y)
SpritePutMirrorClear(sprite_name,color,x,y)
SpritePutMirrorAnd(sprite_name,color,x,y)
SpritePutMirrorOr(sprite_name,color,x,y)
SpritePutMirrorXor(sprite_name,color,x,y)

Sprites are defined by codes after last "end" of pascal program

Operators for windows:
WindowSet(x,y,width, height) - set of window tile parameters for next operators
WindowClear
WindowGet - window image to memory
WindowPut - window image from memory
WindowScrollUp - on 1 pixel
WindowScrollDown - on 1 pixel
WindowScrollLeft - on 1 pixel
WindowScrollRight - on 1 pixel

Operators for maps:

Map is 2-dimensional labirint, landscape, playing field... Map is associated with 2-dimensional array of byte. Array contains ID of cells. Sprite bitmap is sequence of sprite codes for ID (after last "end" of pascal program).

MapSet(array_name,sprite_bitmap_name,x,y,width, height) - set of array and bitmap names and screen tile coordinates for map output
MapPut1x1(x,y) - output of 1x1 tile map to screen from x,y cells at array
MapPut2x2(x,y) - output of 2x2 tile map to screen from x,y cells at array
MapSearch(...) - search a cell ID at map array for various criteria

Other operators:
ArrayClear(array_name) - quick cleaning of numeric or string array
ScreenThaw
SoundEffect(wave_n,wave_time,wave_frequency) - wave sound effect for beeper
VirtScreenClear - cleaning of virtual (shadow) screen in memory
VirtScreenPut - output virtual screen from memory to real screen

Filling the virtual screen with texts and sprites occurs as well as the real screen, with the special compilation flag turned on.

After last "end" of pascal program are placed a codes of sprites, assembler procedures and other information.

ZX Like Pascal compilates to assembler code with optimizations.
Coder of ZXOOM, Euphoria 2D, ZX Like Pascal, Russian Railway Magnate...
User avatar
PeterJ
Site Admin
Posts: 6873
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Russian Railway Magnate

Post by PeterJ »

Thanks [mention]Andrew771[/mention]
User avatar
R-Tape
Site Admin
Posts: 6402
Joined: Thu Nov 09, 2017 11:46 am

Re: Russian Railway Magnate

Post by R-Tape »

Great game [mention]Andrew771[/mention]. I just 'won' (in your face Vladimir Yakumin and Yefin Cherapanov!) with my network spreading east and north to Helsinki, Odessa, Archangelsk. As your network grows I realised you can become quite brutal and not only undercut your competitors by a penny, but by a 5p each time, which forces them to drop their prices lower than their dwindling finances can afford. Not very comradely of me, but I rather enjoyed that. Having said that, I didn't have many shared cities, so competition wasn't very fierce.

I think it would be better if the tariffs could only be changed every 8 turns or so. It makes for a fairly repetitive and easy strategy when it's every turn.
Andrew771
Drutt
Posts: 42
Joined: Mon May 04, 2020 9:59 pm
Location: Moscow, Russia

Re: Russian Railway Magnate

Post by Andrew771 »

Thank you, [mention]R-Tape[/mention] !
And thanks for the great idea.
I recently tried to make sure that with a certain balance of money from competitors (300-400 thousand rubles), they already gave up the competition and set the price at a maximum of 30 rubles in order to save a little and move away from the critical line. But this did not help to improve the game. Still, the optimal strategy is being calculated now. But setting the price every few moves is an interesting idea, I'll try it sometime.
Actually, when I was thinking about the game, I wanted to do it in a completely different way. Different cities produce different types of goods, while in other cities they are consumed. And it is necessary to transport these goods between cities, it would be necessary to search and build optimal routes in order to have more profit. Moreover, the paths have a maximum capacity, so it would be necessary to think about how to carry out alternative paths. But I figured it would take up a lot of memory, and the playability would be questionable, it would look more like a logistics program than a game.))
Coder of ZXOOM, Euphoria 2D, ZX Like Pascal, Russian Railway Magnate...
User avatar
R-Tape
Site Admin
Posts: 6402
Joined: Thu Nov 09, 2017 11:46 am

Re: Russian Railway Magnate

Post by R-Tape »

Andrew771 wrote: Wed May 19, 2021 8:36 pm Actually, when I was thinking about the game, I wanted to do it in a completely different way. Different cities produce different types of goods, while in other cities they are consumed. And it is necessary to transport these goods between cities, it would be necessary to search and build optimal routes in order to have more profit. Moreover, the paths have a maximum capacity, so it would be necessary to think about how to carry out alternative paths. But I figured it would take up a lot of memory, and the playability would be questionable, it would look more like a logistics program than a game.))
I did wonder about types of commodity giving the game more depth. It's a very intersting idea, but as you say things could get too complicated to work. It's good as it is, and more people may try it because it's easy to pick up and play.
R-Tape wrote: Sat May 08, 2021 12:02 pm ...with my network spreading east and north to Helsinki, Odessa, Archangelsk.
Damn I meant WEST! I keep confusing left/right as east/west!
Post Reply