About this mod
Adds a custom attack input controller and various weapon behaviors like cleaving and reach. Android version available.
- Requirements
- Permissions and credits
- Changelogs
Unbind your vanilla SWING WEAPON action in the controls by right-clicking on it or to a different Key than the one used for the ATTACK key in the Mod Settings (default: MOUSE1). YOU MUST USE THE TOB ATTACK KEY FOR THE NEW FEATURES TO WORK.
For Android users, you can simply remove the SWING WEAPON action mapping from the button you use to attack and replace it with the KeyCode.
Refer to the Unity documentation for a list of valid KeyCodes.
The TOB Mod Settings Weapon Swing Mode takes priority over the DFU settings.
ATTACK INPUT CONTROLLER
Allows specific swing directions to be performed without using the vanilla Drag-to-Swing attack scheme. Includes several control scheme options:
- VANILLA - Hold ATTACK key and drag your mouse to perform a specific attack. Basically the same as base DFU scheme but you can specify by how much the view is locked when the key is being held using the Dampen Strength slider (1 is fully locked like in vanilla).
- HOLD TO ATTACK - Hold ATTACK key to continuously attack. Unlike base DFU behavior, it will not have the chance to randomly perform the same attack over and over. It will perform all swing directions once and alternatingly.
- MOVEMENT - Morrowind-style adapted to Daggerfall. Attack directions will be dependent on the direction you are moving when the attack starts. Standing still and moving backwards or diagonally performs overheads. Moving sideways performs horizontals. Moving forward performs a thrust. Diagonal swings are unusable in this scheme (like in Morrowind).
- SPEED - Swing directions are based on your current speed with a modifier key. Standing still or moving at less than half-speed performs horizontals. Moving at full speed performs diagonals. Holding the RUN input and standing still performs overheads. Moving at full speed while holding the RUN input performs thrusts.
REVAMPED HIT DETECTION (and CLEAVING)
Weapon attacks are now capable of hitting multiple targets and this fixes some problems with the environment and corpses "eating" your attacks and preventing small enemies on the floor from being hit.
HOW HITS ARE DETECTED: Unlike base DFU, weapon collision is made by making a bounding box check in front of the player character and taking all damage-able (entities and villagers) colliders that the box overlaps. Optionally at this point, it can also make a direct weapon reach check to disregard colliders at the far corners of the box, making the hitbox feel more like an arc. That list of colliders is sorted by distance to the origin of the swing (right of the player for a right-to-left horizontal swing, etc) and each is "attacked" in sequence after checking for line-of-sight. If no colliders are detected, then the environment check will proceed as in base DFU for bashing doors and similar.
Weapons will have varying degrees of REACH. This value is used to construct the bounding box for hit detection. For example, Short Blades will have less range than in base DFU, while Long Blades like Claymores can hit enemies further than in base DFU. Thrust attacks will also generally have 25% more REACH than other attacks.
This allows you to hit enemies you are not directly aiming at with directional swings. A small enemy on the floor or in the air can by hit by an overhead swing without having to look directly at it, for example. Same with an enemy to the side of your crosshairs when performing a horizontal swing. This makes crosshair-less gameplay much more comfortable, at least in my opinion. If you wish for a more precise attack, Thrust attacks will generally perform the same as vanilla attacks in terms of precision.
Hand To Hand has a bonus reach multiplier for the kick attacks (Left, Down and Up, in addition to the Thrust attack bonus).
NOTICE: This may cause problems when fighting in populated areas as errant villagers may get caught in your sweeping attacks. Stick to overheads and thrusts when friendlies are around, or enable the SAFEGUARD feature to prevent hitting allies and wandering commoners as long as your crosshair isn't too close to them (about 25% of your screen height in distance)
HOW CLEAVE WORKS: Cleaving works by getting a base CLEAVE value which is derived from the character's STRENGTH stat and equipped weapon. An entity that is successfully hit has a vanilla WEIGHT stat that is used to calculate the effect of knockback on them, and that value is subtracted from CLEAVE. If there are targets left to hit and CLEAVE value is still more than 0, another attack is made against the next target. If CLEAVE value is reduced to 0 or less, the attack stops.
In the Mod Settings, it is possible to configure:
- Disregard boxed targets outside of weapon reach from the player (eg, the furthest corners of the bounding box) This makes the hit box have more of a radial arcing shape. (default: ENABLED)
- Whether allied Entities or MobileNPCs can be unintentionally hit by attacks
- Ignore the LOS check (default: DISABLED)
- A missed attack against an enemy with the ParrySounds flag can prevent a cleave from propagating (default: DISABLED, requires Vanilla Combat Event Handler or a mod that supports VCEH events to work)
- Modify the global reach multiplier for all weapons
- Modify the interval between Cleave update ticks
- Modify the base CLEAVE amount value of weapons
- Modify the target weight that is subtracted from the Cleave amount
- The exact values of REACH and CLEAVE for each weapon can be edited.
Implements the scaling of your attack effectiveness based on the amount of Power you have built up. Power is gained in several different ways:
- With a melee weapon (or unarmed), Power increases gradually and constantly while readied and not attacking.
- With Draw-and-Release enabled and while using a bow, Power increases while the bow is drawn. If the bow is kept drawn for too long, Power will begin to decay.
- Without Draw-and-Release and while using a bow, Power will constantly oscillate between minimum and maximum values.
Accuracy Scaling - Multiplies the player's base To-Hit Chance with Power. The options available are:
- None (Vanilla) - No accuracy scaling
- Bows Only (Default) - Only bows will have their accuracy scaled
- All Weapons - All weapons and attacks will have their accuracy scaled.
- Random Range (Vanilla) - A number is randomly chosen between the weapon's minimum and maximum damage values. For example, a Steel Claymore can deal anything between 2 to 18 points of damage. Vanilla behavior.
- Random Range with Scaling (Default) - Same as Random Range but the result is multiplied with the Attack Power. For example, if a Steel Claymore dealt 9 damage but also had an Attack Power of 75%, then the damage is adjusted to 6 (9 x 0.75 = 6.75 rounded down).
- Deterministic - An experimental method very similar to Morrowind's charge attack mechanic. A value is picked from the weapon's damage range depending on how much Power the attack had. For example, a Steel Claymore that is swung at 100% Power will always deal 18 damage. Conversely, if swung at 50% Power, it will always deal 10 damage.
- Ceiling is the multiplier of Power at maximum value. It scales with Strength and Critical Strike
- Floor is the multiplier of Power at maximum value. It scales with Strength and Agility
- Gain Speed and Draw Time determine how fast Power is built up. They scale with Weapon Skill and Weapon Weight
- Cost affects how much Power is subtracted from the current with every attack. It scales inversely with Agility
IMPROVED ARCHERY
Makes archery hit detection more reliable to varying degrees based on mode and comes with some extra features to spice up the gameplay.
There are three MODES you can choose from:
- Vanilla - This uses the regular DFU arrow projectiles, unmodified with one exception: Their Rigidbody detection mode is set to Continuous instead of Discrete, helping to make collisions more reliable for the player's arrows.
- Custom (Global) - This uses a custom Missile class that moves in steps in FixedUpdate and uses Spherecasts and Raycasts to detect collision between those steps. Highly reliable and configurable. Allows for the changing of projectile characteristics like Speed and Gravity.
- Custom (Typed) - Same as above but the base values for projectile characteristics are modified depending on whether you are using a Long Bow or Short Bow. Replaces the original Bow Mode in the Controls section.
- Radius - The size of the Spherecast used in Custom mode. Higher values makes it easier to "hit" enemies, especially useful since some enemy orientation graphics don't line up with their colliders. The Spherecast doesn't collide with the environment.
- Speed - A multiplier on the base speed of the arrow when shot. Straightforward. In Typed mode, Longbows will have a higher base speed multiplier.
- Gravity - Makes the arrow accelerate downwards as it flies, giving its path a parabolic curve. When enabled, includes the option to show the predicted flight path of the arrow. Disabled by default.
- Draw Zoom - When using Draw-And-Release bow controls, drawing the bow will cause your view to zoom by the configurable multiplier. The duration of the zoom-in as well as the delay before the zoom begins are also configurable. In Typed mode, Longbows will have a higher base zoom. Disabled by default.
- Draw Scaling - When using Draw-And-Release bow controls and Custom mode, projectile speed will scale linearly with the duration of the draw, from 50% to a maximum of 200% speed. The value on the slider is the time in seconds it requires the draw to reach the base speed. Twice the value is when it will reach the maximum speed. In Typed mode, Longbows will have a higher value and will take longer to reach maximum draw. Disabled by default.
HOW IS THIS DIFFERENT FROM BETTER ARCHERY - Both mods have the same bottom-line: making archery more reliable and less frustrating. This module simply leverages the control that a completely custom WeaponManager like TOB allows. No FindObjectOfType calls in Update, just directly grab a reference to the missile whenever one is spawned. Also, TOB Arrows completely eschew Rigidbodies and colliders for hit detection and instead use Spherecasts for enemy collisions and Raycasts for environment collisions. In the end, it's up to you which one you prefer.
OVERRIDE MISSILE PROPERTIES - Other mods can send a mod message to TOB to change the properties of the next fired missile. The changeable properties are:
- Ammo Item Template Index - The index of an item template that will be consumed with every shot instead of a normal arrow.
- Model ID - The index of a model that will be used instead of the arrow mesh.
- Speed Multiplier
- Gravity Multiplier
- To-Hit Modifier - Value added to the To-Hit Chance of the projectile
- Damage Modifier - Value added to the Damage dealt by the projectile on a successful hit
- Ammo Counter Color - Changes the color of the Ammo Counter.
- Auto-Reset - Whether or not it will automatically revert to normal arrows when no more custom ammunition is carried.
MISSILE EVENTS - TOB now supports events that fire when a missile is spawned (OnMissileSpawn), when a missile hits (OnMissileHit) and when missile properties are changed (OnMissileChanged). Other mods can subscribe to these events in order to be called when they fire.
WAR MAGIC
Improves hit detection of spell missiles and allows for configuring their properties like speed, collider radius or AOE range. Also fixes some problems with the vanilla DFU spell collisions, notably with Touch spells and adds a "Ready Spell" VFX with lighting based on your Spell Lighting and Shadows settings (works quite well with Readied Spellcasting Hands).
Implements an event handler for spellcasting, allowing other mods to run code when the following happens:
- When a spell is readied
- When a spell is cast
- When a spell is released
- When a spell missile is spawned
- When a spell missile hits
FEEDBACK
Makes combat a bit more dynamic and player-facing without affecting the mechanics as much. Requires VCEH or a mod that supports VCEH events. (DEFAULT: Disabled)
There are several modules.
- Parry Pause - Enemies with the "Parry" flag will stop moving for a short duration when missed by a physical attack. They can interrupt this state with an attack if their target is already in range.
- Visible Dodge - Enemies that cannot parry will visibly shift position when missed by a physical attack. This does not affect their animation state, timers or their decision-making.
- Failed Spell Save Knockback - When an entity fails a saving throw (usually against a spell) they will be knocked back and play the HURT animation state. This will drastically affect AI mechanics like timers and decision-making, especially for Continuous spells, but I think it's worth adding due to how spells have basically no feedback aside from the text message.
The base mod does not override any formula and so is generally compatible with other mods unless they depend on the SWING WEAPON action or with certain values from the WeaponManager class or use their own custom attack input controller (like fully custom weapons).
Recommended mods:
- Arrow Variety by Excoriated utilizes the new Missile Override features in version 1.5 to add new types of arrows to DFU. Highly recommended!
- Roleplay & Realism and R&R - Items by Hazelnut further differentiates weapons by adjusting their attack speeds depending on weight and even adds new weapons that are fully compatible with TOB like the Archer's Axe and Light Flail. For use with Power Attacks and Improved Archery, see the section below.
- Bloodfall by SquidKamer adds some needed viscera to the combat. Just keep in mind that if your settings allow you to cleave through too many enemies, you might notice some micro-stuttering. Increase the Cleave Interval in the TOB mod settings to mitigate this.
- DaggerBlood by Excoriated works similarly to Bloodfall but it uses VCEH so it adds the crunch with little performance impact. Nothing like swinging a warhammer once and watching multiple enemies turn into gory giblets!
- Villager Reactions also by SquidKamer can help mitigate hapless villagers from wandering into your swings when fighting in populated areas. Either that or get comfy with using only overheads and thrusts when there are friendlies around.
- Weapon Widget can improve the look of the weapon handling and sync better with the cleaving. Also, with its Recoil module (requires VCEH), it can show miss effects appearing on individual enemies, informing you of which attacks were missed.
- Horrible Hordes by Ralzar makes certain enemies, like rats, bats, orcs and skeletons, spawn in mobs. Give that cleaving arm a workout!
- AdjustWeaponHitChanceMod
- AdjustWeaponAttackDamage
The Deterministic Damage Mode requires overriding the CalculateWeaponAttackDamage and CalculateHandToHandAttackDamage formulas.
- Daggerfall Enemy Expansion also overrides this formula in order to give the DEX Skeletal Soldier the same weaknesses as the vanilla Skeletal Warrior. If you're fine with not having that, you may place TOB to load after DEX so that TOB's override will take precedence.
- Sphincter Vision Attacks! overrides this formula as a matter of course. There is a WIP compatibility override built-in if SVA! is installed, but as the mod isn't open-source it is currently held together with educated guesses and wishful thinking and is definitely not accurate to how SVA! works.
Much thanks to Magicono43 and DunnyOfPenwick who were extremely helpful in finding existing DFU variables to use for the systems and to the other folks on the Lysandus' Tomb DFU Modding discord server for their feedback.