Logistics: On Rails, Transport game I'm developing.

This is the place to talk about anything not related to Transport Tycoon itself.

Moderator: General Forums Moderators

Post Reply
User avatar
uzurpator
Tycoon
Tycoon
Posts: 2235
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Logistics: On Rails, Transport game I'm developing.

Post by uzurpator »

Since about November 2023, I've been developing a game I wanted to make for a long time. One could even say I attempted to make it at one point ( hint: Transport Empire ). Multiple times, behind the scenes, I restarted it several times, writing a few nibbles of code here and there. But it went nowhere for a long time.
I restarted the project in October 2023 for the umpteenth time, and frustrated with Ogre, I finally decided to bite the bullet and write the game engine from scratch. It’s been going on for the last year and a half. Currently, I’m about 86k lines of code into it.

In a nutshell, the game I’m creating will be a mix of Railroad Tycoon 3, Transport Tycoon, and Locomotion. This yet unnamed project inherits tile-based world, perspective, and how things are constructed from Chris Sawyer’s titles. RT3 gives it the sole focus on railroads and some mechanics, especially those on the financial side of things.

If you are wondering how deep I’m into it. Most of the supporting systems are already there. There is content management, configuration management, and even a content editor that you can download and play with today.
BrickED is the editor for the game’s graphical stuff, which is also developed in the direction of this project. You can download it and play with it a little, although note that I am about 200 revisions further along with it.

Tech wise, the game will be in full 3D, but played from a perspective similar to OTTD, just with things like smooth track curves or free rotation of view.

This topic is going to be my blog of sorts, as I think that this forum deserves to be the first place where I disclose the project.
Last edited by uzurpator on 13 May 2025 18:02, edited 1 time in total.
User avatar
uzurpator
Tycoon
Tycoon
Posts: 2235
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Re: Unnamed transport game I'm developing.

Post by uzurpator »

As I said above, the terrain is tile-based, but tiles are a little more freeform than those in TTD. I utilize the 3D environment to the fullest. Similar to how it looks in Locomotion, tiles can have different heights, creating ridges and edges. Unlike in locomotion, there are limits to this displacement, so as the player terraforms the space, the adjacent tiles will also change their altitude.
map3.png
map3.png (350.99 KiB) Viewed 4491 times
Moreover. Like I believe it is in Minecraft, the map has no set size, the player can always extend the game area in any direction, discovering new towns and industries.

If you are curious, yes, the seawater is sparkling just like in Transport Tycoon.
Attachments
map.PNG
(1 MiB) Not downloaded yet
User avatar
uzurpator
Tycoon
Tycoon
Posts: 2235
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Re: Unnamed transport game I'm developing.

Post by uzurpator »

Towns are similar to RT3. They are a collection of buildings that serve a purpose similar to their role in TTD, but there are no roads. Buildings are a representation of their purpose. In this image:
town2.png
town2.png (151.7 KiB) Viewed 4487 times
Each coloured placeholder model denotes a building. Green are rural buildings, aqua are residential, orange are industrial, violet are commercial and blue are business. Each of these denotes a ‘zone’ of a town. Zones produce different cargoes - such as passengers ( of several kinds ), mail, valuables, or general merchandise. The last type is produced and consumed by industrial zones, but works similarly to passengers.

As things are moved into a town, it grows. Towns left to their own devices, shrink. And yes, this mechanism already works.
User avatar
uzurpator
Tycoon
Tycoon
Posts: 2235
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Re: Unnamed transport game I'm developing.

Post by uzurpator »

Last, on todays streak of multiposting. Currently I'm working on heavy industries - coal mines, factories, steel mills and such. Today, I've finally finalized the mechanics of cargo distribution similar to how it works in RT3 - that is, cargoes slowly migrate from a producer to a consumer industry and can be picked up along the way.

Since I have nothing to show for it - other than unit test patterns and results - I have a family photo of placeholder models. The coloured town buildings you I already presented. Below them there is an input warehouse, processor and output warehouse - three components that industries are comprised of and which make those industries behave similarly to towns. Industries can grow, shrink or close if not serviced.
placeholders2.PNG
placeholders2.PNG (692.02 KiB) Viewed 4487 times
User avatar
uzurpator
Tycoon
Tycoon
Posts: 2235
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Re: Unnamed transport game I'm developing.

Post by uzurpator »

Showcase what the map will look like - at least at this stage of development. This was generated with a "mountainous" setting and is 512x512 in size. Currently, the engine does no frustum culling ( a fancy name for "renders what is invisible" ), so performance will go up once I implement it. This is run on Ryzen 5700x3d with Intel ARC770LE gpu, so quite a potent system.



