AAA combat interactions for your Godot game

<aside>

code: https://github.com/Gab-ani/Godot_Universal-Controller-tutorial/tree/episode-4-intermediate-interactions

</aside>

image.png

This character can hit, be hit, parry, and riposte. It also has stamina and HP pools and usages for them, and its codebase has zero "signal" keywords.

How to interact

image.png

Until now, our controller enjoyed an empty level. But characters must face enemies.

Common way to communicate with other entities often involves signals everywhere or a "game manager." Both are not ideal in this context.

<aside>

image.png

image.png

</aside>

The root cause of "signal plague" is incomplete understanding of game logic.

<aside>

move gd

move gd

When a transition occurs, we ask three questions:

  1. does something from the past force us to transition somewhere?
  2. If not, does something textual from the present modify our inputs?
  3. if nothing above, what vanilla state wants to default to?

So what I did is I renamed all previously overridden check relevances of our states to default life cycle.

Then I modified the state base to have an actually callable check_transition that implements the mentioned steps.

</aside>

Deal with parameters

image.png

Now, when we learn how to talk with people, our problems have just begun. You'll quickly find that instead of a nice conversation, they're bombarding you with questions about things you didn't know about yourself earlier and didn't even want to. We need to learn how to answer them effectively. These parameters have unique behaviors in every state and often are changed in time. I want to show two methods of conveniently doing it.

method 1

<aside>

image.png

Method one

simpler, quicker, but less scalable, and works best if your animations have a single window of something.

This approach works best if you have very little parameters with simple behaviors, "platformer" is probably what comes to mind.

</aside>