Skip to content

intervexual/TLDBaseViz

Repository files navigation

TLDBaseViz

Visualization for safehouses in The Long Dark. This is a work in progress!

The purpose of this vizualizer is to give a bird's eye view of all one's bases in the game. Everything is SVG, meaning you can zoom in and out and the icons will scale nicely.

I'm currently using this vizualizer to keep track of all my bases in my current interloper game. Right now, it looks like: my bases

Dependencies

You can install them with: pip install drawsvg beautifulsoup

How to use

The visualizer takes its data from a JSON file which you provide as a command-line argument. Two example JSON files are provided: mybases.json and loottable4.json.

To run the visualizer: python3 TLDBaseViz.py <inputFile.json>

The input JSON has two sections: a list of bases, and a list of connections between the bases. A small vizualization might look something like this:

DP example

In this example, Hibernia, the No 5 Mine, and Lonely Lighthouse have been explored, but the other locations have not, and are hence outlined in purple. Square boxes indicate indoor (warm) locations where one could cure a hide. The opacity of the box's border indicates whether there is safehouse customization. Italics indicate there is no loading screen to access this location. The JSON entry for Hiberina is:

	"Hibernia":{
		"region": "DesolationPoint",
		"customizable": true,
		"loading": true,
		"cabinfeverrisk":true,
		"indoors": true,
		"explored":true,
		"features": ["salt,beachcombing",
					"bed, grill, workbench",
					"quality, -hammer",
					"#Cannery, +woodworking, +furnbench, +bearbed"
		]
	},

The icons are specified by the list features: each string is a row, and each string in the list is a column. Every icon has a specified keyword (e.g. salt is for salt deposit). There are three special prefixes:

  • - is used to indicate something should be taken from this location (e.g. -hammer: you can see the nearby Riken has a +hammer showing where it should go). By default, cyan is used for this.
  • + is used to indicate something should be brought to this location (e.g. +woodworking). By default pink is used for this.
  • # is used to indicate a text box. This is useful for notes for yourself, such as if an item is coming or going far away. In the example above, #Cannery is a note I made to indicate the woodworkng tools are coming from the Cannery.
  • * is used to indicate something should be produced (crafted) for this location (e.g. a furniture workbench).
  • ? is used to indicate something should be searched for at this location.

Connections are formatted as a list, and an excerpt looks like this:

	["Hibernia", "north", "top,left", "BrokenBridge", "bottom,left", "path"],
	["Hibernia", "south", "bottom,left", "Riken", "top,left", "charcoal"],
	["Riken", "east", "top,right", "LittleIsland", "top,left", "charcoal"],
	["No5Mine", "east", "bottom,right", "Hibernia", "top,left", "path"],

The format goes:

  1. Name of source base
  2. Direction from source base to sink (destination) base
  3. Which corner of the source base's box the connection starts from
  4. Name of sink base
  5. Which corner of the sink base's box the connection ends at
  6. A keyword used to style the connection. For example path for when a connection is readily navigated in low-visibility conditions thanks to a road, railroad, or natural path.

You can change the colour scheme by editing styling.json as desired. A high contrast style file, hicontraststyling.json is also provided.

The order of the bases in the JSON file matters

The order in which you list your bases in the JSON file affects the order in which they are drawn. The program draws bases in this order:

  1. Draw the first base in the JSON file.
  2. Draw all of the bases connected to that base.
  3. Move to the second base in the JSON file. If it isn't already drawn, draw it. Then draw all of the bases connected to it.
  4. Repeat #3 with the third base, fourth base, etc.

If your bases are appearing in janky locations, you may have to fuss with the order of the bases. If the program gets to a base but has no connections to it so far, it won't know where to put it, and will put it at the location of the first base.

Icons available and their keywords

A full legend is avilable in legend.csv.

Natural resources

natural

Furniture

furniture

Tools

Green indicates it is not available on interloper/misery.

tools

Clothing

clothing

Miscellaneous

misc

Adding/changing icons

You can modify legend.csv to remap the keywords and add icons of your own. If you want to add or modify the SVG icons, please be forewarned that the SVG parser is rather minimal, and presently only supports SVG files which are square in shape, have no layers, no relative paths, and no transformations.

Image Credits

Icons used here are all from The Noun Project unless otherwise noted. They are all Creative Commons licensed.

TODOs

Icons to add

  1. Icons for all accessories
  2. Sewing kit
  3. Can openers?
  4. Wall art and rugs?
  5. Separate icon for outdoor workbench?
  6. Bear processing locations?

Coding/UX

  1. Revamp colour scheme
  2. Add day # to visualization
  3. Automatic centring and canvas sizing (two-stage drawing?)... when redrawing, put the connections under the boxes
  4. Automatic legend location
  5. Allow stacking of items
  6. Indication of rope climbs
  7. Write more documentation for other people to use it
  8. Finish loot table templates for interloper
  9. Refine the dark mode / hi contrast style

Maybe later

  1. Add some level of importance/priority?
  2. Festive lights

Acknowledgments

About

Visualization for

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages