76 (edited by Steviebops 2015-04-08 10:58:56)

Re: Z - axis movement

I believe I now have a working patch that will add z-axis functions to vanilla V1.5 projects. Word of Warning: the patch is 256mb, so it's a bit weighty.

Here's the Google Drive link

https://drive.google.com/file/d/0B_Pzto … sp=sharing

Share

Thumbs up +2 Thumbs down

Re: Z - axis movement

As promised, here is a git version of the patch that will take an existing project and add in the changes with minimal conflicts.

https://www.dropbox.com/s/b0soopmlv9vr6 … patch?dl=0

cd  /PATH/TO/PROJECT
git am -3 /PATH/TO/0001-pid-1607-p160.patch

Share

Thumbs up +1 Thumbs down

Re: Z - axis movement

So this is a dumb question im a newb so far at coding but im getting better everyday I believe.  Currently practicing C# and ASP.net to improve my skillset and expand my horizons.  anyways all irrelevant stuff to the side, how do I install this diff file?  a 3D arena version of UFE is really exciting.

Re: Z - axis movement

You'll need to used some sort of Source Control software. The version I posted uses Sourcetree, the version roswell108 posted will work with Git.

Once you have a code repository (your project) set up, you can apply the file as a patch.

Share

Thumbs up Thumbs down

Re: Z - axis movement

Steviebops wrote:

You'll need to used some sort of Source Control software. The version I posted uses Sourcetree, the version roswell108 posted will work with Git.

Once you have a code repository (your project) set up, you can apply the file as a patch.

Both still need the gameobject changes. Yours covers the camera in testscene but the one I posted didn't include that since asset files don't register partial changes.

The guide you sent me was really easy to follow but I don't want to step on your toes wink

Share

Thumbs up Thumbs down

81 (edited by Steviebops 2015-04-09 18:25:11)

Re: Z - axis movement

What gameobject change was that? Im blanking on it.
Feel free to post any corrections I missed, there's no hassle there. big_smile

Share

Thumbs up Thumbs down

Re: Z - axis movement

Ive trimmed the patch for Sourcetree users down to <1.3mb.

You can get it here
https://drive.google.com/file/d/0B_Pzto … sp=sharing

There's some setup involved.
You also need to attach a rigidbody to the camera, you can turn off gravity there. The camera settings will need to be tweaked in the Global config window too.

Also in Global Config - Stages, you'll find Ring Radius. This is how large the area the players can move around, it replaces the old boundary values.

For each character, add an empty gameobject to their prefab hierarchy, set at around head height. This is for the camera to track.
Attach the CamPoint.cs from the MyScripts folder to each char. Add the empty you just created in the Child Empty field.

Your character can now step into and out of the background, and needs to have animations added to do that. You can add any one you want to avoid an error.
This also changes the way jumping works, as the up and down controls are now strafe. I use Block + up/down for jumping and crouch respectively.

Using the char Joan as an example, you'll find that the way forces are applied are now different as they can't be applied globally anymore.

For her Dash moves, simply invert the values, make the positive, negative and vice-versa. I did this, and she now dashes correctly, For Joan's dashes, Dash Back is x = 20
Dash Forward is x = -30.

If you want to add a side-dodge move, you can do so using a similar thing to the dash.
You would be creating a move, then adding force along the z-axis.

Auto-correct rotation is now more important, as you need to use it to have the characters aim their attacks at each other.
I recommend using it early in the move, so the player lines up against the opponent, but that opponent still has the opportunity to dodge.

You may also find Auto-correct useful for dodge moves. simply adding z-force tends to move the player out of the way, but gives no real advantage, one way of fixing this would be to have a combination of x+z force, as well as some autocorrect, so the player ends the dodge beside or behind the opponent, but within striking distance.

I added a new feature for moves. Under Active Frames - hits, you can now set the attack type as Horizontal or Vertical, as well as the standard hit type.
This is for dodging, as under Invincibility Frames, a new option, Dodge invincibility, gives you the choice to select Dodge Invincibility, which makes the player invincible to Vertical attacks, but not Horizontal.

There's some new stuff under the HitType as well, SwingFromLeft,SwingFromRight, these were just to test which side hits are coming from, there is a bug in the code, which I just found tongue It's an easy fix though.

In ControlsScript.cs, find the lines   else if (hit.hitType == HitType.SwingFromRight) and
else if (hit.hitType == HitType.SwingFromLeft),
replace that with 

 else if (hit.hitType == HitType.SwingFromRight)
            {
                if ( pRight || pFront)
                {
                    if (myMoveSetScript.basicMoves.getHitFromRight.clip1 == null)
                        Debug.LogError("Get Hit From Right animation not found! Make sure you have it set on Character -> Basic Moves -> Get Hit From Right");
                    currentHitAnimation = myMoveSetScript.basicMoves.getHitFromRight.name;
                    currentHitInfo = myMoveSetScript.basicMoves.getHitFromRight;
                    if (myMoveSetScript.basicMoves.getHitFromRight.invincible) myHitBoxesScript.HideHitBoxes(true);
                }
                else
                {
                    if (myMoveSetScript.basicMoves.getHitFromLeft.clip1 == null)
                        Debug.LogError("Get Hit From Left animation not found! Make sure you have it set on Character -> Basic Moves -> Get Hit From Left");
                    currentHitAnimation = myMoveSetScript.basicMoves.getHitFromLeft.name;
                    currentHitInfo = myMoveSetScript.basicMoves.getHitFromLeft;
                    if (myMoveSetScript.basicMoves.getHitFromLeft.invincible) myHitBoxesScript.HideHitBoxes(true);
                }
            }
            else if (hit.hitType == HitType.SwingFromLeft)
            {
                if (pRight || pFront)
                {
                    if (myMoveSetScript.basicMoves.getHitFromLeft.clip1 == null)
                        Debug.LogError("Get Hit From Left animation not found! Make sure you have it set on Character -> Basic Moves -> Get Hit From Left");
                    currentHitAnimation = myMoveSetScript.basicMoves.getHitFromLeft.name;
                    currentHitInfo = myMoveSetScript.basicMoves.getHitFromLeft;
                    if (myMoveSetScript.basicMoves.getHitFromLeft.invincible) myHitBoxesScript.HideHitBoxes(true);
                }
                else
                {
                    if (myMoveSetScript.basicMoves.getHitFromRight.clip1 == null)
                        Debug.LogError("Get Hit From Right animation not found! Make sure you have it set on Character -> Basic Moves -> Get Hit From Right");
                    currentHitAnimation = myMoveSetScript.basicMoves.getHitFromRight.name;
                    currentHitInfo = myMoveSetScript.basicMoves.getHitFromRight;
                    if (myMoveSetScript.basicMoves.getHitFromRight.invincible) myHitBoxesScript.HideHitBoxes(true);
                }
            }

This can be used in conjunction with new areas under the Character config,Get Hit From Left,Get Hit From Right.
There's code included to detect what side your char is being hit from, so the forces can be applied correctly.

Share

Thumbs up +2 Thumbs down

83 (edited by roswell108 2015-04-09 20:57:12)

Re: Z - axis movement

You covered it. The emptyChild

Here is the patch for the above changes (requires the first one already applied)
https://www.dropbox.com/s/2zdr2ogk18c97 … patch?dl=0

Share

Thumbs up +1 Thumbs down

Re: Z - axis movement

I am hoping over the next few days I can finish an update for the AI to go along with this. Might as well have the enemy move the same way.

Share

Thumbs up Thumbs down

Re: Z - axis movement

I'm working on a patch for UFE v1., unfortunately, Sourcetree keeps freezing on me, so it'll be delayed until I work around that.

Share

Thumbs up Thumbs down

86 (edited by Steviebops 2015-06-27 14:44:11)

Re: Z - axis movement

Latest patch is below

Should work with v1.6

I missed the camPoint Script, but it's basically just this

using UnityEngine;

public class CamPointScript : MonoBehaviour
{
    public Transform childEmpty;
    
}

I'll be testing as I go, but if anything is missing or off from the last version, please let me know.

Share

Thumbs up Thumbs down

Re: Z - axis movement

How do u impliment it in your game

Share

Thumbs up Thumbs down

88 (edited by Steviebops 2015-05-26 15:04:58)

Re: Z - axis movement

The instructions carry over from what's posted above.

Dodge invinc is re-added, the above link now has the latest version.

Share

Thumbs up Thumbs down

89 (edited by Steviebops 2015-05-27 11:51:34)

Re: Z - axis movement

Some missing code in the MoveSetScript.cs file

add these two lines

setBasicMoveAnimation(basicMoves.getHitFromLeft, "getHitFromLeft", WrapMode.ClampForever, BasicMoveReference.getHitFromLeft);
        setBasicMoveAnimation(basicMoves.getHitFromRight, "getHitFromRight", WrapMode.ClampForever, BasicMoveReference.getHitFromRight);

In with the other getHit stuff.

And in the ControlsScript.cs
Add these two extra bits to TestBlockStances And the same again to  TestParryStances

 if ((hitType == HitType.Mid || hitType == HitType.MidKnockdown || hitType == HitType.Launcher || hitType == HitType.SwingFromLeft || hitType == HitType.SwingFromRight) && myPhysicsScript.IsGrounded()) return true;

Replace the line in both of them with that to allow for being hit from the left and right side

Share

Thumbs up +1 Thumbs down

Re: Z - axis movement

Hi I'm having a bit of difficulty downloading the 1.6 patch you posted up earlier.  It says the link is invalid.

