Universal Fighting Engine 2

Hello! I started to use UFE2 for a new prototype as a sub module besides a board game. Therefor it is necessary to load and unload the UFE2 scene. The first time the game starts a battle everything is working. But if the scene with the UFE object is being loaded a second time it stops because of weird behaviours. target platform is mobile. I need to switch scenes because of memory issues.

MissingReferenceException: The object of type 'Image' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
DefaultBattleGUI.OnGameBegin (ControlsScript cPlayer1, ControlsScript cPlayer2, UFE3D.StageOptions stage) (at Assets/UFE/Engine/Scripts/UI_Templates/DefaultBattleGUI.cs:417)
UFE.FireGameBegins () (at Assets/UFE/Engine/Scripts/Core/Manager/UFE.cs:822)
UFE._StartGame (System.Single fadeTime) (at Assets/UFE/Engine/Scripts/Core/Manager/UFE.cs:1335)
UFE+<>c__DisplayClass394_0.<StartGame>b__0 () (at Assets/UFE/Engine/Scripts/Core/Manager/UFEPart.cs:347)
UFE.ExecuteLocalDelayedActions () (at Assets/UFE/Engine/Scripts/Core/Manager/UFE.cs:361)
UFE3D.GameManager.UpdateGameState (System.Int64 currentFrame) (at Assets/UFE/Engine/Scripts/Core/Manager/GameManager.cs:146)
UFE3D.GameManager.DoFixedUpdate () (at Assets/UFE/Engine/Scripts/Core/Manager/GameManager.cs:18)
UFE.FixedUpdate () (at Assets/UFE/Engine/Scripts/Core/Manager/UFE.cs:1723)

image is part of the DefaultBattleGUI class. It is the content of the array of WonRoundImages.
Because of the crash the Game object and the UI is being instantiated multiple times until memory overflow occurs.

I appreciate every help, hint or solution if this problem is already known.

It depends on how you are loading UFE as a sub module. Are you using the Shell mode template? You can find an example scene here: UFE/Demos/_2DFighter/Shell_Mode/Demo 2D Fighter (Shell).

This video should tell you everything you need (skip to 1:30):

https://www.youtube.com/watch?v=z8-U8xi5CzI

Make sure you add both scenes (Demo 2D Fighter (Shell) and Demo 2D Fighter (Versus Mode Only)) to the β€œScenes to Build” under Build Settings as well as the training room scene listed under Config_2D_Fighter_Basic β†’ Global Editor β†’ Stages (UFE/Demos/Shared_Assets/Stages/TrainingRoom2D/TrainingRoom.unity)

New update is now available (version 2.6.0)
Source: http://u3d.as/1hgZ
PRO: http://u3d.as/1gRz
Standard: http://u3d.as/1hrC

Change log:
http://www.ufe3d.com/doku.php/changelog#version_260

Forum discussion:

Discord:

Thank You very much for the quick response. As far as I can see I followed exactly the example. I set up the needed info via script in the global config, then loading the scene containing just the camera and the UFE Manager object. The stage prefab contains all lighting for the scene. And the character configs are set dynamically regarding on the board situation of the board game. The first time the engine initialises completely fine. Th config and setup seem to work. The fight is working without any issue. Returning to the board game scene I am able to fetch the battle result.
But in the moment the Fight scene with the UFE Manager object is being loaded the second time, the Game object and the UI Canvas object in the Fight scene gets initialised multiple times. The scene is NOT loaded additionally. It is loaded exclusively. The bug happens exactly at the same place every time again (my original post above). If the exception is thrown somehow it starts again to instantiate the objects again and again. Why? It would be easier to debug if it wouldn’t instantiate again and again. I also don’t understand how the instance of a reference inside a prefab could be destroyed at runtime in this case.

Here the method which initialises the global config and loads the UFE scene:

private void InitializeGlobalInfoForFight()
{
    var gridIndexDefender = fightDataSo.Content.playerFightDatas[1].gridIndex;
    var gridTile = gridInfoProviderDataSo.Content.GetTileController(gridIndexDefender);
    var stageIndex = gridTile.CurrentEnvironmentDimension.StageOptionsIndex;

    // I don't know if this is necessary
    globalInfo.player1Character = fightDataSo.Content.playerFightDatas[0].playerCard.UfeCharacterInfo;
    globalInfo.player2Character = fightDataSo.Content.playerFightDatas[1].playerCard.UfeCharacterInfo;

    // This is necessary
    globalInfo.selectedStage = globalInfo.stages[stageIndex];
    globalInfo.deploymentOptions.deploymentType = DeploymentType.VersusMode;
    for (var i = 0; i < 2; i++)
    {
        globalInfo.deploymentOptions.activeCharacters[i] = fightDataSo.Content.playerFightDatas[i].playerCard.UfeCharacterInfo;
        globalInfo.deploymentOptions.AIControlled[i] = fightDataSo.Content.playerFightDatas[i].playerData.IsCPU || playAsCPUAnyway;
    }
    globalInfo.deploymentOptions.skipLoadingScreen = false;
}

The following is calling the above and loading the scene:

private IEnumerator LetThisHappenInTheNextFrame()
{
    yield return null;

    InitializeGlobalInfoForFight();
    SceneManager.LoadScene(gameConfig.FightSceneName);
}

I tested the Shell mode multiple times and could not replicate the issuer you are having. Are you using the latest version of UFE? (2.6.0)

This is the script that comes with it (LoadVersusMode.cs):

