Lunacraft Reborn
-- Dev Log --
6/6/2025 (almost there...)
-------------------------------------
I just want to get a quick update out, because I'll be away over the next week and unable to work on the game. I was planning to release at the start of the month, but at the last minute I discovered several bugs/oversights that needed to be dealt with. The only thing I have left to finish is the astronaut behavior, then I'll send the game to some playtesters. Once whatever they catch has been ironed out, I'll release the game. Sorry it's a bit later than I promised. The game should be ready for release no later than the 20th.
5/11/2025 (BIG PERFORMANCE UPDATE)
-------------------------------------
Ok, my last day of school was last Friday, so I'm finally free! I just spent all of the following Saturday (yesterday) working on the game's performance, and I made incredible progress, so I wanted to make a dedicated post. The game had a terrible lag spike when it began generating new chunks, and the performance while it was generating was not optimal. I managed to solve all of this in one move.
I've been representing the chunks as multidimensional (3D) arrays, for obvious reasons. The issue is that these can't be directly written/read to/from disk. They must first be converted to a 1D byte array, which requires iterating through all their elements. A single chunk has 32x32x128 = 131,072 elements. You see the problem. Not only that, but indexing into multidimensional arrays is radically less cache-efficient than 1D arrays.
So, I changed the chunks to be simple 1D byte arrays (the bytes are the block IDs, if you're wondering). Not only did this eliminate the need to iterate through the chunks before saving/loading them, which automatically killed half the lag spike, this also made the chunk generation about 6x faster (13ms -> 2ms, on average), killing the other half of the lag spike. I made some other small tweaks to make the rendering of individual chunks 2x faster (4ms -> 1.9ms, on average).
At the end of all this, the game is running way smoother than it has any right to, averaging about 200fps on my computer at a moderate render distance. I won't get deep into it here, but I made two critical errors in my approach to this. First, I used Unity. Unity's multithreading (Job system) is so restrictive I literally cannot use it to any benefit. Thus, the game is locked to a single core. On top of that, I committed the greatest possible sin in making a voxel game in Unity: having one GameObject per block. In the future I'll probably make a more dedicated post/YouTube video explaining these decisions. Anyway, given these issues, the game should have been dead in the water, but fortunately I seem to have salvaged enough performance for the game to be shippable. At least I hope, we'll see how the playtesting goes.
Anyway, I'll stop there. I expect to release the game around the end of the month. Get ready!
5/4/2025
-------------------------------------
Just a quick update, since I've been silent for a few weeks now. The game is nearly finished! Right now I just need to add turrets, the astronauts, and refine a few things. This is my last week of school, so I'll be focusing on that, but this Saturday I'll get back to the game and finish it off. Shouldn't be more than a few weeks now.
4/12/2025
-------------------------------------
- Added green mob
- Added brown mob
- Implemented alchemy system
4/6/2025
-------------------------------------
- Added crosshair
- Added bobbing animation when walking
- Added shaking animation when drilling
- Some refinements/bug fixes
4/5/2025
-------------------------------------
- Finished options menu (volume, hide/show fog, etc.)
- Factored Tree Cover and Terrain Roughness settings into the terrain generation
- Players can now control the look of their moon!
- Added creative mode inventory
- Implemented chronobooster and chronowinder
4/4/2025
-------------------------------------
- Music now plays upon loading into a new moon, and then every 8-12 minutes
- Items can now be thrown out of inventory
- This is important for befriending astronauts with gold
- Cleaned up the code and removed lots of unused assets
- Not important to players, but important to me!
3/31/2025
-------------------------------------
- World time now saves
- Added shift-clicking to inventory
- Made block selection overlay more like original game
- On a related note, I found a better way to utilize the mining overlay textures, so mining looks more like the original game as well
- Things have really come together over the past month. Now I only need to finish the mobs, a handful of minor features, and make some refinements, then it's basically done.
3/30/2025
-------------------------------------
- Added sound effects (finally!)
- I added all the sounds I could confirm from YouTube videos (drilling, jetpack, mining, etc.), but there are several sounds in the original game files I can't identify
- Still need to make music occasionally play
- Added fog (see here)
- This goes a huge way toward capturing the original aesthetic
- Added more spiral light tree variants
- Minor improvements/bug fixes
- Slug pistol shoots more toward the center of the screen
- Switching items while punching/drilling now cancels the animation
- Added block placing animation
3/26/2025
-------------------------------------
- Finished mining system
- Added drill animation
- Blocks now drop and can be picked up
- Added slug pistol
3/1/2025
-------------------------------------
- Finished basic inventory functionality
- Added scanner
- Added spacesuit slots (helmet, battery, jetpack)
- Added jetpacks
- Added crafting
2/19/2025 (9am - 6pm)
-------------------------------------
- Added walking animation for giraffe
- Added models for all astronauts
- Added model for Blue I
- Laid groundwork for inventory
2/16/2025 (2pm - 8:30pm)
-------------------------------------
- Fixed holes in crystal plant textures
- Made plant spawning more uniform
- Made ore distributions closer to original game (in accordance with this article)
- Mrob27's articles on the wiki have been super helpful!
- Added green and brown mobs, and space giraffes
- Brown mob doesn't target player and explode yet (no way to aggravate them)
2/7/2025 (6pm - 9pm)
-------------------------------------
2/3/2025 (5pm - 6:30pm)
-------------------------------------
1/26/2025 (3pm - 8pm)
-------------------------------------
- Fixed washed out Light block texture
- Just switched to unlit shader; no need for emission map
- Fixed bug that spawned more water than necessary
- Simplified all shaders
- Water and crystal plants now respond to changing light (which massively improves the look of the game; see here)
1/25/2025 (3pm - 7pm)
-------------------------------------
- After many hours of toil, I finally got point lights to work
- I was starting to doubt if the flat lighting I wanted was even feasible, as I didn't think it was practical to pass point light data to the shaders, but it turns out I was just being retarded
- Added block placing system
1/18/2025 (1pm - 2:30pm)
-------------------------------------
- Fixed all of the textures
- They were much darker than the originals. Game looks so much better now.
- Added vignette and slight color grading
- Changed sun color from yellowish to blueish
1/16/2025 (7:30pm - 8pm)
-------------------------------------
- Fixed: F3 button didn't save the debug info option
- Mouse sensitivity slider now works
1/14/2025 (5pm - 7:30pm)
-------------------------------------
- Added skybox
- Added day/night cycle
- Added basic fog
- Makes the world slightly more interesting but needs work (doesn't cover the skybox like in the original game)
- Player's head can no longer spin 360 degrees
1/12/2025 (7pm - 8:30pm)
-------------------------------------
- Fixed pause menu bugs
- Options menu was open by default
- Gravity applied while paused
- Added moon seed to debug info
- Render distance now adjusts when changed in-game
1/11/2025 (5pm - 6pm)
-------------------------------------
- Made structure spawns deterministic
- Just use the moon seed with the PRNG -- duh
1/10/2025 (3pm - 9pm)
-------------------------------------
- Added debug menu
- Spent hours fixing reserve system, only to realize it isn't actually helping performance. Fuck.
1/6/2025 (5pm - 9pm)
-------------------------------------
- Spent many hours trying to figure out how to do the lighting for light blocks, to no avail. Pretty sure I need a custom lighting system.
1/5/2025 (4pm - 6pm)
-------------------------------------
- Minor tweaks
- Ores are less common
- Structures can't be placed right on top of each other
- Crystal plants now use same shader as water (looks better)
- Made blue crystal more opaque (like original game)
- Modified block reserve system
- Reduced total reserve by 80% (game loads much faster now)
- Now uses a dictionary to reduce the number of branches and simplify the code
- Added astronaut lairs
- Still want to make them more complex
1/4/2025 (4pm - 2am)
-------------------------------------
- I finally got the water to render correctly! Thankfully, it was achievable with a custom shader.
- The issue was that overlapping faces would "add" and create a bunch of planes in the water.
- Made terrain much closer to original game
- Added crystal plants
- Added ores
1/2/2025 (1pm - 8pm)
-------------------------------------
- Camera orientation now saves, along with player position/rotation
- Threw out Cinemachine in favor of custom controller. Too much of a headache, and totally unnecessary.
- Added loading bar while loading existing moon
- Initial rendering is now done in main menu, so it doesn't freeze as bad when switching scenes
- When breaking blocks, neighboring non-air blocks are placed. No more holes!
- The game is looking really good now. There don't seem to be any bugs in the generation/rendering, the main menu is finished, the basic block destruction system is in place (and block placing will be easy), and all game data is saving correctly.
1/1/2025 (5pm - 9pm)
-------------------------------------
- Player position/rotation is now saved when quitting
- Still need to figure out how to save camera orientation
- Fixed bug where options menu didn't close after hitting escape
- New bullshit pops up every time I think this, but the dynamic generation/rendering appears to be stable
- Now it just needs to be optimized. In the editor, generating/rendering a new chunk row drops the FPS from ~140 to ~60
12/30/2024 (4pm - 10pm)
-------------------------------------
- Player can no longer break blocks in pause menu
- Significantly modified renderer
- Removed fixed arrays centered around player. Too bug prone, and annoying to deal with.
- Made BlockIsTouchingAir() fully general (and fixed holes in map)
- Now it generates block data one chunk beyond the render distance so that data is immediately available
- At this point, at least 70% of the "rendering time" is spent on the EditorLoop. The built game averages ~400 fps
12/24/2024 (5pm - 8pm)
-------------------------------------
- Fixed mysterious bug with loading chunks when the player crosses different chunk boundaries
- For some reason I cannot identify, after switching directions either the first or last generated chunk is wrong.
- I've been hung up on this for days now. I rewrote the rendering to be more systematic, using a task queue.
12/19/2024 (1pm - 3pm)
-------------------------------------
- Added outline to block player is looking at
- Added basic block destruction
- Added level saving
12/18/2024 (4pm - 6:45pm)
-------------------------------------
- Gave up on pure GPU instancing in favor of GameObjects
- Performance is actually decent: ~150fps in editor, with lag spikes down to 70fps when loading new chunks
- Still need to fix bug where some blocks touching air aren't being rendered
- Did away with custom flat shaders (no need)
- Chunk loading is *basically* in place now
12/11/2024 (7pm - 10pm)
-------------------------------------
- Separated chunk generation and rendering
12/8/2024 (11am - 6pm)
-------------------------------------
- Added pause menu
- Fixed (literal) holes in rendering code
- Static rendering code is finished (140 avg fps for render distance = 3 after build)
12/7/2024 (10am - 8pm)
-------------------------------------
- Fully finished main menu
- Adjusted menu sizes to be less ridiculous
- Finished animated background system
- Fixed button bugs
- Made fully responsive
- Added progress bar when generating moon
- Made file IO SIGNIFICANTLY more efficient (huge win)
- Laid groundwork for (static) chunk generation
- Figured out why the textures are wonky
- The reds and blues were switched around in the texture atlas (hence the file name textures256reversed.png)