GithubHelp home page GithubHelp logo

blind-coder / pz-mapmap Goto Github PK

View Code? Open in Web Editor NEW
34.0 3.0 11.0 119 KB

A commandline tool to convert Project Zomboid map data / savegames into PNG files

Makefile 1.29% C# 94.74% Java 2.30% Shell 1.66%

pz-mapmap's Introduction

pz-mapmap

A commandline tool to convert Project Zomboid map data / savegames into PNG files

Setup

  • Download and extract MapMap.exe into its own directory on a volume with a LOT of space. You're going to need it. This tool needs to run on Windows as mono on Linux has issues with transparency when creating image files.
  • Copy the entire texturepacks directory next to MapMap.exe
  • Create a directory Mapname_lotpack and copy all files of the map into it
  • Create a directory Mapname_output Your setup should look like this now:
MapMap.exe
texturepacks/
├── ApCom_old.pack
├── ApCom.pack
├── ApComUI.pack
├── Characters.pack
├── Erosion.pack
├── IconsMoveables.pack
├── JumboTrees1x.pack
├── JumboTrees2x.pack
├── Mechanics.pack
├── Overlays1x.pack
├── Overlays2x.pack
├── RadioIcons.pack
├── Tiles1x.floor.pack
├── Tiles1x.pack
├── Tiles2x.floor.pack
├── Tiles2x.pack
├── UI2.pack
├── UI.pack
└── WeatherFx.pack
Mapname_lotpack/
├── 1_1.lotheader
├── 2_1.lotheader
├── chunkdata_1_1.bin
├── chunkdata_2_1.bin
├── map.info
├── objects.lua
├── spawnpoints.lua
├── thumb.png
├── world_1_1.lotpack
└── world_2_1.lotpack
Mapname_output/

Now run the command:

MapMap.exe -gfxsource TexturePacks\Erosion.pack -gfxsource TexturePacks\Tiles2x.pack -gfxsource TexturePacks\Tiles2x.floor.pack -gfxsource TexturePacks\ApCom.pack -gfxsource texturepacks\RadioIcons.pack -gfxsource TexturePacks\ApComUI.pack -mapsource Mapname_lotpack -output Mapname_output\ -dolayers true -divider 4 -maxthreads 2

