Mods / WebCartographer

Tags: #Utility
Author: Th3Dilli
Side: Server
Created: Feb 26th 2023 at 9:28 AM
Last modified: Jun 16th at 9:37 PM
Downloads: 6222
Follow Unfollow 155

Recommended download (for Vintage Story 1.20.0 - 1.20.3, 1.20.4, 1.20.5 - 1.20.7, 1.20.8 - 1.20.10 and 1.20.11 - 1.21.0-pre.1):
webcartographer_0.7.4.zip  1-click install


This is a utility to export a web map from a savegame file (.vcdbs).
The final output can be hosted using nginx or apache or any other webserver.

Thanks to Drakker who made the website part of this project. vs-webmap

For help, discussion or suggestions join the Discord Server



Demo: TOPS Webmap

 

To create a webmap you will also need the client side color exported found here

WebCartographer color exporter  

 

Further instructions on how to use it and set it up can be found on the repository readme.


Export instructions

1. Add the Webcartographer mod to your server
2. Start the server - it will initialize the config with default values
3. Configure what the mod should do using the generated `Webcartographerconfig.json`
- by default it will export to the data path of your vs server or client into the "webmap" folder
- if you want to export when the server starts change `"ExportOnStart": true`
4. If you use a Mode other then 4 you need to add the https://mods.vintagestory.at/wcce to your client and run `.exportcolors` to start a export, this will send the block colors needed to construct the map to the server and start a export. If you use Mode 4 you can still use this to start a export. Once the server has the colors or in Mode 4 you can also use ExportOnStart to export when the server start. You only need to run `.exportcolors` again when changing or updating mods/game to ensure they have the correct color.
5. Wait till it is done, see server console, Note it will by default lock the server and kick players since the server is unusable while exporting
6. In the output directory you will find a html folder that is ready to be hosted using any webserver (nginx, apache, ...) or just open the index.html file in your webbrowser to see the map (markers wont work using that method)

Mod Version For Game version Downloads Release date Changelog Download 1-click mod install*
0.7.4
1.20.0 - 1.20.3 1.20.5 - 1.20.7 1.20.8 - 1.20.10 1.20.11 - 1.21.0-pre.1
274 Jun 2nd at 9:44 AM webcartographer_0.7.4.zip 1-click install
  • removed food, potery, glass trader from trader list since those no longer exists (nto sure since when but they must be mising for some time already)
  • base/misc/server marker export will now pickup any <AM:Base> or <AM:bAsE>  and output it as "Base" also the ExportCustomTaggedSigns will now also output the name with the first letter as uppercase 
0.7.3
1.20.0 - 1.20.3 1.20.5 - 1.20.7 1.20.8 - 1.20.10
202 May 2nd at 1:55 PM webcartographer_0.7.3.zip 1-click install

- fixed FixWhiteLines mode

0.7.2 12 May 2nd at 12:54 PM webcartographer_0.7.2.zip 1-click install

- fixed layer icons being inversed + new icons
- fixed potential overflow when the titel was too long

0.7.1 109 Apr 22nd at 11:44 AM webcartographer_0.7.1.zip 1-click install

- skip export on missing color config and not kill it
- when exporting also update the settings lastUpdated timestamp

0.7.0 298 Feb 22nd at 2:46 PM webcartographer_0.7.0.zip 1-click install
  • add new command /webc export to start a export from console or when in game
  • add new setting ExportCustomTaggedSigns to export any <AM:SOMETAG>, ExportUntaggedSigns now only exports signs without <AM:> tag, thanks to Cristiano on Gitlab
0.6.1 247 Jan 21st at 10:24 PM webcartographer_0.6.1.zip 1-click install

- fix export stopping if a translocator does not have a proper source and destination, now we skip those

0.6.0 230 Dec 6th 2024 at 5:08 PM webcartographer_0.6.0.zip 1-click install

- added teleporters to be exported and marked on the map