Additionally, I understand others have asked before, but can you please provide a very simple instruction on what to apply and when (not actual implementation, I'd rather figure that out so I can learn)?  For example:

1.  Apply 1.5/1.6 Patch
2.  Apply diff file
3.  etc.

This is awesome and I'm looking forward to testing it out.

Share

Thumbs up +1 Thumbs down

91 (edited by Steviebops 2015-06-29 17:37:50)

Re: Z - axis movement

Updated patch is in the post below.

Share

Thumbs up Thumbs down

Re: Z - axis movement

Steviebops wrote:

Apologies for the broken link, I think I had sharing off, try this one.

https://drive.google.com/open?id=0B_Pzt … authuser=0

Step 1
You basically apply the patch to a new v1.6 UFE project. However you apply a .diff  with your chosen software should be fine, I use Sourcetree.

Ok, so I apply the first .diff file (the 1.3 MB one) and then this one you posted above?  Thanks again for your assistance and prompt replies.

Share

Thumbs up +1 Thumbs down

93 (edited by Steviebops 2015-06-27 14:45:48)

Re: Z - axis movement

No, just the file posted above, the other one is outdated, Ill edit those posts for clarity.

The links above that again, are for UFE V1.5 ONLY.

I've left them in case anyone still wants them

Share

Thumbs up Thumbs down

94 (edited by Steviebops 2015-06-29 17:40:51)

Re: Z - axis movement

I have created a new patch, and ninjasdf was kind enough to test it, this should work on a clean UFE installation

https://drive.google.com/file/d/0B_Pzto … sp=sharing

You don't need to make any code changes with this patch.

Steps
1: Apply this patch
2: In the Editor:

You also need to attach a rigidbody to the camera, you can turn off gravity there. The camera settings will need to be tweaked in the Global config window too.
Also in Global Config - Stages, you'll find Ring Radius. This is how large the area the players can move around, it replaces the old boundary values.
For each character, add an empty gameobject to their prefab hierarchy, set at around head height. This is for the camera to track.
Attach the CamPoint.cs from the MyScripts folder to each char. Add the empty you just created in the Child Empty field.
Your character can now step into and out of the background, and needs to have animations added to do that. You can add any one you want to avoid an error.
This also changes the way jumping works, as the up and down controls are now strafe. I use Block + up/down for jumping and crouch respectively.
Using the char Joan as an example, you'll find that the way forces are applied are now different as they can't be applied globally anymore.
For her Dash moves, simply invert the values, make the positive, negative and vice-versa. I did this, and she now dashes correctly, For Joan's dashes, Dash Back is x = 20
Dash Forward is x = -30.
If you want to add a side-dodge move, you can do so using a similar thing to the dash.
You would be creating a move, then adding force along the z-axis.
Auto-correct rotation is now more important, as you need to use it to have the characters aim their attacks at each other.
I recommend using it early in the move, so the player lines up against the opponent, but that opponent still has the opportunity to dodge.
You may also find Auto-correct useful for dodge moves. simply adding z-force tends to move the player out of the way, but gives no real advantage, one way of fixing this would be to have a combination of x+z force, as well as some autocorrect, so the player ends the dodge beside or behind the opponent, but within striking distance.
I added a new feature for moves. Under Active Frames - hits, you can now set the attack type as Horizontal or Vertical, as well as the standard hit type.
This is for dodging, as under Invincibility Frames, a new option, Dodge invincibility, gives you the choice to select Dodge Invincibility, which makes the player invincible to Vertical attacks, but not Horizontal.

3: Add animations where needed for new stuff (dodges, sidesteps, hit reactions).

Share

Thumbs up +3 Thumbs down

Re: Z - axis movement

Made a clean project, imported UFE 1.6, made a commit in SourceTree, applied the patch, and every file came up rejected.

Share

Thumbs up Thumbs down

Re: Z - axis movement

May I ask, what files did you track in Sourcetree?

Share

Thumbs up Thumbs down

97 (edited by roswell108 2015-07-09 11:46:05)

Re: Z - axis movement

http://stackoverflow.com/questions/4770 … -not-apply solved the problem. Looks like Windows whitespace strikes again.

Looks good. Everything is up and running with no install issues other than needing the additional git flags on the merge. Kudos.

Share

Thumbs up +2 Thumbs down

98 (edited by roswell108 2015-07-09 15:02:31)

Re: Z - axis movement

I found a few other moves that need inverted x values (self applied forces / projectile)

Joan / HouyokuSen
Kyle / Launcher

Need further testing:

Kyle / FireBallHeavy
Kyle / FireBallLight

I managed to capture some video of an unusual issue that randomly happens after adding the z-axis. I haven't tracked down the cause or if some combination of auto-correct values will fix it.

[media]https://youtu.be/yJ16cQUE2Rs[/media]

Share

Thumbs up Thumbs down

Re: Z - axis movement

I hadn't intended to use projectiles, so I never adapted their code.
I did notice another issue with jumping characters, also in your vid.

When one player jumps, the other rotates around the x-axis to face them. I coded that out, rotation should only occur on the y-axis.

In the ControlsScript.cs, find the line

        newLookTarget = Quaternion.LookRotation(opponent.transform.position - _myTransform.position);

and immediately after, add the lines,

       
        newLookTarget.z = 0;
        newLookTarget.x = 0;

I've also discovered some issues with direction inputs + crouching.

Find the line
           

 currentSubState == SubStates.Blocking && UFE.config.characterRotationOptions.fixRotationWhenBlocking ||

and replace it with

           
isBlocking && UFE.config.characterRotationOptions.fixRotationWhenBlocking ||

Find the lines

                            if (!isBlocking)
                            if (!isBlocking && currentState != PossibleStates.Crouch)
                            {
                                if (toLeft)

and replace if(!isBlocking)
with                       

    if (!isBlocking && currentState != PossibleStates.Crouch)

The final bug I found today was getting the correct directional input WHILE crouching.
Look for this block

 if (currentState == PossibleStates.Stand                        
                            && !isBlocking
                            && !myPhysicsScript.isTakingOff
                            && currentSubState != SubStates.Stunned
                            && !blockStunned
                            && currentMove == null)

And add the line   

|| currentState == PossibleStates.Crouch

right after the stand one.

I hadn't got around to posting these changes here yet.

I can't say for sure if they'll fix your issue, but they are needed anyway.

I'll test the fireballs with the UFE chars, see if it  happens to me.

Share

Thumbs up Thumbs down

Re: Z - axis movement

Fireballs only seems to happen to player 2. The best I could find was that there is an option to mirror the animation for player 2 and it seems like with the inverted x, it is likely as simple as disabling that mirroring. The only problem being there is no mirroring checkbox, so it is likely hardcoded lol.

Share

Thumbs up Thumbs down