PVESieges
PvE castle sieges: bandits, militia, the Legion and more raid your castle in waves. Sappers bomb your gates, Raid Captains lead the charge, V Blood kills bring revenge raids. Win for loot.PVESieges (V Rising)
Hostile factions besiege your castle in waves: they march on your castle heart, blow your doors with a sapper's bomb, and fight anyone who gets in their way. Beat the raid for the spoils of war.
Install
Only the server needs the mod: the dedicated server, or in a private / hosted game the built-in server the game starts (VRising_Server in the game folder). Players who join need nothing. Requires BepInEx 6 (IL2CPP, build 733 or newer).
- Thunderstore / r2modman (private or hosted game): install PVESieges with the mod manager and start the game from it. A mod manager puts mods in the game's own BepInEx, which the built-in server doesn't use, so the package brings ServerLaunchFix along: it makes the server the game starts use the same mods. The first host can time out while BepInEx prepares the server; host again (a few tries at most). ServerLaunchFix needs the game on an NTFS drive and rewrites the built-in server's
doorstop_config.iniandBepInEx.cfgon every start. - Dedicated server: install BepInEx on the server and copy
PVESieges.dllinto itsBepInEx/plugins(with a mod manager: from its profile'sBepInEx/plugins). Restart the server. - Private / hosted game by hand (no mod manager): set BepInEx up in
VRising_Serveras for a dedicated server: copyBepInEx/(withoutBepInEx/interopandBepInEx/cache, which are made fresh for the server),dotnet/,winhttp.dll,doorstop_config.iniand.doorstop_versionfrom the V Rising folder intoVRising_Server, and putPVESieges.dllinVRising_Server/BepInEx/plugins. The first host after that (and after each game update) can take 1–2 minutes while BepInEx prepares the server; if the game gives up, host again. - Check it runs: the server's log (
BepInEx/LogOutput.log; for a hosted gameVRising_Server/BepInEx/LogOutput.log) showsLoading [PVESieges ...]andserver world found. In the game client's own log the mod only says it has nothing to do there: that's expected. - Updating: copy the new
PVESieges.dllin; older ones can stay, BepInEx loads the newest. Upgrading from 1.0.242 or older: remove the old DLL (see below).
What it keeps and changes on your PC
- No internet access. The mod's own files hold no player data (no names, no SteamIDs).
- Player names: the only place one appears is the server log, when an admin uses
!siege allor!siegestop(for examplePVESieges: <name> called a siege on every castle with someone home ...). Its purpose is to let server owners see who started or stopped raids. The mod writes it nowhere else and keeps it nowhere. Raid messages in chat (!siegemsg) and opting out (!siegeoptout) are remembered only until the server restarts and are never written to disk. - Only with
Trailson (off by default): walked trails near castles but outside players' plots (map positions only, per castle; inside a plot only the spots where a walk crosses its edge) in%LOCALAPPDATA%/CastleSieges/castles, saved once a minute in the background (off the server's main thread). Files of castles not on this save are kept (another save on the same PC may use them) and removed after 30 days unused. - Its config,
BepInEx/config/PVESieges.cfg. - The heart scan and the game's terrain it reads are kept in memory only, for the raid, and never written to disk. With
Trailsoff (the default) the mod writes nothing but its config. - It never deletes, moves or copies any DLL. Several versions in the plugins folder are fine: BepInEx loads the newest. Upgrading from 1.0.242 or older (the plugin id changed from
melty.castlesiegestopvesieges): remove the old DLL yourself; while it's still loaded, the new one stays off and the log names the file.
How sieges start
- At random: at sunrise (8%,
DayChance) and nightfall (10%,NightChance), for every castle whose owner or a clan-mate is online. If someone is home (inside the castle's territory; withHomeTerritoryOnlyoff, within 60 m of the heart counts too), it starts right away; if they're all away, it waits and marches as soon as the owner or a clan-mate gets home (one waiting raid per castle; online clan members get a message). - After slaying a V Blood (70%,
VBloodRaidChance): that boss's own faction comes for your clan's castle when you or any clan-mate is back home (without a clan: your castle, when you are). One such raid waits per clan at a time; a kill while one is waiting says so. Beasts and bosses without a raiding faction don't. - Raids are called off if the owner and the whole clan go offline.
- Admins (logged in with
adminauth) can call and stop sieges in chat (see Commands).
Factions
Which factions can come depends on your castle heart level:
| Heart level | Sunrise | Nightfall |
|---|---|---|
| 1-2 | Bandits, Restless Dead (Farbane) | Restless Dead |
| 3 | Militia, Dunley Dead | Dunley Dead |
| 4 | the Transcendum, Dracula's Vanguard (the Legion's lesser troops), Restless Spirits (ghosts) | Restless Spirits |
| 5 | the Church of Light's army, the Blackfang's Venom Blades, Dracula's Legion | any of these |
Slaying a faction's V Blood sends that faction whatever your heart level. A clan gets one kind of raid at a time: while a random raid (sunrise or nightfall) is waiting, under way, or has ended since the last sunrise or nightfall, V Blood kills call no raid; and while a V Blood raid is, sunrise and nightfall don't roll for that clan.
Rarely, the forest itself comes: at every nightfall and sunrise there's a 3% chance (TreantRaidChance) of a Treant raid instead, whatever your heart level, with waves of 2 Treants each (TreantWaveSize). Treants never sleep during a raid and plant no bombs: they line up before your door and break it with one volley of entangling projectiles.
A siege
- A warning, then 30 seconds later (
WarningSeconds) the first wave. Three waves by default (Waves, 1–10) of 5, 8 and 10 raiders with one defender (Wave1Size–Wave3Size, the Raid Captain included; with more waves the middle ones repeat, e.g. 5 waves of 5, 8, 8, 10, 10). Each mixes fodder and tougher units (all fodder, then 80/20, then 60/40) in a random line-up. A wave has 20 seconds (WaveSeconds) before the next one arrives; beat it sooner and the next comes right away. A Raid Captain with the Blackfang Sentinels' level aura leads the last wave. - Each extra defender adds 3 raiders to every wave (
ExtraRaidersPerDefender). Every player within 90 m of the heart defends it, clan or not: guests count for the waves, the defeat, the raid messages and the spoils. Only the owner or a clan-mate at home can bring a raid on. - Raiders never come above the strongest defender's level (weaker units, or the faction's fodder, take their place).
- Where they gather. Never inside any player's territory (plot): not yours, and not a neighbour's either, and never in a pocket of ground the plots all but close round (an inlet into your plot, a gap between neighbours' plots). If your plot is up on high ground (the way in climbs 3 m or more, by the game's terrain), they gather at the foot of the way up (a ramp, a slope, stone steps, also stairs in two flights with a landing between): a few metres before the climb starts, on level ground, outside the plot, on the way up that's shortest to the heart, preferring a way up that leads to a door or gate (a ramp or stairs up to your front gate) over one with none. A plot on the ground: right in front of your castle's way in, 3 m or more outside your plot, on level ground. When that way goes through a door or gate (a castle door, or a garden gate in a fence), they gather as close in front of it as the plot allows, at the door's own height (within 2 m); otherwise in front of the open doorway. Until the heart scan is ready (a second or a few after the raid starts, so at times the first wave) the older rules apply: on ground players have walked, level and with a walked way in, at least 10 m from any castle wall, else as near your main gate as possible; and if nobody has walked outside, just past the edge of the territories, on the side whose ground (from the game's terrain) is at the height where you walk and the heart stands, never on a cliff top or in a hollow. Wherever it is, the spot has a patch of open ground at least 8 x 8 m round it (
SpawnSquare): no rock, cliff face, tree, wall, step or drop in it, and outside every territory. If the spot picked has none, the nearest one within 20 m on the same level is used, so a wave never appears in a cranny or squeezed between a wall and a cliff. On the heart scan's map, the gathering spot and every raider's own spot also need a 5 x 5 m patch of open ground with a way in round them (GroundPatch). - The heart scan. On your plot they find their own way: when the raid starts, a scan spreads out from the heart, metre by metre, over the heart's floor, down your staircases to every floor up to 20 m below it (and up a staircase built on the open ground, on a ramp or by a terrace, to the floor it leads to), and out over the open ground to 20 m past your plot's edge (75 m for a raised plot whose way up starts further out). It goes round walls, pillars and railings and through doorways and open doors. A closed door can be crossed but counts as 30 m of extra walking, so they only break a door when there's no open way in, and then the one that leaves the shortest walk. A wall counts as 500 m: a way through a wall is only taken when there's no other (raiders then walk up to it, and through, if it's really an opening the mod doesn't know). So the scan always covers the whole plot, however the castle is built. On open ground it reads the game's own terrain (
PlotTerrain, on by default): rocks, cliff faces and trees block it, it only climbs ramps and gentle slopes, never a cliff, and it steps between a castle floor and the ground beside it only where they're within 2 m of each other. Raiders follow it downhill to the heart, up to 10 m at a time but only as far as they can walk in a straight line (no rock, tree or wall across it); a raider that still stands still steps 2 m at a time for 15 s, and if even that fails (an upper floor, something the scan can't see) tries other ways for 20 s (open doorways, straight at the heart). It's made again only when your castle's own walls, pillars, railings, floors or staircases change, or a new door appears (a broken door is simply walked through). - Beyond the scan's reach they head on toward the plot until the scan takes over; a raider just off it walks to its nearest spot (within 12 m) with a way to the heart. With
Trailson (off by default) the mod also records where players walk near castles (never inside plots) and raiders out there follow those walks to the plot (the shortest way counts both); flying in bat form isn't counted as a way, any part of a walk that passes through a wall (a jump, say) is left out, and walks are kept across restarts. - Within 25 m of the door they're breaking, raiders head straight for the spot in front of it, unless a wall stands in between. Open doors and empty doorways are simply walked through; a raider with no walked way on heads for the nearest one it can see that brings it closer to the heart.
- Any closed door standing across their way is the one to break, even one the scan's map lost track of. At each closed door, wide door or garden gate on their way, a sapper (a fodder unit; once the raid has no fodder left, one of the tougher raiders; the Raid Captain only when nobody else is left outside) carries a bomb to the door while the army waits 12 m back (
BombStandBack): 6 seconds to set it (SapperSetSeconds), then it goes off 5 seconds after it's lit (BombFuseSeconds), hurting anyone next to it. A wide door takes two bombs; a single door or garden gate, one. Doors are never battered: only bombs break them (and the Treants' volley). With nobody left outside to carry a bomb, they wait for the next wave. A stuck raider out of sight may be put back beside another raider, but never through a wall or a closed door and never further in than it got itself. - Raiders only ever break doors, wide doors and garden gates: walls, door frames, pillars, railings, windows, furniture, chests, floors and stairs are never damaged. If the heart is shut in, they blow the nearest closed door that leads to it.
- Opting out: type
!siegeoptoutand your clan (or you alone, without a clan) gets no raids until the server restarts or someone in the clan types!siegeoptin. Walling the heart in no longer opts a castle out. - They fight you, your servants and summons within 15 m (
RaiderAggroRange) with no wall or closed door in between, chase up to 25 m (ChaseRange), and fight back against creatures that attack them. Someone they can only reach through a wall isn't chased: they keep making for the door. - Win: kill the Raid Captain and it drops the spoils where it falls, one share per defender: jewels (tier 1–4 by how hard the raid was, for every faction), recipe books, Stygian shards, passive ability scrolls and shattered ancestral weapons, depending on the faction.
- Raiders who reach the heart (within about 6 m of it) with nobody to fight face it and hack at it with their own attacks about once a second (
HeartAttackAnimations); the heart isn't harmed, but don't stand in the swing. - Lose: they hold your heart for 30 seconds (
HeartHoldSeconds; within 5 m of the middle of it (HeartReach), on its side of your walls and doors: raiders outside a wall next to it don't count; the heart isn't harmed, but a burst of blood erupts at it,HeartLostEffect), every defender and servant at the castle falls, or a wave lasts 15 minutes (WaveTimeLimitSeconds) with nobody fighting it. No spoils.
Commands
Type !siegehelp in chat for the commands you can use.
!siege pieces(admins): the castle pieces within 4 m of you and how the raid sees them (wall, door, railing, doorway...), in chat and the server log. Handy to check a fence or gate. Fences count as walls in the heart scan (the only way through a fence is its gate).!siegemsg,!siegemsg on,!siegemsg off: show or hide raid messages for yourself (everyone).!siegeoptout,!siegeoptin: your clan (or you, without a clan) gets no raids, or gets them again (everyone;AllowOptOut). Opted out: no night or day raids and no V Blood raids, and a raid already waiting turns back; a raid already under way still plays out. It lasts until the server restarts.- Admins only by default (
ChatCommandAdminOnly), logged in withadminauth:!siegeor!siege <faction>: a siege on your castle (stand near your heart).!siege allor!siege all <faction>: a siege on every player's castle where the owner or a clan-mate is home.- Add a number to any of these (
!siege 25,!siege legion 25,!siege all 25) for exactly that many raiders in every wave (up to 200, the Raid Captain included). !siege terrain: writes a 41 x 41 m map of the game's terrain data round you (what blocks walking, ground heights) to the server log. For testing whether the mod can use it.!siege vfx: plays the effect shown when raiders take a heart: on your heart when you're at your castle, else where you stand.!siege vfx <name>plays another to try it:crimsonnova(-346299479),bloodsoul(250152500),feeddracula(1340086775),ringofblood(1035629642),fountain(-1830781170), or any effect id; put the id inHeartLostEffectto use it. Some effects show nothing when played this way (their visuals belong to their original caster).!siegestop: ends the siege on your castle (or the one nearest you) at once; its raiders vanish and nothing drops.!siegestop allends every siege.
- Factions by id or part of the name:
bandits,skeletons,militia,dunley,transcendum,lesserlegion(Dracula's Vanguard),ghosts,army,venom,legion,treants.
Raid messages
Each player joining the server is told, a few seconds after they're in, to type !siegehelp for the siege commands (turn it off with WelcomeMessage). Raids are quiet by default, like the vanilla game: no chat messages. Type !siegemsg to show or hide them for yourself; your choice lasts until the server restarts. Server owners can change the default with ShowRaidMessages.
Settings
BepInEx/config/PVESieges.cfg (created on first run; settings from very old versions' melty.castlesieges.cfg move there by themselves): chances, number and size of waves, the fodder mix, aggro and chase range, sapper and bomb timings, rewards, level cap and more. Restart the server after changing it.
The file has two sections. [Castle Sieges] holds the everyday ones: on/off, raid chances (day, night, Treants, V Blood), the night factions, waves (how many, together or not, timings, time limit, sizes, fodder share, extra raiders per defender), how long they must hold the heart, the Raid Captain's weapon chances, and scaling to player level. [Castle Sieges - Advanced (only change these if you know what you are doing)] holds the rest (steering, scans, spawning rules, chat, debugging). Upgrading moves your existing values into the right section by itself.
Settings that no longer do anything are gone from the list (SapperBombs, GateDamagePerHit, DestroyWalls, BreachRadius, DoorHitSeconds: door battering was removed, doors are only ever blown). If an old config file still has them, they're ignored. New ones added since 1.0.33x: AllowOptOut, WelcomeMessage, SpawnSquare, GroundPatch, HomeTerritoryOnly.
On big servers: the mod goes through the server's castle pieces a little each frame (at most 0.3 ms, CastleScanMsPerFrame; a full pass every 5 s during sieges, 30 s otherwise), skipping every kind of piece (walls, doors, pillars, railings, stairs, floors, the rest) that nobody built or destroyed since the last pass, so no check reads every castle at once. Saved walks are read and written in the background. During raids, one raid's army is steered per frame and one raid's upkeep (waves, doors, the heart) is done per frame, so several raids share the frames instead of piling into one. The mod's code is compiled ahead right after the server starts (about 1 ms a frame for the first minute), so first-time work never lands on a raid's frame; raiders' steps along the heart scan are worked out once per spot and shared by the whole army; the work on a finished heart scan is spread over the next frames; the join message only looks at the player who just connected. The heart scans share that same per-frame limit: at most one is set up per frame, each is only as big as its plot and the band round it, a new one reuses the old one's memory, and the doors on the ways in are remembered until a door changes. The game's terrain is read in 8 x 8 m cells and kept (at most about 5 MB; cells unused for 5 minutes go first).
In a private / hosted game, the settings that count are the built-in server's: VRising_Server/BepInEx/config/PVESieges.cfg.
Log
The server log (BepInEx/LogOutput.log and the server window) only notes what matters: sieges starting and ending, each wave, the Raid Captain and its spoils, and any problems. To report a bug, set DebugLog = true in the config and restart: the log then also shows the detailed notes (raiders marching, wave line-ups, form-up spots, doors, bombs, the clock, a short check of each raider type, the heart scan's size, floors, terrain and where waves gather (with a map of the heart's floor when every way in goes through a wall), and once a minute an [ms] report: how much server time the mod used in all, per frame on average and at worst, and each of its parts with its total, number of runs and worst run, the castle scans together, the highest ms generator of the minute, and the records since the server started: the part that used the most time overall, the slowest single run and the worst frame, with when they happened). A frame where the mod takes 5 ms or more (SpikeMs) is reported right away as an [ms] spike line naming the parts that took the time (at most one a second; the rest are counted). Turn it back off afterwards.
Made with AI
This mod's code and this README were written with the help of AI (Anthropic's Claude), directed, reviewed and tested in game by the author.
