diff --git a/README.md b/README.md index 25fd1ce..81cd2e8 100644 --- a/README.md +++ b/README.md @@ -106,11 +106,12 @@ A pre-built `MorriCraft-Windows.zip` is available in the repository root. ## 📜 Version History -### v2.2.21 - Save Fix & Updater Polish (Current) -- **Player Position Fix**: Resolved a critical bug where players would reset to spawn when reloading a world. Player coordinates are now correctly preserved. -- **Improved Updater**: Added "Downloading" and "Installing" status messages. -- **Dynamic Progress**: The progress bar now pulses during the download to show active background work. -- **Extraction Fix**: Resolved an issue where the updater failed to find the downloaded ZIP due to an incorrect filename extension. +### v2.2.22 - World Generation Polish (Current) +- **Spawn Plateau**: Implemented a terrain smoothing algorithm around the spawn point (0,0). This ensures new players start on a flat, safe area and prevents "cliff spawns" or starting inside walls. +- **Larger Biomes**: Biome scale has been increased by 4x. Deserts, forests, and rocky regions are now much more expansive and realistic. +- **Improved Spawning**: Refined the surface-finding logic to ensure players always start precisely 0.1 blocks above the grass. + +### v2.2.21 - Save Fix & Updater Polish ### v2.2.20 - UI Polish & Spawn Fixes diff --git a/release/MorriCraft-Linux.zip b/release/MorriCraft-Linux.zip index 6899708..c309f65 100644 Binary files a/release/MorriCraft-Linux.zip and b/release/MorriCraft-Linux.zip differ diff --git a/release/MorriCraft-Windows.zip b/release/MorriCraft-Windows.zip index db27bed..3d27f40 100644 Binary files a/release/MorriCraft-Windows.zip and b/release/MorriCraft-Windows.zip differ diff --git a/release/version.txt b/release/version.txt index 622320c..7d5f7cf 100644 --- a/release/version.txt +++ b/release/version.txt @@ -1 +1 @@ -v2.2.21 +v2.2.22 diff --git a/src/main.cpp b/src/main.cpp index 9c9bc1b..555d90e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -380,7 +380,7 @@ void RebuildChunkRenderList(Chunk* chunk, int cx, int cz) { unsigned char faces = GetExposedFaces(lx, ly, lz, chunk, nxM, nxP, nzM, nzP); if (faces != 0) { - // Simple Torch Lighting (v2.2.21) + // Simple Torch Lighting (v2.2.22) float blockLight = 0.0f; Vector3 bPos = {(float)(worldX+lx), (float)ly, (float)(worldZ+lz)}; for (const auto& tp : torchPositions) { @@ -677,11 +677,21 @@ void GenerateChunk(int cx, int cz) { float detailNoise = fbm(worldX * 0.015f, worldZ * 0.015f, globalSeedHash + 9999); // Combine: broad hills (±12) + local detail (±4) = up to ±16 around Y=32 int height = 32 + (int)(continentNoise * 12.0f) + (int)(detailNoise * 4.0f); + + // Spawn Plateau (v2.2.22): Smoothly flatten area around (0,0) + float distToSpawn = sqrtf(worldX * worldX + worldZ * worldZ); + if (distToSpawn < 12.0f) { + float plateauStrength = 1.0f - (distToSpawn / 12.0f); + if (plateauStrength > 1.0f) plateauStrength = 1.0f; + // Force height towards 32 in the center + height = (int)(height * (1.0f - plateauStrength) + 32 * plateauStrength); + } + if (height < 10) height = 10; if (height >= CHUNK_HEIGHT - 2) height = CHUNK_HEIGHT - 2; - // Biome noise: determines surface type - float biomeNoise = fbm(worldX * 0.008f, worldZ * 0.008f, globalSeedHash + 77777); + // Biome noise: determines surface type (v2.2.22: 4x larger biomes) + float biomeNoise = fbm(worldX * 0.002f, worldZ * 0.002f, globalSeedHash + 77777); for (int y = 0; y <= height; y++) { if (y == 0) { @@ -965,7 +975,7 @@ int main(void) // By default, windows have minimize, maximize, and close buttons on the top bar. SetConfigFlags(FLAG_WINDOW_RESIZABLE | FLAG_VSYNC_HINT); - InitWindow(screenWidth, screenHeight, "MorriCraft v2.2.21"); + InitWindow(screenWidth, screenHeight, "MorriCraft v2.2.22"); LoadConfig(); SetExitKey(KEY_NULL); // Prevent ESC from closing the window @@ -1029,7 +1039,7 @@ int main(void) float updateTimer = 0.0f; float downloadProgress = 0.0f; std::string latestVersion = ""; - std::string localVersion = "v2.2.21"; // Default fallback + std::string localVersion = "v2.2.22"; // Default fallback // Read local version std::ifstream vfile("assets/version.txt"); @@ -1636,7 +1646,7 @@ int main(void) // --- GLOBAL TIME & AUDIO MANAGEMENT --- - float cycleLength = 600.0f; // Slower day cycle (v2.2.21: cut speed in half) + float cycleLength = 600.0f; // Slower day cycle (v2.2.22: cut speed in half) if (currentState == GAMEPLAY) gameTime += GetFrameTime(); float timeOfDay = fmodf(gameTime, cycleLength) / cycleLength; float sunAngle = timeOfDay * 2.0f * 3.14159f - 3.14159f/2.0f; @@ -1990,7 +2000,7 @@ int main(void) AddToInventory(targetBlock); NetSetBlock(hitX, hitY, hitZ, AIR); - // Tool Durability Logic (v2.2.21) + // Tool Durability Logic (v2.2.22) InventorySlot* slot = &hotbar[activeHotbarSlot]; if (slot->maxDurability > 0) { slot->durability--; @@ -2165,7 +2175,7 @@ int main(void) std::string versionUrl = "https://git.linology.tech/michael/MorriCraft/raw/branch/master/release/version.txt"; // Download binary - // v2.2.21: Download directly to the expected zip name + // v2.2.22: Download directly to the expected zip name int r1 = system(("curl -L -s -o " + binaryName + " \"" + binaryUrl + "\"").c_str()); currentProgress = 0.7f; @@ -2213,7 +2223,7 @@ int main(void) DrawTextEx(customFont, "Installing update...", (Vector2){ (float)currentWidth/2 - 80, (float)currentHeight/2 - 60 }, 24, 1.0f, GREEN); } else { DrawTextEx(customFont, "Downloading update...", (Vector2){ (float)currentWidth/2 - 90, (float)currentHeight/2 - 60 }, 24, 1.0f, YELLOW); - // Dynamic progress pulse (v2.2.21) + // Dynamic progress pulse (v2.2.22) if (currentProgress < 0.7f) currentProgress += 0.001f; } int bw = 500, bh = 35; @@ -2487,8 +2497,8 @@ int main(void) DrawTexturePro(titleTexture, sourceRec, destRec, origin, 0.0f, WHITE); EndMode2D(); - // Show Version Number (v2.2.21) in Red - DrawTextEx(customFont, "v2.2.21", (Vector2){ 20, (float)currentHeight - 30 }, 22, 1.0f, RED); + // Show Version Number (v2.2.22) in Red + DrawTextEx(customFont, "v2.2.22", (Vector2){ 20, (float)currentHeight - 30 }, 22, 1.0f, RED); // --- PLAYER NAME POPUP (IF MISSING) --- if (playerName == "") { @@ -2666,7 +2676,7 @@ int main(void) spawnSavedX = 0; spawnSavedY = -1; spawnSavedZ = 0; } - // Load Chests (v2.2.21) + // Load Chests (v2.2.22) chestInventories.clear(); std::ifstream cf("saves/" + currentWorldName + "/chests.dat", std::ios::binary); if (cf.is_open()) { @@ -2684,7 +2694,7 @@ int main(void) cf.close(); } - // Load Torches (v2.2.21) + // Load Torches (v2.2.22) torchPositions.clear(); std::ifstream tf("saves/" + currentWorldName + "/torches.dat", std::ios::binary); if (tf.is_open()) { @@ -2968,7 +2978,7 @@ int main(void) snprintf(worldName, sizeof(worldName), "%s", currentWorldName.c_str()); worldNameLen = strlen(worldName); - gameTime = 150.0f; // Start new world at 7:00 AM (v2.2.21 adjusted for slower cycle) + gameTime = 150.0f; // Start new world at 7:00 AM (v2.2.22 adjusted for slower cycle) if (serverMode) { serverSocket = socket(AF_INET, SOCK_STREAM, 0); @@ -3115,7 +3125,7 @@ int main(void) } else if (renderType == TORCH) { for (Chunk* chunk : visibleChunks) { for (auto& data : chunk->renderLists[TORCH]) { - // 3D Flickering Torch (v2.2.21) + // 3D Flickering Torch (v2.2.22) float flicker = sinf(GetTime() * 12.0f) * 0.03f; float h = 0.6f + flicker; float w = 0.12f; @@ -3359,7 +3369,7 @@ int main(void) (Vector2){ (float)(sx + (slotSize/2) - (countSize.x/2)), (float)(hotbarY + slotSize - 14) }, 12, 1.0f, WHITE); - // Draw Hotbar Durability Bar (v2.2.21) + // Draw Hotbar Durability Bar (v2.2.22) if (hotbar[s].maxDurability > 0 && hotbar[s].durability < hotbar[s].maxDurability) { float durP = (float)hotbar[s].durability / hotbar[s].maxDurability; int barW = slotSize - 10; @@ -3390,7 +3400,7 @@ int main(void) DrawRectangleRec(slotRect, hov ? (Color){90,90,90,255} : (Color){60,60,60,255}); DrawRectangleLinesEx(slotRect, 2.0f, hov ? WHITE : (Color){100,100,100,200}); - // Draw Durability Bar (v2.2.21) + // Draw Durability Bar (v2.2.22) if (slot.maxDurability > 0 && slot.durability < slot.maxDurability) { float durPercent = (float)slot.durability / slot.maxDurability; int barW = slotRect.width - 10; @@ -3666,7 +3676,7 @@ int main(void) } } if (hov && IsMouseButtonPressed(MOUSE_RIGHT_BUTTON)) { - // Right click: pick up/place one (v2.2.21) + // Right click: pick up/place one (v2.2.22) if (mouseHeldItem.blockType == AIR) { if (chestInv[i].blockType != AIR && chestInv[i].count > 0) { mouseHeldItem = InventorySlot(chestInv[i].blockType, 1); @@ -3713,7 +3723,7 @@ int main(void) } } if (hov && IsMouseButtonPressed(MOUSE_RIGHT_BUTTON)) { - // Right click logic for player inv in chest GUI (v2.2.21) + // Right click logic for player inv in chest GUI (v2.2.22) if (mouseHeldItem.blockType == AIR) { if (inventory[i].blockType != AIR && inventory[i].count > 0) { mouseHeldItem = InventorySlot(inventory[i].blockType, 1); @@ -3890,7 +3900,7 @@ int main(void) invf.close(); } - // Save Chests (v2.2.21) + // Save Chests (v2.2.22) std::ofstream cf("saves/" + currentWorldName + "/chests.dat", std::ios::binary); if (cf.is_open()) { uint32_t count = (uint32_t)chestInventories.size(); @@ -3906,7 +3916,7 @@ int main(void) cf.close(); } - // Save Torches (v2.2.21) + // Save Torches (v2.2.22) std::ofstream tf("saves/" + currentWorldName + "/torches.dat", std::ios::binary); if (tf.is_open()) { uint32_t count = (uint32_t)torchPositions.size(); diff --git a/version.txt b/version.txt index 622320c..7d5f7cf 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v2.2.21 +v2.2.22