shudnal / Seasons

Valheim mod. Adds seasons system.
The Unlicense
3 stars 2 forks source link

Seasons

Four customizable seasons.

If you feel impact on fps.

If you do then probably you GPU can do better. Try setting launch options -gfx-enable-gfx-jobs -gfx-enable-native-gfx-jobs in Valheim general settings at Steam.

It unlocks more GPU power available to the game which could help. It's more handy than editing boot.config file. It won't harm at least.

If you use RenderLimits mod and have "Distance area" setting more than 10 it may cause noticable fps loss at tree heavy areas. It couldn't be optimized further using only tools available for mods.

What can be customized in different seasons

Configurating the mod

The mod have general settings done by usual config through bepinex.

Custom settings

Custom seasonal settings are done by creating/changing JSON files.

The mod creates a directory "shudnal.Seasons" at bepinex/config folder. There is the storage of cache, default and custom settings.

Default settings

On every launch the mod is generating "Default settings" folder at config folder. There is storage of files with mod's default values to be applied.

Mod creates \BepInEx\config\shudnal.Seasons\Default settings directory on every world load. So you need to launch a world at least once after mod was installed.

Texture recoloring

The mods comes without built-in textures and generate them on the first launch. You can change cache settings as you pleased if you don't like the defaults. Cache settings will be synced from the server on log in.

The textures and rules for applying them to objects are stored at \BepInEx\cache\shudnal.Seasons folder. By default cache is saved as nonhumanreadable binary file for further faster loads. It can also be saved as JSON and PNG files.

The rules for cache forming are stored at "Cache settings" folder in config folder. The list of the objects comes from prefab, clutter and locations list after ZoneSystem.Start. Due to procedural generation of objects textures if the game have custom assets loaded at that moment they will be tried to recolored the same way as the default game's assets.

You can replace generated textures with your own ones.

The main idea of the mod is only to change vanilla colors without changing other parts of object appearance.

Recoloring settings

Seasonal settings

Basic seasonal settings are located in JSON files: Spring.json, Summer.json, Fall.json, Winter.json. Files with default settings are located in "Default settings" folder. Mod creates \BepInEx\config\shudnal.Seasons\Default settings directory on every world load. So you need to launch a world at least once after mod was installed.

To start making custom changes you should copy the corresponding file to config folder "shudnal.Seasons". When you change the file there should be "[Info : Seasons] Settings updated: Season_Name" line in the bepinex console and LogOutput.log file.

Every property not represented in the custom file will fall to default value from "Default settings" seasonal file. It means you may left only changed values at custom file to make it more meaningful.

Settings descriptions

Some explanations and ideas behind default settings

Seasonal environments

There are files with unloaded vanilla environments "Default environments.json" (basically vanilla weather list) and biome environments "Default biome environments.json" (distribution between biomes). This files are for informational purposes only. To get an idea behind vanilla weather and to further copy that weather to customize.

Environment

The structure of the environment reflects adapted ingame environment settings. The most useful to change vanilla environment properties:

Custom properties:

Biome environments

The structure of the biome environment reflects adapted ingame biome environment settings. Customized biome environment settings:

Weather are chosed from environments list based on pseudorandom value common to all clients.

Custom environments

File "Custom environments.json" contains default custom environments being added to environment list. Basically it's the list of new weather.

Properties in that file are similar to Environment while only changed one are presented.

There are seasonal variants of vanilla weather mostly.

Custom music

Place music files into "...\BepInEx\config\shudnal.Seasons\Custom music" folder.

Any media track that Unity Engine can read will be loaded into music and will be available to use in custom environments.

For example track "runichills.mp3" will be loaded as "runichills" music track.

To set custom music track settings create file with .json extension and the same name as music track.

For example track "runichills.mp3" can have "runichills.json" settings file otherwise default settings is used.

Paste code in *.json file you created (this is default settings)

