Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
CustomMonsterReplacer
Monster manager: replace a vanilla monster's visual with a custom 3D model, or clone a prefab into a new creature with its own model, health, faction and spawns. Web tuning GUI.
By DFG
CHANGELOG
Changelog
All notable changes to CustomMonsterReplacer.
[1.4.3]
- Package fix:
Blurrg.glbwas shipping in the deployed profile but was missing from the 1.4.2 package, so anyone installing from Thunderstore got a mod one model short of the one the author had been testing. The package now stages models straight from the build output rather than from a hand-kept list, so this cannot silently recur. - Re-verified against Valheim 1.0.16.
[1.4.2] - Performance
Four separate causes of lag, all real, all fixed:
updateWhenOffscreenwas forced on for every customSkinnedMeshRenderer, so the CPU re-skinned all 25trooper.glbparts (and the bundle meshes) every frame for every greydwarf at any distance. It is now explicitly off.AnimatorCullingMode.AlwaysAnimateon bundle creatures is nowCullUpdateTransforms. Bones are still written, so culling does not make them pop.MonsterRenderCullerregistered itself inAttach(), which only runs on the prefab, so no live clone was ever in the ticker's list and nothing was ever culled. Registration moved toOnEnable/OnDisable. The log now printsdistance culler: N custom model(s) in the worldwhenever N changes; if that stays at 0, culling is broken again.- The
/optionsprefab cache walked all ~4,600 entries ofZNetScene.m_prefabswith aGetComponent<Character>on each, every 2 seconds. It now rebuilds only when the loaded prefab count changes.
Also: the model's Colliders are disabled alongside its renderers when culled, and
Animator.parameters (which allocates a new array on every call) is no longer read from
Update.
[1.4.0] - Creature mode and the monster manager
- Two kinds of entry. Replace swaps a vanilla prefab's visuals in place, keeping its AI, stats and loot. Creature clones a vanilla prefab under a new registered name with its own mesh, health, faction, AI ranges and spawn entries.
- The tuning GUI is now a monster manager. Entries are added and removed in the browser rather than by editing JSON.
- Pre-1.4 configs (one with a root
TargetPath) migrate once into three entries: the old visual replace, the oldCreatureblock, and the code-defined ogre. - Creatures are patched in place on re-apply rather than rebuilt, because the clone is
registered in
ZNetSceneand destroying it would breakspawn. - Added the
valheimbearandvalheimogreAssetBundles (BearPlayer,OgrePlayer) andogre.glb.
[1.2.0]
- Skeleton binding: GLB skin joints are remapped to the vanilla Greydwarf skeleton by name (proximity-weighted fallback) so rigged models animate.
- Live web tuning GUI (
http://127.0.0.1:8777/): scale/position/rotation sliders, per-mesh enable/disable, auto-height-fit, skeleton overlay, and a generated Blender armature script for content creators. - Config moved/kept as JSON (
monsterreplacer_config.json) beside the DLL, saved automatically on tuning.
[1.0.0] - Initial release
- Replaces the Greydwarf visual with the bundled
trooper.glbmodel via custom GLB/GLTF runtime parsing. - Uses Jotunn's
PrefabManager.OnPrefabsRegistered. - Requires Jotunn (Jotunn 2.30.x).