Topic: Implementing new functionality

Hello! I'm starting work on my own fighting game, and I am looking for a better tool to do it.

And I was wondering, will it be easier to use UFE as a base or just start from scratch? How hard will it be to add this things into the game code-wise

Character states:
- Fighting - Dizzy - KO - Dead.

Fighting - regular fighting
Dizzy - a character is standing but not fighting, dazed. Can be used to grab or perform special dizzy-only actions
KO - character is KOed. Can be still further used to punch, or perform a fatality
Dead - well, char is dead.

So in KO state character should have it's own behaviour and animations, for example it's own idle animation for trying to get up or something like that. Dizzy state - character is standing trying to keep balance.

- Fatality animations with dismemberment
- Grappling. Being able to grab an opponent and while holding him perform other actions. Walking, punching, throwing.

So, will it be easier to create such game on Unity with UFE, or from scratch on Unity or UE4?

Share

Thumbs up Thumbs down

Re: Implementing new functionality

You're better off with UFE and modding it to your needs  - which would only be fatalities, everything else you mentioned is either already included or coming in an update very soon.

Share

Thumbs up Thumbs down

Re: Implementing new functionality

Thanks for you reply.

A few more questions which I got after reading the manual:
- is it possible (or will it be in the near future) to create moves with dependency on ENEMY's state?


- is it possible (or will it be in the near future) to create unique reaction animations for ENEMY triggered by your move?

Because fatality is actually just a unique combo which can only be triggered when enemy is like in KO state, and that triggers certain animation for both chars...

anyway, thanks for the great tool smile

Share

Thumbs up Thumbs down

4 (edited by YumChaGames 2014-11-10 16:32:38)

Re: Implementing new functionality

Yes to both.  It's possible to do the latter to an extent now, but more options are available for it in 1.5 update (this was required for grapple reactions).  Check this thread for info, videos and demo.

EDIT: updated version reference

Share

Thumbs up +1 Thumbs down

5 (edited by ShadeAnimator 2014-11-10 13:35:24)

Re: Implementing new functionality

Well, guess just need to understand how to change enemy's state\stance now?

And figure out a way to add fatalities, which now seems to be possible without even going far into coding, right? smile

I mean, I guess putting a character into dizzy state can in theory be done through stance. But then I need to put him in said stance after his health is below something...

Share

Thumbs up Thumbs down

6 (edited by YumChaGames 2014-11-10 17:00:54)

Re: Implementing new functionality

For Fatalities, I would suggest creating a new state the player can be in (an addition to stun and down states, you could call it dizzy or fatalityReady or something).  Then, when the round end check comes in, check if there's a winner and if we're the loser put us into this new state for a preset time.

To create the fatality move, just make a move that is only possible when the opponent is in this new state and the distance you want the move to be triggered from.  The move should have opponent override to control their reaction to the fatality too.

The question I can't answer is how to swap the model with the fatality version (the dismembered one) on the fly.  If that could be baked into an animation somehow, you could have it as part of the reaction move.  But I'm really not sure at all on that.

If you can solve the model swap, that should be all that's required. But I should mention, I haven't tried any of this smile.  Good luck!

EDIT: thought of the fatality model issue.

Share

Thumbs up Thumbs down

Re: Implementing new functionality

And to create a new state I need to add it in the code, or it can be somehow done through the GUI?

My bet is on code, but I'd like to ask anyways smile Thanks for answering my questions

Share

Thumbs up Thumbs down

Re: Implementing new functionality

Yes, you'll need to edit code to add a new state.

Share

Thumbs up Thumbs down

Re: Implementing new functionality

Well, I searched the whole code for states, found where substates are, but can't yet find where they are added into the GUI Move Editor?

Share

Thumbs up Thumbs down

Re: Implementing new functionality

Custom Editors need their files in an Editor folder.  If you are using MonoDevelop, you'll see that your project has at least two branches (I think that's what they're called):  Assembly-CSharp and Assembly-CSharp-Editor.  The editor one has all the editor files (expanding the branch, you can see the files in an Editor folder).  Anyway, all this means is to make a change to a UFE custom Editor Window, you'll need to change the appropriate editor file in the .\UFE\Editor folder.

But you won't need to edit the Move Editor file to get the new state to appear in Player Conditions.  Because if you just the add a new state to MoveInfo.cs as per code below, it will appear as part of the drop down.

public enum PossibleStates {
    Stand,
    Crouch,
    StraightJump,
    ForwardJump,
    BackJump,
    Down,
    FatalityReady
}

http://i.imgur.com/lkWPP1V.png

This will only help you for creating the Fatality move though.

For the rest of it, you'll need to add this to the Character Editor (move sets), in order to have a proper animation assigned (the standing dizzy animation).  And then you'll need to create a whole new case to trigger this new state.  Have a look in ControlsScript.cs, start with this function:

public void EndRound()

Good luck!  In theory, it shouldn't be too hard to implement this.  Depending on your skill level, it could take anywhere from a day to a week to work it all out.

Share

Thumbs up +1 Thumbs down

11 (edited by ShadeAnimator 2014-11-13 08:02:49)

Re: Implementing new functionality

I guess more like a week... smile

So it is better to get it through possibleStates and not substates, right?

Thanks for your answer, you helped a lot already smile

Well, I was able to add new state, and I thought about maybe going with a different apporach...
On life points change - if one's health is below 100 - change state to fatalityready. But... I was able to change combat stance at this point, but did not yet find how can I change player's state through code? Still looking through it.

Share

Thumbs up Thumbs down

Re: Implementing new functionality

Yeah, use State instead of SubState.  State is the primary condition the character is in, so it's ideal for a FatalityReady condition.

Share

Thumbs up Thumbs down

Re: Implementing new functionality

Can't find yet how to change player's state through code =\

Share

Thumbs up Thumbs down

Re: Implementing new functionality

This line:

currentState = PossibleStates.Stand;

changes state to Stand.


This code:

if (currentState == PossibleStates.Down) {
    // I'm down, so something...
}

check's state is Down, at which point it does something.


I recommend the Unity Lessons (specifically, Scripting) to better understand how to code in Unity.

Share

Thumbs up +1 Thumbs down

Re: Implementing new functionality

Nah, I'm just trying to know how this particular code works, what functions are there and how they interact with each other. Already managed to alter end-round event and switch player's state after loosing the round, and giving some health back. But character just stays lying down until moving him through input controls... Well, just need to read the code deeper I guess.

Before I was mostly asking about how to change player's state through GUIScript code. In case I needed it.

Thanks anyway smile

Share

Thumbs up Thumbs down