Devlog 019 - The one about Trains
Author: Jelle,
published 8 months ago,
Hello everyone!
It's finally time to talk about possibly the most anticipated feature of shapez 2: [b]Trains[/b]! We'll keep the intro short, but please remember to wishlist shapez 2! There's a high chance you already have (in which case, thank you very much!), but every single wishlist helps out!
https://store.steampowered.com/app/2162800/shapez_2/
[h2]Disclaimer[/h2]
Please note that the vast majority of train visuals are [b]placeholder[/b] or early concepts. The mechanics and balancing explained in this blog are also subject to change, depending on community feedback. To read more about how we implement new content and the current state of the game, check out [url=https://store.steampowered.com/news/app/2162800/view/4166466695861177287]our previous devlog[/url]!
You can explore everything you see and read in this blog yourself in Alpha 19, available to Patreons.
[h2]Our goal for trains[/h2]
We’d like to quickly preface the blog with our intentions for trains. Their purpose is to transport a large amount of shapes over large distances. While tunnels and space belts work fine to connect nearby platforms, trains will connect your distant platforms that mine that specific shape you really need, but spawned multiple sectors away.
Ultimately, our goal was to create a fun, long-distance transport option that fits well into the existing shapez world and the mechanics you’re used to. It should be easy to get into but provide depth for optimization and versatility. For this reason we’ve omitted signals and other, more complex train mechanics in favor of a simpler line system that still offers a lot of depth for those willing to invest their time into optimization.
[h2]The basics[/h2]
To get started, let’s place a station! You can also choose to start with the track or a depot, but we’ll start with a station as they come with a pre-build segment of track. The station building tells a locomotive where to stop. To load and unload the wagons you need to place Train Loaders and Train Unloaders, both of which are available for both shapes and fluids. Each (Un)Loader can service one wagon.
Once the stations are in place, it’s time to place tracks. You don’t have to worry about the length of the line, as placing tracks is completely free. Connect the stations by track in any way you want, but do keep in mind that tracks are directional. Additionally, trains have to slow down when making a turn and speed up on long, straight sections. You’ll want to minimize the amount of turns a train needs to make in order to maintain a high speed.
[img]https://clan.cloudflare.steamstatic.com/images//43169810/4fc260a320705acefa657d2bf34aa047f49e4744.png[/img]
When your stations are connected, you won’t have to worry about making a loop or a place where the train can turn around: tracks are double-sided. When a train reaches the end of a line, it will flip to the bottom side of the track and turn back to where it came from. This helps a lot with space management as you won’t have to worry about frontal collisions or need to make two tracks to allow trains to travel back and forth. However, trains traveling along the bottom of a track cannot be serviced by stations and only travel in a straight line. If the line has junctions or switches, you may still need to complete a loop to get your train back to the start.
[img]https://clan.cloudflare.steamstatic.com/images//43169810/9439a78eedb0d33a4666991db1f91be96d2b75db.gif[/img]
Now that you’ve connected an input station and an output station, it’s time to get a train running. To spawn a train, you need a train Depot. This depot is one chunk big and allows you to spawn a single locomotive that cannot carry any products by itself. To add capacity, you’ll need to attach a Wagon Extension to the Depot. You can choose between two types of cargo wagons: Shape Wagons and Fluid Wagons. Filler Wagons are also available to space out two cargo wagons, but can’t be used to transport products. You’re free to mix and match the wagon types, there’s no need to stick to just one. With these wagon extensions attached, any train spawned by the Depot will pull a single wagon for every extension. If you’d like a second train, you’ll need to place a second train Depot with its own wagon extensions.
[img]https://clan.cloudflare.steamstatic.com/images//43169810/07baa8111ad48c85ce6d7b27bce78f1fd53d51b2.png[/img]
A train will automatically spawn from the depot and do its thing: it will follow the track and stop at every station it comes across. It will load shapes at Train Loaders, and unload shapes at Train Unloaders. This is the simplest use of trains: a single train moves along a line and does its thing. You can stop there, but there’s a lot more possible.
[h2]Lines[/h2]
If you were to give every single line its own track, you’d need to reserve a lot of space for all the tracks you’d need. Instead, you can work with colors! When placing a track or a Depot, you can currently pick between four colors: red, green, blue and white. The color determines which line which train will follow. For example, a train from a red Depot will always follow the red line in case of a switch.
The colors come into play once you merge two or more tracks of different colors into a single track. If you have a green line and you merge a red line onto the same track, the track will become both green and red in the direction of the track. This means that both red trains and green trains can travel along this line! If you were to split the green line off this track, you’d get your separated red and green tracks back.
[img]https://clan.cloudflare.steamstatic.com/images//43169810/03a40e2d65036ec86ec5e54904c5ff7b2dbc95ec.png[/img]
A track can support all four colors simultaneously, giving any piece of track an effective limit of four different lines. If you require more lines, you’ll need to make a parallel track that travels in the same direction or separate your train network into smaller subnetworks. When traveling along the bottom of a track, trains will no longer follow their line and only go straight at switches.
[img]https://clan.cloudflare.steamstatic.com/images//43169810/9d0b4411595ec290b0bfbc78d051b4080d9073d5.png[/img]
[h3]Crossings[/h3]
If you need to cross tracks, there are two ways to do it. The first one is to simply create a crossing by placing a second track across an existing track to create a crossing. At a crossing, lines and trains can only go straight. If you want to give trains the option to merge into the other track as well, you need to manually build a switch.
[img]https://clan.cloudflare.steamstatic.com/images//43169810/92b1c0178574dd6b59f2aa5fa1ea1c8020fedfc5.png[/img]
However, the second way is a lot more fun: just make a Train Launcher! Just like with conveyor belts, you can place a launcher that will launch the train into the air and across any other tracks and onto the catcher. Unlike the conveyor belt equivalent, you can change the strength of the launcher to determine how far the train will fly.
[img]https://clan.cloudflare.steamstatic.com/images//43169810/7cc965b88be79e21bcfa9982b2762c092d7c6753.gif[/img]
Before you ask: Yes, the Train Launcher also works on trains at the bottom side of the track.
[img]https://clan.cloudflare.steamstatic.com/images//43169810/cda05c7d0a76e8b0631ecd5b9ebddcb3a9720a9e.gif[/img]
[h2]Balancing[/h2]
So after all this, you may wonder why you’d use trains instead of tunnels or space belts. Aside from being way cooler, it’s a matter of cost, speed and throughput.
[h3]Costs[/h3]
Below, you see a table with the costs of running a train. For this example, we run a single train with three wagons between two stations with capacity for all wagons.
[hr][/hr][table noborder=1 equalcells=1]
[tr]
[th]Object[/th]
[th]Chunk cost each[/th]
[th]Amount[/th]
[th]Chunk cost sum[/th]
[/tr]
[tr]
[td]Locomotive[/td]
[td]10[/td]
[td]1[/td]
[td]10[/td]
[/tr]
[tr]
[td]Wagon[/td]
[td]5[/td]
[td]3[/td]
[td]15[/td]
[/tr]
[tr]
[td]Station[/td]
[td]1[/td]
[td]2[/td]
[td]2[/td]
[/tr]
[tr]
[td]Platform[/td]
[td]2[/td]
[td]6[/td]
[td]12[/td]
[/tr]
[tr]
[td][/td]
[td][/td]
[td][/td]
[td]––[/td]
[/tr]
[tr]
[td][/td]
[td][/td]
[td][b]Chunk cost total[/b][/td]
[td][u]39[/u][/td]
[/tr]
[/table][hr][/hr]
39 chunks may sound like a lot, but the best part is that tracks are completely free! This means that no matter the distance, be it 5 chunks or 500, the cost remains the same. Additionally, locomotives don’t require fuel and there’s no maintenance fee either. If you compare this to our other mass-transport options like Space Belts and Space Tunnels, both of which have an effective per-chunk cost of 1, trains become increasingly more chunk-efficient the longer the distance traveled. The cheapest possible setup for a functioning train is one locomotive with one wagon running between two stations, which would cost you 21 chunks.
[h3]Throughput[/h3]
Shapes and fluids are loaded on a train in packages. A single wagon has capacity for three packages – one for each building layer – with each package having a capacity of 960 shapes or 9,600 L of fluids. This gives every wagon a maximum capacity of 2,880 shapes or 28,800 L of fluid when using all three layers. Trains will only pick up packages that are completely filled, giving a wagon a minimum required load of 960 shapes or 9,600 L as well.
A wagon can only pick up one package per layer. If you only use the bottom layer of the station, the wagon can only pick up one package: it does not automatically place a second package on top of the first one. Additionally, Loaders and Unloaders can store up to two full packages per layer. To make full use of both the wagons and the (Un)Loaders, you’ll want to split the load across all three layers.
When it comes to speed, trains are considerably faster than the alternatives. If you were to move shapes across a distance of 300 chunks using space belts, you’d be looking at almost an hour of travel time! A train however, will cross that distance in under 30 seconds. Trains slow down for turns and take some time to get back up to speed, so every corner will considerably increase the travel time of a train. Adding wagons to a train does not affect the speed or acceleration.
To summarize the balance, space belts and tunnels are ideal for short-distance connections between platforms. Trains are what you’ll want to use for medium and long distances. They’re incredibly versatile and you can add or remove trains and wagons as needed. However, it takes time to set them up and poor planning and/or using too many trains can create bottlenecks when collision avoidance enters the fray – more on that next.
[h2]Future possibilities[/h2]
[h3]Collision avoidance[/h3]
In the latest Alpha build (Alpha 19 at the time of writing), trains still just phase through each other. However, we’re currently experimenting with a collision avoidance system. How it will work exactly is still to be determined, but a train should brake when another train gets in its way. Once the path is clear, it should continue its journey.
This also means that congestion would be possible if you have a lot of trains on the same line or have a very busy crossing. Avoid conflict points, build station bypass tracks and use the line colors to the best of your ability to avoid gridlocking your entire transport system.
[h3]Colorblind features[/h3]
Since we’re working with colors, we’re planning to use the same color pattern shaders we showed in [url=https://store.steampowered.com/news/app/2162800/view/4166466695861177287]the last devlog[/url] for the line colors as well. How exactly this will look depends on what the final train and track visuals end up looking like.
We have some more ideas, but they require more testing before we can say with certainty they'll make it into the game. Names pending.
[list]
[*][b]Side swapper track[/b]: Special track segment that will ‘flip’ the track and allows trains to swap to the other side while continuing in the same direction, without slowing down.
[*][b]Locomotive recoloring platform[/b]: Change a locomotive’s line color and reroute them on the fly with a special platform.
[*][b]Vortex train launch[/b]: Launch trains directly into the Vortex to deliver a large amount of shapes at once.
[/list]
[hr][/hr]
Can't wait to try trains and want get involved in the process? Consider supporting us on [url=https://www.patreon.com/tobsprgames]Patreon[/url] to get access to the bi-weekly Alpha builds as they release! Your feedback is essential to us while we're working very hard to get shapez 2 ready for Early Access.
That's all we have on trains for now! We hope to soon be able to show you what trains will actually look like, but we first need some more time to get all the features in. Thank you for your time and we hope to see you again in two weeks.
~ Tobias & the shapez 2 team
[img]https://clan.cloudflare.steamstatic.com/images//43169810/5aac65496a380bf7a61ebc1eaeaecdbb5e06249e.gif[/img]
[h3]Join the community:[/h3]
[url=https://twitter.com/tobspr style=button]X / Twitter[/url] [url=https://www.youtube.com/@tobsprGames style=button]YouTube[/url] [url=https://discord.gg/bvq5uGxW8G style=button]Discord[/url] [url=https://www.reddit.com/r/shapezio/ style=button]Reddit[/url] [url=https://www.tiktok.com/@tobspr_games style=button]TikTok[/url] [url=https://www.patreon.com/tobsprgames style=button]Patreon[/url]