Published on

The Current State of The Game

Authors
Michael Myres Falling Gif

First of all, we wish everyone a Happy Halloween! 🎃

We want to talk a little about the current state of our game. Documenting exactly where we are starting from allows us to properly show off each update as we push towards a release. We want to show off the good and the bad so be prepared for some terrible GIFs!

⚠WARNING⚠

This is a peek in the Pre-Alpha of our game, everything is subject to change.

Trains 🚂

Trains are something we have spent a lot of time on trying to get right. Sometimes things take longer than you expect them to, and trains are one of them. We've gone through three different train systems (currently developing our 4th). Our systems had various issues throughout development, ranging from: wagons not following locomotives to trains spinning around 180 degrees every few steps, and each time required going back to the drawing board.

Through this iterative process we have arrived at a system that should meet all of the needs of our game, and one that we can rely on when going forward. This fourth train system is simpler than its predecessors, easier to maintain and ultimately: easier to extend.

As for the gameplay side of trains. Trains are made up of carriages: passenger, coal or mail as well as a locomotive. The current limit for wagons is 12, although we are looking to increase this in the future. Trains have worked in a variety of ways from across each iteration, but the core gameplay has stayed the same:

  • Place down a depot
  • Click on the depot to buy trains/wagons
  • Refit wagons to hold various goods
  • Open up the train window
  • Set up your trains schedule

We have tried to keep this loop as close to OpenTTD as possible. Trains will move along each route in the schedule loading/unloading resources as required. You have some control of this unloading and loading behaviour when setting up your schedule.

Pathfinding 🔍

Pathfinding is a cornerstone of our game, serving as the backbone of the main game loop. Without a reliable pathfinding algorithm, we'd end up with trains unable to detect routes that players can spot instantly. One of the biggest challenges was visualizing pathfinding; without it, debugging is next to impossible—a lesson we learned the hard way. And while you could say that about any complex system, it's especially true for these kinds of 'invisible systems.

The second big hurdle is optimization; with hundreds of trains running at once we need to ensure the system performs smoothly under heavy loads and we feel like we've achieved this successfully.

Tracks 🛤

It took us quite a while to reach the point we are now, and I think that length of time is the most visible when comparing our first iteration of track drawing with the current one. We've opted for a style that allows players to have wave-iness into the tracks for better visualization of junctions and because they look cooler.

Resources 📦

The main point of a transport tycoon is—to transport cargo. We're calling any type of cargo “resource”. To obtain resources, putting a station near an industrial building, resources will start spawning inside the station at a fixed rate. These can afterwards be transported by any means to a further away station (that accepts that specific resource as input) for payment. To simplify we've created the resourcing system, which can be easily and quickly configured to change the feel and difficulty of the game.

Save/Load 💾

We have a fully working save and load system. As you would expect this will allow players to continue where they left off whilst playing, share maps and of course to help us debug the game. It's an integral step to any games development (especially larger tycoon style games). Something you might not expect is that a good Save/Load system is usually a requirement for multiplayer, as it allows you a nice standardised way to serialise information.

Our Save/Load system is also used to load in our own JSON definitions of each item in the game. From this definition you can adjust: item prices, wagon lengths, locomotive speeds, and names. This is the very early start of our modding system, and something we want to expand on going forward.

Bulldoze Tool 🐂

After some iterations on all the other systems we've finally decided to also add in an easy way to remove the things we place. Of course, once things are placed, it seems like it's impossible to remove them, but after some time and code thrown on the problem, we've managed to implement the tool without any major issues (for the time being). The bulldoze tool resells placed items at 75% of their original value. This value will be configurable by the player in the settings.

World Generation 🌎

Currently in the game there is only flat terrain Crying Gif Emoji
We have plans to make a full custom terrain generation system, but for the time being it's just a series of planes. In this flat world you will find a number of buildings. At the moment these are the Powerplant and the Coal Mine (our first two test buildings).

Making money is straight forward. Transport coal from the Coal Mine to the Powerplant.

We split the world into a number of cells, and then generate buildings in those cells. These cells are essential to partition the world into different regions. We can name these regions and keep everything consistent. In a place called 'Willby' you would have: 'Willby Coal Mine', 'Willby Power Plant' etc.

Instanced Grass and Chunking 🌾

Grass in games often goes unnoticed, but it's essential for bringing a world to life. We wanted to capture that same effect in our game. Our approach allows us to make the environment feel more vibrant, and we didn't stop at just the grass—we actually reuse this technique for most decorative objects across the game world, adding to its overall depth and character.

By slicing our world into tiles (chunks) we can select various parts to either render or not, as such, removing a “chunk” (pun intended) off of the heavy lifting the GPU does constantly to render the scene. This isn't completely in effect just yet.