Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Diagonal minecart tracks  (Read 701 times)

JasonMel

  • Bay Watcher
    • View Profile
Diagonal minecart tracks
« on: March 27, 2024, 05:19:10 pm »

I'm making a fortress with a radial hub sort of layout, which entails a lot of diagonal hallways. I'm also using minecarts for the first time. The collision of these two facts, and its consequent, omnipresent zig-zags, got me thinking:

Dwarves and other creatures can move diagonally (8-connected). So why not minecarts? Why should they have to stay 4-connected?

Of course, there are a lot of issues to work out, so let's address them each in turn. In the figures below, a minecart is traveling northeast on the track beginning at (1,1) in each figure, unless otherwise indicated.

4 □□∙#
3 □∙#∙
2 ∙#∙□   Figure 1.
1 #∙□□
  1234

A minecart would pass along this track unhindered, in either direction. No items or creatures would be in danger of being hit in the open floor squares of Figure 1, such as (3,2) and (2,3). I'll call these positions, those tiles without track but whose corners touch the track, the "corner touch" tiles.

4 ∙∙∙#
3 ∙∙#∙
2 ∙#□□   Figure 2.
1 #∙□□
  1234

However, walls in corner touch positions would be hit. A minecart traveling northeast in Figure 2 would be halted at (2,2) and send its contents to squares north: (2,3), (2,4), etc. How far north would presumably depend on the cart's speed when it struck the wall. Similarly, a cart traveling southwest would be halted at (3,3) and send its contents west.

4 □□∙#
3 □□#∙
2 ∙#□□   Figure 3.
1 #∙□□
  1234

Two cross-track, corner-touch wall tiles, such as in Figure 3, would halt the cart and each contained item would have a chance (50%?) to be sent through the gap onto the track or stay in the cart. Or maybe it could depend on the item's size, with only small items passing through.

5 ∙∙∙∙#
4 ∙∙∙#∙
3 ∙∙□∙∙
2 ∙#∙∙∙   Figure 4.
1 #∙∙∙∙
  12345

The wall tile at (3,3) of Figure 4 would obviously halt a cart traveling in either direction. I believe it should act exactly like a wall tile placed in the middle of a 4-connected track does currently, for reasons I explain following Figure 9 below.

5 ∙∙∙∙∙
4 ∙∙∙∙∙
3 ∙∙###   Figure 5.
2 ∙∙#∙∙
1 ∙∙#∙∙
  12345


5 ∙∙∙∙∙
4 ∙∙∙∙∙
3 ∙∙#∙∙   Figure 6.
2 ∙#∙#∙
1 #∙∙∙#
  12345

A 90-degree corner on a diagonal like Figure 6 should behave in every respect like its cardinal counterpart in Figure 5.

5 ∙∙∙∙∙
4 ∙∙□∙∙
3 ∙□###   Figure 7.
2 ∙∙#∙∙
1 ∙∙#∙∙
  12345


5 ∙∙∙∙∙
4 ∙□∙□∙
3 ∙∙#∙∙   Figure 8.
2 ∙#∙#∙
1 #∙∙∙#
  12345

A 90-degree corner on a diagonal should be able to have a stabilizing wall, just as a cardinal 90 can. The wall tiles at (2,4) and (4,4) of Figure 8 keep the cart on the track at any speed, in either direction. This is why the wall tile in Figure 4 should simply stop the cart and its contents, and not, for example, send its contents flying to both sides (as a previous version of this post suggested before I got to this point and modified it).

5 ∙∙∙∙∙
4 ∙∙∙∙∙
3 ∙∙###   Figure 9.
2 ∙#∙∙∙
1 #∙∙∙∙
  12345

A 45-degree bend like Figure 9 would act much like a 90-degree bend, carrying the cart through the turn with the same hazards, except that it can handle higher speeds. What happens when the cart is going too fast for a 90-degree turn happens only at a higher speed for 45s. I don't know how that physics was worked out, but a similar process may suffice for the new angle.

4 ∙∙□∙∙
3 ∙∙###   Figure 10.
2 ∙#∙∙∙
1 #∙∙∙∙
  12345


4 ∙∙∙∙∙
3 ∙□###   Figure 11.
2 ∙#∙∙∙
1 #∙∙∙∙
  12345

The stabilizing wall arrangements in Figures 10 and 11 would keep the cart and contents confined to the track at all speeds, similarly to a wall placed at a 90. A cart traveling northeast in Figure 10, and a cart traveling in the opposite direction in Figure 11, would be protected from derailment or other mishaps due to excessive speed.

5 ∙∙∙∙∙
4 ∙∙□∙∙
3 ∙□###   Figure 12.
2 ∙#∙∙∙
1 #∙∙∙∙
  12345

Here is where we get into some trouble. A route on the cardinal 90 track in Figure 7 would be protected from excessive speed hazards by the adjacent wall tiles, no matter which direction the cart was traveling. However, I don't see a reasonable way of speed-proofing a bi-directional 45 unless we scrap the collision rule in Figure 2, since it says a cart traveling northeast would hit the wall tile at (2,3) of Figure 12. And if Figure 2 collisions go, then surely Figure 3 collisions go as well. (Actually, there's somewhat the same problem in Figure 11, even with west-traveling carts.)

The easy solution would be to make all 45s safe at all speeds, but I don't think that makes sense. Physics aside, you could just cut off every 90's corner track tile to make two successive 45s to speed-proof a 90. That seems like an exploit.

Maybe there can be a special case for the corner track tile of a 45 and its surrounding walls, but that's sort of ugly.

Of course, the game would have to realize that a cardinal 90 is, in fact, a 90 and not two successive 45s with some extra track on the outside of the curve. That seems doable.

5 ∙∙∙∙∙
4 ∙∙∙∙∙
3 ∙∙∙##   Figure 13.
2 ∙∙#∙∙
1 ∙∙#∙∙
  12345


5 □□□□□
4 □□□□□
3 □□###   Figure 14.
2 □□#□□
1 □□#□□
  12345


5 □□□□□
4 □□□□□
3 □□∙##   Figure 15.
2 □□#□□
1 □□#□□
  12345

This raises the question, is it cheap to allow cutting the corner, as in Figure 13, to make the track safer?

Not necessarily. It's true that in an open area it could be done, and doing so would be both safer and more economical in material and dwarfpower. However, in solid stone, changing Figure 14 into Figure 15 wouldn't work, since the collision rule of Figure 2 says the cart should stop and empty its contents. You'd have to mine out the wall at (4,2) to make this work.

The same issue exists with 135-degree turns as well.

5 ∙∙∙∙∙
4 ∙∙∙∙∙
3 ∙∙#∙∙   Figure 16.
2 ∙##∙∙
1 #∙#∙∙
  12345


3 ∙∙∙∙∙   Figure 17.
2 ∙##∙∙
1 #∙#∙∙
  12345

A 135-degree turn like that implied in Figure 16 should not be navigable. It's just too tight at any speed. Without this serendipitous maxim, there would be an ambiguity in how to interpret such a tile arrangement. However, since one interpretation should not be navigable, the tracks in Figures 16 and 17 should behave the same. That is, an apparent 135-degree turn should be interpreted as a 45 and a 90 in succession.

The question then becomes, what about this?

7 #∙∙#∙∙#
6 ∙#∙#∙#∙
5 ∙∙###∙∙
4 #######
3 ∙∙###∙∙   Figure 18.
2 ∙#∙#∙#∙
1 #∙∙#∙∙#
  1234567

This is where I give up and accede that the game is perfect just the way it is.
Logged