Factory Town

Factory Town

View Stats:
Zistack May 9, 2021 @ 12:18pm
The available logistics options are a bit under-powered
After I realized that I couldn't build a smart train network due to the logic timing issues discussed by my previous post, I decided to try to convert my setup into a hub-and-spoke arrangement. Trains are still my primary transport backbone. While I basically succeeded, I noticed that configuring this setup was a less-than-pleasant experience. Balancing the buffer sizes, the rail loop lengths, and the number of train cars for each type of item turned into a major source of tedium.

The Problem

I believe that I have come to understand why I've struggled so much with coming up with a nice schema for organizing my item transport in this game. Fundamentally, because of the way things are balanced, this game exposes a logistics problem that is much harder than what you see in other factory games.

Let us consider a single production building for a moment. With happiness boosts and things like steam boosters or mana boosts, you can generally get a building in the neighborhood of 3-4x production pretty easily. For most recipes involving low to mid-level products, you can easily find yourself consuming in the neighborhood of 3-4 items per second for at least one of the recipe ingredients, if not more than one.

Belts and Pipes

The thing is, this is pretty near the transport capacity of magic belts and omni-pipes. You basically can't feed more than one or two buildings at most off of a single full omni-pipe of a given type of item in most cases. Belts and pipes end up only being usable for point-to-point transportation, due to the relatively high rates of consumption of most recipes.

Caravans, Boats, and Airships

If we consider labor-based transportation, that also can only handle point-to-point transportation, as that's the only sort of command that you can give them. The primary advantage of labor-based transportation is that the endpoints only need to be connected by some sort of network - the routing is done on the player's behalf by the pathfinding algorithms. However, the downsides are generally decreased capacity as compared to belts, and the labor cost. Labor is a very limited resource, and transport capacity is already very tight, so players naturally tend to avoid using labor-based transportation when operating at scale.

Routing is Hard

What's wrong with point-to-point transportation? Routing. Routing is hard. Specifically, the question of whether or not there is a way to establish a specific set of connections between a set of various points within a particular volume of state is an NP-hard problem. It's the kind of problem which is genuinely difficult for both humans and computers. While the actual constraints on solving the instances of this problem that show up in Factory Town are generally pretty relaxed, that doesn't make finding a good solution particularly easy. Many of the most difficult constraints still show up when trying to actually get all of the endpoints of the belts and pipes to attach to the desired buildings while not getting in the way of anything else.

Because we pretty much have to connect production nearly directly to consumption, we've tightly coupled the issue of building whole production chains together, since we can no longer think about each step in the production chain separately, as a general rule. This is why, during early game, building little self-contained factories that go straight from raw resources harvested from the environment to finished products that we ship to the houses or to barns for storage works so well. When ore could be moved around more or less freely, this was also a totally viable end-game strategy, though there was usually a period during mid-game where these routing problems reared their ugly head as you needed ore in quantity, but could just move the basic production around.

Now that ore patches cannot be moved so easily, and because the new town specialization mechanics strongly encourage us to build production chains split up across multiple town centers with the centralized production of different resources within limited spaces, the extremely limited power of belts and pipes has become very obvious and very strained - already there have been complaints about belt spaghetti. The only alternative left to turn to is trains, which are ostensibly meant to be able to handle high-capacity, long-distance transport.

Trains

Let's talk about trains then. Trains are not like belts or labor-based transportation. A train can pull a very large number of cars, and loads and unloads at train stations very quickly: 100-200 items per second. This isn't too bad - until you realize that the train loading and unloading speed represents the theoretical maximum level of item throughput that is possible, and it doesn't actually add up to very much when you do the math.

Let's suppose that we have a train that can teleport down the tracks, so loop length doesn't matter. Let's also suppose that we're transporting only loose bulk items, so our loading and unloading speed is 200 items per second. That means we have an actual total transfer rate of 100 items per second, split up between all the different items that our train is meant to transport. Divide by 4, and we can supply 25 production building inputs at the boosted rate we were discussing earlier. Not too bad. Thing is, we probably also want to retrieve the outputs from those buildings, cutting down our supply capability by approximately half in most cases. Now we're down to a dozen buildings. Then we should consider that trains in this game don't actually teleport, and will spend much more than half of their time traveling. Now our train can supply maybe 4-6 buildings? While the train version is a bit more flexible in the variety of items that it can safely carry, we're still not winning all that much over pipes here.

Now, multiple trains over the same track ought to be a much bigger win, right? Well, doing that introduces new problems to solve. In order to make that work, the stations can no longer be hooked up to the main line. Trains have to be able to get out of the way of other trains when they load or unload. This involves some fairly sophisticated logic if you want to do it right. Additionally, that loading or unloading area now has to be large enough to fit the whole train - we can't have any rear ends sticking out on the main line either, or that would defeat the purpose of this setup. This means that train length is now constrained by how much space you want to dedicate to loading or unloading. Limited train length means that we have limited item buffers, and limited item buffers mean that our track loop length has to be limited in order for the train to be able to make a complete circuit before the buffers it is supplying empty out. But wait, that just means that we need even more trains, so that we can take advantage of pipeline parallelism, right?!

Besides all that, let's talk about train stations themselves. Train stations are pretty cool They can hold a lot of stuff - or a wide variety of stuff - but not really both. At 4 items per second, a single 200-count slot in a train station will last 50 seconds. In practice, high-volume items will need 2 slots or more dedicated to them in order to provide trains enough time to actually complete a loop of any real size - and that's just for one boosted building consuming one ingredient. Basically, as large as the train station buffers are, they're not really big enough for more than a 2-4 of buildings operating at their boosted rate. Besides that, the train stations are not, themselves, the production buildings. You will need to connect them to production buildings using pipes and/or belts (I suppose there are also minecarts, but they're limited and a bit slow as well). This means that for local distribution from the train station to the production buildings, you have to deal with all of the limitations of pipes and belts - fortunately, you shouldn't be feeding that many buildings from a single train station anyways, so it all works out, right?

In the end, you can make trains work at scale, but it requires very careful balancing of supply, demand, station buffer sizes, number of connected production buildings, number and size of track loops, number of trains on each loop (assuming more than one), number of cars for each item type on each train, etc... It's a lot of work, and the game isn't making it easy for you. The margins are tight enough that you can't just slap something down and know that it will be more than enough for anything that you could want to do.

Problem Summary

Details aside, the problem can really be boiled down into a few simple points.

  • This game gives you vanishingly few tools for simplifying the routing problem at scale.

  • The limited capacity of belts and pipes forces tight coupling between item sources and item sinks at a local scale.

  • It is basically impossible to build any sort of standardized interface or transport system that will be known to work in a variety of situations, due to the relatively tight margin between the scaling behavior of production systems, and the maximum attainable transport capacity of the various transportation options available.

Other Games

I claimed that this game made logistics harder than other games do. My experience is primarily with Factorio and Satisfactory, so I will focus on these.

Factorio belts have absolutely massive capacity compared to the production and consumption of a single building under most circumstances. Additionally, the production and consumption rates of said buildings are also generally stable and easily predictable, so it's a lot easier to come up with a design that could handle whatever you might want to throw at it, even from the very beginning of the game.

Factorio trains are also quite intelligent. They can pathfind to various stations on their own, and if you name the stations according to groups, you can easily get dynamic multi-source, multi-sink supply/demand routing behaviors even without really touching the factorio logic system.

Then there's the logistics robots, which are basically like cheating. You don't even have to think anymore. You just slap down chests and the bots do the rest.

Satisfactory isn't as fully developed as Factorio is, but Satisfactory does have belts of much higher capacity than Factory Town. Building manifolds (a manifold is a row of machines all connected to the same belt for each recipe input/output) is entirely viable, and so the routing problem in Satisfactory is generally solvable on a per-production-step basis, rather than on a per-building basis. Like Factorio, production and consumption rates are very predictable at all stages of the game, so planning ahead is not a problem at all. At the moment, Satisfactory lacks anything of a logistics network nature, but it is hard to say at this point whether or not things will stay that way.

Proposed Changes

As far as fixing the problem goes, things are tricky. A single belt should probably be able to feed between 4-8 maximally boosted buildings on a typical recipe, given the sizes of the town center ranges and how you will likely want to be able to hook things up. This probably means buffing belts and pipes by about 4x. This alone would go a very long way toward making belt spaghetti less of a problem, though as the variety of items fed into markets grows, they'll still become somewhat unmanageable.

