Mini Metro
dholland Jan 15, 2017 @ 12:30pm
Mini Metro maths!
Okay, with my maths background, I may be the only person interested in this topic :-D But just in case someone else cares, here is a distance comparison for loop and non-loop lines. It's all too complicated to deal with every aspect, so I'll simplify with the example of a static network (no moving it around) and one train.

Let's suppose that you have N stations. You can either link them with a loop or a non-loop. How do they compare based only on distance travelled? Simplify further by assuming that a least length line is chosen in each case and only consider average distance the train travels in between visits to a fixed station. Can suppose the non-loop length is N-1 units, and you can probably see that the loop length is at least N (because the path closing the loop is not shorter than the other paths in the non-loop by the shortest distance criterion).

This isn't too unrealistic since non-loops are routinely chosen with short lengths, and it's not too hard to see that it's going to be harder to choose short loops. You probably experienced loops with very long path segments over rivers in the game. Anyway, if N is odd there's a middle station in the non-loop. Remember we're simplifying to averages, so we can suppose the distance between successive stations is 1 and a train leaving the middle station (either way) will return in N-1 distance. If we look at a station to either side of the middle, it waits longer one way than the other: N-3 to N+1. But the average is still N-1. Cool.

The same procedure works all the way until we consider the end stations. Each one waits a whopping 2(N-1). Not cool! Yet if we average over all the stations to get a (greatly simplistic) measure of efficiency, we get (N^2+N-2)/N which is always less than N+1.

Of course, the loop efficiency is at least N because all stations are equally served by a trip around the entire loop. Perhaps unexpected, and fun.

Of course, in practice, even though non-loops can be slightly more efficient by this measure, depending on how much longer the loop is, waiting passengers will pile up at the end stations which in the game can easily make you lose, so people are right to consider loops as a safer option, serving their stations more equally. And of course, I'm not considering multiple lines and how they link, or what happens if you have more than one train.

If you manage to find a perfectly balanced loop (all stations at equal distances), it will be slightly more efficient than the non-loop, of course.
Last edited by dholland; Jan 16, 2017 @ 8:11am
< >
Showing 1-15 of 18 comments
Ravsters_ Jan 15, 2017 @ 1:47pm 
i hope this works, cos i'll be trying it next time i play mini metro
Twelvefield Jan 15, 2017 @ 8:13pm 
Also important is whether or not your loop has bends that are less than ninety degrees, since this slows trains. It''s an issue that's intrinsic to lines, as the train will always slow for the terminus whether there are pax or not. However, on looped stations where there are no pax and the bend is 90 degrees or less, the train will travel at maximum speed.

If you loop (you should, you should), and you use multiple engines, you're wanting to have each engine go in the opposite direction, since engines do not decelerate for one another if they approach head on. If they are travelling the same direction, the engine in the rear will slow and stop for timing pauses if it catches up to the train in front.

Multiple trains on a line, sooner or later one train will catch up to another, which causes headaches. The best uses for lines are as feeder routes that are short and that either bring outlying stations to your loop, or that cut across loops to feed overcrowded stations to the main squares.
dholland Jan 16, 2017 @ 3:49am 
Aw! You pre-empted my next installment on multiple trains and waiting -- or, the loops strike back! I did mention it was a simplistic analysis. Probably the most fun and key part of the game is how you link multiple lines. Also, the game mechanics of being able to move lines and trains around can be very important. Of course, bridges are key to linking land masses and especially if you want loops doing this, they will consume many bridges. Whilst loops are very important, very long ones with wildly varying distances between stations can end up less efficient than non-loops. That's not to say I don't end up with loops in most of my games.

However, the maths of a lot of these features are either trivial or very complex. If I think of more situations where I can make the maths clear I'll post them.

Another issue is that you're pretty much forced to use non-loops at the start of the game, and when new stations pop up it's much easier to reach them via non-loops. That's not to say it's not a good idea to do a major reorganization of all your lines to reach them with loops or non-termini, provided you are still at a stage where your network can cope with a big change without spiralling to disaster.

