A coop session


Development

A rather lengthy blog this month, so lets start with a set of points on what we have been working on since last time:
  • Loading improvements. Loading the small map like Hawaii loaded in a suitable time that clients would not disconnect in multiplayer games. For our super large test map, Grand Canyon, this was not the case! To combat this I've added in threaded loading, which allows the network players to not disconnect when loading takes a long time.
  • Screenshot support - All images in this blog are now taken using this new feature!
  • Initial unit test support. Our first unit test *attempts* to go through and check all maps load and takes a screenshot once loaded to verify against. It's not full functional yet.
  • New camera code + polished input handling have been implemented in an attempting to get rid of some camera "sticky keys" we ported from Windows. The problem turns out to actually be a Godot bug caused by low frame rates. Our changes have helped it seems to some degree in being able to make the camera code more durable at times when frame rate is crud.
  • A new outline effect has been implemented. The old version was a temporary hack, which would duplicate what you were selecting, modify the mesh normals such that the geometry could be pushed out along the normals so the model would inflate. Once inflated, it would be switched on or off as you mouse over it and rendered to a separate texture and overlaid over the screen. This was okay, but had two major drawbacks: (1) Zooming in and out would cause the outline thickness to vary and (2) performance problems when spawning in tracks, trains or stations as they had to go through this complex geometry transformation process.
    The new system simply draws the objects straight to a render texture using a light weight clone of the geometry, then runs a shader over the resulting frame buffer to generate an outline that solves all our issues!
New outline effects

  • Content packaging is now in for the full version. The demo we released was packaged, but the tricky part is for proper mod support we need each mod and each map to be in its own package. This is now working after much anguish on working out how to package the full version for release.
  • Mod.io support (https://trainsandthings.mod.io/) is starting to come along. We have it building into the Godot engine so its only a small jump to get it implemented in game.
  • The UI has been themed so the game is looking less like Godot and more like.... Trains & Things!
  • A new recipe system is being rolled out. The recipe system is like cooking, it takes the ingredients and combines them in some way to produce something else.

    An example of an old recipe:
           1 people + 1 iron = 1 steel 

    The same example using the new recipe system:
           trif consume(people, 1) and consume(iron, 1) and supply(steel, 1) then return

     The old system would parse this string at run time into a table and process it when required. It had no ability to do anything other than consume resources (on the left side of the =) and produce resources (on the right side of the =). The new system is transpiled into gdscript so it can do complex things! The 'trif' command means 'transactional if' which combines an 'if' statement with something akin to SQL's transaction mechanism. This means that while the if statement is being evaluated, it can be doing work at the same time. Should the result of the if statement be false, the changes are reverted. If it succeeds, then the changes are committed. Because it can do work and results in a committing or reversal of changes it means it can do a lot and keep the length of the recipe concise!

A co-op session

Now for something you have all been waiting for! A large screenshot drop and talk about playing the game.
Often we get so bogged down in programming, art and development that we rarely actually get to sit down to a scheduled game.
So we finally have some stability again after the major refactor and had one such game.

The game spanned about 3 hours, on our largest map yet: Grand Canyon, which we briefly mentioned in our last developer blog. This map is a work in progress.

I (Fabian aka "supagu") hosted the game, while Bronson, aka "Gibbz" the creator of the map joined me. Seeing as Gibbz is working on the map, it only seemed fair that I choose the start location, so I picked "Needles" as it looked to be surrounded by some suitable resources. I could have spent far to long trying to find another spot, but if this was a competitive game then time wasted is defeat! But luckily we were playing a friendly coop game and I just wanted to get stuck into playing.

Needles with first expansion: Meat production

Early on after some discussion we developed the infrastructure needed to get cows & sheep to the slaughterhouse where they were packaged into meat. We then proceeded from there to the city of Needles.

Needles leveling up nicely

After sometime of balancing and micro'ing the trains we managed to level up the city and resources to maximise profit.

The Grand Canyon in its full glory! Imagine that with 12+ players!

We had reached the limit of what was possible. Running meat to Needles was not enough to sustain our appetite for growth and profits. So I started expanding southwards to try to break into a new city centre: Bagdad.

Stretching southward

As I did this I left Gibbz to further micro manage and optimise the northern region.

Trains starting to bank up

This was the first game we played where we increased the maximum train length from 6 carriages up to 20, and we found it gave us more decisions to make. Where we used to always just make 6 carriages, now we had a suitable number to play with: go big and slow or small and fast?
This also opened up more complex train routing as well. We used to only have a train run a single product one way and bring something back where possible. Now with 20 carriages we were having a single train run 3, 4 or even 5 stops carrying many products in an effort to reduce congestion.

Worth the effort

After levelling up Bagdad, I pushed westward to try to tap into the wood market.
It was an agonising stretch that bled our profit. All I could do was try to build the track in small affordable chunks at a time.

Gibbz kept yelling across the room "If this doesn't pay off soon we are sunk!" I kept yelling back "Just a bit more money! Squeeze some more out of some where!"

The long run south and south west

Just finished unloading timber, now taking a shipment of employees to help cut more wood!

We finally broke through and then all of a sudden we had a massive cash injection from all our struggling and striving. Any wise man would stop and count his luck and call it a day, but I was not so wise this day!
I spent some time paying back the bank to cut down on interest on our bank loan as I eyed out Supai in the north. A land flowing with wheat, flour, and bread!
My eyes twinkled at the thought of profit! If only I could tap that market!

The great wheat belt around Supai

Again we were bled dry, but I decided to take advantage of the longer trains and set up a single train to drive the whole market.

The most complex of trains!

... "Royal Cheeseball" was her name, and she was magnificent! As I had hoped, we were once again flowing with money and proceeded to pay off all our debts to the bank.

Expanding north

All we had to do now was to close the gap and connect our north expansion to our southern railway, but this is where we had to end our game.



That's all for now folks!
Remember to join our matrix channel to get in touch and add Trains & Things to your steam wishlist.
All over at the Trains & Things website.


Popular posts from this blog

Open-sourcing Trains & Things (and our other projects)

Trains & Things Official Announcement

Editor & Mod Tools Released