From 8c7f99371bc20501109f21f94d055abe2503dbe0 Mon Sep 17 00:00:00 2001 From: crabman Date: Thu, 28 Mar 2024 09:32:59 +0000 Subject: [PATCH] New default singleplayer world --- CHANGELOG.md | 1 + assets/world/map/veloren_0_16_0_0.bin | 3 +++ server/src/lib.rs | 2 +- server/src/settings.rs | 3 +-- voxygen/benches/meshing_benchmark.rs | 2 +- .../src/singleplayer/singleplayer_world.rs | 6 +++--- world/benches/cave.rs | 4 ++-- world/examples/cave_biomes.rs | 4 ++-- .../examples/chunk_compression_benchmarks.rs | 4 ++-- world/examples/dungeon_voxel_export.rs | 4 ++-- world/examples/heightmap_visualization.rs | 4 ++-- world/examples/pricing_csv.rs | 4 ++-- world/examples/water.rs | 4 ++-- world/examples/world_block_statistics.rs | 4 ++-- world/examples/world_generate_time.rs | 4 ++-- world/src/sim/mod.rs | 20 ++++++++++++++++++- world/src/site/economy/context.rs | 6 +++--- 17 files changed, 50 insertions(+), 29 deletions(-) create mode 100644 assets/world/map/veloren_0_16_0_0.bin diff --git a/CHANGELOG.md b/CHANGELOG.md index f0267f7e85..1b8e84896b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -105,6 +105,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Dropped items now merge dynamically (including non-stackables). - You no longer need to unlock health, energy and roll skills to get to max. - Rolls now don't skip recovery, and instead have increased buildup during ability interrupts. +- Changed default world map ### Removed diff --git a/assets/world/map/veloren_0_16_0_0.bin b/assets/world/map/veloren_0_16_0_0.bin new file mode 100644 index 0000000000..b90fdcad55 --- /dev/null +++ b/assets/world/map/veloren_0_16_0_0.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3319df27b313530a772aa55f78aeabc2a9fa37047bc7c20a22f8dee213fb0ac8 +size 16777252 diff --git a/server/src/lib.rs b/server/src/lib.rs index 2d0c06848b..f2a914de28 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -146,7 +146,7 @@ use crate::{chat::ChatCache, persistence::character_loader::CharacterScreenRespo use common::comp::Anchor; #[cfg(feature = "worldgen")] pub use world::{ - sim::{FileOpts, GenOpts, WorldOpts, DEFAULT_WORLD_MAP}, + sim::{FileOpts, GenOpts, WorldOpts, DEFAULT_WORLD_MAP, DEFAULT_WORLD_SEED}, IndexOwned, World, }; diff --git a/server/src/settings.rs b/server/src/settings.rs index 24d07c3c85..880df37062 100644 --- a/server/src/settings.rs +++ b/server/src/settings.rs @@ -30,11 +30,10 @@ use std::{ path::{Path, PathBuf}, }; use tracing::{error, warn}; -use world::sim::FileOpts; +use world::sim::{FileOpts, DEFAULT_WORLD_SEED}; use self::server_description::ServerDescription; -const DEFAULT_WORLD_SEED: u32 = 230; const CONFIG_DIR: &str = "server_config"; const SETTINGS_FILENAME: &str = "settings.ron"; const WHITELIST_FILENAME: &str = "whitelist.ron"; diff --git a/voxygen/benches/meshing_benchmark.rs b/voxygen/benches/meshing_benchmark.rs index 4b78cb5db5..2cfe9563a1 100644 --- a/voxygen/benches/meshing_benchmark.rs +++ b/voxygen/benches/meshing_benchmark.rs @@ -15,7 +15,7 @@ pub fn criterion_benchmark(c: &mut Criterion) { let pool = rayon::ThreadPoolBuilder::new().build().unwrap(); // Generate chunks here to test let (world, index) = World::generate( - 42, + sim::DEFAULT_WORLD_SEED, sim::WorldOpts { // NOTE: If this gets too expensive, we can turn it off. // TODO: Consider an option to turn off all erosion as well, or even provide altitude diff --git a/voxygen/src/singleplayer/singleplayer_world.rs b/voxygen/src/singleplayer/singleplayer_world.rs index a182ce4ee0..cddfe15a93 100644 --- a/voxygen/src/singleplayer/singleplayer_world.rs +++ b/voxygen/src/singleplayer/singleplayer_world.rs @@ -6,7 +6,7 @@ use std::{ use common::{assets::ASSETS_PATH, consts::DAY_LENGTH_DEFAULT}; use serde::{Deserialize, Serialize}; -use server::{FileOpts, GenOpts, DEFAULT_WORLD_MAP}; +use server::{FileOpts, GenOpts, DEFAULT_WORLD_MAP, DEFAULT_WORLD_SEED}; use tracing::error; #[derive(Clone, Deserialize, Serialize)] @@ -84,7 +84,7 @@ fn migrate_old_singleplayer(from: &Path, to: &Path) { return; } - let mut seed = 0; + let mut seed = DEFAULT_WORLD_SEED; let mut day_length = DAY_LENGTH_DEFAULT; let (map_file, gen_opts) = fs::read_to_string(to.join("server_config/settings.ron")) .ok() @@ -238,7 +238,7 @@ impl SingleplayerWorlds { name: "New World".to_string(), gen_opts: None, day_length: DAY_LENGTH_DEFAULT, - seed: 0, + seed: DEFAULT_WORLD_SEED, is_generated: false, map_path: path.join("map.bin"), path, diff --git a/world/benches/cave.rs b/world/benches/cave.rs index 25b9c71e04..786149b452 100644 --- a/world/benches/cave.rs +++ b/world/benches/cave.rs @@ -3,14 +3,14 @@ use criterion::{black_box, criterion_group, criterion_main, Criterion}; use rayon::ThreadPoolBuilder; use veloren_world::{ layer, - sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP}, + sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP, DEFAULT_WORLD_SEED}, CanvasInfo, Land, World, }; fn cave(c: &mut Criterion) { let pool = ThreadPoolBuilder::new().build().unwrap(); let (world, index) = World::generate( - 230, + DEFAULT_WORLD_SEED, WorldOpts { seed_elements: true, world_file: FileOpts::LoadAsset(DEFAULT_WORLD_MAP.into()), diff --git a/world/examples/cave_biomes.rs b/world/examples/cave_biomes.rs index 26fa889d36..90a17dd53c 100644 --- a/world/examples/cave_biomes.rs +++ b/world/examples/cave_biomes.rs @@ -6,14 +6,14 @@ use veloren_world::{ self, cave::{Biome, LAYERS}, }, - sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP}, + sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP, DEFAULT_WORLD_SEED}, CanvasInfo, Land, World, }; fn main() { let pool = ThreadPoolBuilder::new().build().unwrap(); let (world, index) = World::generate( - 230, + DEFAULT_WORLD_SEED, WorldOpts { seed_elements: true, world_file: FileOpts::LoadAsset(DEFAULT_WORLD_MAP.into()), diff --git a/world/examples/chunk_compression_benchmarks.rs b/world/examples/chunk_compression_benchmarks.rs index 54f2038f90..ae60471a54 100644 --- a/world/examples/chunk_compression_benchmarks.rs +++ b/world/examples/chunk_compression_benchmarks.rs @@ -29,7 +29,7 @@ use tracing::{debug, trace}; use vek::*; use veloren_world::{ civ::SiteKind, - sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP}, + sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP, DEFAULT_WORLD_SEED}, World, }; @@ -682,7 +682,7 @@ fn main() { common_frontend::init_stdout(None); println!("Loading world"); let (world, index) = World::generate( - 59686, + DEFAULT_WORLD_SEED, WorldOpts { seed_elements: true, world_file: FileOpts::LoadAsset(DEFAULT_WORLD_MAP.into()), diff --git a/world/examples/dungeon_voxel_export.rs b/world/examples/dungeon_voxel_export.rs index f0280c8e1f..695c5f0f24 100644 --- a/world/examples/dungeon_voxel_export.rs +++ b/world/examples/dungeon_voxel_export.rs @@ -12,7 +12,7 @@ use common::{ use rayon::ThreadPoolBuilder; use vek::{Vec2, Vec3}; use veloren_world::{ - sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP}, + sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP, DEFAULT_WORLD_SEED}, site2::{plot::PlotKind, Fill, Structure}, CanvasInfo, Land, World, }; @@ -25,7 +25,7 @@ fn main() -> Result { let pool = ThreadPoolBuilder::new().build().unwrap(); println!("Loading world"); let (world, index) = World::generate( - 59686, + DEFAULT_WORLD_SEED, WorldOpts { seed_elements: true, world_file: FileOpts::LoadAsset(DEFAULT_WORLD_MAP.into()), diff --git a/world/examples/heightmap_visualization.rs b/world/examples/heightmap_visualization.rs index 22e42b4e01..3b5ed27b29 100644 --- a/world/examples/heightmap_visualization.rs +++ b/world/examples/heightmap_visualization.rs @@ -6,7 +6,7 @@ use rayon::ThreadPoolBuilder; use std::{fs::File, io::Write}; use vek::*; use veloren_world::{ - sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP}, + sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP, DEFAULT_WORLD_SEED}, Land, World, }; @@ -120,7 +120,7 @@ fn main() { let pool = ThreadPoolBuilder::new().build().unwrap(); println!("Loading world"); let (world, _index) = World::generate( - 59686, + DEFAULT_WORLD_SEED, WorldOpts { seed_elements: true, world_file: FileOpts::LoadAsset(DEFAULT_WORLD_MAP.into()), diff --git a/world/examples/pricing_csv.rs b/world/examples/pricing_csv.rs index 26dd357d0f..e305c29c1e 100644 --- a/world/examples/pricing_csv.rs +++ b/world/examples/pricing_csv.rs @@ -9,7 +9,7 @@ use strum::IntoEnumIterator; use vek::Vec2; use veloren_world::{ index::Index, - sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP}, + sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP, DEFAULT_WORLD_SEED}, World, }; @@ -162,7 +162,7 @@ fn main() { println!("Loading world"); let pool = ThreadPoolBuilder::new().build().unwrap(); let (world, index) = World::generate( - 59686, + DEFAULT_WORLD_SEED, WorldOpts { seed_elements: true, world_file: FileOpts::LoadAsset(DEFAULT_WORLD_MAP.into()), diff --git a/world/examples/water.rs b/world/examples/water.rs index 4b2475713a..ebbf4a3f9a 100644 --- a/world/examples/water.rs +++ b/world/examples/water.rs @@ -15,7 +15,7 @@ use tracing_subscriber::{ }; use vek::*; use veloren_world::{ - sim::{self, get_horizon_map, sample_pos, sample_wpos, WorldOpts}, + sim::{self, get_horizon_map, sample_pos, sample_wpos, WorldOpts, DEFAULT_WORLD_SEED}, util::Sampler, ColumnSample, World, CONFIG, }; @@ -43,7 +43,7 @@ fn main() { _map_file.push(map_file); let (world, index) = World::generate( - 5284, + DEFAULT_WORLD_SEED, WorldOpts { seed_elements: false, world_file: sim::FileOpts::LoadAsset(sim::DEFAULT_WORLD_MAP.into()), diff --git a/world/examples/world_block_statistics.rs b/world/examples/world_block_statistics.rs index 551bfa688d..6d597e5905 100644 --- a/world/examples/world_block_statistics.rs +++ b/world/examples/world_block_statistics.rs @@ -21,7 +21,7 @@ use std::{ }; use vek::*; use veloren_world::{ - sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP}, + sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP, DEFAULT_WORLD_SEED}, World, }; @@ -63,7 +63,7 @@ fn generate(db_path: &str, ymin: Option, ymax: Option) -> Result<(), B println!("Loading world"); let pool = ThreadPoolBuilder::new().build().unwrap(); let (world, index) = World::generate( - 59686, + DEFAULT_WORLD_SEED, WorldOpts { seed_elements: true, world_file: FileOpts::LoadAsset(DEFAULT_WORLD_MAP.into()), diff --git a/world/examples/world_generate_time.rs b/world/examples/world_generate_time.rs index 7292a2cf32..bcbd622a23 100644 --- a/world/examples/world_generate_time.rs +++ b/world/examples/world_generate_time.rs @@ -1,6 +1,6 @@ use std::time::Instant; use veloren_world::{ - sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP}, + sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP, DEFAULT_WORLD_SEED}, World, }; @@ -9,7 +9,7 @@ fn main() { let start = Instant::now(); let (world, index) = World::generate( - 0, + DEFAULT_WORLD_SEED, WorldOpts { seed_elements: true, // Load default map from assets. diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index ff2acb27b9..eb814e516e 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -560,7 +560,25 @@ pub type ModernMap = WorldMap_0_7_0; /// TODO: Consider using some naming convention to automatically change this /// with changing versions, or at least keep it in a constant somewhere that's /// easy to change. -pub const DEFAULT_WORLD_MAP: &str = "world.map.veloren_0_9_0_0"; +// Generation parameters: +// +// gen_opts: ( +// erosion_quality: 1.0, +// map_kind: Circle, +// scale: 2.098048498703866, +// x_lg: 10, +// y_lg: 10, +// ) +// seed: 469876673 +// +// The biome seed can found below +pub const DEFAULT_WORLD_MAP: &str = "world.map.veloren_0_16_0_0"; +/// This is *not* the seed used to generate the default map, this seed was used +/// to generate a better set of biomes on it as the original ones were +/// unsuitable. +/// +/// See DEFAULT_WORLD_MAP to get the original worldgen parameters. +pub const DEFAULT_WORLD_SEED: u32 = 1948292704; impl WorldFileLegacy { #[inline] diff --git a/world/src/site/economy/context.rs b/world/src/site/economy/context.rs index 9cf07f69ee..54a00bca45 100644 --- a/world/src/site/economy/context.rs +++ b/world/src/site/economy/context.rs @@ -336,7 +336,7 @@ mod tests { execute_with_tracing(Level::INFO, || { let threadpool = rayon::ThreadPoolBuilder::new().build().unwrap(); info!("init"); - let seed = 59686; + let seed = sim::DEFAULT_WORLD_SEED; let opts = sim::WorldOpts { seed_elements: true, world_file: sim::FileOpts::LoadAsset(sim::DEFAULT_WORLD_MAP.into()), @@ -362,7 +362,7 @@ mod tests { execute_with_tracing(Level::INFO, || { let threadpool = rayon::ThreadPoolBuilder::new().build().unwrap(); info!("init"); - let seed = 59686; + let seed = sim::DEFAULT_WORLD_SEED; let opts = sim::WorldOpts { seed_elements: true, world_file: sim::FileOpts::LoadAsset(sim::DEFAULT_WORLD_MAP.into()), @@ -502,7 +502,7 @@ mod tests { execute_with_tracing(Level::ERROR, || { let threadpool = rayon::ThreadPoolBuilder::new().build().unwrap(); info!("init"); - let seed = 59686; + let seed = sim::DEFAULT_WORLD_SEED; let opts = sim::WorldOpts { seed_elements: true, world_file: sim::FileOpts::LoadAsset(sim::DEFAULT_WORLD_MAP.into()),