Also, my analysis is simplistic enough to mislead. Only the stations near the centre of a non-loop are well-served. For example, a station next to a terminus has most of the different station types and connections on one side, so the same will be true of most passengers, so it's little better off than the terminus. Since the numbers of stations are so small, there isn't time to average things out nicely. If you pay special attention to station type balance, you can avoid some problems (don't have two circles at the end of a line).
Last edited by dholland; Jan 16, 2017 @ 4:31am
Simon Jan 16, 2017 @ 6:56am 
Can you paragraph your first post? It's doing my head in!
dholland Jan 16, 2017 @ 8:14am 
Originally posted by Simon:
Can you paragraph your first post? It's doing my head in!

Done. It doesn't matter if N is odd or even, I just find the argument easier to follow with N odd. I suggest you try the cases N=3, 4 and 5 to understand what's going on and be convinced that it generalizes.
Robert  [developer] Jan 16, 2017 @ 2:23pm 
Wow, cool! :D I usually use loops in the centre of the map which has stations that more passengers appear at, and use single lines (usually coupled with carriages) to service the outer, less-frequented, stations. For those stations the longer delay isn't that much of a issue.
Twelvefield Jan 16, 2017 @ 2:53pm 
In my experience, you can have a normal train service three like stations in a row without worry, i.e. O,O,O. The trouble with lines is if the three O's are at the terminus. Then you're really servicing five O's in a row, plus you get an automatic deceleration:

Say the line is straight east and west, going west to a terminus like Δ, O, O, O. The train goes to the Δ and drops off all its O pax at the first O station. Then it goes to the second O and then it must slow to a stop at the third O whether or not there are pax. Then it reverses and goes back to the second O and then the first O... five O's in a row.

With a loop, that's only the O's in a row and the train won't automatically decelerate since there's no terminus.

You can get a regular train to hit four like stations in a row, but you have to plan on micromanaging in the late game. Five like stations is asking for it. Carriages help in a way, but sometimes they blow on by one of the like stations because of pax logic. Even if the carriage does pick up all the pax, you end up getting a big dump of non-O pax at the east end of the line, and if there need to be transfers, that east terminus station can become overcrowded in a flash.
dholland Jan 17, 2017 @ 3:07am 
Consider the following combo of 2 lines. One is a long loop, taking in a lot of stations (of course, circles and triangles) and a square. The other is a non-loop, connecting opposite sides of the loop, and sending them to or near uniques.

Hopefully the loop will deal with circle and triangle pax (passengers). It might be slow with square pax unless you get a second square on the opposite side of the loop. Unique pax only have to get around half the loop before changing for a more direct route to destination. If the loop gets too long you may need more non-loops to draw off excess pax.

In practice, square pax are a tough problem, especially if there's only one square or a square paradise. Another problem is the huge number of late game circle stations. It gets very hard to reach them all, and you can end up temporarily disconnecting stations so you can deal with others, which can keep things going for a while but ends up with loads of angry disconnected stations.

Hence the famous thread on circle hatred venting :-)
Last edited by dholland; Jan 17, 2017 @ 3:43am
God666 Jan 17, 2017 @ 12:18pm 
I've got a graphs networks and algorithms textbook on a shelf in here somewhere and know it would be applicable if I managed to engage my brain! So I see I'm not the only that tries to put my education to good use! Where and when did you study maths?

I end up with spreadsheets for allot of what I play (the last big main one being probability calculations for Vermintide).
dholland Jan 17, 2017 @ 12:22pm 
I studied in the UK about 25 years ago! I did enjoy graph theory (the 4 colour theorem!).
God666 Jan 17, 2017 @ 12:32pm 
UK also Exeter here but only about 15 years ago! Where abouts in the UK were you?
dholland Jan 17, 2017 @ 1:20pm 
Newcastle (degree) Durham (PhD). UK and Canada postdoc.
Twelvefield Jan 17, 2017 @ 6:20pm 
See? There we go. Brits plus math(s) equals Mini Metro, proof being of the unparalelled utility of the original London Underground diagram as designed by super genius Harry Beck back in 1931.

My background is graphic design and animation. I couldn't add numbers together properly if it meant that I would then get booze for life or that it would save a train from derailing onto a nunnery or something. If I can draw it, I can figure it out, but otherwise a 5 is just a crooked 2 to me.
Myxocon Jan 22, 2017 @ 5:48am 
Originally posted by dholland:
If you manage to find a perfectly balanced loop (all stations at equal distances), it will be slightly more efficient than the non-loop, of course.

I would say no. I think your approach is too simple. You're missing one important aspect: train capacity or rather the efficiency of capacity. If you're only using one train, you receive a loop with an one-way passenger flow, while a line will pass most of the stations in two directions. A loop will have to use its capacity for longer directions.

To see the problems I created heptagonal stations with a high variation of the three standard shapes [no images; I've used paper]. The line has following stations: Circle, Triangle, Circle, Square, Circle, Triangle and Circle. To simplify the problems there's only a certain amount of passengers waiting; no additional passengers spawn. So it ist a matter of serving an existing static system.

There are following passengers waiting:

1C = 2s, 4t
2T = 4c
3C = 3s, 3t
4S = 6c
5C = 4s, 2t
6T = 4c
7C = 3s, 3t

The loop connects station 7C with station 1C and will get to turns. I ran four different scenarios, a good and a bad scenario with each line and loop. A scenario is good, if a train picks those shapes first which will exit the train first. A scenario is bad, if a train picks those shapes first which will exit the train last. I will use following representation:

station = stock change | left passengers | free capacity

First scenario; good line

1C = +4t, +2s | 0 | 0
2T = -4t, +4c | 0 | 0
3C = -4c, +3s | 3t | 1 [it doesn't matter]
4S = -5s, +6c | 0 | 0
5C = -6c, +2t | 4s | 4
6T = -2t, +4c | 0 | 2
7C = -4c, +3s, +3t | 0 | 0
6T = -3t | 0 | 3
5C = +3s | 1s| 0
4S = -6s | 0 | 6
3C = +3t | 0 | 3
2T = -3t | 0 | 6
1C = 0 / end of service

Not served: 8 | Not served per trip: 8/12 ~ 0,67 | Not served at all: 1
Free capacity: 25 | Free capacity per trip : 25/12 ~ 2,08 | Remaining Load: 0

Second scenario; bad line

1C = +4t, +2s | 0 | 0
2T = -4t, +4c | 0 | 0
3C = -4c, +1s, +2s | 2s | 0
4S = -3s, +3c | 3c | 0
5C = -3c, +2t | 4s | 1
6T = -5t, +4c | 0 | 2
7C = -4c, +3s, +3t | 0 | 0
6T = -3t | 0 | 3
5C = +3s | 1s| 0
4S = -6s, +3c | 0 | 3
3C = -3c | 2s | 6
2T = 0 | 0 | 6
1C = 0 / end of service

Not served: 12 | Not served per trip: 12/12 = 1 | Not served at all: 3
Free capacity: 21 | Free capacity per trip : 21/12 ~ 1,75 | Remaining Load: 0

Third scenario; good loop

1C = +2s, +4t | 0 | 0
2T = -4t, +4c | 0 | 0
3C = -4c, +3s, +1t | 2t | 0
4S = -5s, +5c | 1c | 0
5C = -5c, +2t, +3s | 1s | 0
6T = -3t, +3c | 1c | 0
7C = -3c, +3t | 3s | 0
1C = 0 | 0 | 0
2T = -3t | 0 | 3
3C = +2t | 0 | 1
4S = -3s, +1c | 0 | 3
5C = -1c, +1s | 0 | 3
6T = -2t, +1c | 0 | 4
7C = -1c, +3s | 0 | 2
1C = 0 / end of service

Not served: 8 | Not served per trip: 8/14 ~ 0,57 | Not served at all: 0
Free capacity: 16 | Free capacity per trip : 16/14 ~ 1,14 | Remaining Load: 4

Fourth scenario; bad loop

1C = +2s, +4t | 0 | 0
2T = -4t, +4c | 0 | 0
3C = -4c, +1s, +3t | 2s | 0
4S = -3s, +3c | 3c | 0
5C = -3c, +3s | 1s, 2t | 0
6T = -3t, +3c | 1c | 0
7C = -3c, +3s | 3t | 0
1C = 0 | 0 | 0
2T = 0 | 0 | 0
3C = 0 | 2s | 0
4S = -6s, +3c | 0 | 3
5C = -3c, +1s, +2t | 0 | 3
6T = -2t, +1c | 0 | 4
7C = -1c, +3t | 0 | 2
1C = 0 / end of service

Not served: 14 | Not served per trip: 14/14 =1 | Not served at all: 2
Free capacity: 12 | Free capacity per trip : 12/14 ~ 0,86 | Remaining Load: 4

Even though a loop has more trips, there is less available capacity. Picked up passengers have a longer travel distance. If you compare the unfinished transports, you see that the good loop is even less efficient than the bad line [3 not served at all versus 4 remaining load]. If you add now spawning passengers the loop with the remaining load is more likely to struggle.

The reason is of course the weakpoints of the loop: You need at leat one train for each direction to create an efficient loop. Just imagine your single train has to pick up 6 squares at the first station after square station: You need an entire loop to be able to pick up another passenger. The line itself doesn't render this issue: There is no reason to pick up the squares; they will be served in the opposite direction.
You can bypass this problem with serveral connecting stations. But if you only use a single track with a single train, a line is better than a loop.
dholland Jan 22, 2017 @ 6:45am 
You remember I said the maths was either trivial or very complex? And that I was greatly oversimplifying? Of course your more complex example is not covered by my simple ones. But what you're saying is interesting, another subtle weakness of loops in some situations. That said, I still prefer loops in actual games most of the time (an exception is if it's too difficult to get enough tunnels to support loops crossing rivers). But I haven't dealt with the situation of different numbers of trains and balance factors because of the extra complexity.

You're pointing out that the interior (non-terminal) stations on a non-loop are better served than the average loop station. But my maths already shows that because of the average N-1 efficiency for interior non-loop against N for loop station. However, I did not consider the aspect of stations being covered in both directions. This is a little complex because, except for a middle station in a non-loop with odd number of stations, the interior stations are covered by trains travelling different numbers of stops in the two directions. A problem with taking advantage of this non-loop efficiency in actual games is that you most often have important stations like squares in the centre, but not many elsewhere (would be interesting to have a city where that is not so true, say with 2nd and 3rd squares a long way from the centre, maybe across rivers). So non-loops get limited by having to serve the centre and the improved service for the interior stations gets a bit wasted by congestion of lines in the centre. But in the occasional situation where you can get interior stations of non-loop far from the centre without distances being too large, then this non-loop advantage could be significant.

But I appreciate you've probably got more experience with the game than me, in terms of time played and achievements (you've got all of them, I'm missing 3). And where we are in accord is in pointing out that non-loops can have some benefits over loops, although in practice the problem of poorly served termini makes it hard to realize non-loop benefits. If non-loop termini are served by only one line, far from the centre, then you're going to have problems dealing with the termini pax, and it's quite difficult to avoid this common scenario without missing out important central stations or having too-great distances between stations.
Last edited by dholland; Jan 22, 2017 @ 7:35am
< >
Showing 1-15 of 18 comments
Per page: 1530 50

Date Posted: Jan 15, 2017 @ 12:30pm
Posts: 18