HomeTown Forums
HomeTown Mapping Project - Printable Version

+- HomeTown Forums (https://hometownmc.com:443/forums)
+-- Forum: SMP Server (https://hometownmc.com:443/forums/forumdisplay.php?fid=4)
+--- Forum: General (https://hometownmc.com:443/forums/forumdisplay.php?fid=11)
+--- Thread: HomeTown Mapping Project (/showthread.php?tid=5480)



HomeTown Mapping Project - kirinelf - 04-25-2020

Ahoy! Mae govannen, Kirin here! ~Bit.ly Link for Posterity: https://bit.ly/2zpImkx~

Updates
[10/05/2020] Thanks N00dlez!
[01/05/2020] Thanks Illo and Elses! [GIF link of evolution thus far]
[26/04/2020] Thanks Elses!
[25/04/2020] Thanks Arden!
[24/04/2020]

So I've been bored lately, and the work for my build is looking extremely monotonous for the near future. So as procrastination, I figured I wanted to try mapping out the world of HomeTown. No, not ingame, but out of the game. Here's a sample: [Link]

Is anyone interested in helping me out? If so, please do the following:

0) For anyone who already has VoxelMap installed for a while, skip steps (1) and (2).
1) Install VoxelMap. It's compatible for both Forge and Fabric for 1.15.2. I'm not going to put a big tutorial here on how to do this, it should be fairly simple.
2) Hop around HT doing your thing. Give it a week or a few days or whatever. An empty piece of paper doesn't help. xD
3) Head over to your minimap cache folder (.minecraft\mods\mamiyaotaru\voxelmap\cache\smp.hometownmc.com\Default\overworld for me, it may be different for you. For example, you may not have a Default folder, or it may have another name. The important thing is to get the one that's most updated, check the Date Modified).
4) ZIP up everything in that folder, or even just zip the overworld folder up if you want. People without any archivers like 7zip or WinRAR can do it like [this], but those with archivers should know what to do.
5) Upload the file somewhere safe, like on Dropbox, Google Drive, MEGA or whatever, and post the link here.
6) ???
7) Profit!!!

What this does is upload your map data obtained from running around in HT with VoxelMap installed so that I can get my grubby hands on it and merge it into one compiled image. For instance, [this] is my map without any external assistance. Arden sent me his map data, and [BOOM]! Okay, not that much more, but MORE. And it will keep growing as people add to it, if they want to!

One last thing to remember: The images generated are static. They do not update as people and builds come and go. This is not a Dynmap, as much as I would have liked one, only a replacement (It's kind of because there isn't a Dynmap that I'm doing this. xD). If anyone of you has recently done a big build and want it updated, upload the map data! If I'm around I'll compile it, and if I'm not around the instructions to do so will be further down.

And disregarding those instructions for now, I'm done! I hope this gets some interest, although I know a lot of folk on the server don't actually come on the forums. But hey! It's a thing. Namarie, folks!



------How It Works------
Skip this if you don't care. I would put this in a spoiler tag, but the forums don't support it. xD This can get a little technical, and I go into a lot of detail that may be redundant for the skilled, so beware!

This all centers around one specific mod: the minimap mod VoxelMap. I COULD make this a LOT easier on myself if I used Forge's JourneyMap, but... well. Forge doesn't have an autowalk mod. So I'm taking on the challenge of doing this with Fabric.

So, being a minimap mod, VoxelMap renders the surrounding blocks and displays it to you as either a minimap and/or a fullscreen map. Specifically, it renders 3 chunks in every direction, or a 7x7 square with the player in the center chunk, a little smaller than the 11x11 chunk that the server itself renders. Uniquely (as far as I know) to VoxelMap and JourneyMap, the map data can be exported as images rather than as data files, but still generally as individual 16x16 chunk 256x256 pixel images, where each pixel is a single block in the game. [This] is an example of VoxelMap's output of the top left corner of the map.

Image Export
To get VoxelMap to output these images, you need to first open up voxelmap.properties (found in this path: .minecraft\mods\mamiyaotaru) from your mods folder in a text editor with Minecraft closed, and add "Output Images:true" (without the quotation marks) at the end on a new line. [This] is how it should look like if you've done it in Notepad++ like I have. Save it, and boot up Minecraft. Then when you load into HomeTown, open up your worldmap (Default keybind for VoxelMap is M), and pan across the map, like [this]. Everything that loads in will be exported as a PNG file when you close Minecraft again.

If you don't pan over the whole map, some areas might not be rendered and exported. Also note that the "Output Images:true" line will be removed each time it gets loaded, so if you want to update the images, you'll need to repeat the entire process from the start. One you're done panning around, close Minecraft again. You can now boot it back up and play as normal if you want, having it running shouldn't affect the rest of the steps.

So now, if you head into your minimap cache folder (Again, .minecraft\mods\mamiyaotaru\voxelmap\cache\smp.hometownmc.com\Default\overworld for me), you should see a folder titled "images", along with a whole bunch of ZIP files. It looks like [this] for me. Inside that images folder, you should see a folder named "z1". These are all the images exported by VoxelMap that make up the HT server overworld. "z1" means zoom x1, which we'll get to below.

So now we have a whole bunch of images. However, they aren't really arranged in any real order that's helpful for us. [This] is what mine looks like, and it don't make no sense to me. Also, this is at one particular zoom level, as rendered by VoxelMap. We have a ways to go, and lots of funky stuff to do.

Rendering Zoom Levels
This is an interesting little bit. By default, as I've said above, VoxelMap renders each individual block as a single pixel. This means that each 16x16 chunk image is a 256x256 pixel image, again as I've said above. But this means that to render the whole of HT, you'll need a 10,000x10,000 pixel image at the least (It's actually a little more, since you load chunks even past the world border, even if you can't get past it), and that's scary for anyone who has ever done image processing. To put it into perspective, most people are running either a 1920x1080 pixel resolution monitor, or maybe 2560x1440p for some, if not full on 3840x2160p or even higher for the rich 'uns. You'll overheat your computer trying to stitch an image that big.

Thankfully, there's a way around this: By rendering zoom levels, compressing the number of images by effectively smushing them together. [This] is my z1 folder. [This] is my z0.0625 folder. And [THIS] is my z8 monster.

The author of VoxelMap, MamiyaOtaru, has very helpfully linked to a renderer that'll do different zoom levels for us [here]. However, the instructions on the page are on how to make a JourneyMap-like webpage, complete with Google Maps API. While that's great and all, I haven't been able to make it work: for some reason the map does not render anything with a negative X coordinate, leading to only half a map like [this]. If anyone can help me figure this out, that'd be great! But basically, because I'm not going to make a map with multiple levels of zooming in and out, I'm gonna do something a little different.

My first step is to edit the java code to skip zooming in, which results in the z2-z8 folders. For anyone who knows anything about coding, it's simple enough: Download the GIT as a ZIP, extract it, open up the AnvilMapper.java file in a text editor, comment out [these lines] at lines 66 and 67, then compile it with the BAT file that it comes with. For those of you who aren't confident in that, I've uploaded an archive [here] that you can use, with the instructions enclosed. There is also one extra file in there that will be coming in handy later.

Following the instructions in that archive, execute the "run.bat" file in the archive and sit back and wait for the program to render out the different zoom levels. If you were a madlad like me and didn't comment out the lines or use the archive above, you'll have to wait a LOT longer. Once all is done, the window will prompt you to hit a key to close the window, and that's that! You should end up with something like [this], if you didn't comment out the lines, and will not have the "z2", "z4", and "z8" folders if you were a little more prudent.

Image Stitching - This requires installing another thingy.
Unfortunately, for this, we have to install another programming language and a relevant library. There may be a Java image stitcher out there, but this is the one I found, so this is the one I'm going to use. Full credit goes to [this dude] for the script, and our very own hubajo for a fix!

Step one is to install [Python]. Step two is to install the Python Imaging Library Pillow, which can be done by opening up cmd.exe and using the command "pip install Pillow" like [this] after installing Python. This is what allows Python to process images and pictures.

Now, remember that file I mentioned above that was included in the archive I uploaded but didn't use? Open that in a text editor. If you didn't download the archive because you're THAT good, go [here] and copy everything in there into your text editor of choice. Edit the directory path to be your chosen zoom level. In my case, I used the 0.25x zoom, and even that still gave me a file size of just over 40MB. The higher your zoom, the longer this will take, and the bigger the resulting file size. A higher resolution only really helps if you plan on zooming in HARD on the final image, so there really isn't a need to use a high zoom.

Anyways, once you've selected your zoom level and entered the correct path for the directory, save the file as a PY file (for example, "VoxelStitch.py"). You may have to rename the file if it saves as a TXT file ("VoxelStitch.py.txt" won't work, for instance, you need to remove the ".txt" from the end). Then run the PY file you just saved and wait! A PNG file named "map" will eventually appear in the same folder as the PY file, and there's your final map!

