-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Diamond Square Refactor & Revamp #19
Conversation
CC @rom1504 |
I might also add trees if I have time |
Removed dependencies detected. Learn more about Socket for GitHub ↗︎ 🚮 Removed packages: diamond-square@1.5.0 |
...duplicateArr(['plains'], 15), | ||
...duplicateArr(['forest'], 20), | ||
...duplicateArr(['desert'], 10) | ||
] | ||
|
||
function generateSimpleChunk (chunkX, chunkZ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This overall looks a bit messy, all the copies, temporary objects and lookups will make generation substantially slower. Can you do a benchmark before vs after?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chunk generation when moving with an elytra is not visibly slower than the previous world gen, and uses less memory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perf tips based after the benchmark:
- don't define objects (use [] or {}) inside hot loops that need to run many times (this creates lots of garbage), instead put them at the top
- don't use long object.property.access as 3 different lookups need to happen opposed to one, avoid null checking (like x?.y) when possible
- avoid hash maps / don't check for features inside for loops
- use integers instead of strings when comparing things, which are also garbage that has to be copied around (js strings are by copy over reference)
What scope do you want to pick for this world generator? If you want to build something really complete, I am not sure if this is the right repo for it. |
A lightweight world generator that's playable and enjoyable.
Fair enough. Would you prefer for me to create a new repo and request that it be transferred to the PJS org? |
Fair enough. I'll be forking, then. |
@Pandapip1 Where I can find the repo with up-to-date code? would like to use it for my project, if possible. Imo it looks really good, but the most basic oregen should added as well imo |
I've undeleted my branch. It should be available at https://github.com/Pandapip1/diamond-square/tree/use-prismarine-registry |
would you be up for improving it? I'm using it and everyone is happy because of the trees :) Trees make a huge difference |
I've kinda abandoned it at this point. Feel free to fork! |
Enhanced features:
This should be a major version, since it breaks existing seeds.