Is it possible to get some information about the Melee Combat System in Fortnite?

This one goes to the gameplay programmers over at Epic who are working on Fortnite. :wink:

Is it possible for you to share some information about the melee combat system in fortnite? I am currently in need for such a system and was wondering what your approach is. I do have a few ideas but would love to know more about your approach.

Any kind of information you can share would be really appreciated!

Best Regards

Hi . I apologize for the incorrect information I provided earlier. I was not aware that we would be making some of that information available. There should be a more detailed answer coming soon.

Have a great day.

Sure, here’s some stuff to get you started:

First, we relied heavily on the [AnimMontage][1] and [AnimNotify][2] systems. You’ll want to read those docs to get a feel for the terms involved.

Basically each melee weapon type has it’s own montage. So a sword attack may have a different montage than a hammer attack, etc. In the montage there are multiple sections, with one section for each attack, and sections for the transitions back to idle. Then, we made several custom blueprint-based AnimNotifies and AnimNotifyStates. The docs talk a bit about them, you can make a blueprint subclass of AnimNotify or AnimNotifyState and they will show up in the montage editor when you right click the event track.

So, we made a notify for starting a “decision window” and used a branch point to end the “decision window”. In the event for starting a window we define which section to jump to if the user clicks, fails to click, etc. Then at the decision window we run native code to jump to the appropriate section. Then, we also made a notify that means “do melee damage”, and when it hits that point it calls native code to actually apply damage. You could also do it in blueprint if you wanted to. Here’s a fairly complicated montage, that has all the setup for a full combo with a few different branches. TriggerDelayedSkill is what does the damage, and PlayMeleeSwingFX plays some effects.

Each of those StartDecisionWindow notifies were set up as blueprints that take parameters, so you can click on them from the montage view, and you get to specify parameters like so:


Lastly, here’s what that notify blueprint looks like. We set up a bunch of variables and then wire them up to call a native function defined on our player pawn:

When it goes to actually do the damage, the trace logic used by fortnite is actually really complicated and game specific, so not worth going into detail. Basically it does a bunch of capsule traces, figures out what it should hit, and then does damage to the targets. Anyway, that’s the basics of how you can use montages to make a melee system in UE4.

Here’s the notify blueprint I mentioned above

Wow, thanks for the information!

When it goes to actually do the damage, the trace logic used by fortnite is actually really complicated

Would love to hear more about it (or in general, the complicated C++ stuff) As this is the stuff where there aren’t that much tutorials :wink:

Sorry for opening up an old post, but would you be able to elaborate the function “Start Montage Decision Window” in the notify blueprint? Like are those inputs just names?

Yeah those inputs are just names. I hooped up the blueprint function to call Montage_JumpToSection and Montage_SetNextSection on the pawn’s UAnimInstance as appropriate, passing in those names. Eventually we will have a better way of identifying montage sections, the name solution is usable but error prone

Great, thank you for sharing.
It would be super useful if you could kindly make a video tutorial about making 1 of those combos. I searched all over the internet and unfortunately nothing out there about this topic. You can be the first :smiley:
Thanks a lot, again, for sharing :slight_smile:

Yes tutorial please. Have been searching for weeks, and have found nothing (at least at my comprehension level).

If possible I would like to get some more information on how to set up those decision windows as I am trying to create something similiar but a bit more complicated because the player can press 1 out of 4 buttons to determine which combo animation will play next (or none and return to idle on no input).

Yeah, he stopped at exactly the place I needed to know about! Drat! Is there any other sources on how to do the melee system traces properly? There’s an obvious gap of functionality in UE4 where Overlaps don’t give you HitResults and Hits necessitate collision…

I realize this is an old topic and an older version of the engine judging by the looks of the branching points. I hope I will get an answer. What is really confusing me is the anim montage given as an example. Why is every section containing the same animation? What is the point of this?

This question just got pinged, so I’ll drop a link here: The new Action RPG sample implements something very similar to this so take a look at that sample (plus documentation) for a practical example

Coincidentally the Action RPG sample came out today and illustrates some of this, I added a link below

Thank you very much ! That’s a big help! :slight_smile: