🌸 Tue, May 5, 2026 🌸
Refactor audio system and optimize build configuration
- Rename Source to AudioSrc and refactor sound processing logic.
- Spatial SFX go into Sfx3d, and interface SFX go into SfxUi.
- Add loot pickup sound effect and increase gain for various SFX.
- Update Makefile to buld release by default and set up .dir-locals.el for release.
- Return the intermediate texture to full screen resolution, update the blurring values accordingly.
- Centralize in game SFX processing in SfxSrc.
- Integrate new audio assets for clicks and loot pickup including click sounds for PieMenu and button interactions.
I found a magic phrase, #pragma clang optimize on, which supposedly forces optimization for a specific part of the code. I’m not sure if it goes all the way to -O3, but it was enough to let my sound subsystem handle up to 256 concurrent sounds without choking—even in a debug build.
Well, #pragma clang optimize on turned out not to work as well as I hoped. I’ve decided to just run the game in release mode by default and only switch to debug when I actually need to step through the code.
🌸 Tue, May 5, 2026 🌸
OMG, ChatGPT is designed to ragebate to you, so it can push as many ads as possible into my throat.
🌸 Tue, May 5, 2026 🌸
Every once in a while, I try to get back into ChatGPT. Sometimes on YouTube, I see videos praising the new models. The last okay version was 4.5; after that, it has been all downhill.
🌸 Mon, May 4, 2026 🌸
Refactor audio system and improve loot mechanics
- Implement MasterSpeaker to handle audio mixing outside of the SDL callback.
- Introduce SfxSource and Snd3d pull/vpull logic to optimize concurrent sound processing.
- Remove thread locks from audio mixing path for improved performance.
- Add loot bounce SFX and update physics properties for loot objects.
- Shuffle loot drop delays to distribute processing load.
- Optimize Snd3d attenuation and mixing logic.
- Clean up unused todo documentation.
May the fourth be with you!
I’ve been adding more sounds and hitting some performance issues. With 60 mobs walking around, attacking, and grunting, plus loot showering down—each piece making noise when it spawns, bounces, and gets picked up—I sometimes have hundreds of concurrent sounds. My current implementation is struggling to keep up. I added a priority system to play only the most important sounds, but I really want to hear everything!
I’ve been thinking… could I implement this on the GPU? It should work, right? I could upload all the SFX to the GPU and use a compute shader to mix the sound frames (1024-2048 samples). It would be lightning fast. I’d just need to upload a list of active SFX positions each frame and download the mixed buffer back. Since it’s only 2 channels * 2048 samples * 4 bytes, that’s only 16 kilobytes to transfer back—hardly anything.
I’ve been playing around with the CPU version for now. In a debug build with 64 concurrent audio sources, it takes 10ms to process a 2048-sample frame, but in release, it’s only 0.5ms. I’m torn on what to do since I spend most of my time developing in debug mode.
🌸 Sun, May 3, 2026 🌸
Add audio assets and implement sound triggers for loot and mobs
- Integrate new SFX for Live Rock damage/death and tiered loot (Entropy, Essence, Harmony).
- Implement 3D sound triggers in loot and mob classes.
- Add debug toggle (Tab) to enable bgfx debug overlay.
- Display hovered node’s JSON representation in debug overlay.
- Add JSON serialization support for Mob level and HP.
- Enable VSYNC in renderer reset flags.
- Improve FPS label smoothing logic.
I don’t have too much time today, as I’m heading out to a party, but I managed to add some sounds: the Live Rock’s sound effects and some loot sounds. I still need to polish them up, but I have to go for now. For the loot sounds, I’m thinking of playing C for essence, F and C for harmony, and F# and C for entropy. I playtested it and think I’m moving in the right direction, but I need to tune the tone—I want it to sound more like a crystal.
🌸 Sat, May 2, 2026 🌸
Refactor post-processing pipeline and centralize fullscreen logic
- Consolidated blur compute shaders with 2x downsampling support.
- Moved post-processing buffers (Bloom, SSAO, Blur) to half-resolution.
- Renamed combine-vs.sc to fullscreen-vs.sc and removed redundant vertex shaders.
- Introduced settings uniform to control AA, AO denoising, and Bloom.
- Disabled AA and Bloom by default for performance.
- Improved FPS label smoothing and fixed UI positioning.
I’m giving up on the blur algorithm for now. It feels like a huge waste of time. I could have implemented a bunch of game-related features and assets, but instead I spent it on AA, bloom, and AO denoising. I feel kind of bad about it. So I’ll keep the code for now but leave all the features disabled. I might revisit it later and find a more performant way to do blur with the same quality. I really like how the AA is looking, though—especially how it handles dithered transparency.
🌸 Sat, May 2, 2026 🌸
Implement Anti-Aliasing (AA) with compute shaders
- Added AA mask pass to identify edges based on depth and normals.
- Implemented adaptive horizontal and vertical blur shaders for AA.
- Refactored Render class to incorporate AA in the deferred pipeline.
- Added screen-space pass to blit the combined buffer to the backbuffer.
- Moved perspective near and far constants to near-far.hpp for consistency.
- Various code cleanups and bug fixes in shaders and C++ code.
Spent the rest of the day implementing AA. I probably shouldn’t be messing with this so early in development, but I just couldn’t help myself. FPS tanked down to 120, but it looks pretty sweet. I’ll sleep on it and see if I can find a way to optimize it. Something feels a bit off with the compute shaders—maybe I’m passing some wrong parameters? Intuitively, it shouldn’t be this expensive.
🌸 Fri, May 1, 2026 🌸
Refactor blur shaders into separate R8 and RGBA8 versions
- Create specialized R8 and RGBA8 wrapper shaders for compute blur.
- Rename existing blur compute shaders to .sh for inclusion.
- Update Render class to load and dispatch the appropriate blur programs for Bloom (RGBA) and SSAO ®.
Gemini reviewed my code and mentioned it’s not a good idea to mismatch pixel formats. For the SSAO buffer, I was passing R8 values, but the blur shader was expecting RGBA. Everything worked fine for me, but it might have fallen apart on different hardware or driver combinations. I’ve refactored the shaders to use separate R8 and RGBA8 versions just to be safe.
🌸 Fri, May 1, 2026 🌸
Refactor rendering pipeline with compute shader blur and move shader compilation to Chef
- Implement compute shader-based recursive blur for Bloom and SSAO.
- Significant refactor of Render class and Deferred rendering setup.
- Rename bgfx handles to shorter forms (e.g., HTexture -> HTex, HProgram -> HProg).
- Move shader compilation from Makefiles to the chef asset processor.
- Fix initialization order in Source constructor to match declaration.
- Update gameplay.json and crystal group point light radii.
I can’t get the idea of compute shader blur out of my head. Logically, I don’t need it at this stage—SSAO looks fine and bloom looks great. But there was an itch, so I decided to go for it. Not sure why, but FPS went down from 400 to 250 no matter what I did; just enabling the compute shader reduced the performance. Anyway, I might need it for something else later—AA, for example, or a better transparency pass.
perf: optimize audio system and implement sound prioritization
- Refactor Source/Sink to use pre-allocated buffers and reduce heap churn in audio thread.
- Implement priority-based sound mixing with a limit of 16 concurrent sources.
- Move 3D sound attenuation updates to a 30 FPS timer in Scene.
- Add randomized walk speeds for LiveRock mobs.
- Remove atomic gain/pan in favor of synchronous updates under sink locks.
I’ve been working on optimizing the sound system, and it’s been quite a challenge. I’m not sure how this is typically handled, but I ended up limiting the number of simultaneous sound sources to 16 and implementing a prioritization system. I also attempted to reduce memory allocations by reusing buffers, although it didn’t seem to make a huge difference. I decided to keep those changes anyway as they’re slightly more efficient and I’d rather not revert them now.
refactor: optimize mob AI and physics performance
- Enhance Timer class to support recurring tasks and robust cancellation.
- Refactor LiveRock to use standard dynamic physics bodies instead of CharacterVirtual for better performance.
- Implement randomized AI tick frequency (25-35 FPS) to distribute computational load.
- Re-enable VSync by default for improved rendering stability.
- Add “info:” prefix to Chef cooking time logs.
feat: move animation baking to Chef pipeline and refactor consts
- Offload skeletal animation baking to the Chef tool, reducing game load times to ~1.5s.
- Update AnimAsset to load pre-calculated .anim and .anim.bin assets.
- Relocate global constants to libs/shared/consts.hpp.
- Refactor Chef to use a centralized GLTF scene loader.
- Improve Makefile PCH management and add clean-all target.
- Extract BGFX reset flags and disable VSync by default.
- Update mob task list in todo.md.
feat: implement animation baking and update gameplay
- Implement animation baking in AnimAsset to pre-calculate matrices at 120 FPS, improving runtime performance.
- Populate gameplay.json with additional LiveRock mob instances for performance testing.
- Adjust player starting equipment levels.
feat: implement Life Rock mob (WIP) and its animations
- Add LifeRock class for the new mob type.
- Include Life Rock assets: mesh, textures, and idle/run animations.
- Update asset lists and gameplay configuration to incorporate Life Rock.
- Perform minor cleanup and refactoring in CrystalSanctuaryGuardian.
feat: implement incremental asset caching in Chef
- Integrate MurmurHash3 for input-based cache key generation.
- Implement FuncCache for function-level memoization of asset cooking tasks.
- Add file tracking (path, size, mtime) to detect source asset changes.
- Refactor MeshAsset cooking to use incremental caching for collision shapes.
- Reduce game startup time to ~1.7s by avoiding redundant asset processing.
- Update .gitignore to exclude the new .chef/ cache directory.
- Update development journal with latest performance metrics.
feat: implement real-time 3D audio spatialization
- Refactor Snd3d to update gain and panning in real-time via the Ticker interface.
- Use std::atomic for gain and pan to ensure thread-safe updates between the main and audio threads.
- Fix logic errors in stereo panning calculations within Sample and Sink.
- Implement ticker cleanup in Scene to prevent leaks and crashes.
- Adjust CrystalGroupBlue light color to purple to match its visual model.
- Update project TODO list and refine the development journal entry.
refactor: introduce asset cooking pipeline and shared library structure
- Create ‘chef’ utility for pre-processing assets and baking collision shapes.
- Implement ‘libs/shared’ to house physics and asset processing logic used by both the game and chef.
- Move asset declarations to shared ‘process-assets.hpp’ for single source of truth.
- Update MeshAsset to load pre-compiled Jolt (.jph) collision shapes from disk.
- Integrate ‘chef’ into the main Makefile as a build dependency.
- Configure ‘coddle’ with a local repository for the new shared library.
- Update documentation with future plans for boss minions and ability mechanics.
feat: implement 3D spatial audio, boss SFX, and optimize audio loading
- Add Snd3d class for spatialized audio with distance attenuation and panning.
- Rename SoundWave to SndWav and integrate with audio sinks in Scene/Gameplay.
- Implement Crystal Sanctuary Guardian SFX: attack, damage, death, intro barks, and animation-synced footsteps.
- Optimize audio loading by removing the normalization pass and reusing buffers.
- Improve SkMesh::getAnimTime for precise animation-to-SFX synchronization.
- Add Bitwig source projects and raw WAV assets for new sound effects.
- Create doc/journal.md and update doc/todo.md with progress on rendering and boss completion.
- Update .gitignore to exclude auto-backups.
Optimize light pass with scissors, enhance Scene Editor, and add crystal assets
- Implement screen-space scissoring for light passes in deferred rendering, control it with a radius parameter
- Add debug visualization for light scissors (toggled with ‘L’)
- Support 2D alignment modes (XY, XZ, YZ) in Scene Editor using Shift modifier
- Allow adding specialized nodes (Lights, etc.) from the Editor asset menu via NodeTypesRegistry
- Fix skeletal mesh normal/tangent skinning and view-space depth reconstruction
- Add crystal group assets (Blue, Purple, Red) and associated textures
- Refactor getModelMat() to getModelMtx() and add double-sided material support
- Remove collider from mushroom nucleus, roots, and shrubs
- Render point light and spotlight meshes in editor mode
- Make rng shader function that returns values from 0 to 1 and use it instead of PCHHash
- Implement dithered transparency
- Fix artifacts on the screen edges with the SSAO and bloom
- Implement support for two-sided materials
- AI removed gamma correction, not sure why, but I like the result
Optimize asset loading and unpack Blender textures for LFS
- Improved asset loading time from 36s to 4s by caching Assimp scenes in Assets.
- Unpacked textures from Blender files into separate PNGs for better Git LFS support.
- Reused texture loading buffer and reserved memory for mesh vertices/indices.
- Switched to steady_clock for more accurate loading telemetry.
Reverse depth, 32-bit indices, cave assets, loot point lights
- Switch to reverse depth (far=0.05, near=500) to address z-fighting
- Switch mesh and sk-mesh index buffers to 32-bit (BGFX_BUFFER_INDEX32)
- Merge t_metallicRoughness and t_normals combine uniforms into one
- Remove Deferred::geom(); set geometry state per draw call instead
- Add full cave asset library (walls, floors, pillars, decor, etc.)
- Filter scene editor asset list to cave/SM_Wall variants
- Update gameplay.json with cave wall and archway pieces
- Add point lights to EntropyLoot (red), EssenceLoot (green), HarmonyLoot (blue)
- Add point light to BhsProjectile
- Return last inserted node from loadJsonInternal; fix duplicate in editor
- Clamp physics collision steps to max 5 per frame
- Hide mobUi by default in Player constructor
- Log asset load path in Assets::load
- Log texture dimensions on load
Implement normal mapping and octahedron normal encoding
- Add support for tangent space normal mapping across static and skinned meshes.
- Update vertex layouts and Assimp import flags to calculate and include tangent data.
- Implement octahedron normal encoding for G-buffer optimization, storing geometric normals in the metallic-roughness target and pixel normals in the normal target.
- Refactor material system to use bitmasks for shader settings instead of individual floats, reducing uniform overhead.
- Consolidate skinned mesh and static mesh fragment shaders to use a unified
geom-fs.sc. - Integrate
shaderlib.shfor shared decoding/encoding utility functions. - Add
metallicRoughnessCombinesampler to the deferred combination pass to support new normal reconstruction logic.
3x14=42 Pi is the meaning of the life.
Mushrooms, cave level, separate physicsTick from tick
- Add mushrooms.blend with 31 mushroom mesh variants
- Add cave.blend with CrystalSanctuary mesh and dedicated collision
- Place 31 mushroom instances in gameplay.json near starting area
- Update CrystalSanctuary path from world/ to cave/ with separate coll
- Filter scene editor asset list to mushrooms only
- Extract Scene::physicsTick from Scene::tick for clarity
I noticed instead of clicking on the cross in the top right to close the app, I usually fish for the Exit or Quit menu, because that fricking cross button, in 50% of cases, does not close the app and does something weird, like putting it in the background.
1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - 29 - 30 - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 38 - 39 - 40 - 41 - 42 - 43 - 44 - 45 - 46 - 47 - 48 - 49 - 50 - 51 - 52 - 53 - 54 - 55 - 56 - 57 - 58 - 59 - 60 - Next