It would be nice to see labor-based transport fill the niche where one needs to handle variety, but not capacity. Transporting goods to markets is an ideal example, especially if used primarily as a last-mile solution. The problem is that those workers are point-to-point only, and cannot consider supply and demand. Because of this, you have to set each worker for a specific set of items if you want to avoid clogs caused by filling up on a resource that there is no demand for. Ideally, these workers could actually reason about the supply and demand of the points they're configured to visit, and would make intelligent decisions about what to pick up and drop off and where. This would make them indispensable for short-distance logistics. They might also need a bit of a buff to keep up with the production and consumption rates of boosted buildings.

As far as flexible, high-capacity transport over long distances, this is where trains should shine, but kindof don't. They sort of do high-capacity, and they sort of do flexible, and they sort of do long-distances, but they suffer greatly if you try to combine those things. The issues with trains are more complicated than the issues with belts and pipes or labor-based transportation. See, right now it is really difficult to build a train network. Ideally, we wouldn't just have trains on loops. Doing that really just turns trains into glorified belts - and the relatively limited capacity of having one train per loop incurs the coupling/routing problems that belts and pipes have. While buffing train car capacity would help with that, it seems like a cheap way of fixing the problem.

I do think that train car capacity could use a buff in the neighborhood of 2-4x - I shouldn't have to worry about my trains literally filling up all of my track space. However, I think that simply buffing trains isn't a complete solution, since using trains to carry items to markets when you're aiming to feed them the largest possible variety of items will still result in ridiculously long trains. I think the biggest problem with trains right now is that they're dumb. Basically, what good is a rail network if my trains cannot actually navigate it? It is the limited navigation abilities of trains that make them little better than a stack of belts. There is a reason that LTN is an all but required mod when building megafactories in factorio.

There are two ways to fix this. One is to just make trains smarter. Make it so that they can reason about supply and demand and the contents of their inventories. Make it so that they can pathfind. The other is to give players the logic tools that they need to build more or less the same functionality out of logic blocks. The former will be more accessible. The latter will be more customizable. Either way, making it so that a single train can be used to transport many different kinds of resources will hugely save on the number of trains and train cars that we need.

I didn't really get into it, before, but the lack of available information on how production is computed and what the upper limits are makes it a little difficult for a player who doesn't know the game inside and out to plan ahead. Making that information more available in-game before everything is unlocked would also help a lot with these issues.

Disclaimer

There is a chance that I have misjudged the intended nature of the game. The game is definitely playable and winnable right now - it's just a bit more tedious than it really ought to be, IMO. If the developer actually wants us to play such routing and optimization games, then all of my suggestions here are moot (and I have a very different set of suggestions in that case). I strongly suspect that this is not the point of the game, however.

I might also be missing some trick that lets us work around these issues. Packagers don't quite work for this for a couple of reasons. They're not buffed by happiness, so they don't scale properly in towns. Additionally, as far as I am aware, packed items cannot be sorted by their contents, making a variety of logic and filtering impossible on packaged items. If I am wrong or I have missed something, please let me know.

EDIT: While I talk about boosting buildings to about 4x base production, if shooting for maximum happiness, the achievable base production goes up to be quite a bit higher than that, making pipes and belts look pathetically inadequate for the task in many cases. Arguably, the scaling on how much different transport solutions improve over the previous tier should be adjusted with this sort of thing in mind.
Last edited by Zistack; May 10, 2021 @ 9:29am
< >
Showing 1-2 of 2 comments
Space Wizard May 9, 2021 @ 8:14pm 
I like the analysis of the systems and their problems, but I am curious about your scale. How big of a base did your problems appear?

I’m not sure there is a big problem with the worker count either. It’s tight up until Base 5, generous until Base 7, and basically free higher up. Could be a difference in the way we play.

The last time I achieved a 5000 happiness town was when minecarts were the “trains” of the game and I hooked up a packager per 4 products to each side of the shop. One magic conveyor was enough for all but a few of the bulk products in the food market. It primarily used a logic block checking the packager inventory and a stop sign back at the storage barn. I could totally see an LTN system being doable here, it just wouldn’t be smooth to implement.

I was able to set up a logistic system that only sent a mine cart from the storage barn if the packager was sub 16 crates. It wasn’t easy, and I think I was suffering a bug back then that was fixed.

The tools are all here in factory town, and other than smart workers/stations I don’t quite see an elegant solution.

Edit: to be clear, 5000 happiness is when all of the buildable homes are happy from all possible goods. This goalpost can change due to the latest town update, and the nature of infinite research expanding the housing limit.
Last edited by Space Wizard; May 9, 2021 @ 8:26pm
Zistack May 10, 2021 @ 9:28am 
Originally posted by Space Wizard:
I like the analysis of the systems and their problems, but I am curious about your scale. How big of a base did your problems appear?

I was basically looking to try to reach the 5000 happiness point. I had covered at least half the map with buildings and tracks, looking to really scale up my production for the late-game.

Originally posted by Space Wizard:
I’m not sure there is a big problem with the worker count either. It’s tight up until Base 5, generous until Base 7, and basically free higher up. Could be a difference in the way we play.

I don't really think that the labor count is a problem. Ignoring the period of time where I hadn't figured out how to upgrade houses with the new mechanics yet, I always had plenty of spare labor, really. I was relying exclusively on belts/pipes and trains for my transport, expecting to use much or all of my labor for production, though.

If I wasn't interested in doing that, I likely wouldn't have run into these problems to quite the same extreme. I would have noticed that my belts were a little bit under-powered for local distribution at some point, and I would have had a bit of train/belt spaghetti going from town to town, and I likely would have noticed that I needed a couple of dedicated train loops for some of the bulkier resources that need to be moved from one town to another. Nothing that would have stopped me from progressing exactly, but annoying hurdles that are somewhat difficult to anticipate given the availability of information on production/consumption rates in the game right now, and the fact that infinite research can break pretty much any such calculation at end-game.

Originally posted by Space Wizard:
I was able to set up a logistic system that only sent a mine cart from the storage barn if the packager was sub 16 crates. It wasn’t easy, and I think I was suffering a bug back then that was fixed.

I'm also not really talking about the last little bit shipping the final products to the markets - that's a way lower volume than any other step in the production chain. I'm primarily focusing on transporting raw materials and the first tier of intermediate products. These are the items that really need to be moved around in massive quantities.

Originally posted by Space Wizard:
I could totally see an LTN system being doable here, it just wouldn’t be smooth to implement.

Sort of. The logic system in its current state is woefully inadequate for that sort of system, due to broken timing behaviors and a lack of primitives capable of handling the concurrent nature of the problem. At the moment, I don't think a player could actually get very close to that behavior, even in theory.

That said, after the logic rework, and with the right extensions, it may well become viable for the player to set up such a system themselves without an absurd amount of effort.

Originally posted by Space Wizard:
The tools are all here in factory town, and other than smart workers/stations I don’t quite see an elegant solution.

As far as tools go, I think the tools we had were mostly adequate until the most recent update where things started needing to be shipped around between different production centers to maximize bonuses. Point-to-point basically works if you can put everything close together and build production for pretty much any resource close to where it is being consumed. Now that that isn't really true, getting items where they need to go has become a real headache.

I basically agree with the latter statement, which is something that I have mixed feelings about. I kindof like having to build systems that solve problems, and magical units that just make the problem go away for me don't really give me that opportunity. I have some pretty good ideas about how you might extend the game's logic system to enable the construction of such a system for trains, but I don't know how you would do something similar for labor-based transportation. I also am not sure that it is fair to force most players to make such heavy use of the logic system in order to avoid other headaches in the game.

Originally posted by Space Wizard:
Edit: to be clear, 5000 happiness is when all of the buildable homes are happy from all possible goods. This goalpost can change due to the latest town update, and the nature of infinite research expanding the housing limit.

Yes, the unpredictable nature of where the goalpost is is one major problem that I probably didn't really talk about enough in my OP. It's not directly related to transport being under-powered, but it does make it much more difficult for the player to predict how much of whatever tools they have that they will need to accomplish their objective, which adds annoying hurdles to advancement. It would probably be a good idea to somehow put a cap on the productivity boost that can be obtained through happiness, so that it is actually possible to plan all the way through end-game.
< >
Showing 1-2 of 2 comments
Per page: 1530 50

Date Posted: May 9, 2021 @ 12:18pm
Posts: 2