JereKuusela / valheim-expand_world_data

The Unlicense
2 stars 1 forks source link

Expand World Data

Allows adding new biomes and changing most of the world generation.

Always back up your world before making any changes!

Install on all clients and on the server (modding guide).

Features

For example you can create entirely flat worlds with only Meadows for building. Or group up colder biomes up north while more warmer biomes end up in the other side. Or just have a world with terrain shapes no one has ever seen before.

Tutorials

Configuration

Settings are automatically reloaded (consider using Configuration manager). This can lead to weird behavior so it's recommended to make a fresh world after you are done configuring.

Note: Pay extra attention when loading old worlds. Certain configurations can cause alter the terrain significantly and destroy your buildings.

Server side

This mod can be used server only, without requiring clients to have it. However only following files can be configured:

When doing this, enable Server only on the config to remove version check.

Ashlands & Deep North

Ashlands and Deep North have special terrain features that can be modified in the config.

Terrain is lowered before Ashland and Deep North to make Ocean appear. This can be disabled with settings "Ashlands gap" and "Deep North gap".

Ashlands terrain is limited by the position. This can be fully disabled with setting ""Restrict Ashlands position" or modified with settings "Ashlands length restriction" and "Ashlands width restriction".

Note: The same settings exist in Expand World Size mod. Only change these settings in one of the mods.

Data

This mod provides additional configuration files (.yaml) that can be used to change most world generation related data.

These files are generated automatically to the config/expand_world folder when loading a world (unless they already exist).

Each file can be disabled from the main .cfg file to improve compatibility and performance (less network usage and processing when joining the server).

Data can be split to multiple files. The files are loaded alphabetically in reverse order. For example expand_biomes_custom.yaml would be loaded first and then expand_biomes.yaml.

Note: Some files are server side only. Use single player for testing so that your client has access to all of the information. Mods that cause clients to regenerate dungeons or locations may not work correctly.

Note: Some files automatically add missing entries to add new content automatically. If you want to remove entries, set enabled to false instead. Automatic data migration can be disabled from the config.

Note: Editing files automatically reloads them. This can be disabled from the config (requires restart to take effect). If disabled, the world must be reloaded to load any changes.

Blueprints

Dungeons, locations and vegetation support using blueprints to spawn multiple objects. Both PlanBuild .blueprint and BuildShare .vbuild files are supported (however PlanBuild files are preferred).

The file format is slightly modified from the usual:

Biomes

The file expand_biomes.yaml sets available biomes and their configuration.

You can add up to 23 new biomes (on top of the 9 default ones).

Note: The game assigns a number for each biome. If some mods don't recognize new biomes you can try using the number instead. The first new biome gets number 1024 which is doubled for each new biome (2nd biome is 2048, 3rd biome is 4096, etc).

World

The file expand_world.yaml sets the biome distribution.

Each entry in the file adds a new rule. When determing the biome, the rules are checked one by one from the top until a valid rule is found. This means the order of entries is especially important for this file.

Note: The world edge is always ocean. This is currently hardcoded.

Amount

Technically the amount is not a percentage but something closer to a normal distribution.

Manual testing with ew_biomes command has given these rough values:

For example if you want to replace 25% of Plains with a new biome you can calculate 0.6 -> 64 % -> 64 % * 0.25 = 16 % -> 0.35. So you would put 0.35 (or 0.36) to the amount of the new biome.

Note: The amount is of the total world size, not of the remaining area. If two biomes have the same seed then their areas will overlap which can lead to unexpected results.

For example if the new biome is a variant of Plains then there is no need to reduce the amount of Plains because the new biome only exists where they would have been Plains.

If the seeds are different, then Plains amount can be calculated with 0.6 -> 64 % -> 64 % * (1 - 0.25) / (1 - 0.16) = 57 % -> 0.56.

Sectors

Sectors start at the south and increase towards clock-wise direction. So that:

Note: Of course any number is valid for sectors. Like from 0.37 to 0.62.

Environments

The file expand_environments.yaml sets the available weathers. Command ew_musics can be used to print available musics.

Note: As you can see, lots of values have unknown meaning. Probably better to look at the existing environments for inspiration.

Clutter

The file expand_clutter.yaml sets the small visual objects.

Locations

The file expand_locations.yaml sets the available locations and their placement. This is a server side feature, clients don't have access to this data.

Note: Missing locations are automatically added to the file. To disable, set enabled to false instead of removing anything.

Note: Each zone (64m x 64m) can only have one size.

See the wiki for more info.

See examples.

Locations are pregenerated at world generation. You must use genloc command to redistribute them on unexplored areas after making any changes. For already explored areas, you need to use Upgrade World mod.

Dungeons

The file expand_dungeons.yaml sets dungeon generators. This is a server side feature, clients don't have access to this data.

Command ew_dungeons can be used to list available rooms for each dungeon.

Rooms

The file expand_rooms.yaml sets available dungeon rooms. This is a server side feature, clients don't have access to this data.

See examples.

New rooms can be created from blueprints or cloning an existing room by adding :suffix to the name.

Vegetation

The file expand_vegetations.yaml sets the generated objects. This is a server side feature, clients don't have access to this data.

Changes only apply to unexplored areas. Upgrade World mod can be used to reset areas.

Note: Missing vegetation are automatically added to the file. To disable, set enabled to false instead of removing anything.

Custom objects

New objects can be added to locations, dungeon rooms and zone spawners (creature spawns) by using the objects field.

The objects are added relative to the spawn or location center.

  - objects:
    # Format is:
    - id, posX,posZ,posY, rotY,rotX,rotZ, scaleX,scaleZ,scaleY, chance, data
    # Adds a mushroom at the center to visually show where it is.
    - GlowingMushroom, 0,0,0
    # Adds a mushroom 20 meters away from the center that snaps to the ground.
    - GlowingMushroom, 20,0,snap
    # Adds a bigger mushroom if the first one wasn't big enough.
    - GlowingMushroom, 0,0,0 0,0,0 2,2,2
    # Adds a chest near the center with 90 degrees rotation that has a 50% chance to appear.
    - Chest, 5,0,0, 90,0,0, 1,1,1, 0.5
    # Adds a chest with specific data.
    # It's recommended to use the objectData field if possible (less typing).
    # However this can be used to override the objectData.
    - Chest, 5,0,0, 90,0,0, 1,1,1, 0.5, infinite_health

For the default objects, you can use commands ew_locations and ew_rooms to print location or room contents.

Object swaps

Objects in locations can be swapped to other objects by using the objectSwap field. This affects both original and custom objects.

Note: To prevent a custom object being swapped, use a dummy object and then create a swap for it. For example a custom object A would get swapped to object X, then use object D instead and swap it back to the object A.

Note: Objects can be removed by swapping to nothing.

  - objectSwap:
      # Swaps object A to object X.
      - idA, idX
      # Adds another swap for object A. The swap is randomly selected.
      # Total weight: 1 + 2 = 3.
      # 2 / 3 =  66% chance to select this swap.
      - idA:2, idY
      # Same as above but in a single line.
      - idB, idX, idY:2
      # Dummy swap. To add a custom object A, use object D instead and swap it back to A.
      - idD, idA
      # Swap object E to nothing.
      - idE,
      # Swap object F to nothing or object X (50% chance).
      - idF,,X

Object data

Initial object data in locations can be changed by using the objectData field. This affects both original, custom and blueprint objects.

Data is merged from multiple levels. The order is:

  1. all data from expand_locations.yaml or expand_vegetations.yaml.
  2. Object specific data from expand_locations.yaml or expand_vegetations.yaml.
  3. all data from expand_dungeons.yaml.
  4. Object specific data from expand_dungeons.yaml.
  5. all data from expand_rooms.yaml.
  6. Object specific data from expand_rooms.yaml.
  7. Blueprint or custom object data (the highest priority).

For example if the blueprint has infinite health then it can't be changed by using the objectData field. But other data could be set like wear from Structure Tweaks mod.

There are two ways to set data:

  1. Add a new entry to data.yaml with data save and use its name.
  2. Use data copy_raw to copy the raw data value.

See data documentation for more info.

  - objectData:
      # Sets all objects data to infinite_health.
      - all, infinite_health
      # Overrides idA health to default_health.
      - idA, default_health
      # Adds another possible object data for idA.
      # Total weight: 1 + 2 = 3.
      # 2 / 3 = 66% chance for infinite_health and 33% chance for default_health.
      - idA:2, infinite_health
      # Same for idB but in a single line.
      - idB, default_health, infinite_health:2

Status effects

Both the biome and the current environment can apply status effects to the player. Effects can be active during the day, night or both.

Each entry has following fields:

See examples.