I’m currently developing a hack and slash game. I’m aiming for a combat system like in Devil May Cry. I’m hoping that this discussion becomes a good source of ideas and best practices.
For example, currently, I’m trying to come up with a system that allows me to build different combos with ease. In DmC one combo can branch to another one. In a sense, the combo is a tree of animations that depending on the timing (and other conditions) can branch to a different combo. The first thing that comes to my mind is to use animation montages for every combo and the branching would be done by custom animation notifies (or animation notify states). Another idea for the implementation of the “combo” tree would be to create a special data structure containing animations from the combo. My approach is to look at the combos as a single unit. Have you guys implemented such a system? What solutions did you come up with?
Montages are great for such a system. It is possible to just use the AnimGraph as well, but montage might enable you to encapsulate logical chains of animations better.
In general, blending between animations is handled quite well by UE. You have control of the blend timings - be sure to make them small to switch quickly.
For chaining different combos, your approach of using anim notifies to determine which branch is a good as well. Be sure to mark them as Branching Point and not Queued. (The delayed timing of Queued can cause problems).
Hey, thanks for contributing to this topic. What worries me about anim montages is that it seems there is no blending between the different sections of the montage. For example, the montages blend in and out as a whole, but when you jump to a section it doesn’t blend to the next section and it starts playing it directly. At least this is what I observed so far and what I found in other topics. Also, it seems that to jump between sections I have to store the previous section name and the next section name as strings and this workflow is troublesome for me. An approach that is more to my taste is to wrap a single animation in a montage and store them in some data structure. This structure will represent the combo and it will have a method “GetNextAttackMontage” or something.
And another thing. A notify marked as Branching Point is just a notify that gets executed immediately when encountered right? There is nothing else “special” about it?
It appears you are right about the blending between sections. If your source combo animations are not seamless - eg dont share a common branching frame - then montage might not be a good approach.
I have been using the AnimGraph for my current project (although had been considering switching to montages because I thought it might encapsulate things better). AnimGraph does blend between any number of multiple playing poses. Also, in addition to AnimNotifies triggering from the animation, you can trigger them when entering/exiting transitions and states.
Based on this I think I may stick with the AnimGraph approach -
Well the locomotion part is a topic on to it’s own as to game theory but as animation theory in general where the hips goes the rest will follow
As for action states, or an Ability as Epic likes to call it, a montage is almost a must use as it solves a lot more problems than it introduces into the migration path.
Number one is once a montage is activated it will play on unless told to stop or a new montage is activated.(button mashing)
Only one montage at a time can play with in the same group at any give time.
Montages do not suffer from the animation take not resting properly with in the animgraph.
Best still is you will only need a single slot that can be layered in
Would you need to included notifies?
For things like sound, particle effects, and sync markers these are notifies activated with in the montage but as to activating an action state just activating a new state will over ride the current state. You could add states as to when a hit could occur but for our hits we are using the physics asset .
The trick to it all is building the behavior tree of conditional switching of the current action state. Used a lot in bot AI but I’m not up on this need to runtime animmBP as mine has been limited to changing expression sets.
If you can spare a few bucks there are a few combat systems on the market place to look at and learn BUT any kind of system is a chicken versus the egg problem where it’s best practice to make a chicken first to just make it work and then fine tune based on the logic.
I have no problem with spending money on combat systems from the market place, but in my experience they are either made by people that are not too experienced, are done in a really messy way. I’d be grateful if you can recommend a good one that would actually prove useful. The new mobile RPG demo came out with 4.20, so at least we can see something done by the guys at Epic