Jump to content
Sign in to follow this  
DorHans

SinglePlayer Map Renderer

Recommended Posts

Howdy Survivalists,

 

since Random Gen I always wanted a tool to export the explored world. Although I really like cumu's tool Export-discovered-map-to-png, it simply doesn't fit my needs. Personally I don't like python very much and I don't want to run a web server and browser just to see my map.

 

So, I made my own version based on cumu's tool. It's a small .net application and exports only one player map to one png file.

The only option so far is the size of the exported map:

  • FullSize means one pixel equals one ingame block
  • HalfSize means one pixel equals four ingame blocks (two in x and two in y)
  • and so on

Download and source code is available at: https://github.com/DorHans/7DTD-SMR/releases

 

Old address provided, in case you need an older version: https://7dtdsinglemaprenderer.codeplex.com

 

A big thanks to cumu for sharing his great work!

Also a big thanks to Karlovsky120 for writing the 7DaysProfileEditor.

 

Changelog:

2020-02-06 version 1.11.2020.206

  • added missing symbol for gyrocopter

 

2019-12-31 version 1.11.2019.1231

  • added rendering of biome map and prefabs for Alpha 18
  • added TileSizes double, triple and quadruple (maximum pixel size of png file is about 20k by 20k, enough for double size with 8k maps or quadruple size with 4k maps)
  • added setting for game directory (needed for prefabs) -> please check "Settings" window!

 

2019-12-22 version 1.10.2019.1222

  • new method for reading waypoints from ttp files
  • spawnpoint (bed), backpack and quickmarker are no longer rendered

 

2017-11-12 version 1.9.2017.1112

  • new experimental tool RegionViewer (maybe useful for RegionEditor)
  • ImageFilePath is saved for each SaveGame individually

 

Old versions:

 

 

2017-09-02 version 1.8.2017.0902

  • first Github release
  • rendering of ingame waypoints for Alpha 16.3 (b12)

 

2017-06-12 version 1.8

  • last Codeplex release
  • map file format changed with Alpha 16 (b105)
  • rendering of ingame waypoints for Alpha 16 (b105)

 

2016-10-06 version 1.7.1

  • rendering of ingame waypoints for Alpha 15

 

2016-06-05 version 1.7

  • rendering of ingame waypoints for Alpha 14
  • rendering of spawn position, dropped backpack and quick map marker
  • added datastore for large maps (map file > 64 MB, see Settings menu)

 

2015-12-18 version 1.6

  • added rendering of ingame waypoints
  • added rendering of names to all POIs and waypoints

 

2015-12-05 version 1.5

  • added rendering of POIs from a csv file (see post #22)
  • fixed calculation of region numbers
  • added experimental tools (from "Debug build" of 1.4)

 

2015-10-12 version 1.5 b1

  • added command line interface (see post #21)

Browse the "DOWNLOADS" tab on the Codeplex site to find this release.

 

2015-09-27 version 1.4

  • small UI improvement, so you can select your save game rather than a map file
  • added options to render region names (see post #20)
  • added settings.xml to the application directory
    Be sure not to put the exe under "C:\Program Files" or "C:\Windows", however "C:\ProgramData" or any other directory with full access is fine.

The project site on Codeplex also has a "Debug build" of 1.4.

 

2015-08-26 version 1.3

  • added options to draw grid lines (could be useful with Regionedit)
    to align the grid to regions use a grid size of 512
    to align the grid to chunks use a grid size of 16

For a screenshot and further discussion, see post #15.

 

2015-08-16 version 1.2

  • added button to open the export folder
  • added possibility to draw a background (taken from game resources)

 

2015-07-19 version 1.1

  • added optimized rendering method for "FullSize" images (up to 10x faster with maps 5000x5000 blocks/pixels)

 

 

Edited by DorHans
New version released. (see edit history)
  • Like 3

Share this post


Link to post
Share on other sites

Thanks for the nice words.

 

Just released version 1.1. Now my map, with a size of 7888*9440 pixels, renders in 2.5 seconds instead of 26 seconds. Though smaller sizes still need the whole time.

  • Like 1

Share this post


Link to post
Share on other sites

This is super -- thank you, DorHans. For a long time now, I've wanted an offline way to scour my explored map to find those teeny cave entrances. (In-game, not only is the clock always ticking, but the resolution of max zoom isn't that great.)

Share this post


Link to post
Share on other sites

Just came across this from this thread: 7DTD Alpha 12 - Full mod list!

 

I have to say this sounds perfect for plotting my next days course and summarising what stashes I have made from the previous day, all I may add, from the comfort of my plate wood and stick chair by the soothing light of a fire torch. I'm guessing it can be opened in Publisher? Can't try it yet as stuck at work.

Share this post


Link to post
Share on other sites

Since this tool exports the map as a png file, it should be compatible with almost every graphics software ;)

Share this post


Link to post
Share on other sites

Then you sir are the man! :). I'm home now so giving this a run in a few minutes.

 

