New default singleplayer world

This commit is contained in:
crabman 2024-03-28 09:32:59 +00:00
parent b2e38d7e6d
commit 8c7f99371b
No known key found for this signature in database
17 changed files with 50 additions and 29 deletions

View File

@ -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). - Dropped items now merge dynamically (including non-stackables).
- You no longer need to unlock health, energy and roll skills to get to max. - 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. - Rolls now don't skip recovery, and instead have increased buildup during ability interrupts.
- Changed default world map
### Removed ### Removed

BIN
assets/world/map/veloren_0_16_0_0.bin (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -146,7 +146,7 @@ use crate::{chat::ChatCache, persistence::character_loader::CharacterScreenRespo
use common::comp::Anchor; use common::comp::Anchor;
#[cfg(feature = "worldgen")] #[cfg(feature = "worldgen")]
pub use world::{ pub use world::{
sim::{FileOpts, GenOpts, WorldOpts, DEFAULT_WORLD_MAP}, sim::{FileOpts, GenOpts, WorldOpts, DEFAULT_WORLD_MAP, DEFAULT_WORLD_SEED},
IndexOwned, World, IndexOwned, World,
}; };

View File

@ -30,11 +30,10 @@ use std::{
path::{Path, PathBuf}, path::{Path, PathBuf},
}; };
use tracing::{error, warn}; use tracing::{error, warn};
use world::sim::FileOpts; use world::sim::{FileOpts, DEFAULT_WORLD_SEED};
use self::server_description::ServerDescription; use self::server_description::ServerDescription;
const DEFAULT_WORLD_SEED: u32 = 230;
const CONFIG_DIR: &str = "server_config"; const CONFIG_DIR: &str = "server_config";
const SETTINGS_FILENAME: &str = "settings.ron"; const SETTINGS_FILENAME: &str = "settings.ron";
const WHITELIST_FILENAME: &str = "whitelist.ron"; const WHITELIST_FILENAME: &str = "whitelist.ron";

View File

@ -15,7 +15,7 @@ pub fn criterion_benchmark(c: &mut Criterion) {
let pool = rayon::ThreadPoolBuilder::new().build().unwrap(); let pool = rayon::ThreadPoolBuilder::new().build().unwrap();
// Generate chunks here to test // Generate chunks here to test
let (world, index) = World::generate( let (world, index) = World::generate(
42, sim::DEFAULT_WORLD_SEED,
sim::WorldOpts { sim::WorldOpts {
// NOTE: If this gets too expensive, we can turn it off. // 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 // TODO: Consider an option to turn off all erosion as well, or even provide altitude

View File

@ -6,7 +6,7 @@ use std::{
use common::{assets::ASSETS_PATH, consts::DAY_LENGTH_DEFAULT}; use common::{assets::ASSETS_PATH, consts::DAY_LENGTH_DEFAULT};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use server::{FileOpts, GenOpts, DEFAULT_WORLD_MAP}; use server::{FileOpts, GenOpts, DEFAULT_WORLD_MAP, DEFAULT_WORLD_SEED};
use tracing::error; use tracing::error;
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Deserialize, Serialize)]
@ -84,7 +84,7 @@ fn migrate_old_singleplayer(from: &Path, to: &Path) {
return; return;
} }
let mut seed = 0; let mut seed = DEFAULT_WORLD_SEED;
let mut day_length = DAY_LENGTH_DEFAULT; let mut day_length = DAY_LENGTH_DEFAULT;
let (map_file, gen_opts) = fs::read_to_string(to.join("server_config/settings.ron")) let (map_file, gen_opts) = fs::read_to_string(to.join("server_config/settings.ron"))
.ok() .ok()
@ -238,7 +238,7 @@ impl SingleplayerWorlds {
name: "New World".to_string(), name: "New World".to_string(),
gen_opts: None, gen_opts: None,
day_length: DAY_LENGTH_DEFAULT, day_length: DAY_LENGTH_DEFAULT,
seed: 0, seed: DEFAULT_WORLD_SEED,
is_generated: false, is_generated: false,
map_path: path.join("map.bin"), map_path: path.join("map.bin"),
path, path,

View File

@ -3,14 +3,14 @@ use criterion::{black_box, criterion_group, criterion_main, Criterion};
use rayon::ThreadPoolBuilder; use rayon::ThreadPoolBuilder;
use veloren_world::{ use veloren_world::{
layer, layer,
sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP}, sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP, DEFAULT_WORLD_SEED},
CanvasInfo, Land, World, CanvasInfo, Land, World,
}; };
fn cave(c: &mut Criterion) { fn cave(c: &mut Criterion) {
let pool = ThreadPoolBuilder::new().build().unwrap(); let pool = ThreadPoolBuilder::new().build().unwrap();
let (world, index) = World::generate( let (world, index) = World::generate(
230, DEFAULT_WORLD_SEED,
WorldOpts { WorldOpts {
seed_elements: true, seed_elements: true,
world_file: FileOpts::LoadAsset(DEFAULT_WORLD_MAP.into()), world_file: FileOpts::LoadAsset(DEFAULT_WORLD_MAP.into()),

View File

@ -6,14 +6,14 @@ use veloren_world::{
self, self,
cave::{Biome, LAYERS}, cave::{Biome, LAYERS},
}, },
sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP}, sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP, DEFAULT_WORLD_SEED},
CanvasInfo, Land, World, CanvasInfo, Land, World,
}; };
fn main() { fn main() {
let pool = ThreadPoolBuilder::new().build().unwrap(); let pool = ThreadPoolBuilder::new().build().unwrap();
let (world, index) = World::generate( let (world, index) = World::generate(
230, DEFAULT_WORLD_SEED,
WorldOpts { WorldOpts {
seed_elements: true, seed_elements: true,
world_file: FileOpts::LoadAsset(DEFAULT_WORLD_MAP.into()), world_file: FileOpts::LoadAsset(DEFAULT_WORLD_MAP.into()),

View File

@ -29,7 +29,7 @@ use tracing::{debug, trace};
use vek::*; use vek::*;
use veloren_world::{ use veloren_world::{
civ::SiteKind, civ::SiteKind,
sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP}, sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP, DEFAULT_WORLD_SEED},
World, World,
}; };
@ -682,7 +682,7 @@ fn main() {
common_frontend::init_stdout(None); common_frontend::init_stdout(None);
println!("Loading world"); println!("Loading world");
let (world, index) = World::generate( let (world, index) = World::generate(
59686, DEFAULT_WORLD_SEED,
WorldOpts { WorldOpts {
seed_elements: true, seed_elements: true,
world_file: FileOpts::LoadAsset(DEFAULT_WORLD_MAP.into()), world_file: FileOpts::LoadAsset(DEFAULT_WORLD_MAP.into()),

View File

@ -12,7 +12,7 @@ use common::{
use rayon::ThreadPoolBuilder; use rayon::ThreadPoolBuilder;
use vek::{Vec2, Vec3}; use vek::{Vec2, Vec3};
use veloren_world::{ use veloren_world::{
sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP}, sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP, DEFAULT_WORLD_SEED},
site2::{plot::PlotKind, Fill, Structure}, site2::{plot::PlotKind, Fill, Structure},
CanvasInfo, Land, World, CanvasInfo, Land, World,
}; };
@ -25,7 +25,7 @@ fn main() -> Result {
let pool = ThreadPoolBuilder::new().build().unwrap(); let pool = ThreadPoolBuilder::new().build().unwrap();
println!("Loading world"); println!("Loading world");
let (world, index) = World::generate( let (world, index) = World::generate(
59686, DEFAULT_WORLD_SEED,
WorldOpts { WorldOpts {
seed_elements: true, seed_elements: true,
world_file: FileOpts::LoadAsset(DEFAULT_WORLD_MAP.into()), world_file: FileOpts::LoadAsset(DEFAULT_WORLD_MAP.into()),

View File

@ -6,7 +6,7 @@ use rayon::ThreadPoolBuilder;
use std::{fs::File, io::Write}; use std::{fs::File, io::Write};
use vek::*; use vek::*;
use veloren_world::{ use veloren_world::{
sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP}, sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP, DEFAULT_WORLD_SEED},
Land, World, Land, World,
}; };
@ -120,7 +120,7 @@ fn main() {
let pool = ThreadPoolBuilder::new().build().unwrap(); let pool = ThreadPoolBuilder::new().build().unwrap();
println!("Loading world"); println!("Loading world");
let (world, _index) = World::generate( let (world, _index) = World::generate(
59686, DEFAULT_WORLD_SEED,
WorldOpts { WorldOpts {
seed_elements: true, seed_elements: true,
world_file: FileOpts::LoadAsset(DEFAULT_WORLD_MAP.into()), world_file: FileOpts::LoadAsset(DEFAULT_WORLD_MAP.into()),

View File

@ -9,7 +9,7 @@ use strum::IntoEnumIterator;
use vek::Vec2; use vek::Vec2;
use veloren_world::{ use veloren_world::{
index::Index, index::Index,
sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP}, sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP, DEFAULT_WORLD_SEED},
World, World,
}; };
@ -162,7 +162,7 @@ fn main() {
println!("Loading world"); println!("Loading world");
let pool = ThreadPoolBuilder::new().build().unwrap(); let pool = ThreadPoolBuilder::new().build().unwrap();
let (world, index) = World::generate( let (world, index) = World::generate(
59686, DEFAULT_WORLD_SEED,
WorldOpts { WorldOpts {
seed_elements: true, seed_elements: true,
world_file: FileOpts::LoadAsset(DEFAULT_WORLD_MAP.into()), world_file: FileOpts::LoadAsset(DEFAULT_WORLD_MAP.into()),

View File

@ -15,7 +15,7 @@ use tracing_subscriber::{
}; };
use vek::*; use vek::*;
use veloren_world::{ 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, util::Sampler,
ColumnSample, World, CONFIG, ColumnSample, World, CONFIG,
}; };
@ -43,7 +43,7 @@ fn main() {
_map_file.push(map_file); _map_file.push(map_file);
let (world, index) = World::generate( let (world, index) = World::generate(
5284, DEFAULT_WORLD_SEED,
WorldOpts { WorldOpts {
seed_elements: false, seed_elements: false,
world_file: sim::FileOpts::LoadAsset(sim::DEFAULT_WORLD_MAP.into()), world_file: sim::FileOpts::LoadAsset(sim::DEFAULT_WORLD_MAP.into()),

View File

@ -21,7 +21,7 @@ use std::{
}; };
use vek::*; use vek::*;
use veloren_world::{ use veloren_world::{
sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP}, sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP, DEFAULT_WORLD_SEED},
World, World,
}; };
@ -63,7 +63,7 @@ fn generate(db_path: &str, ymin: Option<i32>, ymax: Option<i32>) -> Result<(), B
println!("Loading world"); println!("Loading world");
let pool = ThreadPoolBuilder::new().build().unwrap(); let pool = ThreadPoolBuilder::new().build().unwrap();
let (world, index) = World::generate( let (world, index) = World::generate(
59686, DEFAULT_WORLD_SEED,
WorldOpts { WorldOpts {
seed_elements: true, seed_elements: true,
world_file: FileOpts::LoadAsset(DEFAULT_WORLD_MAP.into()), world_file: FileOpts::LoadAsset(DEFAULT_WORLD_MAP.into()),

View File

@ -1,6 +1,6 @@
use std::time::Instant; use std::time::Instant;
use veloren_world::{ use veloren_world::{
sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP}, sim::{FileOpts, WorldOpts, DEFAULT_WORLD_MAP, DEFAULT_WORLD_SEED},
World, World,
}; };
@ -9,7 +9,7 @@ fn main() {
let start = Instant::now(); let start = Instant::now();
let (world, index) = World::generate( let (world, index) = World::generate(
0, DEFAULT_WORLD_SEED,
WorldOpts { WorldOpts {
seed_elements: true, seed_elements: true,
// Load default map from assets. // Load default map from assets.

View File

@ -560,7 +560,25 @@ pub type ModernMap = WorldMap_0_7_0;
/// TODO: Consider using some naming convention to automatically change this /// TODO: Consider using some naming convention to automatically change this
/// with changing versions, or at least keep it in a constant somewhere that's /// with changing versions, or at least keep it in a constant somewhere that's
/// easy to change. /// 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 { impl WorldFileLegacy {
#[inline] #[inline]

View File

@ -336,7 +336,7 @@ mod tests {
execute_with_tracing(Level::INFO, || { execute_with_tracing(Level::INFO, || {
let threadpool = rayon::ThreadPoolBuilder::new().build().unwrap(); let threadpool = rayon::ThreadPoolBuilder::new().build().unwrap();
info!("init"); info!("init");
let seed = 59686; let seed = sim::DEFAULT_WORLD_SEED;
let opts = sim::WorldOpts { let opts = sim::WorldOpts {
seed_elements: true, seed_elements: true,
world_file: sim::FileOpts::LoadAsset(sim::DEFAULT_WORLD_MAP.into()), world_file: sim::FileOpts::LoadAsset(sim::DEFAULT_WORLD_MAP.into()),
@ -362,7 +362,7 @@ mod tests {
execute_with_tracing(Level::INFO, || { execute_with_tracing(Level::INFO, || {
let threadpool = rayon::ThreadPoolBuilder::new().build().unwrap(); let threadpool = rayon::ThreadPoolBuilder::new().build().unwrap();
info!("init"); info!("init");
let seed = 59686; let seed = sim::DEFAULT_WORLD_SEED;
let opts = sim::WorldOpts { let opts = sim::WorldOpts {
seed_elements: true, seed_elements: true,
world_file: sim::FileOpts::LoadAsset(sim::DEFAULT_WORLD_MAP.into()), world_file: sim::FileOpts::LoadAsset(sim::DEFAULT_WORLD_MAP.into()),
@ -502,7 +502,7 @@ mod tests {
execute_with_tracing(Level::ERROR, || { execute_with_tracing(Level::ERROR, || {
let threadpool = rayon::ThreadPoolBuilder::new().build().unwrap(); let threadpool = rayon::ThreadPoolBuilder::new().build().unwrap();
info!("init"); info!("init");
let seed = 59686; let seed = sim::DEFAULT_WORLD_SEED;
let opts = sim::WorldOpts { let opts = sim::WorldOpts {
seed_elements: true, seed_elements: true,
world_file: sim::FileOpts::LoadAsset(sim::DEFAULT_WORLD_MAP.into()), world_file: sim::FileOpts::LoadAsset(sim::DEFAULT_WORLD_MAP.into()),