Kakoen/valheim-save-tools

Player Map Data

Closed this issue · 4 comments

Is it possible to read the map data for the player? I'd like to be able to pull out the data for what the player has explored. I see a section for mapData in WorldPlayerData.java.

Thanks for the suggestion. I just added parsing and writing of mapData.

There is a byte array property explored in there, with size textureSize * textureSize.

  • Every byte represents the explored state of one pixel on the minimap. The value is 1 when explored, and 0 when it's not.
  • To determine whether coordinate (x, y) is explored, you can check if explored[(y * textureSize) + x] is 1. Where 0 <= x < textureSize and 0 <= y < textureSize.
  • textureSize always seems to be 2048.
  • In the JSON representation this byte array ends up as a base64 encoded string.

Wow, that was fast! So is that information only stored on the client side? It doesn't exist on the server side (in the case of a dedicated server).

Wow, that was fast! So is that information only stored on the client side? It doesn't exist on the server side (in the case of a dedicated server).

You're right. The client is fully trusted and keeps track of exploration progress, inventory, skills, respawn / logout locations, etc.

The server does not keep track of any character data. In fact there isn't much evidence of players' names or steam ids in the server data. The only exception seems to be beds; they have a property with the owner's name.

I'm closing this issue now. The fix will be included in version 1.0.4. Feel free to start a discussion if you have more questions or ideas.