How do you make a tile map?

How does one make a Escape Velocity type linked node map?

  • So there was an old Mac space trading game named Escape Velocity. On its map, each star system was connected to 1 to 8 other star systems. Each of those systems could be connected to another 1 to 8 star systems, on and on to the edge of the map. What is that type of thing generically called (node map, node web, I'm just guessing)? More inside. I want to generate those types of maps randomly in a game I'm writing. It's easy to make a (X by Y) matrix of X number of systems with 1 to Y connections from system Z to systems Z1, Z2, Z3...ZY. But when you draw it visually, I don't know how you make it so connected systems are close to each other on the map. Each system should be as close as possible to the systems it is connected to. If you just start drawing links, you end up with a tangled mess of lines after the first few link levels (if that's the correct term). My solution, which I think is kind of funny, was to model them as spheres in the Unity physics engine, and have them attract the spheres they are linked to while repulsing spheres they are not linked to, all locked into a single plane to keep the map flat. Sometime I set up an "explosion" in the middle to get them moving around faster. This sort of works, but is there a "mathier" way to make these maps? I'm asking this here instead of the Unity forums because it isn't a Unity specific question, and this place has a lot of math folks. I can follow you as far as DiffEq, but if you start talking tensor fields and such I'll need a translation. Thanks!

  • Answer:

    Your Unity-based solution is a http://en.wikipedia.org/wiki/Force-directed_graph_drawing. As Just this guy said, there are plenty of libraries out there that will help you generate and plot graphs.

BeeDo at Ask.Metafilter.Com Visit the source

Was this solution helpful to you?

Other answers

On further thought, another way to do this would be to generate random coordinates for nodes, and use a http://en.wikipedia.org/wiki/Delaunay_triangulation to decide the edges. This has the advantage of giving you a planar graph (can be drawn in 2D without overlapping edges).

qxntpqbbbqxl

The data structure of these sorts of maps is an "undirected graph". Mathematica has http://reference.wolfram.com/mathematica/tutorial/GraphDrawingIntroduction.html documenting how to use its own graph-plotting tools and algorithms, which might be a good place to start.

tylerkaraszewski

Probably the first thing you want to read about is Graph Theory. This is the study of linked structures like you describe. I am willing to bet that whatever you're coding in has libraries for doing graph work. As a bonus, said libraries should also help you with pathfinding.

Just this guy, y'know

A http://en.wikipedia.org/wiki/Graph_%28mathematics%29. They're composed to edges (the connections) and vertices (a node, if you will). If edges are one-way, then it's a directed graph.

k5.user

Awesome. Thanks!

BeeDo

The next step is to assign a cost to each link.

Bruce H.

This is totally not answering the question, and the mods may smite me, but if you're designing a game anywhere remotely similar to EV, for the love of god memail me and I will buy it with real money. Also, I once had extensive correspondence with one of the EV developers and can try and coax his email out of the (internet) paleolithic if you need.

digitalprimate

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.