Quick reminder that all that work was for a static map that doesn't update at all and will need to be replaced as more map data comes in anddynmapwhenpls.


RE: HomeTown Mapping Project - Penguin - 04-25-2020

this is such a cool idea Big Grin


RE: HomeTown Mapping Project - illogicalsong - 04-26-2020

For this, every time I switch worlds I have to re-inform voxelmap of which world I'm in. Will this mess up things if I forget to put the world each time it yells at me about not knowing the world?


RE: HomeTown Mapping Project - kirinelf - 04-27-2020

tl;dr: Yes.

It does, I believe. VoxelMap really only recognizes three types of worlds, the Minecraft defaults of overworld, the_end, and the_nether. As I'm sure you know but for the benefit of those who don't, those are used as the basis of all the multiworlds spawned by MultiWorld. For instance, Resource World is simply another overworld, as is I think Creative and maybe the art worlds? If you don't split them up, it overwrites the coordinate data with whichever multiworld instance you were last in.

Obviously, the mod should be saving the data in the right spot, including which set of data belongs to which Multiworld, but as you've said, it doesn't seem to be working for you, which is an issue because of the overwriting I mentioned above. I have no clue how to fix this since it hasn't happened to me and the two others who have contributed thus far to the project for the main world specifically. I have that issue with Res World not saving.

I just did a bunch of warping between resnether, xpfarm, res, and home, and it detects the nether maps perfectly. If I warp to home after warping to both nethers first, it remembers home's MultiWorld. But if I visit res at all, it still remembers the nethers, but it loses both res and home and I have to warp to the two nethers again. I tried going to creative as well, and the same issue happens. As far as I can tell, it's an issue with the overworld preset. Maybe the size of the map? I dunno.

--Did a bunch of warps, between End, Nether, ResNether, etc. From what I can tell, it seems like it doesn't like the main worlds on my end. ResNether and Gold Farm worlds worked fine at first, and always remembered their worlds even after warping between other worlds. But as soon as I visited the normal Nether, ResNether started getting screwy. At this point, all I can say is that there seems to be an issue with the Multiverse compatibility on VoxelMap.--

As far as contribution to the project goes, I would say you have three choices:

1) Don't worry 'bout it.
2) Manually select the world each time you do change, until something finally sticks.
3) Don't use the mod until you want to actively spend time mapping.

I recommend 1. xD You have enough on your plate already, I don't want you to waste time fiddling around with something that's ultimately pointless anyways.


RE: HomeTown Mapping Project - N00dlez_ - 05-07-2020

Link to GDrive: File


RE: HomeTown Mapping Project - N00dlez_ - 05-14-2020

Updated Link