using UnityEngine;
using UnityEngine.SceneManagement;

public class LoadVersusMode : MonoBehaviour
{
    public UFE3D.GlobalInfo globalConfigFile;
    public UFE3D.CharacterInfo P1SelectedChar;
    public UFE3D.CharacterInfo P2SelectedChar;
    public int selectedStage;
    public string UFESceneName;

    public void LoadUFEScene()
    {
        globalConfigFile.deploymentOptions.deploymentType = UFE3D.DeploymentType.VersusMode;

        globalConfigFile.deploymentOptions.activeCharacters[0] = P1SelectedChar;
        globalConfigFile.deploymentOptions.activeCharacters[1] = P2SelectedChar;
        globalConfigFile.deploymentOptions.AIControlled[0] = false;
        globalConfigFile.deploymentOptions.AIControlled[1] = true;

        globalConfigFile.selectedStage = globalConfigFile.stages[selectedStage];

        SceneManager.LoadScene(UFESceneName);
    }
}

Maybe you have a script that is connecting to UFE and that script is not being destroyed, causing UFE to linger in the memory. Are you using event listeners? Try removing them before destroying the scene containing UFE.

How to make character fall down at life 0 when player1 attacks with power and player2 has reaction animation to be playing. If player 1 attacks with punches then player2 fall down when life is 0 but when player1 uses power to attack at final move then player 2 has static animation move playing instead of UFE reactions. So I want player2 fall down when player1 uses power move and player2 plays reaction animation then fall down only life is 0.

I’m currently working on a VR boxing game project and could use some advice.

I’m looking to integrate the Universal Fighting Engine (UFE) for its AI features with PuppetMaster to achieve more realistic physics-based animation during character interactions.

I’m wondering if anyone has experience integrating UFE and PuppetMaster simultaneously in a Unity project.

If anyone has tackled something similar or has tips on how to go about this, I’d greatly appreciate your insights! Any guidance, best practices, or pointers would be awesome.

Thanks a bunch in advance for any help you can provide!

UFE with puppetmaster
9631283--1368395--ezgif-2-7c06aab6b3-ezgif.com-video-to-gif-converter.gif

UFE without puppetmaster
9631283--1368401--ezgif-2-46315f984c-ezgif.com-video-to-gif-converter.gif

9631283--1368401--ezgif-2-46315f984c-ezgif.com-video-to-gif-converter.gif
9631283--1368395--ezgif-2-7c06aab6b3-ezgif.com-video-to-gif-converter.gif

I don’t think this is related to memory usage, but rather animation root motion. The characters seem to be using both animation motion and UFE physics when jumping or performing moves. Here, check out this post:

I don’t have any experience using that asset, but I found someone who attempted something nearly a decade ago in this post:
https://www.ufe3d.com/forum/viewtopic.php?id=20

This was attempted at UFE 1. No guarantees it would work today on version 2.6.

I meet a strange problem when I play the demo scene, can you please help me?

I’m unable to reproduce this issue. What license are you using (Lite, Basic, Standard, Pro, Source)?
And have you changed or did anything to the project that could have potentially caused the issue?

Hello,
I have tried to sign up for the website but I haven’t gotten the activation link and it has been several days. I tried signing up again and got nothing. I checked my junk/spam folder and got nothing. I emailed the webmaster and still nothing.
The problem that I am having is that I cannot get the character to rotate 90 degrees when setting up the hitboxes. So instead of using the hitbox transform boxes in the character window to rotate him, instead I used the rotation from the inspector window. However when I go to add a new hitbox, the hitboxes are not showing up. I have a video here. I also checked the gizmos to make sure that it is properly loaded. Please advise.

For support, use Discord instead:

:rocket: UFE 2.7.0 is here! :tada:
─────────────────────────────
Get the latest version:

─────────────────────────────

How to Update:

  1. Backup Your Project
    Before installing the new version, backup your project files to avoid accidental data loss.

  2. Export Stances (if applicable)
    If you have your moves assigned under "Move Editor -> Move Sets -> Stances (Preloaded)", click on β€œExport Stance”.
    This will create a new move set file that can be converted to UFE 2.7.0’s new data model.

  3. Replace the Files in Your Project
    Go to "<Project Folder>\Assets\UFE\" and delete all files in this folder before adding the new package files.

:warning: Important: If you have custom files inside this folder, move them to a safe location outside your project folder before proceeding.

  1. Update UFE in Your Project:
    • When reopening your project, you should see an alert prompting you to update to UFE 2.7.0. Click β€œProceed with Upgrade”.
    • Didn’t see the alert? Right-click any global file in the project and select UFE -> Apply 2.7.0 Update.

─────────────────────────────

Post-Update Adjustments:

While the update automates most changes, a few manual tweaks may be necessary:

  • Multi-Gauge Characters:
    If your characters use multiple gauges, open the Character Editor and add new gauges under the Gauge Options section.

  • Battle GUI Updates:
    Update the gauge definitions in your Battle GUI prefab:

    • Open Global Editor β†’ GUI β†’ Preset Interfaces β†’ Battle GUI.
    • Locate the Default Battle GUI and assign the correct Gauge ID and Meter Images to the new gauge definitions under Player1/2 GUI.

─────────────────────────────

Compatibility:

  • The update has been tested on data sets from version 2.5.3 and above. If you are using an older version, consider updating to 2.5.3 first.

─────────────────────────────

Changelog: https://www.ufe3d.com/doku.php/changelog#version_270
Documentation will be updated shortly. Stay tuned!