This is gonna make those "minibike pickup trips" so much easier than having to remember where I stashed all that loot. Wish they'd add custom markers to the map so we can drop\pin our own POIs.

Edited by General_Disorder (see edit history)

Share this post


Link to post
Share on other sites

OK first thoughts:

 

Install: "Crap I did it wrong, that "install" was far to quick and easy!"

Launch: "That looks too nice to be working surely!"

Import: "I'm expecting a pack of dogs to come chasing me this is too easy!"

Export: "Job done!"

Viewing: "HOLY FRACK!!!"

 

An amazing bit of coding there! The clarity is unbelievable! Far too many !'s but hell, this is awesome dude!

 

A quick bit of Publisher editing and I've got bases, pickups and mines\caves highlighted...again amazing job!

 

ScreenShot143.jpg.a0111635498e594bf4ae84285935f341.jpg

Edited by General_Disorder (see edit history)

Share this post


Link to post
Share on other sites

Fantastic! Not only is it easy to use but it works like a charm! Found a new cave within .5 km of my base that I never saw before. Thank you for this!

Share this post


Link to post
Share on other sites

Version 1.2

 

Hi guys,

 

just released version 1.2. I took the background from the in-game map. It's just nicer, than the plain black.

 

map_compare.jpg.d0f82bd6220abe175df430fd59ccaa58.jpg

Share this post


Link to post
Share on other sites

Version 1.3

 

I've added options for drawing grid lines. The attached picture has a grid distance of 100 blocks and the point 0/0 is marked with a small circle. (Just noticed the attached image got converted to jpg and you can't really tell where the circle is. Sorry for that.)

map_grid.jpg.0a1f487aac843144a4e57c07790590d9.jpg

 

My plans for the next versions:

  • improve usability
  • add overlays
  • any ideas?

As for usability I think about saving settings, last used files or make a dropdown with all saved games, so you don't have to select the *.map file.

Well, overlays should include your "home" symbol. You should be able to add your own symbols for POIs or caves, like in post #11. It would be great, if anyone has an idea on how to get this information!

 

I'd like to hear if you have any other ideas or suggestions.

Edited by DorHans
bad quality of attached image (see edit history)

Share this post


Link to post
Share on other sites

Just awesome. Thanks for this review! Keep up your great work.

 

I really like your idea about aligning the grid to regions - should come in handy. That's definitely on my list.

Share this post


Link to post
Share on other sites

This is excellent. Thanks from another.net developer. :)

It works flawlessly.

I use IRFanView to display it on my second monitor.

Anyone else have a nice lightweight image viewer url they'd like to share?

 

DorHans, if you're looking for ideas, I'd LOVE to have a command line version that I could call from a shortcut if it's possible. This way I could update the map with a click.

Share this post


Link to post
Share on other sites

Version 1.4

 

This version brings a small UI improvement, so you can select your save game rather than a map file. And there are new options for rendering the names of region files:

SMR_regionnames.jpg.993a7b3cfb3c53eee4c7920a9b0a3d71.jpg

