So, I am modding a game where the distance in pixels between star systems DOES matter on how the game calculate stuff.

We currently have a cool looking sub-way style map, with a lot of things in arbitrary places and shapes, unfortunately this caused a lot of gameplay bugs.

So I was looking around for examples of star maps, and noticed all of them, anime, movies, games, etc... is a variant of "bright dot to represent a system on a black BG".

So how someone would make a map of the stars? Even better, how someone can make a map that someone in-universe would use, for maximum immersion?

Most people can't think in 3D, so what kind of maps would represent in 2D, distances (in time, our setting has wormholes for FTL, thus NOT actual distance between stars) in a way that people would understand, and be useful in a military manner?

  • 6
    $\begingroup$ Can you elaborate on why your subway-style map is causing you issues? It seems that given your use of wormholes, some kind of shapeless graph capable of showing arbitrary connections between points is just what you need, and a subway-style map should be able to provide that. $\endgroup$ Jul 30, 2020 at 16:51
  • $\begingroup$ The artist assumed that the distance didn't matter, and so he used whatever looked better, giving arbitrary sizes and distances to things. For example star systems on that map are represented by ovals (not quite elippses), and seemly his method of drawing them was... randomly drawing elippses using MSPaint, not caring how big or small they are. Then he linked them with lines to show the wormhole connections. Problem is the size of the connections on the current map do not represent the time it takes, and the size of the circles do not represent anything either. $\endgroup$
    – speeder
    Jul 30, 2020 at 17:01
  • 3
    $\begingroup$ Dark spots on a bright background is actually reasonably common in astronomy, where it used to be standard to examine photographic negatives from telescopes. $\endgroup$ Jul 30, 2020 at 17:29
  • $\begingroup$ There's an interesting blurb in Uhura's Song about how standard star charts are black-on-white... but as to the actual question, if your in-universe people have holographic maps, well then, problem solved... OTOH, the galactic plane makes for a semi-reasonable reference for producing a 2D projection. $\endgroup$
    – Matthew
    Jul 30, 2020 at 18:28
  • 1
    $\begingroup$ Have you looked at the star map for Galaxy on Fire 2? That was always one of my favorites. It's basically 2.5D, 2D plus some height perspective so that when you move the map the stars shift at different rates that intuitively implies their relative heights. $\endgroup$ Jul 31, 2020 at 14:20

5 Answers 5


You say that:

We currently have a cool looking sub-way style map, with a lot of things in arbitrary places and shapes, unfortunately this caused a lot of gameplay bugs.

But in the comments, you say:

The artist assumed that the distance didn't matter, and so he used whatever looked better, giving arbitrary sizes and distances to things.

You could work on fixing that specifically. A good example I like is the map of Δv's for KSP:

A Δv map of the Kerbol system: source: https://wiki.kerbalspaceprogram.com/wiki/Cheat_sheet

The size of each "leg" of a path is not to scale, but they have numbers printed on them showing the actual Δv you need to go from one point to another. You could improve on it by making the legs to scale.

An alternate form is that of a grid. I've seen it in numerous board games, and in attempts to map the galaxy for Star Wars and other sci-fi franchises. The one below is for Elite Dangerous:

enter image description here Source: https://www.reddit.com/r/EliteDangerous/comments/9ppcpg/high_res_map_of_the_new_galactic_grid_chapter_4/

If you are not going to explore the full galaxy, you can zoom in your map to only a part of it. With a grid representation, it is also simple to represent wormhole connections.

  • 3
    $\begingroup$ The board game map version works quite well for galaxies and solar systems, since they are generally pretty flat (disc-shaped) and project well onto a 2D plane. The Milky Way, for example, has a diameter 200x greater than its thickness, so calculating the distance between two points while completely ignoring the vertical dimension will be a reasonable approximation of the 3D distance, especially as the points become farther apart horizontally. $\endgroup$ Jul 30, 2020 at 19:51
  • 3
    $\begingroup$ The first part of this answer was pretty much my thought after reading the comments on the question. OP's problem isn't "a subway map doesn't work for my game", their problem is "the subway map I have is poorly-made". The solution may very well be to simply make a better subway map, rather than changing to a completely different mapping style. $\endgroup$ Jul 31, 2020 at 8:34
  • 2
    $\begingroup$ @NuclearWang - Spiral galaxies project well into a 2D plane. Elliptical galaxies - not so much. Of course, the OP is most likely in the Milky Way, so that probably isn't an issue. $\endgroup$ Jul 31, 2020 at 16:20

There isn't any mapping from 3D to 2D that will preserve pairwise distances between all points. Using time as a measure doesn't fundamentally change anything about the problem, since instead of "distance" being measured in km/AU/lightyears, it's instead measured in hours/days/years - but you still just have a series of pairwise distances between points.

You could make a locally oriented map that accurately shows distances from your current location (A) to any other location (B or C). But this type of 2D map would not accurately represent the distance between B and C.

