[MOD]Ambidexterity Module (Shield Module Branch)

Show off your mod creations or just a work in progress.
Post Reply
l3lessed
Posts: 1398
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

[MOD]Ambidexterity Module (Shield Module Branch)

Post by l3lessed »

I began work on the parry system but found out very quickly, I would be building heavily off the work I already did for my shield module mod.

As a result, I have decided to begin a second module that is an updated branch of the shield module, and I will call it the Ambidexterity Module; I think you can figure out why I am naming it that. Look at the magic I created this evening.

What's Done/Included:

Blue = New Features
  • SHIELD MODULE: Everything from the original, plus anything I add further down.
  • COUNTER ATTACKING/PARRYING: You can time your attack against your enemy's attacks to counter them zeroing out damage and knocking you both away from one another, but it must be timed to your weapons hit frame (The second render frame).
  • OFF-HAND WEAPON WITH FULL ATTACK ANIMATIONS: Already recreated the animation system and implemented a full fps weapon for the off hand, including attacks and attack animations. It mimics the traditional system down to the frame. Weapon animation/times are exactly the same as default and hit ray is tied to the hit frame and animation time like traditional DF FPSWeapon system. Should feel exactly the same as your main weapon.
  • SMART/RESPONSIVE KEY INPUT: The mod will monitor for the attack keys. Upon detecting the player pushing either one, it will begin the smart input system using c# queue class. From here, it will allow you to begin a parry up for a small window before beginning the swing. Once the attack starts, it will monitor for follow up key presses, and will start chaining attacks if it detects a new attack triggered them during the current attack last frame.
  • BASIC CHAIN ATTACK COMBO SYSTEM: Using the key input detection system, you can prime a follow up attack during the current attack to keep the momentum of your attacks/body/combo going. The moment you stop this chain of attacks, it resets, and you have to wait the small attack primer window before beginning another chain of attacks (Defaults to .16 seconds but it adjustable in mod settings).
  • WEAPON PARRY: A short animation that has you put your weapon up to try a momentary weapon parry. Will be for offhand weapons and two handed weapons. Will play counter attack animation, stun enemy for a moment, and allow quicker counter attacks.
  • WEAPON PHYSICS SIMULATION/MULTIPLE RAYCAST CODE- DF engine begins sending out raycasts on every frame. Once it hits an object, the raycasts stop. A bool trigger then tells the animation system to replay the animation backwards at an accelerated rate. This simulates a hit and collision. Marking it as finished, but plan on smoothing animations at some point. I have inserted in a coding loop so hit detect raycasts will continually shoot out from the players camera to simulate actual weapon swings from beginning to end. Currently raycast stops on first object hit detection. Uses weapons animation time to sync raycast and time their shots (shoots about 30 within a normal animation). As each raycast is shot, a lerp vector transform moves it along a defined axis based on the animation time. Once an object is hit, raycast stop, fps collision animation begins, and player sets back to idle. Marked as finished, even though I have to refine the vector offsets for the animations.
  • PARTICLE SYSTEM/WEAPON SPARKS - Setup particle system and created realistic looking metal sparks for succesful parries. Particle system emits between 15 and 30 metal sparks, each one a unique tiny 3d mesh with collisions. Also, the mesh changes colors, emits light, and has trails, all changing overtime to mimic real life sparks.
  • DYNAMIC HANDS - both hands will always animation during an attack. Non-attacking hands moves out and back into view as attack animation plays to mimic natural attacking body movements. Will add this to primer attack window too, so weapons pull back quickly before initiating attack to mimic more natural, real attacking movements.
  • CONFURGABLE WEAPON PROPERTIES - Added code and text file to allow users to set a number of unique weapon properties to whatever they see fit with the simple editing of a text file. This includes changing individual weapon attack range, individual weapon attack speeds, individual unsheathed movement speed, and individual attacking movement speed. This also support addition of any mod added item template weapons through the addition of a single line to a text file.
  • MOVEMENT BASED ATTACKS - Added code and setting to enable attack based on last movement direction. Only allows left, right, down, and up since we only have 4 movements.
  • DIRECTION BASED ATTACKS - Added code and setting to enable attack based on mouse yaw direction.
  • WEAPON/SHIELD BOBBING - restored weapon and shield bobbing animation code. When toggle on in settings, weapons and shields will bob up and down while moving. Works with classic animations too, but it looks best with modern smooth animations enabled.
  • DREAM Texture Support - Added in custom animation code for all animations to ensure animations smooth and play properly with DREAM Textures.
  • ANIMATION SMOOTHING *BETA* - You can now try animation smoothing by turning off classic animations under settings. When turned off, you get smooth animations. It limits you to left, right, down, and up attacks, since down-right and down-left are very hard to smooth properly.
    AUTOPATCHER FOR POPULAR MODS - My mod will now detect if either DREAM or Physical Combat & Armor Overhaul are installed. If so, it will enable DREAM textures and/or Physical Combat & Overhaul Formulas to ensure the mods are compatibility out of the box with this one; Let me know if there are others needed.
MODIFYING CUSTOM WEAPON PROPERTIES
  1. When installing the mod, you will find a WeaponProperties text file within the "streamingassets/mods/" folder, where the mod file is put.
  2. When you open this file, you will find all the weapon properties listed by their weaponID as the first time.
  3. From here start modifying the properties however you wish, and they will load on the fly anytime you equip a weapon. No need to relaunch the game. the text file is read dynamically on weapon equip once to ensure most up to date text file values are loaded into engine.
  4. Once done, save the file, and load or alt tab to the game and play with your custom weapons now.
    *any dash symbol "-" put within the text line will mark that line as none usable comments and will ignore it. Use the "-" to add any custom comments about your changes, if you wish.*
CURRENT WEAPON PROPERTIES TEXT VALUES
  • Item/Weapon ID: This is used by the code to figure out which properties go to which weapon/item. I've already added the ids for all classic weapons. If you have any custom weapons from mods, you can add them using their itemtemplate id.
  • Reach: The attack range of the weapon. This is a raw float value, with classic defaulting to 2.25f for all weapons.
  • Unsheathed movement: How much the weapon slows you down when unsheathed in hand. This is a float value used to scale base values by percentage. use 1 for default 100% and change from there.
  • Attack movement: How much the weapon slows your during attacks. This is a float value used to scale base values by percentage. use 1 for default 100% and change from there.
  • Attack Speed: How fast or slow compared to classic speed the weapon attack is. This is a float value used to scale base values by percentage. use 1 for default 100% and change from there.
  • Offhand Allowed: Can this weapon be equipped in the offhand? This is a float value being turned into an int/bool switch. This needs to be 0 for No the weapon not being equippable in the offhand and 1 for yes, it can be equipped in the offhand.
What Will Be Added:
  • More Mod Settings for more customization
  • Patches for most commonly used combat mods. They will be ready before public release to ensure players don't have to choose between mods.
  • Exploring weapon sparks/debri on object/parry hit.
  • Melee blocking/parrying for stopping melee attacks but not weapons.
  • Animation smoothing (As seen in my combat Overhaul project).
  • Unique weapon attack reach.
  • Movement modifiers for unsheathed state and when in attacking state.
Key Setup & Combo: Bug List:
Green = Bug Fix Submitted but waiting for player testing to confirm fixed.
Yellow= Bug Fixed but not submitted.
Red = Currently debugging.
Purple = Reported Bug.
  • Parry animation shows slight artwork clipping for certain weapons. This is a result of the devs never expecting the artwork to move on screen. I'll fix this through some offsetting or an updated parry animation.
  • Using left handed settings doesn't break the mod, but your right swing animation will be jumpy and glitchy when using smooth animations. It will get fixed in next release.
  • Melee attacks do not have hit arcs built for them yet, so when using melee attacks you will still get large weapon arcs. This will be fixed on next release.
  • Sparks generate at larger enemies feet. Need to move generation location to hitcast location.
  • Drag mouse attacking broken again.
  • Weapon hit trace still happens when weapons are sheathed/not showing.
  • Parry animation glitches out on successful parry.
  • Bow equip state largely broken and buggy. Will add bowstates to remedy this issue. Will add vanilla mode, plus add mode for added offhand render.
  • Enhanced bow setting breaks bow and render states when enabled and bow equipped. Now checks and restores enhanced bow mechanics.
  • Can swap weapons during attacking but shouldn't be able to.
  • Bow doesn't disappear on reload.
  • Weapons do not disappear during equip.
  • Weapons do not disappear during swapping.
  • Can't attack villagers or guards.
  • Offhand stops rendering when equipping shield without weapon.
  • Equipping from a shield to a bow the bow breaks the shield and will stay there forever without switching to something else.
  • Downright attack animation for the offhand is misaligned, which shows the art clipping border on the first frame.
  • Shield breaks when using left handiness setting. This is a result of how ambidexterity manager assigns each hands item object and how the base game sets up player equipped items when in shield state.
  • When using physical weapons & left-handedness, hit arcs don't flip also and cause reverse alignment.
  • Casting hands render over duel wield gui hands.
  • Werebeast state offhand breaks when loading a save in form.
  • Enemy Paralysis effect doesn't stop attacking or hide weapons during effect. Fixed: copied the weaponmanager check over to ambidexterity script.
  • Input manager routine has a state stuck bug. Every now and then, it won't clear the input que and will cause a parry when initiating a new attack.
TEST VIDEO WITH DUEL WIELD DEMO


TEST VIDEO OF PARTICLE SYSTEM/WEAPON SPARKS


Download At l3lessed's MOD Hub
Last edited by l3lessed on Tue Oct 04, 2022 10:16 pm, edited 106 times in total.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

l3lessed
Posts: 1398
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: [MOD]Ambidexterity Module (Shield Module Branch)

Post by l3lessed »

Thought I would show off the most recent chunk of my work. It doesn't look like much difference from the above video, but it actually has a ton of changes and improvements from it on the coding back end side.

In quicker terms, I first hide the fpsweapon. After that, I took everything I learned and reconstructed the fpsweapon script, duplicated that to create a second off hand weapon to render. Now I had two largely functional rendered weapons and a shield render, if you include the shield module. This is where it got really dicy fast, as it clearly would be impossible to control all those individual scripts themselves and keep a stock look to the three differing ongui elements being rendered.

So, at this point, I created a equipment state/weapon state management master script object, used it to load up all the script objects into the mod, and then set it up to control all the different ongui renders based on the numerous different equipment states possible with both hands and a shield allowed now.

So now, all weapon states are in, rendered, and animated.

Weapon States Include:
  • One handed (with opposite hand in melee)
  • Two Handed Weapon (Both hands being used by one weapon)
  • Duel Wield (Both hands used by two separate weapons)
  • Shield + One Handed(Including melee if you want)
    *Can use melee/hand-to-hand combat with any open hand.
This also forced me to clean up some animation stuff with the shield module, so now the classic animation system works better/smoother, and it also has a classic animation bob feature for the shield.

Here's the video. There is a bug I had to fix at the end with the two handed weapons and a shield. You can see me code for a moment.


Now, on to getting the swing animations alignments tweaked and sounds setup properly, adding in a parry animation and block system, and release.

Then, at that point, I can begin recreating combat overhaul features in this mod, including smooth animations.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

l3lessed
Posts: 1398
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: [MOD]Ambidexterity Module (Shield Module Branch)

Post by l3lessed »

Okay, got in parry animation/framework for weapons.

Way it will work is you will setup an offhand bind key to control the other hand, just like the main weapon. That is, it will be a smart, multi-use button. It will control your shield, off-hand weapons, and parry system depending on your current equipment setup/state.

Now, with a offhand and main hand key, you will attack/press both of them them at the same time, and it will initiate the proper parry routine based on if your duel or one hand wielding.

I also built in a small delay window using the Input Manager HasStarted method. This gives players a few frames to push both buttons down, so the parry is a little more natural, forgiving, and easier to use. As a result of the old animation system, this does cause a small frame jump every great once in a while, but it's not noticeable enough for me to care. I'll work more on it later or if tons of people start complaining.

Now, we have both counter attack parries and weapon parries.

Counter attack parries will be done when both entities attack and hit each other at the same time. It will stun and push both of you back to signal the push back from the colliding forces. Again, this specific parry features works for npc's fighting each other too (none of the other features do right now, although I hope to add in shield use to enemies at some point).

Weapon parries will be done when you activate parry and are hit during the animation/parry time frame. If this happens, you will take no damage and instead take a much smaller portion of it in fatigue cost. You will not be stunned at all nor pushed. Instead, the enemy will be stunned a little longer than with a attack parry and be pushed back more from your redirecting their force using yours. However, being hit while parrying will create a small extra penalty, maybe little extra damage or cost the player some extra fatigue for being hit when wide open.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

l3lessed
Posts: 1398
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: [MOD]Ambidexterity Module (Shield Module Branch)

Post by l3lessed »

Getting close to first release.

Just finalized first pass of full parry system with proper animations and state management to ensure animations and attacks feel natural.

Right now, you can load up a second attack on opposing idle hand during the last frame of your current attack hand. This allows you to prime an attack without allowing unrealistic attack spamming and god mode in duel wielding, but still gives a small advantage for using a second weapon and not a shield or twohander.

Parry will engage, as long as you are hit during the first 75% of the animation or so, you will stop the damage and play a counter attack animation, but not an actual attack that does damage. You will also push the enemy back more, sometimes pushing them out of distance of their follow up attacks.

If parrying, you of course are locked to parry until you finish the full animation cycle.

I need to do a few more things before release, but getting close. Just need to put in the code to manage the sheath state and left/right swap states, so the sprites don't render during these periods like in default DF, and I think I can release this.

Here is a video of the full system in action, with the new finished parry state and animation.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

l3lessed
Posts: 1398
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: [MOD]Ambidexterity Module (Shield Module Branch)

Post by l3lessed »

Will be dropping in the next week I think. Going to add an option to limit offhand weapons to small weapons only for immersion freaks like me.

Still, I'm getting close. I wrapped up proper weapon swapping, and attacking priming for very basic two attack combo system.

Now I need to do some cleaning, add in a few more possible settings, and drop in one last feature.

The new feature will be a balance/immersion feature: You will choose the handiness your character has the first time you load the mod. There will be two choices, 1. Default choice (Left or Right handiness selected in main menu) or 2. Ambidexterity(Custom mod setting).

1. Default choice: Main weapon stats normal. Off hand weapon stats and attack time -20% to compensate for lack of ambidexterity and training in offhand weapon combat.

2 .Ambidexterity Choice: Both off and man hand weapons get a %10 reduction in attack speed and stats because of your ability to use both hands and training over your life in it. However, having to counter balance and focus on two weapons has a small penalty for both hands of the mentioned 10%.

*EDIT*
Added bullets explaining the smart key input system and the simple chain combo system
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

l3lessed
Posts: 1398
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: [MOD]Ambidexterity Module (Shield Module Branch)

Post by l3lessed »

*EDIT*
Thought might get it out by tomorrow, but I overlooked one area. The stinking mouse drag attacking. There is no easy way to access it and use it for the offhand weapon, since it is bound in the weapon manager to the attack key press and directly tied to the fpsweapon I hid. This means, I will have to copy and rebuild the mouse manager using int states, since I can't replicate enums yet. The developers never expected a second script object for a offhand weapon, so it was hidden and bound to FPSWeapon.

Question to possible users of this mod, would you want power attacks recreated and put into the game, like most modern FPS melee games use?

With the delayed key input system, I can now put this in I think semi-easily. Just delay the beginning of the attack for a amount of keypress time, and then modify damage and attack time based on how long it is held, up to max time hold time.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

l3lessed
Posts: 1398
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: [MOD]Ambidexterity Module (Shield Module Branch)

Post by l3lessed »

Getting close to a first release. Going to release it without mouse drag support first to get it out and testing as soon as possible.

However, found one last snag, and that is the werebeast animations/sprites and how they work. They require a custom code block to build two separate idle hands and ensure attacks align properly where they need. But, that will take a few hours, at most once. I just need to set the time aside.

Probably drop 1.0 by end of this week.

After that, on to moving combat overhaul features over.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

ArcadeMischief
Posts: 3
Joined: Sat Dec 28, 2019 8:48 pm

Re: [MOD]Ambidexterity Module (Shield Module Branch)

Post by ArcadeMischief »

I think having power attacks would be interesting and cool, but maybe a few people would not like that. Maybe if it's toggleable.

l3lessed
Posts: 1398
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: [MOD]Ambidexterity Module (Shield Module Branch)

Post by l3lessed »

Thanks for the input. It would be optional. I always try my best to make all parts of my mods independent, so each part can easily be turned on and off if needed, without crashing the whole script/mod. Why not since we are using an OO language, plus it's just good practice and learning for how to properly do OO Languages.

One more issue happened yesterday that will slow this again. Sigh.

I was cleaning out my watercooling system because it got a little buildup on the block, and I accidentally snagged a CPU pin with single piece of hair on my arm and pulled it off the motherboard cpu socket setting area. needless to say, my motherboard and CPU are now toast. Can't run a cpu with a missing cpu pin on the MB.

I'm writing this on a decade old computer I pulled out of my closet. I took apart my fried computer, and made some Frankenstein of a machine strapping whatever newer components I could into my decade old plus MB and CPU. Hey it works for distant working. However, the old school into duo core and 8gb of bottom line ddr2 ram aint going to cut it for my coding and developing. And, I can't get it to detect my newer Sata3 drive with my main OS install, even though it is suppose to be backwards compatible with Sata I and II. Oh well, just got to have a working computer for my job for next week or so, until I can rebuild.

Good news, I didn't loose any data. Both hard drives should be fine. Just have to order a new I7 9700 and Asus gaming/performance board, and rebuild. Thankfully, LGA1150 and LGA1151 sockets can be reused on the cpu coolant side, so I can keep my custom watercooling setup and tower. Just got to swap out CPU, MB, and hope windows 10 doesn't freak out when it detects the new MB and CPU.

It will get out in the next few weeks with this new road block. Once I can rebuild the computer, then I can get back to the original window of needing maybe 8 to 10 hours of free coding time to get this to a release, playable state.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

daggerdude
Posts: 241
Joined: Sat May 23, 2015 2:22 pm

Re: [MOD]Ambidexterity Module (Shield Module Branch)

Post by daggerdude »

Sorry to hear about your mishap, that would have crushed me.

Just wanted to pop in and say that I have begun working on shield graphics, trying to make vanilla shields.

Post Reply