Re: Increasing Weapon Animation Frames/Quality
Posted: Wed Sep 25, 2019 4:57 pm
Well, if you really wanted it so the sword travels past the enemy to mimic an attack with the current system, that wouldn't be that hard. I could add a trigger for certain monster types, that when a hit happens but a chance roll fails, the attack code raycast code and animation system continues forward normally, a wiff audio is played, and a hitobject bool isn't triggered.
So you know, there is basic ai for enemies that already tries to predict your attacks based on your movement speed and weapon reach. It's why enemies will many times wait outside attack range for a few moments before running in for the attacks.
What would be the best compromised system is have the enemy entity/sprite do a quick back movement/push on hit and have the player weapon attack continue without interruption. This would mimic the look of a last moment dodge without having to code in a bunch of crazy raycast prediction code and then try to tie it into the enemy entity sense ai script and hope a bug doesn't bring everything crashing down around me.
The last option would require reworking the whole raycast sytem and coding in a rayarc system, where the full arc is projected instead of it being drawn ray by ray. This can allow ai to predict and know if they are within an arc hit range and predict better. Again, this is a time sync though with not enough return for me to go down this coding hole.
So you know, there is basic ai for enemies that already tries to predict your attacks based on your movement speed and weapon reach. It's why enemies will many times wait outside attack range for a few moments before running in for the attacks.
What would be the best compromised system is have the enemy entity/sprite do a quick back movement/push on hit and have the player weapon attack continue without interruption. This would mimic the look of a last moment dodge without having to code in a bunch of crazy raycast prediction code and then try to tie it into the enemy entity sense ai script and hope a bug doesn't bring everything crashing down around me.
The last option would require reworking the whole raycast sytem and coding in a rayarc system, where the full arc is projected instead of it being drawn ray by ray. This can allow ai to predict and know if they are within an arc hit range and predict better. Again, this is a time sync though with not enough return for me to go down this coding hole.