My task for this week is rendering of industries and cargo travelling on the map.
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Unnamed transport game I'm developing.

Post by fonso »

Are you planning to develop the graphical assets as 3D models, too? BrickED Seems to be made for 2D content but the video here looks like you can zoom and spin the viewport at will.

I've also been working on a project, but I'm constrained by my complete inability to produce any graphical assets. I have a hexagonal tile system with railway segments spanning several tiles. There's a basic train movement system, and an unconventional signaling system. It's all done with bevy in rust. I might clean it up and share it in some form if you're interested in a collaboration.
The guy on the picture is not me, it's Alonso.
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Unnamed transport game I'm developing.

Post by fonso »

nine.png
(130.84 KiB) Not downloaded yet
Looks like this so far. The orange boxes are trains. I've been through 4 complete overhauls on the graphics system and I'm not happy.
The guy on the picture is not me, it's Alonso.
User avatar
uzurpator
Tycoon
Tycoon
Posts: 2235
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Re: Unnamed transport game I'm developing.

Post by uzurpator »

@fonso

BrickED you can download here can just generate sprites. BrickED from revision 845 ( not publicly available ) can convert a model made in it into a 3d mesh usable in this game. So - yes - it is going to be fully 3d and BrickED is the editor of choice.

I was also limited by lack of assets for a long time, so I developed an entire system for creating placeholders and an editor to easily edit them in a manner similar to how one draws sprites for TTD. It is my goal for the assets to be easily created without a need to handle modern meshes and/or knowing Blender or any other 3D suite.

I develop in C++, because that is what I do for living. But I'm interested in your approach algorithmically. Once I'm done with industries, I'll switch to terrain modification and later, track laying.
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Unnamed transport game I'm developing.

Post by fonso »

