Search Unity

Universal Fighting Engine 2

Discussion in 'Assets and Asset Store' started by Mistermind, Jul 20, 2018.

  1. MTegarAsta

    MTegarAsta

    Joined:
    Oct 23, 2019
    Posts:
    39
    Already Toggled, it's not often happening, maybe hardware or OS related.

    Thank you. to make this easier to reproduce you can try pausing and unpausing di Editor (to simulate stuttering) when playing with another player. There must a constant input coming from both players.
     
  2. MTegarAsta

    MTegarAsta

    Joined:
    Oct 23, 2019
    Posts:
    39
    Hey umm did u know a way to make 3-player in a room? the other one is for spectator.
     
  3. Mistermind

    Mistermind

    Joined:
    Jun 8, 2013
    Posts:
    844
    More then 2 players (including spectator mode) will be available on UFE 3. I'll post more information about it soon.
     
  4. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I've been watching the development of UFE 2 and I'm wondering if there will be a feature where I can change the start point of the fight, especially if the master level has more than one location.

    An example of this would be a courtyard where it also has an interior level (you can see the outside level) and I would hate to move the entire asset just to have certain part of the level at 0,0,0.
     
  5. MTegarAsta

    MTegarAsta

    Joined:
    Oct 23, 2019
    Posts:
    39
    there is already a feature for that I believed, in stage > position
     
    Mistermind likes this.
  6. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Oh, good to know. I don't have UFE 2 but I'm planning to eventually upgrade from UFE 1 and get back to work on my game
     
  7. Mistermind

    Mistermind

    Joined:
    Jun 8, 2013
    Posts:
    844
    KRGraphics likes this.
  8. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Hi,

    i have a couple of questions !

    1. Scaling : project characters seem to be like 7 meters tall and the test arena is 23 meters tall. The test character i created is like 1.85m tall and the arena models, particle systems etc. we have prepared are also modeled to match our characters size... Is there any reason the scaling in the project is that big and can we setup everything so it feels proper when we use custom characters with "normal" scale (see the image below) ?

    2. Mobile input. I can build the game for android but i can't find info on how to deal with input for mobile devices. Can you please give some info or point me to the documentation ?

    Cheers

    upload_2022-10-7_13-37-15.png
     
    Last edited: Oct 7, 2022
  9. Mistermind

    Mistermind

    Joined:
    Jun 8, 2013
    Posts:
    844
    The templates that comes with UFE have different scales due to some old configuration settings being carried out from previous versions of both Unity and UFE.
    If you are planning on using UFE's demo files as your base, I recommend looking into the following options and values:

    Global Editor -> Camera Options (http://www.ufe3d.com/doku.php/global:camera)
    Global Editor -> Advance Options -> Global Gravity (http://www.ufe3d.com/doku.php/global:advanced)
    Character Editor -> Physics -> Character's Weight and Ground Collision Mass (http://www.ufe3d.com/doku.php/character:physics)
    Move Editor -> Active Frames -> Force Options (http://www.ufe3d.com/doku.php/move:activeframes)
    Move Editor -> Applied Forces (http://www.ufe3d.com/doku.php/move:selfappliedforce)

    I plan on updating all template files to a proper scale on UFE 3, but that might take a while.

    UFE supports several third party input systems, some allowing for direct integrations to the tool. Please read this page:
    http://www.ufe3d.com/doku.php/global:input

    Here are some third parties that provide quick integration to UFE:
    https://guavaman.com/projects/rewired/
    https://assetstore.unity.com/packag...t/control-freak-2-touch-input-made-easy-11562

    Here is a demo:


    The creator of Control Freak also made a tutorial:

     
    Vagabond_ likes this.
  10. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Hi @Mistermind

    thanks for the answer, it's all good. However i have a following question about mobile input. If i want to implement a custom input class and UI ( joystick and buttons ) and not using the "Control Freak 2" plugin, can i do that in theory and if yes how i would do that ?

    EDIT : nvm, i actually found a way. I did create a custom input class based on "AbstractInputController" like in the example in the docs ! Thanks !

    Cheers.
     
    Last edited: Oct 8, 2022
    Mistermind likes this.
  11. Mistermind

    Mistermind

    Joined:
    Jun 8, 2013
    Posts:
    844
    You can also look at the file GUIControlsInterface.cs for reference.
     
    Vagabond_ likes this.
  12. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    You know what I want to see? Is there a tutorial on UFE about material effects, such as turning the opponent into gold (freezing all animation on contact).
     
    kalani_fx and Mistermind like this.
  13. MTegarAsta

    MTegarAsta

    Joined:
    Oct 23, 2019
    Posts:
    39
    I really need this ASAP, for online Tournament. Is There a Work around for this?
     
  14. Mistermind

    Mistermind

    Joined:
    Jun 8, 2013
    Posts:
    844
    Sorry, unfortunately its not that simple. UFE 2's netcode (and subsequentially the rollback system) is internally designed to work with only two players. I tried adding Spectator support to UFE 2 code base sometime ago, but I was not able to successfully get it working until I redesigned the entire system to support more than two players with UFE 3.

    Expect more news about UFE 3 in a couple months.

    PS: There could be alternative solutions for the spectator mode that doesn't involve changing the code, maybe something along the lines of streaming the gameplay directly. Try researching on that:
    https://assetstore.unity.com/?q=streaming&orderBy=1
     
    Last edited: Oct 14, 2022
  15. MTegarAsta

    MTegarAsta

    Joined:
    Oct 23, 2019
    Posts:
    39
    Yes, currently I using streaming the gameplay directly, but I have problem with bandwidth, the game just straight up unplayable when using streaming Logic (Neither FPS drop Or High Ping)

    Also, I recommend using The New Photon Fusion for UFE 3
     
    Last edited: Oct 14, 2022
    Mistermind likes this.
  16. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
  17. MTegarAsta

    MTegarAsta

    Joined:
    Oct 23, 2019
    Posts:
    39
    I Use one of these (the first one) and it works perfectly.
    and i think it will work the same for others
     
    Mistermind and Vagabond_ like this.
  18. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Hi @Mistermind

    we bought a couple of Mecanim compatible animation packs from the store.
    It's all set to Mecanim and all animations work ok with a custom controller and a custom model we use.

    I use the Robot Kyle AnimSet with the custom character and all works great, but as soon as i change the idle or walk animation clip with one of these packs, it starts to cut off animation at some point, as they are not completing. It's like idle/walks are reaching the middle of animation and then start over !

    Ho to fix this ?
     
    Last edited: Oct 20, 2022
  19. MTegarAsta

    MTegarAsta

    Joined:
    Oct 23, 2019
    Posts:
    39
    I think is because it uses animation map, so neither you turn off the animation maps or record the basic move animation for that character. to turn off the animation map you can find it on character editor > Move Sets > Use Animation Map, and for Record the maps you can find a scene name MapRecorder on your project, Assign your character on the script then record the basic move. (keep in mind if you trying to make the game Online, you should to record the character move sets)
     
    Mistermind likes this.
  20. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Ahhhhh yeah, i forgot about this. It now perfectly works. Thank You so much : )
     
  21. MTegarAsta

    MTegarAsta

    Joined:
    Oct 23, 2019
    Posts:
    39
    is there a way to make me as a player to behave using AI when online? because I can only play 1 instance in 2 editors.

    Edit:
    ok found it, just call UFE.SetCPU(UFE.multiplayerAPI.GetPlayerNumber(), true); before going to gameplay (in character select or stage select)
     
    Last edited: Nov 7, 2022
    Mistermind likes this.
  22. BaoBao55

    BaoBao55

    Joined:
    Apr 8, 2016
    Posts:
    13
    Hi, I have some questions about this asset.
    1.Is this asset optimized for mobile?
    2.Do you know the minimum android build size when using Universal Fighting Engine?
     
  23. Mistermind

    Mistermind

    Joined:
    Jun 8, 2013
    Posts:
    844
    If you mean "mobile friendly" the answer is yes. Check out this reply (2nd answer):
    https://forum.unity.com/threads/universal-fighting-engine-2.541442/page-10#post-8497409

    UFE is essentially a fighting game physics engine running on top of Unity. It doesn't interfere with the platform you are building your game on. Android build sizes is entirely dependable on the assets you use for your game.
     
    Last edited: Nov 10, 2022
  24. LeeHearn

    LeeHearn

    Joined:
    Aug 28, 2022
    Posts:
    1
    How do I add a button from the VersusModeScreen to the MainMenuScreen?

    When I open the VersusModeScreen.prefab, I see that the buttons have "On Click" events. The Button_Player_vs_Cpu has a call to the DefaultVersusModeScreen.SelectPlayerVersusCPU method. I want to add a button to the MainMenuScreen.prefab that calls the DefaultVersusModeScreen.SelectPlayerVersusCPU method. What steps do I need to folow to implement that?
     
  25. Mistermind

    Mistermind

    Joined:
    Jun 8, 2013
    Posts:
    844
    Open the file "DefaultMainMenuScreen.cs" and add the following code under the class bracket:
    Code (CSharp):
    1. public void StartPlayerVersusCpu()
    2. {
    3.     UFE.StartPlayerVersusCpu();
    4. }
    Then under MainMenuScreen.prefab, create a new button using the UI tools (watch this tutorial) and assign the "On Click" event to the new function you just created.
     
  26. Mistermind

    Mistermind

    Joined:
    Jun 8, 2013
    Posts:
    844
  27. Mistermind

    Mistermind

    Joined:
    Jun 8, 2013
    Posts:
    844
  28. MTegarAsta

    MTegarAsta

    Joined:
    Oct 23, 2019
    Posts:
    39
    hi is there a way to speed up the recording process? like increase the game speed (timescale)? does it work? even its going to take more CPU power I'm down for it. It just takes too long for a single character that has more than 100 different moves.
     
  29. Mistermind

    Mistermind

    Joined:
    Jun 8, 2013
    Posts:
    844
    You could try adjusting Unity's Fixed Timestep under Project Settings -> Time, but I wouldn't recommend for the sheer chance of missing frames.
    I wouldn't worry so much about it. You only need to run the process once. I recommend only running when you are ready to test it online.
     
    Last edited: Nov 15, 2022
  30. MTegarAsta

    MTegarAsta

    Joined:
    Oct 23, 2019
    Posts:
    39
    in move editor there is a name for the move and it says Unique ID does it must be unique? and what happen if it's not unique? because I just realize it, normally I just copy paste the move for other character.
     
  31. Mistermind

    Mistermind

    Joined:
    Jun 8, 2013
    Posts:
    844
    Yes it is important. The move chain system uses the unique ID to identity possible links.
     
  32. MTegarAsta

    MTegarAsta

    Joined:
    Oct 23, 2019
    Posts:
    39
    (50) 2022 11 17 14 55 40 - YouTube

    I tried to make a new UFE project with the same setting that I use in my main project and see if the desync can occurred or not, here I'm using UFE 2.4 (using UFE 2.5 has the same result) its desync and not disconnected, but if I use playback tools, the tool work perfectly, what do u think? I rather try make the game to sync it back rather that disconnect the client (I'm using 3D with z lock)
     
  33. Mistermind

    Mistermind

    Joined:
    Jun 8, 2013
    Posts:
    844
    Try updating to the latest version (2.5.1):
    http://www.ufe3d.com/doku.php/changelog
     
  34. MTegarAsta

    MTegarAsta

    Joined:
    Oct 23, 2019
    Posts:
    39
    correct me if I'm wrong, after seeing version 2.5.1 does the disconnect desync action just the same as playback tool? but it's just disconnect the player rather showing replay tools? because I don't have any plan to upgrading UFE and keep going to stick with 2.4 because there are so many things I changed in source.
     
  35. Mistermind

    Mistermind

    Joined:
    Jun 8, 2013
    Posts:
    844
    That is correct, but there was an update on 2.5.1 that reenforced the disconnection handlers. Without this update the force disconnection might not occur. We have a video explaining how to upgrade to 2.5 here:


    To know more about the changes between versions check out the change log page:
    http://www.ufe3d.com/doku.php/changelog

    If you made changes to the Source (specially to files that controls the physics and gameplay like ControlsScript or PhysicsScript) and didn't properly track the new variables on the Flux scripts (FluxStateTracker and FluxStates), your game will probably desync almost immediately. If you don't want to deal with this, I recommend simply disabling Rollback (allow Rollback option), since the Frame Delay netcode doesn't require the "time travel" scripts.
     
  36. MTegarAsta

    MTegarAsta

    Joined:
    Oct 23, 2019
    Posts:
    39
    all variable on ControlsScript and PhysicsScript already tracked on Flux, it just sometimes it's desync when packet loss occurred or game Freezing, and for disconnection handler itself I want to use my own handler, because I don't like the way it's just disconnect both the player, I want the non-master to disconnect and reconnect back, I already make reconnect feature in my game and currently it work pretty good (I think :) ).

    there just so many things that I want the game to be like but doesn't have that feature in UFE engine, so that's why I make my own feature that I want in the engine itself.
     
  37. Mistermind

    Mistermind

    Joined:
    Jun 8, 2013
    Posts:
    844
    I see. As you described, the fix for the disconnection option (Sync.action) is available in the newer version. I highly recommend updating it to 2.5.1, even if you have to carry some of the changed code. Source control tools like GIT and SourceTree will help you tremendously with these kind of tasks.

    If you want to just fix this specific issue, look into the changes made to the following files (Use Notepad++ to compare them):
    NetworkSynchronizationAction.cs
    FluxCapacitor.cs
    Basically, search for the uses of the NetworkSynchronizationAction enum in the new version and follow the code differences around those segments.
    Additionally, under UFE.cs I also added a new event listener to UFE.multiplayerAPI.OnDisconnection.
     
    MTegarAsta likes this.
  38. MTegarAsta

    MTegarAsta

    Joined:
    Oct 23, 2019
    Posts:
    39
    I see, thanks for the information, yeah normally I will compare the default 2.4 version with 2.5.1 to see the different, and if it needed, I will just implement it on my game.
     
  39. Mukki

    Mukki

    Joined:
    Jun 4, 2022
    Posts:
    3
    Same Problem does anyone have solution?
     
  40. Mistermind

    Mistermind

    Joined:
    Jun 8, 2013
    Posts:
    844
  41. Mistermind

    Mistermind

    Joined:
    Jun 8, 2013
    Posts:
    844
  42. MTegarAsta

    MTegarAsta

    Joined:
    Oct 23, 2019
    Posts:
    39
    hi, I found that if you have more than 128 characters in game it will stuck in CharacterSelection when in online mode, it turns out that it's saving the index of the character in sbyte (which has 128 max) so I change the code to use short instead (because using a normal byte will not enough for me, I have more that 256 characters), apart from increasing bandwidth is it ok to use short for long term? so far I not found any problem by doing so.
     
  43. Mistermind

    Mistermind

    Joined:
    Jun 8, 2013
    Posts:
    844
    Oh, you will be fine. the variable "_selectedOptions" is only used for menus.
    Glad to hear there were no problems.
     
  44. Mistermind

    Mistermind

    Joined:
    Jun 8, 2013
    Posts:
    844
    New overview video (replaces the old one):
     
  45. MTegarAsta

    MTegarAsta

    Joined:
    Oct 23, 2019
    Posts:
    39
    hi, how is DelaySynchronizedAction actually work? does it need to all the client to call this function to works? or a single client can call this function and the second client will receive it?, I want to make a single client call a function but the second client have to call this function as well without calling it by itself (like RPC) and both will execute at the same time/frame.
     
  46. Mistermind

    Mistermind

    Joined:
    Jun 8, 2013
    Posts:
    844
    No, UFE doesn't implement RPC. DelaySynchronizedAction works as a delay function call (similar to Coroutines or Invoke). I wrote an example here on how it works.
    For more on how UFE's network works, check out this video:
     
  47. swantonb

    swantonb

    Joined:
    Apr 10, 2018
    Posts:
    172
    Hi, you still haven't fixed your demo webgl build, it crashes when you open the multiplayer menu.

    I wanted to test this multiplayer differences that im getting:


    https://gyazo.com/8883fb491bab56c126e92a37ee130f8e

    or look at this video: https://www.dropbox.com/s/gls7dhkuu13jq2n/2022-12-08 12-50-57.mkv?dl=0

    this is at the same time, the lifebars dont sync correctly, one player is dead and in a different position, the timer doesnt sync correctly. Your multiplayer api is very strangely written.

    I cannot test in your latest version because the webgl player crashes when opening the multiplayer menu. Why is this not fixed yet? I reported it months ago.

    Also, in case you know about this issue and maybe you've fixed it in latest version, could you point me where the fix is, in which scripts so i could copy the parts of code responsible for syncing? i copied over photonmultiplayerapi.cs and photonconnector.cs and the result is still the same, the photos above are using this version of those scripts.

    Sorry for ranting but for this price tag i dont expect such rookie mistakes in a network game.
     
    Last edited: Dec 8, 2022
  48. Mistermind

    Mistermind

    Joined:
    Jun 8, 2013
    Posts:
    844
    Which license of UFE 2 are you using? (Standard, PRO or Source)?
    Are you using version 2.5.1?
    Did you run the animation mapper before compiling the characters to online play? If not, watch this video:


    After watching that one, watch this one about handling desync issues:


    Also, be aware that WebGL builds are notorious for being buggy and hard to debug. Its common knowledge at this point, and we pointed it out multiple times in videos and documentations. If you want to get technical, read this:
    https://medium.com/medialesson/so-you-want-to-use-multithreading-in-unity-webgl-5953769dd337

    The WebGl demos available on the website are from version 2.5.1 and they function as intended:
    http://www.ufe3d.com/demo/
    Here is a video of WebGL in action:


    Since you didn't link them, I took the time to and went back to read your messages. Other than the fact you are exporting your game in WebGL, They had nothing to do with the reports you are giving now.


    I can't stress this enough: This tool is made for game developers. Although we work hard to make development as easy and intuitive as we can, a certain level of experience in the area is required in order to use not only this but many other tools in the Asset Store.

    This is what I expect a game developer to know:
    1 - How to research. The official forum is picked up by search engines. You can type any question on Google related to UFE and chances are it will give you a forum link.
    2 - How to report issues (including ways to replicate it). Read your post. The only answers I'm left with are "you are wrong" or "you are right". There are no means or any attempt to find a solution.
    3 - How to talk to other developers, read their questions and answers. Aside from this Unity Thread we have a Discord and our own Forum.
    4 - How to study. Watch ALL video tutorials (it doesn't seem like you did). Make sure you also check the other playlists for additional videos.
    5 - How to be patient and mindful. Please don't blame shift - Nothing good comes out of this kind of behavior. Think of it this way: Am I the only one having this problem? If yes, how can I solve it? If I need help, how do I explain a step-by-step procedure so others can replicate it?

    If any of these is too much to handle, you can always find professional help in our Jobs forum as well as the #jobs channel in our Discord.
    For more on general behavior in this community, please read this post I wrote a few years ago.
     
    Last edited: Dec 8, 2022
  49. swantonb

    swantonb

    Joined:
    Apr 10, 2018
    Posts:
    172
    We are using Source.

    Like I said, we are on a earlier release which probably had this sync issue. We've noticed in the changelog some fix in 2.5.1 about syncing and we figured that is what we need, but now that I read the changelog again, there was never a sync issue, right? You changed something about the desync setting which should just disconnect the players if there is a sync issue.However, we cannot test as the demo webgl build is broken.

    I copied over the photonmultiplayerapi.cs and photonconnector.cs scripts from 2.5.1 in our project. I hoped there was a fault in those scripts that caused the health sync problem but the issue is still there.

    So pretty much I still dont understand what the problem is. The main problem is to WHY the desync happens, could it be the animation mapper? It wouldn't make sense tho, now that i've seen the video about the networking there is no connection between the mapper and why the health bars would be different. The animation mapper has a smooting purpose.

    https://www.dropbox.com/s/gls7dhkuu13jq2n/2022-12-08 12-50-57.mkv?dl=0

    See my video again, the distances between players match, the movements match, there is not much of a problem there, except the health bar.

    According to you if such desync happens then the game should disconnect both players. OK, but we dont want to disconnect them, we want the sync to be correct, don't we? So im still trying to understand why the health bar would not sync correctly? None of your suggestions help me understand that. It can't be the animation mapper as far as i can tell.

    Plus, the moves are the same, it's not like there is on a game instance a move that takes more damage than the same move on another game instance. The game is 100% the same in both instances. We even use one single player, and we spawn different armors on the same base model. So even the player is the same, using the same moves set.



    Sure, but here is the same demo on my end: https://www.dropbox.com/s/8btt2sr6kzi2kev/webgl not working.mp4?dl=0

    Also this doesnt only happen on my pc, it happens to anyone i've given this link to and thats about 10 people. Am I crazy or there is indeed something wrong? It cant only be working at you but for 10 of my friends it wont load the multiplayer menu. I can also notice you're showing me 2.0 in that video, it's probably an old video, you're not playing the game that is currently on your demo page. Now i should ask, why would you give me a video from 8 months ago and not just go on your demo page, play the build and see its broken? What are you trying to prove by showing me a video recorded on another build?



    In conclusion, could you point me to the right direction on debugging/fixing this health sync issue, knowing that the game is literally the same on both ends, desync disconnection doesnt happen (and as far as im concerned it shouldnt disconnect the players but sync correctly), the moves are the same etc. It's not like in your example where one of the games have different settings. This shouldnt happen when the game is literally the same, right?

    btw if it helps with anything those are the photon settings i have:
    https://gyazo.com/064e17ecea3ccd0683634e5a87ec8919

    There is only one difference between your example and my game, i didnt run the animation mapper but that again shouldnt be the cause.

    Could you let me know if this health bar issue was a known issue in earlier versions and it was fixed in later versions? And if yes then could you point me to the scripts that were modified in order to make it work, so i could do the same changes? We have a lot of changes and can't really start over with the last version.


    edit: fixed the animation mapper


    I'm gonna apologise again for ranting, I understand you but it's been a lot of struggle on this matter and there is still no result. There is clearly something wrong in the code and I dont have to be a game developer necesarily to be able to point out the obvious: the code is wrong somewhere, everything syncs fine but the health bar and sometimes the timer as well! Plus, the game doesnt even know there is a problem happening so that it disconnects due to desync. So my discontent is legit but I apologise for my behaviour. Now let's please get to the bottom this. I would prove you that there is a problem in your latest build too with health sync, if you'd fix it so I could play it.



    edit2: i just inspected the video again and took a closer look, it seems that a move was synced twice, hence it took double the damage.

    Go to this video: https://www.dropbox.com/s/gls7dhkuu13jq2n/2022-12-08 12-50-57.mkv?dl=0

    notice that at 0:11 the left player sends one ball attack, but the player in the right side receives 2 ball attacks and his lifebar takes the damage amount twice because he received it twice. That's the issue right there. What could cause this and how can I get this to be fixed?

    oh btw, i did the animation mapping too, the problem is still there, so as i expected, it had nothing to do with it.
     
    Last edited: Dec 12, 2022
  50. Mistermind

    Mistermind

    Joined:
    Jun 8, 2013
    Posts:
    844
    No, those are not the scripts that got changed on the 2.5.1 update. To check individual changes I recommend using version control tools like GIT (along tools like SourceTree). These links should help you:
    What is version control?
    Git - Getting Started
    SourceTree Website

    I see. So the issue is on Room Match (not Random Match) on the WebGL demo build. I'll take a closer look and update the demo to 2.5.1

    The animation maps are essential to run matches with Rollback enabled. Did you made sure each character has "Use Animation Maps" toggled under Character Editor -> Move Sets? This might be a reason why you are still experiencing desyncs.

    Also, be aware that the way variables are setup internally are extremelly sensitive due to the nature of variable tracking with rollback. If you are changing the Source code make sure you read how the variables are stored in every frame by accessing the files "FluxStateTracker.cs". Alternatively, you can also use custom code by using the [RecordVar] attribute:
    http://www.ufe3d.com/doku.php/global:netcode#custom_code

    If you are unsatisfied with the product I recommend requesting a refund from Unity by emailing them your invoice # at support@unity.com