Mini Metro
SuperDude Dec 31, 2014 @ 10:10pm
Dev question - how do you draw lines in Unity?
Love the game! The minimalism is especially inspiring for an artistically challenged person like me.

I'm trying to do a similar thing to how you create metro lines myself in Unity, i.e. drawing lines by dragging the mouse. I've been trying with the built in line renderer component, but the end results aren't particularly ideal.

The other way I can think of (but haven't tried yet) is to draw and update a mesh with the Graphics class, but that sounds like it would be more complicated than it really has to be.

How do you do it in Mini Metro, if you don't mind sharing such secrets?
< >
Showing 1-4 of 4 comments
Robert  [developer] Jan 4, 2015 @ 12:15pm 
Peter's the dev that handles pretty much all of the lower-level code like this, but I can shed a bit of light until he gets the chance to reply!

We use the Futile framework[github.com] by Matt Rix. However that's currently aimed at sprite-based 2D games, and almost all of our game is procedurally generated. So we've added a set of Brush, Path and GeoSprite classes that fit into the Futile rendering and allow us to define any geometry and render it, and also add in alpha-fringing automatically so we don't strobe when zooming out.

I know that's a super high-level look at it, but I can't go into any more detail without getting something wrong I'm afraid!
SuperDude Jan 4, 2015 @ 2:46pm 
Thanks for the answer! Sounds like quite a bit of work went into it then. I was hoping there was a quick, simple solution but I guess this requires some actual coding effort.
xepherys Dec 11, 2023 @ 12:55pm 
Originally posted by Robert:
Peter's the dev that handles pretty much all of the lower-level code like this, but I can shed a bit of light until he gets the chance to reply!

We use the Futile framework[github.com] by Matt Rix. However that's currently aimed at sprite-based 2D games, and almost all of our game is procedurally generated. So we've added a set of Brush, Path and GeoSprite classes that fit into the Futile rendering and allow us to define any geometry and render it, and also add in alpha-fringing automatically so we don't strobe when zooming out.

I know that's a super high-level look at it, but I can't go into any more detail without getting something wrong I'm afraid!

I know this post is incredibly old - but is there any chance you or Peter could follow up? I'm working on a game in Unity and have been trying to use Splines to make something akin to subway lines (not actually transit lines, but a procedural subway map for a different sort of game map), and Splines are... not the answer, nor is LineRenderer.

After seeing this thread, I looked into Futile, and that may be an option, but I'm wildly curious how you all do the offsets and whatnot to make multiple lines cross through a station, and allow procedural transit lines. I don't want to copy your work (I promise, the game isn't even a transit game), but I do want maps that are influenced greatly by Mini Metro because they're just so beautiful and clean!
xepherys Dec 11, 2023 @ 12:57pm 
Originally posted by SuperDude:
Thanks for the answer! Sounds like quite a bit of work went into it then. I was hoping there was a quick, simple solution but I guess this requires some actual coding effort.

SuperDude, did you ever get anything working for this? Yes, there would definitely need to be coding to achieve this sort of thing - and I don't mind that part of the work at all. So far, my attempts with Unity's LineRenderer and Splines have left a LOT to be desired.

LineRenderer is far too limited. Splines are difficult to work with at runtime (trying to recalculate tangents and such on the fly is a mathematical nightmare)
< >
Showing 1-4 of 4 comments
Per page: 1530 50

Date Posted: Dec 31, 2014 @ 10:10pm
Posts: 4