That's certainly some interesting tooling you've built there. My graphics tool of choice so far is OpenSCAD (https://openscad.org/). I've used it to generate the rail segments from mathematical descriptions. I have an OpenSCAD program that takes the length, angle between entry and exit, and horizontal offset of exit vs entry as parameters, and calculates a matching segment as 3D model. It works nicely for this purpose, but creating anything more detailed with it is quite a pain. I'm not sure if that's an actual limitation of the process or just me, though.
The guy on the picture is not me, it's Alonso.
User avatar
uzurpator
Tycoon
Tycoon
Posts: 2235
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Re: Unnamed transport game I'm developing.

Post by uzurpator »

Does not seem like much, but this shows the structure of all industries.
basic_fab.PNG
basic_fab.PNG (249.32 KiB) Viewed 3785 times
The pink buildings are offices, where the industry's Board of Directors resides. Their role is similar to that of a town's local authority. Above, there will be a display of this industry type, like "Coal Mine" or "Fizzy Drink Fountain."

The left building is an "Input Warehouse". You need to have this building In the catchment range of a station to unload into this industry and it has a limited capacity, if its full, then unloading is no longer possible.

The smaller one behind is an "Output warehouse". You need to have that building in the catchment area to get production from this industry.

Lastly, the large building with three chimneys is a Processor.

In this game industries - if applicable - take cargo from Inputs, Process, and put it into Outputs. Production _level_ is determined by the number of Processors an industry had built. As you can imagine - Industries behave a little like towns - they grow by placing new processors, and balance their input/output warehouses to match current production and shipment. Full 'inputs' or empty 'outputs' make an industry grow; the opposite makes it shrink.

Currently 88k LoC
User avatar
uzurpator
Tycoon
Tycoon
Posts: 2235
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Re: Unnamed transport game I'm developing.

Post by uzurpator »

So I've gotten industries to work somewhat reliably, so now I move on to cargo distribution.
cargo.PNG
(694.62 KiB) Not downloaded yet
This is going to work similarly to how it worked in RT3. Cargo slowly moves from sources to destinations, and can be picked up at any point and payment is decided upon the percentage of the distance it travelled _and_ how much faster it was from the intrinsic mode.
User avatar
uzurpator
Tycoon
Tycoon
Posts: 2235
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Re: Unnamed transport game I'm developing.

Post by uzurpator »

Some more progress on industries. Here you see them move cargo using the default "Other means of transportation" mechanic.



If you place a station in the middle of such stream then you can swipe that cargo and deliver it wherever.
User avatar
uzurpator
Tycoon
Tycoon
Posts: 2235
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Re: Unnamed transport game I'm developing.

Post by uzurpator »

After today's debugging session, I finally got the cargo transfers between industries to work how I want them to. What now remains is to devise an algorithm to make industries grow to meet demand.
cargo2.PNG
cargo2.PNG (274.49 KiB) Viewed 2896 times
I'll probably switch to vegetation now.
User avatar
uzurpator
Tycoon
Tycoon
Posts: 2235
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Re: Unnamed transport game I'm developing.

Post by uzurpator »

Progress for the, however much time passed since last progress.



Apart from some under-the-hood stuff, I have the basic tree rendering and growth implemented. In the video you can see two forests fighting for dominance over a patch of land. Obviously, it is way faster than what will happen in the game, and the line of demarcation between the two industries is pretty volatile. But there is a crucial subsystem of space partitioning below this being stressed - and it requires some bugfixes.
User avatar
uzurpator
Tycoon
Tycoon
Posts: 2235
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Re: Logistics: On Rails, Transport game I'm developing.

Post by uzurpator »

I committed an act of website and gave the game a title. The project shall now be known as Logistics: On Rails

https://logisticsonrails.com/

I'd appreciate any feedback. With time I'll also add some other social media like Twitter/X or Youtube.

On the development front. I fixed some bugs in the tree growth algorithm. Now I'll finally go for something transport-related—namely, track building.
User avatar
uzurpator
Tycoon
Tycoon
Posts: 2235
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Re: Logistics: On Rails, Transport game I'm developing.

Post by uzurpator »

Today I finalized details of how the trackage is going to work.

The standard way tracks are laid in games like this in the current times is by using splines. You can do some pretty impressive things with it, like here:
tfscr.jpg
tfscr.jpg (61.15 KiB) Viewed 1855 times
This is from a game of Transport Fever I played a long time ago. The thing is that I like the board-like structure of TTD, so I want to recreate it. However, I also want to achieve some strategy of curve-placement which is nigh-non-existent in TTD, but is quite important in a game like TpF. Smooth curves are also something I want to have. I mean - it's 3d after all, might exploit it to the fullest.

Lastly, I want to increase the density of infrastructure built. Things like double track on a single tile without awkward workarounds. Here is what I came up with:

1. The number of directions has been increased from four to eight.
2. There are more combinations of track segments on a single tile.
3. Trains can change direction by at most one direction ( or two, depending on game difficulty settings ).
4. Depending on circumstance- the game will auto-smooth direction change curves, and depending on how aggressively it can do it, the lower speed restriction there is going to be.

Here are all the allowable track pieces - color coded for some internal stuff.
nodes.png
nodes.png (64.71 KiB) Viewed 1855 times
And using this system one can build things like this:
smoof.PNG
smoof.PNG (114.39 KiB) Viewed 1855 times
The green parts are the actual track pieces and red signifies how the auto smoothing algorithm will work.
User avatar
uzurpator
Tycoon
Tycoon
Posts: 2235
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Re: Logistics: On Rails, Transport game I'm developing.

Post by uzurpator »

Game development, and engine development especially, is a never-ending rabbit hole. I've spent the last week adding track routing, and now I want to visualise it. To do so, I need to add a drag-and-drop operation. Finally, I need to add collision detection. I have this rudimentarily done for BrickED, but not for terrain. To get that, I need to adjust the bounding boxes of terrain leafs.

Which led me to spend three hours today fixing some invisible performance bugs in terrain rendering. But in the end I've got my proper bounding boxes to cast scene query rays against.
example2.PNG
(668.93 KiB) Not downloaded yet
Now the detection does not work.
User avatar
uzurpator
Tycoon
Tycoon
Posts: 2235
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Re: Logistics: On Rails, Transport game I'm developing.

Post by uzurpator »

Another week, another rabbit hole. This time, I was working on collision detection to make tile selection work, so that the drag-and-drop could be implemented.
selection.PNG
selection.PNG (365.09 KiB) Viewed 227 times
And if you are wondering what smooth terrain would look like, it is a matter of modifying one constant and the sources.
smoof.PNG
smoof.PNG (354.12 KiB) Viewed 227 times
User avatar
uzurpator
Tycoon
Tycoon
Posts: 2235
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Re: Logistics: On Rails, Transport game I'm developing.

Post by uzurpator »

I implemented the internal application state machine, and thus now Logistics has its own Main Menu.
title.PNG
title.PNG (345.04 KiB) Viewed 57 times
Post Reply

Return to “Off-Topic”

Who is online

Users browsing this forum: No registered users and 11 guests