0.5.10 210 Oct 24th 2024 at 8:51 PM webcartographer_0.5.10.zip 1-click install

same as 0.5.9 but for 1.20

0.5.9 152 Oct 21st 2024 at 2:09 PM webcartographer_0.5.9.zip 1-click install

- add sub layer item switcher to hide items from the map
- updated openlayers (firefox issue with exported chunks issue)

0.5.8 157 Sep 19th 2024 at 9:46 AM webcartographer_0.5.8.zip 1-click install
  • fixed threading isues (Could not find a free sqlite connection for a worker thread. Exporter may crash.)
  • improved reliability against broken savegames and chunks
0.5.7 211 Aug 13th 2024 at 7:09 PM webcartographer_0.5.7.zip 1-click install
  • add transparency to exported images and sky/stars background
  • remove total counts from debug progress logging
0.5.6 183 Jul 20th 2024 at 10:10 AM webcartographer_0.5.6.zip 1-click install

- improve performance by better sqlite connection usage

0.5.5 194 May 30th 2024 at 4:36 PM webcartographer_0.5.5.zip 1-click install
  • added layer to show the generated chunk version as a color gradient
  • make links sharable so they move you to the position in the link
0.5.4 259 Apr 1st 2024 at 7:11 PM webcartographer_0.5.4.zip 1-click install

- fix export of block with snow variant like the path block with snow not showing correctly

0.5.3 160 Mar 31st 2024 at 8:30 PM webcartographer_0.5.3.zip 1-click install
- remove password temporary pw when done exporting and restore old one or none
0.5.2 216 Mar 27th 2024 at 7:56 PM webcartographer_0.5.2.zip 1-click install

- add a new StopOnDone option to not stop the server when done running
- fix crash when using on singeplayer when this and WebCartographer color exporter is loaded
- output directory is now only cleared when a new export is made instead of on every restart of the server

0.5.1 256 Feb 27th 2024 at 11:58 PM webcartographer_0.5.1.zip 1-click install

Fixed: write worldExtent.js with the correct values

0.5.1-rc.1
188 Jan 26th 2024 at 10:13 PM WebCartographer_0.5.0-rc.1.zip

- change mod to run on the server directly and use the same savegame file as the server
- more fixes with snow and other blocks that would show weird on the map

0.5.0 160 Feb 27th 2024 at 8:31 PM webcartographer_0.5.0.zip 1-click install

Fixed: support other than 256 height worlds

Fixed: artisan trader icon not correctly matched

0.5.0-rc.2 239 Jan 27th 2024 at 5:15 PM webcartographer_0.5.0-rc.2.zip 1-click install

updated to an actual mod now to make exporting easier, it will now create a folder ready to host a webmap

0.4.0
239 Dec 28th 2023 at 2:25 PM WebCartographer_0.4.0.zip
  • add new ingame map style (Medevial)
  • fixed issues with snow getting exported (now all snow is removed and only glaciers will remain, which should allow for prettier maps)
  • removed snow related config options
  • removed DefautlSpawnOffset (now it reads the default spawn from serverconfig.json so make sure that is setup correctly)
0.3.0
294 Oct 26th 2023 at 7:16 PM WebCartographer_0.3.0.zip

- fixed a issue with other mods adding a block that contained "snow" in their name
- converted the WebCartographer to a mods so it should be easier to run (docker setup remains for easy run and deploy of the webmap)

0.2.4
280 Sep 6th 2023 at 4:58 PM WebCartographer_0.2.4.zip

proper update to net7