A lot of png files will be created in the Mapname_output directory, occupying - depending on the size of your map - possibly hundreds of GB of space. For reference, the main Project Zomboid map occupies 461 GB after this. When you are done with this, you need to head over to the deepzoom-utils repository (https://github.com/blind-coder/deepzoom-utils) and continue there.

pz-mapmap's People

Contributors

blind-coder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pz-mapmap's Issues

Unable to run

Unhandled Exception: System.MissingMethodException: Method not found: 'System.String[] System.String.Split(Char, System.StringSplitOptions)'.
   at MapMapLib.MMPlotter.PlotData(MMCellData cellData, String outputDir, Int32 cellx, Int32 celly)
   at MapMap.Main.RunPlotter(MMPlotter childPlotter, MMCellData childMapData, String OutputDir, Int32 childCellX, Int32 childCellY)
   at MapMap.Main.<parseMapData>c__AnonStorey0.<>m__0()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

Compress the images?

How is it you cant reduce the quality of the PNGs to not require 500gb for pixelated images of zomboid -_-

Quality 100 png images are used for like 4k resolution, and the quality to size correlation is not a straight line. You could probably compress the pngs down by 80%, and not even notice a change in image quality but a HUGE gain in storage space.

As is 500gb for a map of a game like this is laughable

Not compatible with latest version

I'm running with mono, this command used to work with game version 41.65

C:
cd "C:\Program Files\Mono\bin"
mono.exe E:\MapMap\MapMap.exe -gfxsource E:\MapMap\TexturePacks\Erosion.pack -gfxsource E:\MapMap\TexturePacks\Tiles2x.pack -gfxsource E:\MapMap\TexturePacks\Tiles2x.floor.pack -gfxsource E:\MapMap\TexturePacks\ApCom.pack -gfxsource E:\MapMap\texturepacks\RadioIcons.pack -gfxsource E:\MapMap\TexturePacks\ApComUI.pack -mapsource E:\MapMap\Mapname_lotpack -output E:\MapMap\Mapname_output\ -dolayers true -divider 4 -maxthreads 2

but when updated E:\MapMap\TexturePacks\ and E:\MapMap\Mapname_lotpack with files from 41.66, program ended with Unhandled Exception

Boundaries: minx -99999 maxx 99999 miny -99999 maxy 99999
Threads: 2
Starting programm...
Reading texture data from: Erosion.pack
Sheet count: 5
Reading texture data from: Tiles2x.pack
Sheet count: 1263557200

Unhandled Exception:
System.ArgumentException: The output char buffer is too small to contain the decoded characters, encoding 'Unicode (UTF-8)' fallback 'System.Text.DecoderReplacementFallback'.

Parameter name: chars

  at System.Text.Encoding.ThrowCharsOverflow () [0x00027] in <32116eccb94d4ed685ca661d98e36637>:0 

  at System.Text.Encoding.ThrowCharsOverflow (System.Text.DecoderNLS decoder, System.Boolean nothingDecoded) [0x00026] in <32116eccb94d4ed685ca661d98e36637>:0 

  at System.Text.UTF8Encoding.GetChars (System.Byte* bytes, System.Int32 byteCount, System.Char* chars, System.Int32 charCount, System.Text.DecoderNLS baseDecoder) [0x0023c] in <32116eccb94d4ed685ca661d98e36637>:0 

  at System.Text.DecoderNLS.GetChars (System.Byte* bytes, System.Int32 byteCount, System.Char* chars, System.Int32 charCount, System.Boolean flush) [0x00059] in <32116eccb94d4ed685ca661d98e36637>:0 

  at System.Text.DecoderNLS.GetChars (System.Byte[] bytes, System.Int32 byteIndex, System.Int32 byteCount, System.Char[] chars, System.Int32 charIndex, System.Boolean flush) [0x000a2] in <32116eccb94d4ed685ca661d98e36637>:0 

  at System.Text.DecoderNLS.GetChars (System.Byte[] bytes, System.Int32 byteIndex, System.Int32 byteCount, System.Char[] chars, System.Int32 charIndex) [0x00000] in <32116eccb94d4ed685ca661d98e36637>:0 

  at System.IO.BinaryReader.InternalReadOneChar () [0x000e8] in <32116eccb94d4ed685ca661d98e36637>:0 

  at System.IO.BinaryReader.Read () [0x0000d] in <32116eccb94d4ed685ca661d98e36637>:0 

  at System.IO.BinaryReader.ReadChar () [0x00000] in <32116eccb94d4ed685ca661d98e36637>:0 

  at MapMapLib.MMTextures.readString (System.IO.BinaryReader binReader) [0x0001a] in <36cf778331e542fdb1e14be4e7371385>:0 

  at MapMapLib.MMTextures.loadFromPackFile (System.IO.BinaryReader binReader, System.Int32 sn) [0x00023] in <36cf778331e542fdb1e14be4e7371385>:0 

  at MapMapLib.MMTextures.readPackFile (System.IO.BinaryReader binReader) [0x0001e] in <36cf778331e542fdb1e14be4e7371385>:0 

  at MapMapLib.MMTextures.Load (System.String path) [0x0003d] in <36cf778331e542fdb1e14be4e7371385>:0 

  at MapMap.Main.readTexturePacks () [0x00019] in <36cf778331e542fdb1e14be4e7371385>:0 

  at MapMap.Main.Run (System.String[] args) [0x0000c] in <36cf778331e542fdb1e14be4e7371385>:0 

  at MapMap.Program.Main (System.String[] args) [0x00006] in <36cf778331e542fdb1e14be4e7371385>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentException: The output char buffer is too small to contain the decoded characters, encoding 'Unicode (UTF-8)' fallback 'System.Text.DecoderReplacementFallback'.

Parameter name: chars

  at System.Text.Encoding.ThrowCharsOverflow () [0x00027] in <32116eccb94d4ed685ca661d98e36637>:0 

  at System.Text.Encoding.ThrowCharsOverflow (System.Text.DecoderNLS decoder, System.Boolean nothingDecoded) [0x00026] in <32116eccb94d4ed685ca661d98e36637>:0 

  at System.Text.UTF8Encoding.GetChars (System.Byte* bytes, System.Int32 byteCount, System.Char* chars, System.Int32 charCount, System.Text.DecoderNLS baseDecoder) [0x0023c] in <32116eccb94d4ed685ca661d98e36637>:0 

  at System.Text.DecoderNLS.GetChars (System.Byte* bytes, System.Int32 byteCount, System.Char* chars, System.Int32 charCount, System.Boolean flush) [0x00059] in <32116eccb94d4ed685ca661d98e36637>:0 

  at System.Text.DecoderNLS.GetChars (System.Byte[] bytes, System.Int32 byteIndex, System.Int32 byteCount, System.Char[] chars, System.Int32 charIndex, System.Boolean flush) [0x000a2] in <32116eccb94d4ed685ca661d98e36637>:0 

  at System.Text.DecoderNLS.GetChars (System.Byte[] bytes, System.Int32 byteIndex, System.Int32 byteCount, System.Char[] chars, System.Int32 charIndex) [0x00000] in <32116eccb94d4ed685ca661d98e36637>:0 

  at System.IO.BinaryReader.InternalReadOneChar () [0x000e8] in <32116eccb94d4ed685ca661d98e36637>:0 

  at System.IO.BinaryReader.Read () [0x0000d] in <32116eccb94d4ed685ca661d98e36637>:0 

  at System.IO.BinaryReader.ReadChar () [0x00000] in <32116eccb94d4ed685ca661d98e36637>:0 

  at MapMapLib.MMTextures.readString (System.IO.BinaryReader binReader) [0x0001a] in <36cf778331e542fdb1e14be4e7371385>:0 

  at MapMapLib.MMTextures.loadFromPackFile (System.IO.BinaryReader binReader, System.Int32 sn) [0x00023] in <36cf778331e542fdb1e14be4e7371385>:0 

  at MapMapLib.MMTextures.readPackFile (System.IO.BinaryReader binReader) [0x0001e] in <36cf778331e542fdb1e14be4e7371385>:0 

  at MapMapLib.MMTextures.Load (System.String path) [0x0003d] in <36cf778331e542fdb1e14be4e7371385>:0 

  at MapMap.Main.readTexturePacks () [0x00019] in <36cf778331e542fdb1e14be4e7371385>:0 

  at MapMap.Main.Run (System.String[] args) [0x0000c] in <36cf778331e542fdb1e14be4e7371385>:0 

  at MapMap.Program.Main (System.String[] args) [0x00006] in <36cf778331e542fdb1e14be4e7371385>:0 

Custom tiles

Hi, I'm attempting to render the Daegu map which uses custom tiles that aren't .pack but rather loose, in the form of pngs:

image

The result images unfortunately seem to be missing the custom tiles:

image

Is there a good way to reference the custom tiles? It seems that there are some .pack files, would I be able to just add those with the -gfxsource argument and have it work?

Tracking down trees/bushes offset issue

I've been trying to find where the offsets for the trees and vegetations is done because they're off from where it should be and 'leaking' out of the tile for some reason.

Here's an example:
image

and the 'leak' i said in the borders:
image

Another example:
image

Could try to fix myself but just wasted a few hours trying to find where the positions are stored (inside map itself with no correction applied?). Played around with the part where it draws the vegetation which touched the random generated bushes and tress but it didn't helped with normal trees that seems to be from the map itself like this part:
image

Any ideas where I should start?

Coordinate variation

Hi i detected some coordinate variation from the game map and in the website
example: an object like a shelf, on map is 6214,5340
but when i teleported was a wrong coordinate, so when i dismantle this object, i got 6207,5336
got a -7 on X and -4 on Y

And thanks for the great work

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.