Skip to content

Phmonski/MidgardMap

Repository files navigation

Midgard Travel Tools

Utilities to build, edit, visualize, and interact with a Midgard travel graph.

Files

  • createGraph.py — produces a sample graph (graph.json). Use --out or --extend existing.json to write/merge.
  • graph_editor.py — GUI editor for nodes/edges (ports, route types, distances, allowed modes). Load/save JSON.
  • visualize_graph.py — renders a PNG of the graph. Requires pip install matplotlib networkx.
  • travel_gui.py — interactive travel day tracker with shortest-path roadmap and time estimates.
  • map_graph_builder.py — click on a map image to place nodes and connect edges; distances are computed from pixel distance times a scale you set.

Quick start

  1. Generate the sample graph (or extend an existing one):
python3 createGraph.py --out graph.json
python3 createGraph.py --extend graph.json --out graph.json   # merge defaults into an existing file
  1. Edit the map (nodes/edges) with the guided GUI:
python3 graph_editor.py --graph graph.json
  • Nodes: set ID and Has port.
  • Edges: pick endpoints, mark undirected, choose one or more route types, distance (km), and allowed travel modes.
  1. Visualize the map (PNG):
pip install matplotlib networkx   # first time
python3 visualize_graph.py --graph graph.json --out graph.png
  1. Plan and track a trip interactively:
python3 travel_gui.py --graph graph.json
  • Choose start/destination, click “Start Trip”.
  • The “Route plan” pane shows the shortest path and estimated time (based on current mode).
  • In a city, choose a route and click “Start Selected Route”.
  • Each day, pick mode + hours and click “Travel Day” to update distance covered/remaining and the log.
  1. Build a graph by clicking on a map image:
python3 map_graph_builder.py --image Alba.jpg --scale 0.5 --graph graph.json
  • Click “Add nodes” mode to place cities/landmarks.
  • Switch to “Connect nodes” and click two nodes to add an edge; distance is pixel_distance * scale.
  • Update the scale (units per pixel) and hit “Recalc Distances” to refresh edge lengths; save to JSON.

Scalefactors for Maps

  • Alba: 1.038

Notes

  • New Feature request: sail-along-the-shore for safer sea travel.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages