Jump to content

SinglePlayer Map Renderer


DorHans

Recommended Posts

  • 2 months later...

Thanks guys for all the feedback. This really cheers me up. And over 250 downloads for the current release, that is really great.

 

@Life_For_Dead

I haven't had this error before, so I can only guess. Make sure you have at least .net Framework 4.5 installed.

If this doesn't help, please provide some more information. Like, when do you get this error. Or post the entry from your systems event log.

 

 

Btw, my code broke. :( The new save file format with Alpha 14 broke the reading of the waypoints. Don't worry, the app will not crash, it simply doesn't render any waypoints. So, now I have to implement a more sophisticated method.

I tried to use the original game assembly, but the unity engine uses system calls, which are only allowed for system assemblies. And yes, reverse engineering the games code works, but I'm not really happy with releasing such. Well, I've seen this thread https://7daystodie.com/forums/showthread.php?36649-Player-save-load-code. That might be heading in the right direction, but is very similar to the games code.

 

If you guys have a good idea, please post it below.

Link to comment
Share on other sites

This tool still works. It only doesn't render any ingame waypoints.

 

At the moment I'm not sure how to tackle the problem with the reading of the player profiles, so I can't say when this feature will be back in.

Link to comment
Share on other sites

  • 1 month later...

Version 1.7

 

Heyho,

 

just released version 1.7, which brings back the ingame waypoints. This also renders the spawn position (bedroll), dropped backpack and quick map marker. Not sure if this code will be compatible with future versions. Since I was not able to use the original game code from Assembly-Csharp.dll, I ripped some code out of it and made a small assembly to read the player profile file.

 

I added a datastore to circumvent the restriction of map files. These can only hold up to 131 072 tiles or be 64 MB big. If you explore a wider area, than the first map tiles will get deleted. As this may take some disk space, you have to activate this under Menu -> Settings -> Edit settings.

 

Let me know what you think or if you found a bug.

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...
  • 2 weeks later...

Thanks for your compliments! I really appreciate it.

 

@rebdog, that was something I haven't done on purpose. This python script (7DTD Leaflet) does a great job for multiplayer server: https://7daystodie.com/forums/showthread.php?14947-Export-discovered-map-to-png. That was the tool, that I based my work on. They use a SQLite database to efficiently store and retrieve all maps from all players.

 

As for my tool, a tile matches a chunk and measures 16 x 16 blocks (or pixels). The map file stores its data as keys and values. The key is composed of an x- and y-coordinate, the value contains the pixel data and is 16 x 16 x 2 bytes.

 

So, if you are going to merge maps from different players, I would recommend the concept from 7DTD Leaflet. You read each tile from a map file and combine it with the file's time stamp. Then you check your dictionary if this tile is already in and decide whether to keep the old or new one.

I've already done something similar. The game deletes tiles if the map file gets to big (it stores 131,072 tiles max). To circumvent this, I store all tiles in a MapDataStore. Have a look at the method "MapRenderer.getAllTiles", from there on you can easily combine multiple map files.

Link to comment
Share on other sites

Ive got

 

var existing = tiles.ContainsKey(tiles_index);

if (existing)

{

var newData = tiles_data;

var data = tiles[tiles_index];

 

tiles[tiles_index] = PixelAnalysisService.CompareData(data,newData);

}

else

{

var newKey = tiles_index;

tiles.Add(tiles_index, tiles_data);

 

}

 

public static class PixelAnalysisService

{

public static byte[] CompareData(byte[] currentVal, byte[] newValue)

{

//two bytes per pixel

byte[] result = new byte[currentVal.Length];

for (int i = 0; i < currentVal.Length; i+=2)

{

byte[] currentdata = new[] {currentVal, currentVal[i + 1]};

var currentValue = BitConverter.ToInt16(currentdata,0);

 

byte[] newData = new[] { newValue, newValue[i + 1] };

var newValueInt = BitConverter.ToInt16(newData, 0);

 

if (currentValue > newValueInt)

{

result = currentVal;

result[i + 1] = currentVal[i + 1];

}

else

{

result = newValue;

result[i + 1] = newValue[i + 1];

}

 

}

 

return result;

 

}

}

 

produces what looks like a full map

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
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.

 

I don't think it would be possible to pull this off for Xbox One (they don't allow game saves on USB) but you could do this for PlayStation 4. Any chance you would support PS4 in the future? I would be happy to give you save files in order to make it possible.

 

EDIT Does this reveal the full map or just places the player has been?

Link to comment
Share on other sites

Bad news is, that I don't own a console. So I have to rely on others to provide data and test the program. But I like the idea.

 

You could have a look at your PS4 save game and see if it contains a *.map file. You then just open this file with the SinglePlayer Map Renderer.

If this doesn't work you may send me an example. (Or upload it to a cloud storage ...)

 

Well, what this tool really does, it takes your ingame map and exports it as a png file.

It does not render maps from region files or generate regions from a seed. And it also doesn't support multiplayer.

Link to comment
Share on other sites

  • 3 months later...

Not working now

 

I used the single map renderer in the past and I have been very pleased with it's function, but I noticed that now it no longer can find the .map file to convert it into a .png.

 

Is there a fix for this? I am doing the same thing I have always done to render the file. The tool only says it is looking for a poi file, no idea what that is.

 

Thanks

 

Llathrum

Link to comment
Share on other sites

Hi Llathrum,

 

the map rendering still works with the very first version of this tool.

I assume you have problems with the UI changes since version 1.4. I think you tried to open a map using the "Browse" button. Please see this screenshot.

SMR_v1.7.jpg.838c5b3df2a671cc37b6f8ba39e7e4cd.jpg

To choose the map, you want to export, you just have to select it from the combo box. In my case it is a "Random Gen" game I called "GreenForest". Below the combo box you will see the path to your map file.

The button labeled "Browse" does search for a poi file (points of interest). This feature was implemented shortly before in game waypoints were introduced. (see post #22)

 

So, please try again by selecting your save game from the combo box.

Link to comment
Share on other sites

Thank you the newer version was what I needed

 

Hi Llathrum,

 

the map rendering still works with the very first version of this tool.

I assume you have problems with the UI changes since version 1.4. I think you tried to open a map using the "Browse" button. Please see this screenshot.

[ATTACH=CONFIG]18903[/ATTACH]

To choose the map, you want to export, you just have to select it from the combo box. In my case it is a "Random Gen" game I called "GreenForest". Below the combo box you will see the path to your map file.

The button labeled "Browse" does search for a poi file (points of interest). This feature was implemented shortly before in game waypoints were introduced. (see post #22)

 

So, please try again by selecting your save game from the combo box.

 

The updated version worked, Thank you so much DorHans. I do not know when the newer version came out but I kept looking for it and could not find it.

 

Aces

Thank you Sir

 

Llathrum

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...