Because you cannot map directly from 3D to 2D and preserve distances, a subway-style abstraction might actually be just what you need. You simply label the subway "legs" with the true 3D distance between points, since you cannot measure the legs on the 2D subway map and get an accurate value. One just needs to be aware that there will be distances that are not reflected in the visual representation of the subway map - some points that appear close together might actually be far apart, and some points that appear far apart might actually be close together.

Note that this distortion is exactly the point of a subway map - it purposefully distorts distances in order to have a more visually pleasing layout. There's no reason you couldn't draw a map of the London Tube that perfectly represents the pairwise distances between all stations (it would just be a regular map), but that is antithetical to the whole impetus for the subway map in the first place. For the star map, you can't perfectly represent the distance in 2D, but you can still try to organize it in a way that minimizes distortions.

It's the job of the mapmaker to choose the representation to minimize that visual disparity, and to put those visually discordant distances in less important or less traveled legs. You can take advantage of natural "projection planes" to minimize distortions, leveraging the knowledge that galaxies and solar systems tend to be much wider than they are thick - projecting a galaxy top-down along its axis of rotation will only lose a fraction of that pairwise distance information (the projection distance is a good approximation of the 3D distance). An edge-on projection, on the other hand, would lose a great deal of that information.

  • $\begingroup$ There isn't any mapping from 3D to 2D that will preserve pairwise distances between all points. There is if you don't require that direction is also preserved. $\endgroup$
    – shade4159
    Jul 31, 2020 at 12:34
  • 4
    $\begingroup$ @shade4159 That is not true. Try mapping 4 equidistant points in 3D (the corners of a regular tetrahedron) to 2D - there is no way to have 4 equidistant points in a 2D plane. You can make 3 of the points equidistant by arranging them in a regular triangle, but then there's nowhere to put the 4th point on the same plane so that it's the same distance from each of the 3 points as those points are from each other. This simple example shows it is impossible to map 3D to 2D and preserve all pairwise distances (except in cases where everything lies on a single plane in 3D). $\endgroup$ Jul 31, 2020 at 13:15
  • 2
    $\begingroup$ Arrange four points in a square, with a distance of (e.g.) 1. Connect each corner to its opposite point to form an X shape (length: sqrt(2)). Connect all points to their neighbors with arcs with lengths of sqrt(2). All points will now be mapped onto a plane with distances preserved. $\endgroup$
    – shade4159
    Jul 31, 2020 at 13:41
  • $\begingroup$ @shade4159 Interesting approach, but you require the specific paths you drew for that to work out, and the arrangement of points on the plane becomes entirely arbitrary. You could put the points anywhere you want and draw convoluted paths between them to make the distances correct. This is similar to the subway map approach, with the added step of scaling all the subway legs to their true length by having them take a looping or bending path. The positions of the points on the plane don't reflect distances, only the specified paths do. $\endgroup$ Jul 31, 2020 at 13:56

Use an actual map.

Frankfurt distances

I found this here: https://www.distantias.com/distances-from-frankfurt_am_main-germany-to-capital-cities.htm#map2

You plug in your city and it will show you distances to nearby cities. This has many benefits.

1: You can center your map wherever you like. I can use this same website and put Vienna in the center, or Kyoto. You can have a map for each star in your game with that star at the center.

2: The distances are real distances and so you don't need to remember them. You can check.

3: Yes, they are actually stars. You are not flying your spaceship among the canals of Amsterdam. The in game story is that this representation worked in world for your star charters and it was easy to remember. Plus instead of long numbers this automatically gives stars names: the Amsterdam system; the Kyoto system etc.

4: There are a lot of cities if you need them. Not as many as there are stars, though.


You can use color to add more spatial dimensions to points that you're plotting. The map would be read by taking in to account both the distance between stars in 2D and the difference in their colors. I can think of some ways to do this:

  • Making it look like the stars are in a fog, so that farther stars have more of the background color than nearer stars.
  • Making it look like the +z stars are white hot, cooling down to red hot -z stars.
  • Use hue.

This would extend up to 6 dimensions, if you wanted (RGB + XYZ in 3D), but your application could use one gradient scale (one dimension of color), combined with two dimensions of space, to displace points in three dimensions.


This is a minimisation problem on a graph

From your description, you have a set of stars which are connected by an arbitrary network of wormholes, each of which can be assigned some 'distance'. You want a two-dimensional representation of this universe (i.e. a map) which is close to accurately representing the distances.

The natural way to draw this map is as a graph, which is a set of nodes (your stars) connected by edges (your wormholes). When turning this into a map, usually a subway-style map is created, because train networks are very similar in being a set of nodes (stations) connected by edges (train lines). This point is covered in Nuclear Wang's and Renan's answers.

If you only need a single map created manually and you only require the distances to be approximately accurate, you could do this by hand (employing appropriate graph-drawing software to make the task easier, so you can drag around nodes until everything looks right, or better yet have it automatically place the nodes). A benefit of doing it by hand is that you can handle outliers in an intuitive manner (e.g. if you have shortcuts which cut through an otherwise well-behaved network of wormholes).

If the location of the stars can be mapped to regular space and the distance of the wormholes is simply proportional to distance, it would be easiest drawing the stars where they are in real space. This is simple and intuitive, although requires either compromise or creativity if there is a significant 3D component.

