Valheim
You are viewing a potentially older version of this package. View Latest Version
Install with App

Details

Date Uploaded
Downloads
792
Size
193KB
ADDatHost Valheim hosting
30% off

Forge Rework

A small BepInEx mod for Valheim's Forge of Potential. Successful attempts increase the item's current quality by one. Failed attempts consume the normal idol cost and leave the item unchanged: no destruction, downgrade, durability loss, or damaging failure explosion. Ordinary crafting and other crafting stations keep their normal behavior.

Multiplayer and server setup (v1.1.1)

Install Forge Rework 1.1.1 and Conditional Config Sync 1.0.9 or newer on the server and every player. Thunderstore installs the dependency automatically. For manual installation, include both DLLs from the Conditional Config Sync package in BepInEx/plugins. Do not install duplicate copies of Forge Rework.

The server controls all five Levels and Probabilities settings. Ordinary players cannot change the shared rules; server administrators can. This is fixed behavior, with no Lock Configuration toggle. These gameplay settings cannot be released to per-client ownership through sync policy. The mod is required on both sides; Peers older than v1.1.1 are incompatible. Solo play uses local settings normally.

Clients wait for initial configuration synchronization before refining. Server values temporarily override local settings; disconnecting restores local values. Configuration Manager edits apply live. When editing this mod's config file directly on a dedicated server, restart that server to apply changes.

This synchronizes and locks configuration; it is not anti-cheat. The upgrade roll, inventory change, and resource consumption still execute on the player's client. The server does not independently validate each refinement attempt.

Configuration

On first launch, BepInEx creates BepInEx/config/MerlinofMines.ForgeRework.cfg in the active profile. Settings also appear in BepInEx Configuration Manager. Changes made through Configuration Manager apply immediately. Restart after editing the file outside the game.

Levels use standard integer inputs. Min Level defaults to 0 and Max Level to 10; 0 disables the maximum-level cap. All probability settings use whole-number 0–100 sliders. Probability Dropoff Per Level is in percentage points: 10 means 10 percentage points per level. Old decimal values are rounded to the nearest whole number. Existing settings are migrated automatically to the new sections and names.

[Levels]
Min Level = 0
Max Level = 10

[Probabilities]
Max Probability = 100
Min Probability = 0
Probability Dropoff Per Level = 10

Percentages use 0–100, and dropoff is in percentage points per level.

chance = max(Min Probability, Max Probability - Probability Dropoff Per Level * max(0, currentQuality - Min Level))

Max Level is a separate hard cap on the resulting item quality. At or above it, attempts are disabled even if the curve still gives a positive percentage. Both the item status and disabled refinement button display MAX, either at the hard cap or when the success probability reaches zero. Those items also have greyed-out names and dimmed, visible icons in the forge list. They remain selectable so you can inspect them. Changing the curve refreshes the list, allowing items to become available again. Set it to 0 to disable the hard cap. A zero success chance still blocks attempts, without charging any resources. Existing items above the cap are left unchanged. Min Level controls where the dropoff begins, not the item's initial quality or eligibility. Below Min Level the odds stay at Max Probability.

Min Probability must not exceed Max Probability. Invalid combined settings disable refinement until corrected and produce a warning in the log.

Default probability preview

Level means current displayed item quality, not the number of forge upgrades. Level 0 is included to illustrate the formula; normal gear starts at quality 1.

Upgrade Success Unchanged on failure
0 → 1 100% 0%
1 → 2 90% 10%
2 → 3 80% 20%
3 → 4 70% 30%
4 → 5 60% 40%
5 → 6 50% 50%
6 → 7 40% 60%
7 → 8 30% 70%
8 → 9 20% 80%
9 → 10 10% 90%
10+ Blocked No cost

Destruction and downgrade chances are always 0%.

For a constant 25% success chance up to level 20, use Max Probability=25, Min Probability=25, Probability Dropoff Per Level=0, and Max Level=20. Level 19 → 20 has a 25% chance; level 20 → 21 is blocked. Alternatively, a falling curve such as 100% minus 10 points per level with a 20% floor and Max Level=15 gives:

Current level Success
4 60%
5 50%
6 40%
7 30%
8–14 20%
15+ Blocked

Build and try it

Requires .NET SDK 9, a local Valheim installation, BepInEx 5, and Conditional Config Sync 1.0.9+. The build references CCS from the profile's plugins folder; override its location with the MSBuild ConfigSyncPath property if needed.

.\build.ps1

This builds the mod, runs automated tests, verifies Harmony/private member bindings against the installed game, creates an importable ZIP in artifacts, and copies the package into the Thunderstore cache under MerlinofMines-ForgeRework/1.1.1. It also updates the installed copy in the ValheimVR profile, so subsequent builds do not require another import. Close Valheim before building, then launch it again to load the new DLL. Disabled mods are left disabled. Override GamePath, BepInExPath, CachePath or ProfilePath with script parameters; use -NoDeploy to build/package only.

A cache copy does not itself enable the mod in an existing profile. Import artifacts/MerlinofMines-ForgeRework-1.1.1.zip using Thunderstore Mod Manager's local-mod import, then launch the profile. Alternatively copy ForgeRework.dll into that profile's BepInEx/plugins/ForgeRework folder. Do not install two copies. Confirm Forge Rework loaded appears in the BepInEx log.

Validation

dotnet run --project tests/ForgeRework.Tests.csproj -c Release
.\tests\Verify-GameBindings.ps1

Tests exercise the actual probability and game-adapter source with minimal game doubles: deterministic roll distributions, exact RNG endpoints, invalid settings, hard caps with positive minimum odds, costs, item preservation, ordinary crafting pass-through, and displayed odds. Binding checks inspect the installed game's assembly. These do not execute Unity or prove compatibility with other mods.

Built against the locally installed Valheim 1.0.20. In-game verification remains:

  • Check level-4 gear displays only Chance To Upgrade: 60%.
  • Attempt refinement and check idol consumption, unchanged failures, and +1 successes.
  • Test with a full inventory; no free slots are needed for broken-item refunds.
  • Set a positive floor and a low Max Level; verify the cap still blocks attempts.
  • Check a normal workbench/forge still crafts and upgrades normally.

Multiplayer release verification still requires a dedicated server and clients:

  • Join with deliberately different local settings; confirm the server's five values and displayed odds win.
  • Try editing settings as a non-admin; confirm edits are rejected. Change values as an admin and check both clients update.
  • Attempt connections without Forge Rework, with v1.0.0, and with a compatible v1.1.1 install; only compatible peers should join.
  • Disconnect, verify original local settings in solo play, then reconnect to a server with different rules.
  • Test player-hosted games and headless dedicated startup, plus an attempt queued during a settings change.

Automated tests cover our sync registration, readiness gates, batched curve updates, invalid-state handling, and disconnect callbacks using a transport double. They do not prove the dependency's live network handshake or configuration transport.

Successful refinement repairs and unequips the item, as ordinary upgrades do, while preserving its existing identity and custom data. Original game eligibility and idol requirements still apply.

Thunderstore development is made possible with ads. Please consider making an exception to your adblock.