0.2.3
260 Jul 14th 2023 at 9:40 AM WebCartographer_0.2.3.zip
  • Added new hillshading (similar to in-game).
  • Added a "fixwhitelines" option to address broken height maps on Net7 versions.
  • Updated Cartographer to use Net7 server.
  • Traders and translocators are now hidden by default.
  • Updated Cartographer to handle zoom level creation, eliminating the need for GDAL (if you used Docker, you shouldn't have had to worry about this).
  • Fixed an issue where colors could shift from one block to another (this could occur when mods were removed at a certain point).
0.2.2
309 Apr 30th 2023 at 7:21 AM WebCartographer_0.2.2.zip

fix broken build

0.2.1
231 Apr 29th 2023 at 10:32 AM WebCartographer_0.2.1.zip

update to 1.18

0.2.0
286 Mar 8th 2023 at 1:12 PM WebCartographer_0.2.0.zip

add build script using docker

0.1.0
321 Feb 26th 2023 at 9:30 AM WebCartographer_0.1.0.zip

intial release


50 Comments (oldest first | newest first)

💬 DracaBro, Jun 24th at 11:45 PM

So a bit of confusion on how to make the map.

What do you recommend as a good host for it?

A video tutorial might be great for this.

💬 Th3Dilli , Jun 23rd at 9:19 AM

DudeBroccoli186

You can have a look at the linked Demo site and there if you click Guide / Contribute you can see how that works and yes it is ingame signs with special text on them.

💬 DudeBroccoli186, Jun 21st at 4:54 PM

Sorry, but I dont understand how the signs work.

Is it an actual sign in the Vintage Story server?

If so what would I put on it if I want it to show up as a base and it to be called OG Base

💬 Th3Dilli , Jun 12th at 11:54 AM

NLTim Yes there is some code for a integration with the a webmab to sync player positons or maybe more but I never worked on that on the webmap side of it. Someone else wanted to work on this for their own webmap implemenation. So its not functional as of now for webcartographer

PeachyPotato since the recent changes to moddb adding new version tags will show the mod as modified since it is now marked compatible with new version which did not need a new verison of the mod to be uploaded.

💬 PeachyPotato, Jun 11th at 9:15 PM

alright this'll drive me crazy

 

Last modified: 8 hours ago

 

but the file was uploaded June 2nd and still has the same version tags What was modified here?

💬 NLTim, Jun 2nd at 8:04 PM

The sources contain an additional mod 'webcartographersync' which is not listed here in the mod DB. What is the status of that? Sounds pretty cool to have the players show up on the map.

💬 Th3Dilli , Jun 2nd at 9:33 AM

Benko_1000 how do you open the map? if it you just open the .html file in a browser the geojson loading will not work

💬 Benko_1000, May 26th at 12:53 PM

Is there some extra setting to enable traders? I ran the mod on the server with default settings and dont see any of them on the map. Does it have to run local to see them?

 

I see the traders in the geojson file and i have them enabled in the map with the eye icons, but they are not there. I assume in the files are the coordinates relative to spawn (i also moved the spawn but only around 4k blocks, so i would still see them if they were off)

 

from the traders geojson file

{"type":"FeatureCollection","crs":{"Name":"urn:ogc:def:crs:EPSG::3857","type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::3857"}},"name":"traders","features":[

{"type":"Feature","properties":{"name":"Yern","wares":"Agriculture trader","z":140},"geometry":{"type":"Point","coordinates":[262,9704]}},

{"type":"Feature","properties":{"name":"Puck","wares":"Kitchenware Trader","z":138},"geometry":{"type":"Point","coordinates":[3690,5136]}},

{"type":"Feature","properties":{"name":"Ahanu","wares":"Clothing trader","z":140},"geometry":{"type":"Point","coordinates":[-2073,4593]}},

{"type":"Feature","properties":{"name":"Timaf","wares":"Treasure hunter trader","z":167},"geometry":{"type":"Point","coordinates":[2646,4360]}},...

💬 Th3Dilli , May 2nd at 12:54 PM

ty, link is now fixed

💬 LilianaXolkiyr, Apr 28th at 10:49 AM

Hey so the demo page seems to be down, I get a page that says:
Server Not Found

💬 Th3Dilli , Apr 22nd at 11:42 AM

PhobosFogg

the modes are listed here

 

I would only change between 3 and 4 the rest are more basic ones, 3 is with color and 4 is the medieval style

💬 Menelos, Apr 7th at 6:37 AM

Th3Dilli if the color file is missing while trying an export the server crashes, could you add a warning and skip the export?

Apr 07 15:32:58 Elwing vintage-story-server[3399990]: 7.4.2025 06:32:58 [Server Notification] WebCartographer is now starting...
Apr 07 15:32:58 Elwing vintage-story-server[3399990]: 7.4.2025 06:32:58 [Server Notification] WebCartographer is now preparing for FixWhiteLines or ExtractWorldMap ...
Apr 07 15:32:58 Elwing vintage-story-server[3399990]: 7.4.2025 06:32:58 [Server Error] [webcartographer] blockColorMapping.json is missing:!!!
Apr 07 15:32:58 Elwing podman[3402388]: 2025-04-07 15:32:58.429007925 +0900 JST m=+0.027178435 container died e60f34e40ace548b29c005dc9cff00a30cbadea96f7d0e374211d8857555dcbc (image=localhost/vintage-story-server:latest, name=vintage-story-server, io.buildah.version=1.28.2, org.opencontainers.image.ref.name=ubuntu, org.opencontainers.image.version=22.04, PODMAN_SYSTEMD_UNIT=vintage-story-server.service)

💬 PhobosFogg, Mar 17th at 6:37 PM

What do the modes do?  What's the significance of Mode 4?

💬 Th3Dilli , Feb 28th at 10:11 AM

LaDestitute

That does not sound normal. best is if you deleted the old files and then copy in the new ones

💬 LaDestitute, Feb 27th at 11:48 PM

I have a map uploaded to a site hosted, its otherwise great but is it normal that after I upload all the numbered folders within data of the root directory the map has copies if itself if i zoom in/out?
I notice the map tends to make copies of the center of the area being made if I zoom in too much but otherwise is normal

💬 Th3Dilli , Feb 9th at 12:43 AM

ongandu

it only exports on start or when you use the WebCartographer color exporter  you can trigger it using .exportcolors too

when you add more to automap.js and set ExportUntaggedSigns: true you can add any you like

💬 ongandu, Feb 5th at 12:19 AM

Hi Th3Dilli, thanks for putting this mod together works really well.

I got a few questions:

  • When and how often does the mod triggers exports? Currently I have to set the `ExportOnStart` option to `true` otherwise it never exports.
    • Does it have to be done manually? If so is there a server command or `.exportcolors` is the correct way?
  • In the guide it says we can place three types of AM markers, SERVER, BASE and MISC, is I add more e.g PORT to the `autoload.js` will it they be picked up?
    • If they are not picked up, do I need to use `ExportUntaggedSigns`?

 

Thanks very much again.

💬 Th3Dilli , Jan 21st at 1:26 PM

LIONSVendi

looks like your 
OutputDirectory settings is set wrong

it should be something like 
"OutputDirectory": "c:\this\is\my\path\",

💬 Th3Dilli , Jan 21st at 1:23 PM

Morggin 

You do not need to mark traders they will get exported automatically

 

zackadiax24

maybe one day it will be added to the ingame map

💬 zackadiax24, Jan 19th at 12:26 AM

If only i could get those teleporter lines on my in game map.

💬 Morggin, Jan 17th at 5:42 AM

How do we mark a trader?  Is <AM:TL>

💬 LIONSVendi, Jan 6th at 12:03 PM

Th3Dilli

I don´t know if I doing something wrong her on my side but if I start my private server it shows me this error.

Can you help me?

6.1.2025 12:28:59 [Server Error] [webcartographer] An exception was thrown when trying to start the mod:
6.1.2025 12:28:59 [Server Error] [webcartographer] Exception: Bad JSON escape sequence: \U. Path 'OutputDirectory', line 3, position 26.
at Newtonsoft.Json.JsonTextReader.ReadStringIntoBuffer(Char quote)
at Newtonsoft.Json.JsonTextReader.ReadStringValue(ReadType readType)
at Newtonsoft.Json.JsonTextReader.ReadAsString()
at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value)
at Vintagestory.Common.APIBase.LoadModConfig[T](String filename) in VintagestoryLib\Common\API\APIBase.cs:line 102
at WebCartographer.WebCartographer.LoadConfig() in /home/dilli/drive_linux/git_repos/vintagestory/mods/WebCartographer/WebCartographer/WebCartographer.cs:line 106
at WebCartographer.WebCartographer.StartServerSide(ICoreServerAPI api) in /home/dilli/drive_linux/git_repos/vintagestory/mods/WebCartographer/WebCartographer/WebCartographer.cs:line 36
at Vintagestory.Common.ModLoader.TryRunModPhase(Mod mod, ModSystem system, ICoreAPI api, ModRunPhase phase) in VintagestoryLib\Common\API\ModLoader.cs:line 664
6.1.2025 12:28:59 [Server Error] Failed to start system WebCartographer.WebCartographer

 

Would be great if you could help me with this.

 

Regards Chris

💬 Th3Dilli , Oct 24th 2024 at 8:52 PM

oh ty, fixed now, there is separate version for 1.19 and 1.20 (just redownload 0.5.9 for 1.19)
Cosmic9

💬 Cosmic9, Oct 24th 2024 at 3:39 PM

Th3Dilli
you have the latest version tagging 1.19.8 as a supported version. doesn't seem supported to me.

24.10.2024 08:33:41 [Error] [webcartographer] Could not resolve some dependencies:
24.10.2024 08:33:41 [Error] [webcartographer] game@1.20.0-pre.1 - Version mismatch (has 1.19.8)

💬 Th3Dilli , Aug 13th 2024 at 7:09 PM

sorry new version should fix that

 

💬 FrostMannen, Aug 8th 2024 at 1:09 PM

I am getting strange SQL errors:

[Server Error] Exception: SQLite Error 1: 'no such column: postion'.
at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
at Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements(Stopwatch timer)+MoveNext()
at Microsoft.Data.Sqlite.SqliteCommand.GetStatements(Stopwatch timer)+MoveNext()
at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
at Microsoft.Data.Sqlite.SqliteCommand.ExecuteScalar()
at WebCartographer.SavegameDataLoader.GetServerMapRegionsCount() in /home/dilli/drive_linux/git_repos/vintagestory/mods/WebCartographer/WebCartographer/SavegameDataLoader.cs:line 149
at WebCartographer.Extractor.ExtractStructures() in /home/dilli/drive_linux/git_repos/vintagestory/mods/WebCartographer/WebCartographer/Extractor.cs:line 115
at WebCartographer.Extractor.Run() in /home/dilli/drive_linux/git_repos/vintagestory/mods/WebCartographer/WebCartographer/Extractor.cs:line 99

What can possible make this to happen?

Running VS Server 1.19.8, when trying the older version it all works. But doesn't generate the map as it should :(

💬 Th3Dilli , Jul 20th 2024 at 7:45 PM

Thalius

redownload the mod now there was an issue so i replaced the current release file

💬 Thalius, Jul 20th 2024 at 3:13 PM

I am trying this mod for the first time, and am not getting a config file generated on my server. Restarted the server a couple of times, and no config file.

 

💬 DejFidOFF, Mar 30th 2024 at 7:53 AM

Th3Dilli

webcartographer_0.5.2.zip

"ExportOnStart": true,
"SaveMode": true,
"StopOnDone": false

 

With this options, after finish map exportin server stucks at savemode and people can´t connect to.

💬 DejFidOFF, Mar 27th 2024 at 8:31 PM

hooray, thank you for new update !

💬 DejFidOFF, Mar 20th 2024 at 8:15 AM

Downside, if you turn the "ExportOnStart": true to false and leave the mod in the /mod directory next server restart it delete all in webmap data folder. It is really bad.

💬 Th3Dilli , Mar 12th 2024 at 8:03 PM

DejFidOFF

can you send me a full server-main.txt on discord pls

💬 DejFidOFF, Mar 10th 2024 at 10:19 AM

Th3Dilli

No just only one mod in the mod directory 0.5.1

 

💬 Th3Dilli , Mar 8th 2024 at 10:37 PM

DejFidOFF

that should mean you have the mod loaded twice (two versions?)

 

💬 DejFidOFF, Feb 28th 2024 at 6:03 AM

0.5.1

28.2.2024 06:57:37 [Error] [webcartographer] An exception was thrown when trying to load assembly:
28.2.2024 06:57:37 [Error] [webcartographer] Exception: Assembly with same name is already loaded
at System.Runtime.Loader.AssemblyLoadContext.<LoadFromPath>g____PInvoke|5_0(IntPtr ptrNativeAssemblyBinder, UInt16* ilPath, UInt16* niPath, ObjectHandleOnStack retAssembly)
at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at Vintagestory.Common.ModContainer.<>c__DisplayClass35_0.<LoadAssembly>b__0(String path) in VintagestoryLib\Common\API\ModContainer.cs:line 449
at System.Linq.Enumerable.SelectListIterator`2.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator`1.ToList()
at Vintagestory.Common.ModContainer.LoadAssembly(ModCompilationContext compilationContext, ModAssemblyLoader loader) in VintagestoryLib\Common\API\ModContainer.cs:line 448

💬 Th3Dilli , Feb 28th 2024 at 12:05 AM

DejFidOFF
try the 0.5.1 this one exports the correct worldextent so if you changed the default spawn that could be the reason for it

 

💬 DejFidOFF, Feb 27th 2024 at 11:07 PM

First thank you so much for your work. But, file exported, 125MB in /data folder but index.html output is just only black screen :( ( also sent color data ).

 

💬 Th3Dilli , Feb 23rd 2024 at 9:48 AM

Versora

you can hop on my discord and post your logs there, then I can have a look at what might be wrong

 

💬 Versora, Feb 16th 2024 at 2:40 AM

I dunno what I be doing wrong but I do not have a webmap folder, and I know I did things correctly.

💬 Th3Dilli , Feb 2nd 2024 at 2:30 PM

MKRhere

I do not have telegram but you can join my discord linked above and ask there some stuff if you want

 

the main issue with the standalone approach is gonna be the blockcolors
currently, the game client sets up all the blocks and adds the textures then you can grep a random color from a blocks upwards facing block through the game api
if you do a standalone approach you need to do that manually meaning you need to get a copy of the game client (since that only contains the textures) and assemble all blocks + mod block and extract the up facing texture and get a color
and then extract the color for each block and you have to redo that with every game or mod update

💬 MKRhere, Jan 30th 2024 at 10:54 AM

> no one invested the time to make a tool

We're working on a tool to read the save file (and render a map) without launching a server. We're currently going through reversing the binary blobs in the database. We'd love more help from people more involved with the game (modders, etc). If you'd like to help out, even if it's occasionally providing an observation, reach out to me muthukumarthefeathersin, or join our Telegram chat (search for "madrasmc"). Thanks!

 

 

💬 Th3Dilli , Dec 3rd 2023 at 3:32 PM

is there an easier way to do this right now? 
short answere no since no one invested the time to make a tool that can do all at once without having to go through this process

the first issues is the server does not know anything about colors and does not even have the textures
second the game stores the blocks as number id and a table to look them up but everytime you add update a mode that may change, so we can only really rely on the block name but we need to spin up an entire server to resolve the mods , load the data from db and turn that into block data with their names so we can lookup the color that can only be exported on the client


sure this could be made more user friendly and maybe simple but would requiere more work, so unless someone takes up that challange this is the best thing you have right now, the previouse iteration of this "system" was to use a client side mod to export chunk images on the client and then use gdal command line tools to stitch them together to then make a webmap of it so this is already a huge improvement but sure it can be improved even more

afaik their is a mod that is not yet on the moddb, made by VeryGoodDog on github, it is in a usable state but not fully finished as far as I am ware


for the powershell script yeah I am sorry that hasn't been tested in a while, thank you for providing the upated version I will add the to the repo

i have now added instructions of how todo it without using docker to the discription I hope that helps

💬 Drathek, Nov 30th 2023 at 10:43 PM

So this took a bit of effort to get working for a modded server. I'm not sure if the export.ps1 was ever tested because it had syntax errors (one of the if checks was not correct), would break because of existing files (if you ran it again due to lack of -Force usage), and funademental flaws such as Expand-Archive not supporting .tar.gz files.

I haven't code dived the color exporter mod, but it seems very redundant to be running an entire copy of the game to run this mod, have the cartographer mod then iterate over a different save file (to get around the save file being locked), and to rely on the user to preemptively provide a blockColorMapping.json. Can those colors really not be determined server side, and is there no way in an existing game to access the data you need from the save file (despite being able to actually run that save file on the server)?

Additionally, it seems needless to fail if the blockColorMapping has client mods listed; would be better to just make it a warning and continue anyways. If there are actually server mods missing that we need colors for then make them hot pink so the resulting map obviously has problems that require a correct blockColorMapping.json.

If you run the webmap and its broken (console is complaining about ol.js), be sure you aren't blocking cdn.jsdelivr.net.

This is the export.ps1 file I ended up with:

$ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest

$TYPE = 'stable'
$VERSION = '1.18.15'
$DEST = "$(Get-Location)/cartographer"
$SAVEFILE = "$env:APPDATA/VintagestoryData/Saves/server world.vcdbs" # Change this to whatever your save file is named

docker compose stop cartographer

Copy-Item -Force $SAVEFILE -Destination "default.vcdbs"

if ((Test-Path $DEST)) {
Remove-Item -Path $DEST -Recurse | Out-Null
}
if ((Test-Path map_data)) {
Remove-Item -Path map_data -Recurse | Out-Null
}
New-Item -ItemType Directory -Path $DEST -Force | Out-Null
New-Item -ItemType Directory -Path html -Force | Out-Null
New-Item -ItemType Directory -Path map_data -Force | Out-Null
New-Item -ItemType Directory -Path "$DEST/cartographerData/ModConfig" -Force | Out-Null
New-Item -ItemType Directory -Path "$DEST/cartographerData/Mods" -Force | Out-Null

$SERVER = "vs_server_$VERSION.tar.gz"

$URL_SERVER = "https://cdn.vintagestory.at/gamefiles/$TYPE/vs_server_linux-x64_$VERSION.tar.gz"

if (-not (Test-Path $SERVER)) {
Invoke-WebRequest -Uri $URL_SERVER -OutFile $SERVER
}
if (-not (Test-Path "$DEST/assets")) {
# Expand-Archive -Path $SERVER -DestinationPath $DEST
tar -xzf $SERVER -C $DEST
}

if ((Test-Path "serverconfig.json")) {
Copy-Item -Force "serverconfig.json" "$DEST/cartographerData/serverconfig.json"
} else {
New-Item -Force -ItemType File "serverconfig.json", "$DEST/cartographerData/serverconfig.json" | Out-Null
}

if ((Test-Path "servermagicnumbers.json")) {
Copy-Item -Force "servermagicnumbers.json" "$DEST/cartographerData/servermagicnumbers.json"
} else {
New-Item -Force -ItemType File "$DEST/cartographerData/servermagicnumbers.json" | Out-Null
}

Copy-Item -Force "WebCartographerConfig.json" "$DEST/cartographerData/ModConfig/WebCartographerConfig.json"
Copy-Item -Force "blockColorMapping.json" "$DEST/cartographerData/ModConfig/blockColorMapping.json"
New-Item -Force -ItemType File "$DEST/cartographerData/Saves/default.vcdbs" | Out-Null
Copy-Item -Force "default.vcdbs" "$DEST/cartographerData/Saves/default.vcdbs"

if ((Test-Path "Mods")) {
Copy-Item -Force -Recurse "Mods" "$DEST/cartographerData"
}

# Doesn't appear to currently be necessary, but it could potentially be
if ((Test-Path "ModConfig")) {
Copy-Item -Force -Recurse "ModConfig" "$DEST/cartographerData"
}

docker compose up cartographer

if ((Test-Path html/data)) {
Remove-Item -Path html/data -Recurse | Out-Null
}
Copy-Item -Force -Recurse "./map_data/world" "./html/data/world/"
Copy-Item -Force -Recurse "./map_data/geojson" "./html/data/"
if ((Test-Path "./map_data/heightmap")) {
Copy-Item -Force -Recurse "./map_data/heightmap" "./html/data/"
}
Remove-Item -Path map_data -Recurse | Out-Null

docker compose up webmap -d

Write-Output "Done creating webmap - Check it out at http://localhost:4242"

💬 Drathek, Nov 30th 2023 at 10:31 PM

xxpowerofsoundxx The webmap is a lot more useful than simply a large image since you can filter what you see, pan and zoom around, click to get commands to add the waypoint in game, etc; but the exported images you could just tile together to form a map if thats all you want.

💬 xxpowerofsoundxx, Nov 30th 2023 at 2:45 PM

Is there anyway to just export my game map as an image or something instead of all the docker, server, rigamorole? I don't understnad why there's no simple translation too for this. 

💬 Th3Dilli , Mar 6th 2023 at 9:40 PM

apperently ther are some issues running verson 0.1.0 on Windows atm,
to get around those delete WebCartographer.exe.config
and copy everything from Lib64 next to the WebCartographer.exe

💬 tanaKa, Mar 6th 2023 at 6:20 PM

Also a note, I had to copy sqlite3.dll personally into the WC directory.

Config:
{
"Mode": 1,
"DatabaseFile": "C:\Users\admin\AppData\Roaming\VintagestoryData\Saves\default.vcdbs",
"OutputDirectory": "C:\Apache24\htdocs\vcmap",
"ExtractWorldMap": true,
"ExtractStructures": true,
"AbsolutePositions": false,
"ExportHeightmap": true,
"IgnoreSnowBelow": 0,
"ExportSigns": true,
"ExportUntaggedSigns": false,
"TileSize": 256,
"MaxDegreeOfParallelism": -1,
"ExportPgw": true
}

💬 tanaKa, Mar 6th 2023 at 6:19 PM

I can confirm the same error on Windows Server 2019

Looks like it's looking for a personal directory at "C:\Users\Tyron"

 

 

image

💬 Th3Dilli , Mar 3rd 2023 at 7:52 PM

DemonBigj781

could you share your config?
preferable on discord (oh forgot to add the discord link)

💬 DemonBigj781, Mar 3rd 2023 at 12:03 AM

i get this erroe when i set up the server

[Server Error] Failed opening savegame.System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
at System.Data.SQLite.UnsafeNativeMethods.sqlite3_config(Int32 op, SQLiteLogCallback func, IntPtr pvUser)
at System.Data.SQLite.SQLite3.StaticIsInitialized()
at System.Data.SQLite.SQLiteLog.Initialize()
at System.Data.SQLite.SQLiteConnection..ctor(String connectionString)
at Vintagestory.API.Common.SQLiteDBConnection.OpenOrCreate(String filename, String& errorMessage, Boolean requireWriteAccess, Boolean corruptionProtection, Boolean doIntegrityCheck) in C:\Users\Tyron\Documents\vintagestory\game\VintagestoryApi\Common\IO\SQLiteDBConnection.cs:line 76

 (edit comment delete)