{
  "m_enabled": true,
  "m_volume": 1.0,
  "m_fadeInTime": 3.0,
  "m_alwaysFadeout": false,
  "m_loop": true,
  "m_resume": true,
  "m_ambientMusic": true
}

Both music tracks and json settings file should be shared with all clients via modpack or manually. Otherwise the music just will not be played.

Custom biome environments

File "Custom Biome Environments.json" contains default custom environments and their distribution between seasons.

Environments set in property "add" will be added to m_environments list in vanilla Biome environments. Environments set in property "replace" will be replace set "m_environment" with the same weight in m_environments list in vanilla Biome environments. Environments set in property "remove" will be completely removed from biome environment.

Use Add to add completely new weather to the biome environment. Use Replace if you made some seasonal variant of the weather (like changing particle system from "Rain" to "Snow" in "LightRain" Meadows weather means what used to be rainy weather becomes snowy weather without other parameters to be changed) Use Remove to get rid of some weather.

Some explanations and ideas behind default settings

Random events

Default vanilla randon events are saved in "Default events.json". They represent the name of the event and biome distribution. Weight value can be ignored. This file is for informational purposes only to copy event name and biomes.

Custom events

File "Custom events.json" contains default custom events and their distribution between seasons. Every other settings have no meaningful purpose in seasonal logic hence were omitted.

Event structure:

That parameters only counts when possible events are being selected.

Some explanations and ideas behind default settings

That way overall raids should be balanced and immersive.

Custom lightings

File "Custom lightings.json" contains default custom lighting settings and their distribution between seasons.

There are distinct luminance and fog density settings for morning, day, evening, night and indoors. "luminanceMultiplier" controls the luminance component of HSL color model of environment lightings. "fogDensityMultiplier" control how much the "air" itself will block lights.

You better test it yourself to find out how it actually looks.

Settings "lightIntensityDayMultiplier" and "lightIntensityNightMultiplier" controls how much light will come from sun and moon. Less luminanceMultiplier and more lightIntensityNightMultiplier makes nights more realistic, moonlit swamp looks terrific.

Some explanations and ideas behind default settings

Custom stats

File "Custom stats.json" contains default custom stats settings and their distribution between seasons.

Current stats tooltip will be shown in almanac to see actual effect. Reopen the almanac after background stats config was changed.

Stats file structure reflects vanilla SE_Stats status effect which has properties:

Damage types

Damage modifiers

Some explanations and ideas behind default settings

Custom trader items

File "Custom trader items.json" contains default custom trader items and their distribution between seasons.

Items can be customized distinctly between seasons and traders. You can use custom traders names.

You can adapt items list from https://valheim.thunderstore.io/package/shudnal/TradersExtended/ as it shares the item structure.

Trader names

You can use different names of the same trader. Case insensitive

Trader item

The structure of the trader item reflects adapted ingame tradeable item description:

Some explanations and ideas behind default settings

Grass control

If you ever used grass tweaks mods you should be familiar with that settings.

You can set default grass settings in "Season - Grass" section in general mod config.

Settings change will be applied on the fly to see effect immediately.

File "Custom grass settings.json" contains distribution of grass settings between days and seasons.

Grass settings depends on day and grass settings will be interpolated between two settings.

For example if scaleMax is set 1.1 in day 1 and 1.3 in day 5 it means intermediate values will be

The same logic works for other values. If value is not set it takes default value set in general settings.

Grass settings

Some explanations and ideas behind default settings

Seasonal clutter

There is 3 new clutter prefabs:

By default that prefabs are only enabled in Spring adding some heavily needed flavor.

File "Custom clutter settings.json" contains seasonal clutter distribution settings between seasons.

You can add your own clutter using other mods and control its seasonal state through that file.

Seasonal clutter settings

Custom textures

Custom textures could be placed in \BepInEx\config\shudnal.Seasons\Custom textures folder.

Mod comes with some predefined default textures. It will be placed in \BepInEx\config\shudnal.Seasons\Custom textures\Defaults folder. Default textures will be overwritten after mod version change.

If you want to make changes to default textures then copy needed folder into \BepInEx\config\shudnal.Seasons\Custom textures.

Folders inside of \BepInEx\config\shudnal.Seasons\Custom textures folder should be named as texture name. If different objects use the same texture it will be replaced for all of them.

To find what texture name is you should set general config option "Test - Cache format" to "SaveBothLoadBinary" and rebuild the cache (by running console command or just deleting old one in \BepInEx\cache\shudnal.Seasons).

After that new cache folder will form with files cache.json and cache.bin and textures folder. Cache.json consists of all objects and their materials and color that will be replaced.

In that file you can find prefab and texture number which corresponds with folder in "texture\" directory.

In that texture directory you can find file with name ending on ".orig.png". That is the name of texture you want to replace.

Texture numbers could be generated differently on every cache build.

Files inside of texture folder corresponds with season and variant. Naming convention is Season_Number.png. Your textures should be named accordingly.

Example

You want to replace winter texture of Beech.

Find your current cache revision folder. It's located in \BepInEx\cache\shudnal.Seasons folder and named as cache revision number. To get your current cache revision number you can enable logging and look for it in log file. Or simply delete every other folder and rebuild cache.

Most recent folder will be your current cache folder. In that example it's 2054891382. Go inside.

Open cache.json file and look for beech prefab name. You can find its name on Jotunn's prefab list or using RuntimeUnityEditor.

In that case there are three beech prefabs in cache.json.

Beech_Sapling, Beech_small1 and Beech_small2 shares the same texture with number 112892 (your number might be different).

Beech1 have material beech_leaf and its _MainTex (main texture) with number 171264. There are also bark material and _MossTex. It should be ignored.

So we take number 171264 and go into \BepInEx\cache\shudnal.Seasons\2054891382\textures\171264 folder. There are set of seasonal files, properties.json file and beech_leaf.orig.png file. Last file is original texture used in vanilla game. Original texture file name convention is {Texture name}.orig.png so our texture name will be beech_leaf.

Now we create new folder in \BepInEx\config\shudnal.Seasons\Custom textures and name it beech_leaf.

For that example we take file Winter_1.png from \BepInEx\cache\shudnal.Seasons\2054891382\textures\171264 folder to \BepInEx\config\shudnal.Seasons\Custom textures\beech_leaf.

You can now edit that file as you wish. It will be loaded as Winter variant number 1 for Beech1 prefab in game.

Any changes done to that file will be applied on the fly.

Only textures appeared in cache.json file could be replaced.

Custom biome settings

File "Custom biome settings.json" contains settings for biome terrain color seasonal override and winter colors for minimap.

Changes made to terrain colors requires change of current season to get effect. You can simply override and change season in general config section "Season - Override".

Changes made to winter minimap colors requires world restart.

Seasonal ground colors

Winter colors

Being set as pairs "Biome": "Color Hex Code".

Vanilla winter colors made by interpolating original biome color to "#FAFAFF" preserving original alpha channel. #FAFAFF also called Ghost White and it's not just white color but has a bit snowy tint.

Some explanations and ideas behind default settings

General settings

Custom world settings for realtime seasons calculations

File "Custom world settings.json" contains example entry of custom world settings.

You can set start time in UTC timezone and the day length in seconds. Your world name should be equal the set world name in settings for them to activate.

If the world setting is set then seasons will be calculated from set datetime using current UTC time, set daylength in seconds and days in season from season settings.

That way you will not have an option to change season on the sleep. Season will change when time is come.

For example you can

It will mean your world has week long seasons starting from set Monday.

Seasonal buff icon replacement

You can place files in the config folder to replace current buff icon (restart required):

Seasonal global key

You can enable setting of season related server wide global key. It's disabled by default. You can customize the key in case you need it.

Default seasonal keys:

Installation (manual)

extract Seasons folder to your BepInEx\Plugins\ folder

Configurating

The best way to handle configs is Configuration Manager.

Or Official BepInEx Configuration Manager.

Mirrors

Nexus

Thunderstore