Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@depwl9992
Last active April 8, 2024 12:27
Show Gist options
  • Star 27 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save depwl9992/626bf2c20269abe9cda79eeab0de58af to your computer and use it in GitHub Desktop.
Save depwl9992/626bf2c20269abe9cda79eeab0de58af to your computer and use it in GitHub Desktop.
A fully comprehensive tutorial for webbukkit/dynmap to render the nether roof in Minecraft

Initial Setup of the Nether Roof Map

  1. Assuming dynmap is already initialized and the folder structure has been generated during a first-time run, <Spigot_Server>/plugins/dynmap/custom-perspectives.txt should exist.
  2. Open custom-perspectives.txt in a text editor.
  3. In this file below the line perspectives: add the following lines of text.
  - class: org.dynmap.hdmap.IsoHDPerspective
    name: nether_top_map_lowres
    maximumheight: 256
    minimumheight: 129
    inclination: 90
    scale: 4
    azimuth: 180
  1. If SpigotMC is not running, start it and wait for everything to load, remaining in the server console. If SpigotMC is running, you can re-attach to the console using whatever method you have set up.
  2. Run dynmap pause all to halt all live updates to the map.
[12:49:49] [Server thread/INFO]: [dynmap] Full/radius render pause set to true
[12:49:49] [Server thread/INFO]: [dynmap] Update render pause set to true
[12:49:49] [Server thread/INFO]: Full/Radius renders are PAUSED
[12:49:49] [Server thread/INFO]: Update renders are PAUSED
[12:49:49] [Server thread/INFO]: Zoom out processing is ACTIVE
  1. If it does not already exist, add a new nether roof map with the command dmap mapadd world_nether:nether_roof title:"The Roof" perspective:nether_top_map_lowres.
  2. If it DOES already exist, you can change the perspective of an existing map with dmap mapset world_nether:nether_roof perspective:nether_top_map_lowres.
[12:50:25] [Server thread/INFO]: Refreshing configuration for world world_nether
[12:50:25] [Server thread/INFO]: [dynmap] Loaded 4 maps of world 'world_nether'.
[12:50:25] [Server thread/INFO]: If you are done editing map data, run '/dynmap pause none' to resume rendering
  1. Run dynmap pause none.
[12:51:37] [Server thread/INFO]: [dynmap] Full/radius render pause set to false
[12:51:37] [Server thread/INFO]: [dynmap] Update render pause set to false
[12:51:37] [Server thread/INFO]: Full/Radius renders are ACTIVE
[12:51:37] [Server thread/INFO]: Update renders are ACTIVE
[12:51:37] [Server thread/INFO]: Zoom out processing is ACTIVE
  1. Run dynmap cancelrender world_nether.
[12:54:27] [Server thread/INFO]: Cancelled render for 'world_nether'

(This could also be blank, meaning no fullrender was in progress.)

  1. Run dynmap fullrender world_nether:nether_roof.
[12:56:54] [Server thread/INFO]: Full render starting on world 'world_nether'...
[12:58:34] [Dynmap Render Thread/INFO]: Full render of map 'nether_roof' of 'world_nether' in progress - 100 tiles rendered (50.30 msec/tile, 18.75 msec per render)
[13:00:13] [Dynmap Render Thread/INFO]: Full render of map 'nether_roof' of 'world_nether' in progress - 200 tiles rendered (53.48 msec/tile, 16.67 msec per render)
[13:01:54] [Dynmap Render Thread/INFO]: Full render of map 'nether_roof' of 'world_nether' in progress - 300 tiles rendered (49.51 msec/tile, 15.78 msec per render)
[13:03:34] [Dynmap Render Thread/INFO]: Full render of map 'nether_roof' of 'world_nether' in progress - 400 tiles rendered (45.63 msec/tile, 15.27 msec per render)
  1. Note in the browser that the new map will not be assigned an icon in the right-hand map list, and as the new perspective starts at y=129, the nether roof texture will not be included. However, the spawn icon should be displayed at (0,0). As I have a standard ilmango zombie pigman gold farm on the nether roof, that is displayed near spawn as well. Screenshot 2020-05-28 13 06 43

Giving the new map an icon

  1. In the server console run dynmap pause all
  2. Run the command dmap mapset world_nether:nether_roof icon:images/sign_warp.png
  3. Return to the browser and note the updated icon now displays something like a white chat bubble with a black "><": Screenshot 2020-05-28 13 20 46
  4. Icons are stored in <Spigot_Server>/plugins/dynmap/web/images.
  5. You can create or find 16x16px custom PNG images, copying them into this folder for use within the server console.
  6. To load the newly copied PNG image, repeat step 2, changing the icon:images/sign_warp.png bit to icon:images/<filename>.png

Example

I threw together this one called which blends the bedrock block texture and the nether_portal block texture, and copied it in as <Spigot_Server>/plugins/dynmap/web/images/bedrock_portal.png.

bedrock_portal

Then I ran the command dmap mapset world_nether:nether_roof icon:images/bedrock_portal.png, which I'm quite happy with!

Screenshot 2020-05-28 13 37 15

  1. Finally, run dynmap pause none to resume the fullrender or active rendering process. If a full render is not in progress, the map will only update when a player loads the nether roof chunks and remains there for some minimum amount of time.

Rendering the bedrock layer

(Assuming you've already done everything previously mentioned)

  1. In the server console run dynmap pause all.
  2. In the file manager, open <Spigot_Server>/plugins/dynmap/custom-perspectives.txt in a text editor.
  3. Edit the line minimumheight: 129, changing it to minimumheight: 128
  4. Save and close the text editor.
  5. In the server console run reload and wait for all server and plugin configurations to be re-read from their respective files.
  6. Run dynmap pause none.
  7. Run dynmap cancelrender world_nether. You'll either see Cancelled render for 'world_nether' if a fullrender was in progress, or nothing.
  8. Run dynmap fullrender world_nether:nether_roof and wait a few minutes for the first few tiles to render in the browser. If all is well, whatever was displayed before should now be overwritten with a dark grey houndstoothy bedrock texture.

Lighting (June 29, 2020)

With Dynmap 3.1 beta released for 1.16 (Nether) I am watching the Nether biome updates roll in gradually as I re-run a full render of world_nether:flat.

And as I wait, I realized that in the time I wrote this to now my brothers and I also defeated the dragon and and started raiding End cities at which point I realized that its default lighting profile "brightnight" is extremely useful in finding cities and End gateways as the diamond flaring of end rods and torches really help when scanning a 10k x 10k map.

So I decided perhaps since the nether roof is most often used for portal hubs, I could change the lighting profile of world_nether:nether_roof to brightnight as well.

  1. dynmap pause all
  2. dmap mapset world_nether:nether_roof lighting:brightnight
  3. dynmap pause none
  4. dynmap fullrender world_nether:nether_roof

And the result is quite stupendous! image

Dark Red Background (November 27, 2020)

Someone in the comments asked about how to add the red background you see in the world_nether:flat and world_nether:surface maps. Turns out this is all to do with some undocumented and unautomated dynmap features that live in the very hard-to-find HD Map Configuration help file.

  1. Open <SpigotMC Directory>/plugins/dynmap/worlds.txt.
  2. Scroll down to world_nether and in the maps section, search for all separate map definitions.
  3. Note that by default, the "flat" and "surface" maps for world_nether have a background property of #300806.
  4. Copy this line into all applicable map sections. For our purposes, the nether_roof will look something like this:
-   name: world_nether
    title: The Nether
    enabled: true
    extrazoomout: 2
    maps:
    ...
    ...
    -   class: org.dynmap.hdmap.HDMap
        name: nether_roof
        title: The Roof is on Fire!
        icon: images/bedrock_portal.png
        prefix: nether_roof
        perspective: nether_top_map_lowres
        ...
        ...
        background: '#300806'
        append_to_world: ''
  1. Reload the server and watch the nether roof map refresh into new, smoldering red gloriousness! image

Additional Options

rgba() with transparency settings instead of the #RRGGBB format actually works!

In worlds.txt, replace background:'#300806' with background: 'rgba(48,8,6,1.0)' and reload.

Additionally I did some digging into the .js files and found that dynmap may be simply translating the background options of map definitions here into raw CSS. In this case, I tried another thing:

background: 'url("images/book.png")'

YIKES!! What are we seeing!? image

Also w3schools' CSS3 background documentation describes a method of embedding not only a background image, but also its positioning, tiling, repeat, and additionally a backup color into the same line.

background: 'lightblue url("images/book.png") fixed'

As docm77 is fond of saying, "Lawd a'mercy..." image

We can also replace 'lightblue' with an RGB definition in #RGB, #RRGGBB, and rgba() formats.

background: 'rgba(48,8,6,0.5) url("images/book.png") fixed'

Not so spectactular, and the image is layered on top of the background color, so the alpha channel does not darken it any image

This simply means that to properly make a GOOD background image, choosing something less busy and/or manually darkening it in photo editing software it may be preferrable.

image

@mylogon341
Copy link

mylogon341 commented May 28, 2020

Legend. I'll give this a go tonight.

@BlackRec
Copy link

Great tutorial !

@DyonR
Copy link

DyonR commented Sep 2, 2020

Great tutorial! Thanks for this!
Do you maybe know how it would be possible to add the dark-red background colour to the new perspective? I did some Googling but couldn't find it myself.

@ruben966
Copy link

Thanks for this tutorial. I followed every step but im still not getting the result i want; making the perspective and the new map is done, im seeing people walking in the new view and i see the spawn icon, but the terrain is not loading. I tried to do a full render multiple times but it just doesnt load new tiles. Do you have an idea where i made a mistake?

@depwl9992
Copy link
Author

depwl9992 commented Nov 26, 2020 via email

@depwl9992
Copy link
Author

@DyonR

Apologies for the delayed response. I like this idea!

Glancing at the map parameters in dmap maplist world_nether, the only thing I can think that would define the background color of a particular map would maybe be the lighting. For example, only world_nether:flat and world_nether:surface use the nethershadows lighting preset, and those two are also the only ones that have the dark red background.

I'm not certain how to define or edit a manual lighting definition, but given that I suggested using the brightnight lighting preset to view torch trails and such, I am going to run a test re-render of the roof map with nethershadows and see if that does the trick. If that's it, then I will see about adding a note regarding that with a few screenshots.

@depwl9992
Copy link
Author

depwl9992 commented Nov 27, 2020

@DyonR

Apologies for the delayed response. I like this idea!

Glancing at the map parameters in dmap maplist world_nether, the only thing I can think that would define the background color of a particular map would maybe be the lighting. For example, only world_nether:flat and world_nether:surface use the nethershadows lighting preset, and those two are also the only ones that have the dark red background.

I'm not certain how to define or edit a manual lighting definition, but given that I suggested using the brightnight lighting preset to view torch trails and such, I am going to run a test re-render of the roof map with nethershadows and see if that does the trick. If that's it, then I will see about adding a note regarding that with a few screenshots.

Found a reference to https://github.com/webbukkit/dynmap/wiki/HD-Map-Configuration, which describes manually defining background color in worlds.txt or configuration.txt. My recommendation is to stop the server, edit these text files manually (as the console command dmap mapset world_nether:nether_roof background:'#300806' did not actually do anything).

I haven't tested worlds.txt editing directly with Minecraft running, so my procedure is currently:

  1. Stop Minecraft
  2. Open <Spigot_Server>/plugins/dynmap/worlds.txt
  3. Search for - name: world_nether and scroll into the maps: section. Find the nether_roof map and edit its parameters with the following addition of a background option:
-   name: world_nether
    maps:
    -   class: org.dynmap.hdmap.HDMap
        name: nether_roof
        background: '#300806'
  1. Save, close and restart Minecraft.

Some further questions I want answered:

  • Will setting the background to rgba(255,0,0,0.0) completely hide the background as I expect it should? Is it possible we could set something like a css background-image:url() for patterns and such? Answer: yes and yes
  • Can we edit worlds.txt with Minecraft running, and simply reload without completely restarting, or do we risk overwriting manual changes to this file? Answer: yes we can, a restart is preferrable though

@mesl
Copy link

mesl commented Feb 8, 2021

Is it also possible to render the tile images where there is air transparent instead of having black boxes between the transparancy and the rendered area?

@DarkFenix139
Copy link

DarkFenix139 commented Feb 22, 2022

I did as in the screenshot.
https://sun9-59.userapi.com/impg/-QD44f05npDWK4E5suvDZeAwr2UcpEL24SunhA/hvkiRy7xZV0.jpg?size=801x699&quality=96&sign=99939768fc37c479269bee68d21ed6dd&type=album
But because of this, the whole card stops working for me.
What have I done wrong?

@depwl9992
Copy link
Author

depwl9992 commented Feb 22, 2022

@mesl I'm really not sure I know of a good way to do that (honestly, by this point I found dynmap to be the biggest resource hog on my server in both hard drive space and memory usage, so I've disabled it completely). It may be possible to force the air texture to an alpha color but I don't recall off the top of my head how textures are manipulated.

@depwl9992
Copy link
Author

@DarkFenix139 Can you upload your screenshot directly to github? I'm not sure what it is you're referring to.

@DarkFenix139
Copy link

@depwl9992
Copy link
Author

@DarkFenix139 Just compared with my own, and the only difference I can see is that I'm using stdtexture as my shader, rather than default. But I can't see that being a problem either..

Otherwise, it looks perfectly reasonable to me!

@DarkFenix139
Copy link

@depwl9992, Very very very strange, but now everything is fine...

@Tommyfoxy2
Copy link

Any chance you could add instructions for adding a 3D/Surface view for nether roof maps?

@flanigomik
Copy link

would also very much like a 3D/Surface onceover

@ConfusedJonas
Copy link

For those asking how to get a 3D/Surface view, simply change "azimuth" to "135" and "inclination" to "30". This will make the map have the same camera angle as Overworld_Surface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment