Skip to content

communityus/CO-DF-Unity-10.23

 
 

Repository files navigation

What is Combat Overhaul Daggerfall Unity?

Daggerfall Unity is an open source recreation of Daggerfall in the Unity engine created by Daggerfall Workshop.

This is a edit of the base script and code surrounding the combat, weapon, and attack animation system. The purpose of this mod is to bring the combat and animation system into a more modern feel without losing the charm and asthetics of the original. It took a year of breaking the code apart and reworking it in order to create this custom animation and raycast system, along with the numerous other features.

How was this magic created? It started out as a simple experiment to get raycast arcs in to simulate a weapon attack arc. This led me to look into how the attack system is managed, which connected to the animation system. Upon learning there wasn't going to be any hi-frame animation replacements, I decided to make this into a full blown project and see if I could create a new animation and hit/raycast detect system using the current engine and code. Here it is a year later, and I was able to prove my concept could be done and produce the look and feel of high frame animations, while working within the original system with all original content.

This is a 100% code based solution to maintain the original game and its feel; this also ensures it should be 100% compatible with mods built for the base branch. If someone ever creates a mod that messes with the animation or racycast code, this will probably have issues.

I hope you enjoy it, and respect coders work. If you wish to use any of my code, get permissions first.

This is currently a developer release meant largely for testing, tuning, and debugging. This is not considered an official release of any type, and I provide no support if your save/game breaks during play through.

Features & Roadmap

Completed

  • Completely rebuilt the weaponmanager and fpsweapon script to create 60fps smooth attack animations. Scales with your attack speed.
  • Rebuilt weaponmanager script to create 90 degree raycast detection arcs on weapon swings. On object hit, stops, and plays a recoil. Scales with your attack speed.
  • Weapons now have a bob effect when moving to simulate real life movement.
  • Every weapon has its own unique range. No longer will weapons all have the same reach.
  • Attacks have been tied to movement keys, so you now can choose your attack based on the four movement keys.
  • Weapons each have their own speed that is uniquely calculated based on their weight and range.
  • Players speed is now reduced with they unsheath a weapon and reduced further when they attack.
  • A number of bug fixes and extra console commands added to improve the code and allow player manipulation.

Not Complete

  • Inventory UI reads out unique weapon ranges for players (Lost in transiton to 10.21).
  • Add a toggle block system for shields.
  • Add a weapon parry system for two handed wielding.
  • Add unique sword sprite sizes to mimick different blade sizes.

General Bugfix & Code Changes

  • Freed some cpu cycles by moving wasted calculations out of script loops.
  • Added a console script and console commands for enabling classic animations and modifiying values.

Console Commands

  • OffsetDistance: This is a float value that changes animation offset distance. Default value varies between .2 and .28 depending on the weapon being used. Higher values faster offset moves.
  • DisableSmoothAnimations: This enables and disables the default or improved animation system.
  • ChangeAttackSpeed: This subtracts or adds a certain float value from the default animation attack speed; Use .01 increments.
  • ChangeHorPos: Changes start and end position of hit arc detection; starts at 45 degree and does 90 degree arc to end at 45 degrees on opposite side. (-start float -end float).
  • ChangeRaycastLerp; Changes how slow or fast the hit arc is drawn. Default is .188f. Recommend .01f increments.
  • ChangeMovementMods; Multiplies base movement speed for sheathed and attack animations. Default is -sheathed .85f -attack .4f. Set values to 1 to disable any movement reduction. (-sheathed float -attack float).

Threads Related to Code

  • In-depth project and discussion on combat and animation system and related code: viewtopic.php?f=14&t=2533
  • A very in-depth breakdown of the combat system and animation system and how they work together to create what happens on the screen: viewtopic.php?f=22&t=2508
  • In-depth discussion, with visual flow chart, of the fps animation system and all related script files the control and run it: viewtopic.php?f=22&t=2554

Links

Versions

  • Daggerfall Unity - v0.10.23
  • Daggerfall Tools for Unity - v1.8.7
  • Minimum Unity3D version - 2018.2.21f1

License

  • MIT License

About

Combat Overhaul Daggerfall Unity - Complete overhaul of the base combat animation and system code to modernize its feel and play.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 94.4%
  • ShaderLab 2.2%
  • HLSL 2.2%
  • Smalltalk 1.2%