(Note: You may change the font and the size to your needs.)

 

Last point: I added a settings.xml to the application directory. Be sure not to put the program under "C:\Program Files" or "C:\Windows", however "C:\ProgramData" or any other directory with full access is fine, like "C:\Users\<username>" or "C:\Temp". (Otherwise the program is not able to write the settings to disk and forgets about everything.)

 

 

@GaryP: I use XnViewMP as image viewer.

A command line version is clearly possible, just give me some time. But please be sure, not to use this tool as a live viewer. 7DtD writes the map file every few seconds and if the reading and writing collides, you may end in a mess.

Share this post


Link to post
Share on other sites

Version 1.5 beta 1

 

Here it is, the first version with a command line interface. Tell me what you like and what you want to see improved!

 

(The download is "hidden" here: https://7dtdsinglemaprenderer.codeplex.com/releases/view/617880)

 

7DTD-SingleMapRenderer.exe /? will print the following help:

7 Days To Die - Single Map Renderer - v1.4.2015.1012

 

Switches:

/m or /map=<value> Path to the map file

/i or /image=<value> Path to the image file

/ts or /tilesize=<value> Size of each map tile (16, 8, 4, 2, 1)

/bg or /background Draws background from in-game map

/g or /grid Draws grid

/gs or /gridsize=<value> Size of a grid cell

/gc or /gridcolor=<value> Name of the grid color

/ga or /gridalpha=<value> Alpha value of the grid color

/rn or /region Draws region numbers

/rfn or /regfontname=<value> Name of font for region numbers

/rfs or /regfontsize=<value> Size of font for region numbers

 

Only the map-switch is required. All other switches are optional.

 

Example:

7DTD-SingleMapRenderer.exe /map="%appdata%\7DaysToDie\Saves\<Path to file>.map" /i="%userprofile%\Desktop\map.png" /bg

Will render the map to your desktop with the in-game background.

Share this post


Link to post
Share on other sites

Version 1.5

 

You can now draw your own symbols to a map.

 

This works with a plain CSV file. For the latitude applies: + is north and - is south. For longitude is + east and - west.

Latitude,Longitude,Symbol
-400,680,book  ;comment 400S 680E bookstore
-350,680,chest

 

Within the application are these symbols included:

book, house, star, fork

chest, medic, tick, gun, shield

drugs, radiation, hammer, fire

SMR_pois.jpg.d2ed8569c7b4f451cd68fb264a146282.jpg

 

Feel free to add own symbols or replace the existing ones! (I recommend a size of 32x32 pixels.)

Create a folder called "Resources" in your application directory. Inside this folder create a new one called "png". In there you may put your "<name>.png". Inside the poi.csv you can now use <name> in the symbol column. See this screenshot:

SMR_own_pois.jpg.5927aa37ccdb5a45c73a38f8de56ec45.jpg

 

And I added some experimental tools (from v1.4 debug):

* Font test: Renders an image with all installed fonts. Choose your favorite with ease.

* XML to CSV converter: Convert blocks.xml, items.xml and materials.xml into a handy csv file. Maybe interesting for balancing your own mods or if you are curious on which blocks mobs can spawn on.

 

As always, tell me you think.

Share this post


Link to post
Share on other sites

Version 1.6

 

Hi guys and gals,

 

here it is, the brand new version capable of rendering ingame waypoints. Hope you like it.

As I am now messing around with the player file (id.ttp), the rendering may break with the next 7DTD release.

 

The POI.csv is extended with a name column (just like in game):

Latitude,Longitude,Symbol,Name
-400,680,book,"Book store"  ;comment
-350,680,chest,warehouse

 

Tell me, if you encounter any problems.

Share this post


Link to post
Share on other sites

Just looked at the sources on CodePlex and it is nice piece of code ;-) Especialy the part were you are using a Pointer to access the pixels of the bitmap... This is really faster than the "Bitmap" class native methods (Get/SetPixel) !

 

Thanks for your work !

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...