For the generic problem, where you have an arbitrary collection of stars connected in an arbitrary manner by wormholes of arbitrary length, your task becomes an optimisation problem in representing this graph. You may need to be able to construct this graph automatically (such as for randomly generated maps). For this we invoke some mathematics. Details of implementing such algorithms are beyond the scope of this site and should be asked elsewhere.

We have a set of distances $\{r_{ij}\}$ between stars, where $r_{ij}$ is the distance between stars $i$ and $j$. Your list of distances might only include explicit wormhole connections. Or you might like to include all pair-wise distances (so that the distances in your map are accurate even for stars not directly connected), in which case you would need to step through your graph one node at a time, building up distance matrix.

(If the 'true' distances between two stars needs to be referred to often, you probably want to keep this distance matrix for use throughout the game and rely on it rather than checking points on the map.)

We want to find the coordinates $\{(x_i,y_i)\}$ of each of the stars in two-dimensional Euclidean space (that is, we want to determine where on the screen to draw them). And we want to find them in such a manner that minimises (in some way) the difference between the desired distance $r_{ij}$ and the drawn distance $\sqrt{(x_i-x_j)^2 + (y_i-y_j)^2}$.

Perhaps the simplest way (but not the only way) to frame this minimisation problem is with non-linear least squares. We can avoid awkward square roots by squaring the distances. Then we can minimise the sum of the squares of the differences between the target and actual distances, $$ S = \sum_{\{(i,j)\}} \left( (x_i-x_j)^2 + (y_i-y_j)^2 - r_{ij}^2 \right)^2, $$ where the sum is taken over pairs of $i$ and $j$ for which you have defined $r_{ij}$. We then minimise $S$ with respect to $\{(x_i,y_i)\}$. How you do this is beyond the scope of this question, although it is a well-studied problem and there are places elsewhere on the Stack Exchange network which will answer how to do this.

Once you have the coordinates $\{(x_i,y_i)\}$, you then get the computer to draw your stars at those points then draw wormholes between the appropriate stars.

You can add extra sophistication to $S$. For instance, you may consider that the more wormhole jumps there are between two stars the less important it is for the distance to be very accurate, so you might apply a weight to each term in the sum to indicate their relative importance. Or you might like to avoid drawing wormholes crossing each other, in which case you can add a penalty function which increases $S$ if two wormholes cross.

While you could write your own code from scratch to draw your star map, graph visualisation is an old problem. There already exists many graph drawing software packages which handles a lot of the problems of creating aesthetically pleasing graphs. You will have to check which ones suit you, since some may not handle hundreds of nodes and some require you to pay. You also want to be able to take the output from the graph visualisation software and insert it into your game graphics engine. Although I have not tried it, a cursory glance through search results indicates that graphviz might be appropriate, since it is open source and implements algorithms which optimise the graph layout for the types of graphs you want. But check yourself if it meets your needs.

Note that, in general, it will not be possible to get the distances on the map to perfectly align to the 'real' distances. If your graph is very complicated, then it might not be possible to get even close to an accurate representation. There are two solutions here. One is to discard the old arbitrary wormhole lengths and instead re-write the wormholes to have a length equal to their length on the map. The other is to write the wormhole lengths as numbers on the map (as in Renan's answer); the people (or computer) reading the map can accept that scale is approximate but rely on the written numbers being exact.

You also ask about how people would represent these maps in-universe.

If the arrangement of wormholes is not expected to change during the lifetime of the map, then the map would likely be created in a similar manner to what I have described above. Software exists for converting graphs into pictures, and depending on the purpose and size of the map it can be partially or wholly designed manually.

Such maps are useful for transportation and travel, like our subway maps. Train lines rarely change, so the map does not have to be updated too often. Train lines also correspond to physical space, so when a new train line is added the map only has to change a little bit to accommodate the new train line.

These maps would also have military applications. Logistics is a big part of war. You want to be able to see what territory each faction controls, how spread out it is, how far it is from your own, how long it would take to get between two points, etc. While quantitatively accurate results will require calculations, a well-designed map will allow for the essential data to be intuitively grasped. For a well-behaved graph, the distances on the map may even be decent approximations for the fully accurate numbers.

You mention in a comment that the wormholes do not change throughout the course of a game. This means the aforementioned map is useful.

However, there is likely a timescale on which wormholes are created or destroyed or moved. Unless the 'distance' of a wormhole is roughly proportional to the real-space distance, creating new wormholes is likely to radically alter and invalidate a graph-based map.

Astronomical and surveyor maps will be of this type which must remain relatively unchanged despite the layout of wormholes. Such maps will try to represent the positions of stars in real space. Wormholes will be drawn as lines between stars without respecting the 'length' of the wormhole. How to draw points in 3D space on a 2D map is its own problem. The data of star positions would be stored as a list of 3D points and it will be up to each mapper to determine how to project that data onto 2D (such as Retracted's answer). Or they could use 3D graphics, holograms, virtual reality or augmented reality to display the data in 3D.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .