Skip to content

Conversation

@DragonDev1906
Copy link

As suggested in #1665 I've added a heatmap showing recent chunks.

  • Based on the chunk mtime (instead of using the chunk inhabited time, which would have required calculating a min/max)
  • Configured by setting an earliest timestamp (alpha=0) and a current timestamp (alpha=255)
  • To make the implementation easier only the alpha value is changed with red as a base color (see Screenshot)
  • You might have to use forcerender, otherwise the layer might not update correctly (maybe deleting the related files in the output might work, too)
  • Could someone test this with a more active map? My testmap is rather small and had only 3 different chunk mtimes, which resulted in the sharp edges shown below. I would like to see how it looks on a more active map.

Example configuration:

renders["spawnable"] = {
   "world": "Test12985",
   "rendermode": [ClearBase(), HeatmapOverlay(
      # t_invisible=int((t_now - timedelta(days=30)).timestamp()),
      # t_full=int(t_now.timestamp()),
   )],
   "title": "Heatmap Overlay",
   "overlay": ["normalrender"],
}

2020-07-12_23:28:49

Copy link
Member

@CounterPillow CounterPillow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry it took a while to review this. I haven't personally run it yet, but there's two things I've spotted which are minor issues before I did. Thanks for your PR!

@DragonDev1906
Copy link
Author

I applied the suggested changes and rebased the PR to the current version (to test if it still works)

@CounterPillow
Copy link
Member

Thanks. I'll try to render a map with it today to see it in action, and then merge it if it's all good

@CounterPillow
Copy link
Member

CounterPillow commented Jun 6, 2021

overviewer_core/src/primitives/overlay-heatmap.c: In function ‘get_color’:
overviewer_core/src/primitives/overlay-heatmap.c:48:5: warning: implicit declaration of function ‘PY_XDECREF’; did you mean ‘Py_XDECREF’? [-Wimplicit-function-declaration]
     PY_XDECREF(mtime_pyobj);
     ^~~~~~~~~~
     Py_XDECREF

Small mistake, please change and git commit -a --amend, then git push -f to force-push your fixup.

Trying this out on a map now anyway with it fixed locally.

@DragonDev1906
Copy link
Author

Thank you for pointing this out, apparently I forgot to run python setup.py build

@CounterPillow
Copy link
Member

image
Seems to work fine, aside from the fact that Minecraft is so write-happy you rarely get smooth transitions since essentially every chunk a player can see will be written.

@CounterPillow CounterPillow merged commit 111579e into overviewer:master Jun 6, 2021
@DragonDev1906
Copy link
Author

Minecraft probably has to save whenever there is any entity in the chunk (or might just save always to make programming easier).

@CounterPillow
Copy link
Member

It famously updates the chunk whenever a cow moos, from what I've heard

@DragonDev1906 DragonDev1906 deleted the issue-1665-heatmap branch August 3, 2021 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants