Mapgen issues for folliage and water #3617
Labels
No Label
#P1 CRITICAL
#P2: HIGH
#P3: elevated
#P4 priority: medium
#P6: low
#Review
annoying
API
bug
code quality
combat
commands
compatibility
configurability
contribution inside
controls
core feature
creative mode
delayed for engine release
documentation
duplicate
enhancement
environment
feature request
gameplay
graphics
ground content conflict
GUI/HUD
help wanted
incomplete feature
invalid / won't fix
items
looking for contributor
mapgen
meta
mineclone2+
Minecraft >= 1.13
Minecraft >= 1.17
missing feature
mobile
mobs
mod support
model needed
multiplayer
Needs adoption
needs discussion
needs engine change
needs more information
needs research
nodes
non-mob entities
performance
player
possible close
redstone
release notes
schematics
Skyblock
sounds
Testing / Retest
tools
translation
unconfirmed
mcl5
mcla
Media missing
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: VoxeLibre/VoxeLibre#3617
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
MineClone2 version: master
What happened?
When profiling flying with an Elytra, mapgen was quite slow. After adding some functions:
MineClone2/MineClone2#3614
to help debug this profiling highlighted issues with this. Setting water palette was over 16%. Folliage colour searching and setting was 6.2%. Set grass palette was 2.7%. Fixing seagrass is 2.66%.
Another issue is these are limited to overworld only, so in nether, and end, they will still search and there is still a cost for that.
Water, and folliage are the big two, of course, but we need to think about why we need these. For example, seagrass, now you've set the correct param2, is the generator even needed?
@FossFanatic I think the approach to this needs to be reconsidered. I think VoxelManip may be more appropriate for this:
https://minetest.gitlab.io/minetest/lua-voxel-manipulator/
What should happen:
This should be more performant.
Steps to reproduce
Profile and fly and elytra.
The reason for the higher impact from foliage, water, and seagrass is because for those three, I used a different method of applying the
param2
, which is about three times slower than the VoxelManip method which the grass seems to currently use.Making those three things use the VoxelManip method could speed things up by a factor of three.
The reason I didn't use VoxelManip, was because I wanted to get the basics out of the way first, not to mention that VoxelManip is very difficult to use.
I should give this another try, though, since the loading times do indeed seem very slow for flying with the elytra.
Fair point. It does seem a bit trickier. I think there is a VoxelManip in the codebase that could be used as a reference point.
Thanks for taking feedback on board. I hasn't realised the impact until I did some profiling. I have a PR in for moving the code to functions called by the generator. You're free to build on that or can start again and I'll close that:
https://git.minetest.land/MineClone2/MineClone2/pulls/3614/files
Either way is fine. As long as I can profile and understand the results, I am happy.