Better Clouds banner

Better Clouds

8 devlogs
57h 19m 35s

Updated Project: I became the maintainer of the project after the original author gave ownership to me. I helped port the mod to 1.21.11, ported it entirely to 26.1, and added many new features as listed in the devlogs.
Better Clouds adds volum…

Updated Project: I became the maintainer of the project after the original author gave ownership to me. I helped port the mod to 1.21.11, ported it entirely to 26.1, and added many new features as listed in the devlogs.
Better Clouds adds volumetric clouds to Minecraft, in a simple, blocky style that matches the rest of the game. Often, shaders and resource packs add hyper-realistic clouds to the game, which look good but don’t match with Minecraft’s style. This mod aims to fix that.

This project uses AI

I wrote all of the code myself, but Codex was immensely helpful in debugging and digging through decompiled Minecraft source code.

Demo Repository

Loading README...

dhyan

Tagged your project as well cooked!

🔥 dhyan marked your project as well cooked! As a prize for your nicely cooked project, look out for a bonus prize in the mail :)

orangishcat

Shipped this project!

Hours: 13.83
Cookies: 🍪 458
Multiplier: 27.65 cookies/hr

Goodbye Flavortown! Today is April 29, and I am shipping before Flavortown and LockIn week 4 ends.

I got version 1.13 of the mod released and painstakingly made some bug fixes to the 1.21.1 NeoForge version of the mod, which is getting a download spike due to Create Aeronautics. Print debugging using Prism Launcher was certainly an experience :)

And for like the millionth time already, I published a hotfix to the mod less than 20 minutes after I released it. Great.

Thanks to Qendolin for letting me maintain his project! You can read some more about it in the previous ship message.

orangishcat

Adding custom noise pattern support basically caused a 7x increase in cloud generation times as the algorithm produces cooler clouds but is more computationally expensive.

So I added an LRU cache that stores the sampler result to speed up cloud generation.

I tried to use fancier methods such as remembering previously computed points but I wasn’t able to get it working.

With the current approach, there’s a decent performance improvement at least, 140 ms -> 50 ms.

Why did I even do this a performance difference this tiny does not matter at all, the cloud generation runs on a separate thread anyway

Attachment
Attachment
2

Comments

penguinencounter

Print debugging using Prism Launcher was certainly an experience :)

use remote debugging! https://www.jetbrains.com/help/idea/tutorial-remote-debug.html (note that the template that IJ gives you is a bit wrong - you have to remove the *: from the address field

orangishcat
orangishcat 2 days ago

Oh that’s really cool. Will give it a try at some point

orangishcat

I spent the past 8 hours fixing bugs. Like I don’t think I did anything else.

The main issue I was dealing with was the release of Create Aeronautics, an insanely cool mod that essentially just adds realistic physics to Minecraft.

The issue was that it was on 1.21.1, and the 1.21.1 version of the mod is Qendolin’s multiple-year-old version and has a ton of bugs.

And that’s really bad because my development environment is broken for older versions. I essentially had to print debug by building JARs -> copying them over to my PrismLauncher instance (I symlinked it later, saved a bit of time) -> then launching the game, letting it crash, then reading PrismLauncher logs. Was a ton of overhead, but fortunately the fix was simple so it didn’t take forever.

Some bugs I ran into:

Clouds would render over DH LODs. The fix was implemented already but had to be manually configured to turn on for a new version of DH, so I had to do that and also add a fallback for certain DH versions.

Oh and also the render phase name changed for some reason (startDrawing -> setupRenderingPhase). This just causes a crash when drawing clouds. Was annoying as I had to add some code to print the method names on crash, since I didn’t have a debugger or anything to work with.

Clouds also only rendered on a corner of the screen. This is intended and only works on certain shaders, the bug was that the shader preset would change without the user doing so due to a bug. I have created an FAQ, but I still need to reproduce the bug somehow.

That was an epic rant of pain. Next up, the cloud generation times increased by 7x because I added a better algorithm in the latest version. I’m gonna try to optimize it.

Attachment
Attachment
Attachment
0
orangishcat

Oh hey this is a cool cloud noise pattern

(I can’t look at IRL clouds normally anymore 😭)

huh how has it been 8hrs since my last devlog??? I felt like I didnt do anything

I’ll do a devlog about what I’ve done in 15 mins

Attachment
0
orangishcat

Shipped this project!

Hours: 43.49
Cookies: 🍪 1385
Multiplier: 26.53 cookies/hr

Sometime back in December, I saw that Qendolin (original author of the mod) didn’t have time to update the mod to 1.21.11, so I submitted a PR doing just that. It wasn’t perfect, but he actually accepted it! I felt quite happy knowing that I just helped someone.

Then later in January, he announced that he was discontinuing the mod as he didn’t have time to maintain it, and was willing to pass ownership onto other people. Multiple people volunteered, including me, and Qendolin clearly had no idea how to decide.

So I jumped in and did a partial update of the mod to 26.1. And Qendolin decided to let me maintain the mod!

So huge thanks to Qendolin for trusting me with his project. It is a huge honor to be working with a mod so popular.

orangishcat

I completely forgot to devlog skulk

So once again, here’s one giant devlog covering everything I did over the past few days.

  • Sampler visualizers: Allows me to create an image with the cloud noise patterns to get an idea of what the cloud generation would look like. Attached as the first image is the original noise pattern.
  • Multiple noise support: Cloud generation uses PerlinSimplexNoise (a Minecraft-exclusive combination of Perlin and Simplex noise) to generate clouds. This can be further configured with Perlin Noise Octaves. I added support for a generator to use multiple noise handlers with different octaves, using a simplex noise pattern to pick the noise generator to use, and interpolate the result between the two closest noise generators. The end result is a nice, smooth pattern (second image) that allows for a lot of diversity in cloud generation.
  • Fill cloud void options: The bottom of a cloud is empty, but to fix that I added the bottomSparsity option that would mirror the top cube under the bottom cube, filling in the cloud and making it look like a blob instead of a thin sheet. Third image: cloud with empty bottom, 4th image: cloud with filled bottom.
  • Noise preset options: Not quite done yet, but once finished it would let you build your own custom noise pattern. 5th image: a preview of the noise options

And lastly I’ve also included a quick timelapse of the clouds moving by. Each cloud pattern is different from the previous due to the new noise options. Hopefully you will enjoy!

Attachment
Attachment
Attachment
Attachment
Attachment
0
orangishcat

This week is LockIn week 3, and I’m going to be submitting this project for it. Here’s what I’ve done so far:

  • Get rid of lunar client sucks message: Qendolin (the original author) added the message; he had a hard time debugging with lunar client when it caused a crash with the mod. I’ve gotten rid of it for now because Lunar seems to work fine right now.
  • Use world time for cloud gen: Added a “Time Source” option to the options menu, with the default being World time. As shown in the attached video, this makes the clouds follow the world time and be affected by /time set commands.
  • Use world seed for cloud gen: The client doesn’t directly receive the world seed, but an obfuscated version of it is sent upon client login for use within the biome manager. I’m using the same seed to produce deterministic cloud patterns based on world seed (previously was hardcoded with seed 1337).

To do list for this week:
[x] get rid of lunar client sucks message

[x] use world time for cloud gen

  • options: clock time, game time, renderer time

[x] use world seed to salt cloud gen

[] sodium extra integration

[] no clouds in desert

[] backport to older version

[] fill cloud void?

[] work with world height datapacks

Attachment
0
orangishcat

The cursed Neoforge build script makes me lose two hours of my life again. Turns out Neoforge doesn’t use include, it uses jarJar instead. Without it, the dependencies are correctly loaded in the development environment, but bundled incorrectly when building the JAR.

-implementation("com.github.bawnorton.mixinsquared:mixinsquared-neoforge:0.3.7-beta.1")
+implementation(jarJar("com.github.bawnorton.mixinsquared:mixinsquared-neoforge:0.3.7-beta.1"))

Error screen looks something like this:

At least it told me it had something to do with MixinSquared. Better than other mixin-related issues I’ve had in the past that just gave me an arbitrary mixin number like mixin_1793.

Attachment
0
orangishcat

Oh no I forgot to devlog 😭

It’s been 5 days since Minecraft 26.1 released. Here’s what I’ve done so far.

  • Cloud pointiness option: A value from 0 to 5, controlling whether the cloud is flat (0), super pointy like a mountain (5), or anywhere in between. The option doesn’t work the greatest so I might have to refine or tweak it in the future.
  • Fixed Iris compatibility and shader support. I added the Iris compat back after it broke, and fixed a bug where Iris was using a different view bobbing matrix, causing a weird visual effect where the clouds would not be affected by view bobbing and move side to side relative to the world.
  • Fixed shader preset dropdown rendering behind text, mutating option text, etc. This bug has been in the codebase for a long time, so I’m glad it’s finally fixed.
  • Fixed clouds not being affected by view bobbing and nausea effects. This was a similar fix to the Iris bugfix I did. Same cause; matrix stack being captured too late.
  • Clean up build.gradle (kinda)
  • Lots of code quality improvements under the hood.

Here’s some screenshots with the fixed shader support.

Attachment
Attachment
0
orangishcat

Time really flies when Minecraft modding; digging through source code is not fun! I felt like I barely did anything and I was already way past 10 hours.

After previously helping port the mod to Minecraft 1.21.11, I now have to port it to 26.1.

Now starting from 26.2 Minecraft will be moving to Vulkan, so I wouuld have to rewrite the mostly-OpenGL renderer in Blaze3D (Mojang’s rendering abstraction), and later port the shaders to be Vulkan-compatible.

Fortunately 26.1 is still OpenGL only and I still can procrastinate a little bit before having to do all that.

There are a lot of files changed…

Here’s a screenshot of the mod in action.

Attachment
0