Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

SmartFoxServer Multiplayer Games Engine

Discussion in 'Multiplayer' started by g_a_p, Oct 12, 2018.

  1. Desert-Tiger-Games

    Desert-Tiger-Games

    Joined:
    Sep 20, 2015
    Posts:
    25
    Thanks for the answer.
     
  2. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    265
    We have just released SmartFoxServer 2X 2.17.0, codenamed “Flash Farewell” as we have cut the remaining ties with the old Flash-based Administration Tool.

    It seems that many users forgot about the termination of Adobe Flash on Jan. 12th 2021 and have found themselves unable to reach their servers with the legacy Admin Tool. This release is particularly targeted at those users, as it packs all the recent updates in one installer.

    Read more about installation and migration to SFS2X 2.17.0 in our support forum post.

    Download and release notes.
     
  3. btckey

    btckey

    Joined:
    Nov 1, 2012
    Posts:
    40
  4. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    265
  5. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    265
    That demo wasn't created by us, so no, we don't have it, sorry. Anyway, from a SFS2X point of view, it uses the same logic described in the example linked above.
     
  6. btckey

    btckey

    Joined:
    Nov 1, 2012
    Posts:
    40
    Good day

    1)

    The PhotonServer does not allow you to unite a large number of players in one room for example 500+
    SmartFoxServer 2X will give me the ability to combine 500+ in one room?
    My game is made in Unity 3D, WebGL
    I am currently using ObjectMovement from example

    2)
    How to sync character animation ?
    I did not find this in any of the examples, only movement.
     
    Last edited: Mar 2, 2021
  7. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    265
    Hello,
    Yes, SFS2X provides MMORooms which are a special type of Room that can handle thousands of players via an AoI (Area of Interest) mechanism. Players in these Room will not listen for every other player's updates, but only for those whose current position falls within the AoI.

    More details here:
    http://docs2x.smartfoxserver.com/AdvancedTopics/mmo-rooms

    There isn't a pre-baked mechanism for syncing animations. Typically what you need to do is adding the animation id/data to the movement data you're sending from client to server and vice-versa.

    The MMODemo and SpaceWar game examples demonstrate two real-life use-cases for the MMORoom:
    http://docs2x.smartfoxserver.com/ExamplesUnity/mmo-demo
    http://docs2x.smartfoxserver.com/ExamplesUnity/spacewar

    The relative code can be downloaded from our website or through the relative example pack in the asset store.
    ( https://assetstore.unity.com/packages/tools/network/smartfoxserver2x-multiplayer-sdk-17261 )

    Cheers
     
  8. btckey

    btckey

    Joined:
    Nov 1, 2012
    Posts:
    40
    Good day
    A lot of mistakes FirstPersonShooter

    Unity 2018.2.2f1 (64-bit)
    1) Unloading broken assembly Assets/Plugins/UWP/SmartFox2X_UWP.dll, this assembly can cause crashes in the runtime
    2) Assets/Game/Scripts/NetworkManager.cs(26,10): error CS0433: The imported type `Sfs2X.SmartFox' is defined multiple times
    3) Assets/Game/Scripts/NetworkManager.cs(134,32): error CS0433: The imported type `Sfs2X.Core.BaseEvent' is defined multiple times
    4) Assets/Game/Scripts/NetworkManager.cs(194,39): error CS0433: The imported type `Sfs2X.Entities.Data.ISFSObject' is defined multiple times
    5) Assets/Lobby/Scripts/LobbyController.cs(151,32): error CS0433: The imported type `Sfs2X.Entities.User' is defined multiple times

    Unity 2019.4.20f1 (64-bit)



    This is generally treated ?
     
    Last edited: Apr 6, 2021
  9. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    265
    Hello. You need to assign each DLL to the related build target. Please check the "Unity" paragraph on this page: http://docs2x.smartfoxserver.com/GettingStarted/client-api-csharp
     
  10. btckey

    btckey

    Joined:
    Nov 1, 2012
    Posts:
    40
    These errors occur on the newly downloaded FirstPersonShooter
    Try to run your own FirstPersonShooter and get a bunch of errors
    your FirstPersonShooter doesn't work for Unity 2019.4.20f1 (64-bit) and higher ?

     
    Last edited: Apr 7, 2021
  11. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    265
    The example works fine in Unity 2019.4.20f1 and higher. You just need to delete the Assets/Plugins/UWP folder if not needed.

    Otherwise you have to assign each DLL (Assets/Plugins/SmartFox2X.dll and Assets/Plugins/UWP/SmartFox2X_UWP.dll) to the appropriate platform in the Inspector panel as in the picture you shared above.

    For example assign the selected SmartFox2X DLL to Editor and Standalone only, then select the SmartFox2X_UWP DLL in the UWP folder and check WSAPlayer only.

    The reason why you need to to the above is that Unity doesn't keep the DLL-platform association when we export the project to create the examples package you got from our website.
     
  12. btckey

    btckey

    Joined:
    Nov 1, 2012
    Posts:
    40
    Good day.

    I don't understand how to sync animation over the network (UNITY WEBGL).

    You do not have a single line of code in the Sfs2X documentation for animation, I also did not find information on Google or YouTube, I am very amazed that I did not find anything, it is very strange that no one provides a description of how animation works for UNITY + Sfs2X.

    The FirstPersonShooter examples use an outdated animation system, and it does not suit me, SpaceWar is also incomprehensible to me.
    I made changes to the PlayerController script by adding an animator with one "walk" animation.
    This works for me, but doesn't work for others (they don't see my walking animation).

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class PlayerController : MonoBehaviour
    5. {
    6.     public float forwardSpeed = 10;
    7.     public float rotationSpeed = 40;
    8.     static Animator anim;
    9.  
    10.     // Dirty flag for checking if movement was made or not
    11.     public bool MovementDirty {get; set;}
    12.  
    13.     void Start()
    14.     {
    15.         anim = GetComponent<Animator>();
    16.         MovementDirty = false;
    17.     }
    18.  
    19.     void Update ()
    20.     {
    21.         // Forward/backward makes player model move
    22.         float translation = Input.GetAxis("Vertical");
    23.         if (translation != 0)
    24.         {
    25.             this.transform.Translate(0, 0, translation * Time.deltaTime * forwardSpeed);
    26.             anim.SetBool("walk_front", true);
    27.             MovementDirty = true;
    28.         }
    29.         else
    30.         {
    31.             anim.SetBool("walk_front", false);
    32.         }
    33.  
    34.         // Left/right makes player model rotate around own axis
    35.         float rotation = Input.GetAxis("Horizontal");
    36.         if (rotation != 0)
    37.         {
    38.             this.transform.Rotate(Vector3.up, rotation * Time.deltaTime * rotationSpeed);
    39.             MovementDirty = true;
    40.         }
    41.     }
    42. }
    Please write how can I make the animation synchronized over the network for all users.

    1) Without using the .jar server extension (so I can quickly test the application)
    2) Using the .jar server extension (so that I can write something better and correct in the future)

    Also, this information will be very useful to anyone using UNITY + Sfs2X.

    Please write an example in the form of C # scripts for a more accurate and quick understanding of animation synchronization over the network.

    Thank you.
     
    Last edited: Apr 13, 2021
  13. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    265
    First of all it is important to understand that in most cases the animation is just a state of an object, just like its color or its shape (see our Object Movement example). This means that the animation system you use on the client is not related to the networking system (in our case SmartFoxServer). You have to learn how to transfer, for example, the state "walking" to other clients, and when the movement stops, transfer the state "standing" in the same way.

    The most common way to do this in SFS is using User Variables: specifically, when you click the button to make your character move, you have to set a variable (lets say it is called "anim") to a given identifier ("walk", "run", "stand", "crouch" - can be a string, a number, or even a more complex object).

    In the Spacewar example, a User Variable is used to show or hide the engine flame when the up-arrow key is pressed or released. As mentioned before, in the Object Movement example two User Variables are used to set the color and shape to show.

    The FPS example uses a slightly different approach: instead of using a User Variable which is automatically synchronized among clients, the animation state is transferred to the server through an Extension request, and the server-side logic is in charge of sending this back to the other clients (see AnimationSynchronizer.SetAnimationState() which in turn calls Networkmanager.SendAnimationState()).

    Our suggestion is to go through all the tutorials to learn step by step the techniques we discuss. Jumping directly to the more complex examples is very difficult unless you already have a good understanding of networking in games.
     
  14. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    265
    We just released v1.7.14 of the SFS2X C# client API for Unity / .Net / Mono / Universal Windows Platform.

    This new version fixes an issue with Unity's Nintendo Switch build target. Due to the System.Net.Http namespace not being supported by Switch, the connection encryption initialization failed (SmartFox.InitCrypto). We introduced a new API specific to all Unity builds (except WebGL, which still requires its own DLL) which overcomes this issue.

    You can download the API at this url: https://www.smartfoxserver.com/download/sfs2x#p=client
     
  15. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    265
    Overcast dashboard update
    We have recently rolled out a new Overcast update introducing domain name management so that custom domains can be associated with SmartFoxServer instances launched in Overcast.
    You can find all the details about domain name management in our updated documentation.

    What's next in Overcast
    With this new update we have also laid the groundwork for what is coming next, namely SmartFoxServer Clustering. We have now finalized the architecture of the system and most of its API and we are entering the testing phase.
    In the next months and after the summer vacations we'll be working on new AdminTool modules, further integration with the Overcast HQ and documentation. If all goes smoothly we will be ready for an open beta by the end of 2021.
     
  16. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    265
  17. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    265
  18. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    265
    A new article in the Overcast series is available on our blog: how to use a database server alongside SmartFoxServer.

    In this first part of the article we focus on launching the database, populating it with some test data and configuring SmartFoxServer to connect to it. In the upcoming part two and three we will deploy an Extension in SmartFoxServer to test the connection with a query.

    https://smartfoxserver.com/blog/using-a-database-in-overcast-part-1/
     
    Last edited: Jul 28, 2021
  19. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    265
  20. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    265
  21. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    265
  22. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    265
    We just released SmartFoxServer 2X 2.17.2, as a cumulative patch. The patch fixes a couple of issues related to Extension compilation and the AdminTool's Analytics module.

    Download and release notes.
     
  23. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    265
    A minor issue with SmartFoxServer's Flood Filter was reported right after we published the previous patch, so here's another one. It's cumulative, so if you still have to install v2.17.2, go directly with v2.17.3.

    Download and release notes.
     
  24. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    265
  25. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    265
    We just released v1.7.16 of the SFS2X C# client API for Unity.

    This new version fixes a crash which could occur in Unity's Android build with il2cpp, due to a Console.WriteLine instruction in the API internal logger.

    You can download the API at this url: ⏩ https://www.smartfoxserver.com/download/sfs2x#p=client
     
  26. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    265
  27. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    265
    We have just released SmartFoxServer 2X v2.18.0, which provides several library updates, new runtime, support for M1 Macs, extra features and bug fixes.

    » Get the new SmartFoxServer 2.18.0 installer from our download section.
    » Read the full release notes here.
     
  28. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    265
    andrew210 likes this.
  29. kensource

    kensource

    Joined:
    Jun 15, 2017
    Posts:
    1

    I would like to deploy our servers with small CPU/RAM to apply horizontal scaling.
    for example: CCU high at 11am, the system automatic add one more EC2 instance, total running instance is 2.
    CCU low at 10pm, the system automatic remove one EC2 instance, total running instance is 1.
    I have some question:
    1. Does SFS support split license?
    2. Can user joined SFS#1 can see or play with users in SFS#2?
     
    Last edited: Feb 27, 2022
  30. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    265
    Hi. There are a couple of possible solutions for this kind of use cases, it depends on what you need to do. I'd recommend toget in touch with directly so we can discuss the details. You can use the info@<our-website> email box, adding a reference to this post.

    Generally speaking... no, because servers don't share data among each other. Also having users play together across servers is not recommended as it makes scalability a nightmare, due to the extra latency. Typically you want players in the same game to be connected on the same server.

    There are multiple solutions and architectures to achieve this, which can include a certain amount of data sharing among all servers, but this topic is pretty broad and it would take a long post to go through all the details.

    We have written several white papers on this topic and dissected several common use cases. You can find them in our documentation, here:
    http://docs2x.smartfoxserver.com/Overview/white-papers

    Specifically:
    • SmartFoxServer 2X Server Architecture
    • SmartFoxServer 2X and Hazelcast integration
    Hope it helps
     
  31. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    265
    We just released SmartFoxServer 2X v2.18.2, which provides several new features and bug fixes:
    • [NEW] QuickJoinOrCreateRoom request allows to join a Room by matching its variables to a specific Match Expression. If no match is found a new Room can be created and joined immediately. The request is available in both the client and server-side API.
    • [NEW] suppressUserList option for Rooms, suppresses the room list upon joining a Room as well as removing the USER_ENTER, USER_EXIT events. It can be used in special cases where Rooms are not used for User interaction, to save bandwidth.
    • [NEW] SFSApi.emptyRoom(...) allows to remove all users from a specified Room.
    • [NEW] client side LagMonitor can be configured to work as a keep-alive mechanism. By default it is turne d off. It can be activated via AdminTool > Zone Configurator > General > Enable Keepalive.
    • [FIX] issue when sending error codes from server side, causing a cast exception on the client side with a subgroup of client side errors.
    We also released C# API v1.7.17, adding support for QuickJoinOrCreateRoomRequest.

    You can download the v2.18.2 server patch here and the v.1.7.17 C# API here.
     
  32. UsefulWeapon

    UsefulWeapon

    Joined:
    Oct 26, 2013
    Posts:
    23
    Hello, i just downloaded 2.18 server exe file and i get a windows malware warning. So is this normal ?
     
  33. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    265
    Hi,
    if you downloaded the installer from our website you can rest assured that it is clean. Otherwise please do not proceed and use our website to download the installer.

    Thanks
     
  34. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    265
    Additionally, if you downloaded the installer from our website (i.e. www.smartfoxserver.com) can you post a screenshot of the windows message?

    Thanks
     
  35. UsefulWeapon

    UsefulWeapon

    Joined:
    Oct 26, 2013
    Posts:
    23
    Missed article about Important note on Windows SmartScreen. So everything is ok now
     
  36. UsefulWeapon

    UsefulWeapon

    Joined:
    Oct 26, 2013
    Posts:
    23
    Also i am not so good at working with netcode and server architecture, so maybe you have some tips and advices on my project ? We are making a metaverse type MMO with at least 500 - XX.000 users. I saw MMO room demo and it was pretty useful, but i need some deeper info about how to optimize all this and make it work. Some time later after prototyping we will buy cloud hosting and license for this purpose.
     
  37. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    265
    Can you be more specific about the advice you're looking for?
    Have you checked our documentation regarding MMORooms?
    http://docs2x.smartfoxserver.com/AdvancedTopics/mmo-rooms
    http://docs2x.smartfoxserver.com/AdvancedTopics/advanced-mmo-api

    Cheers
     
  38. UsefulWeapon

    UsefulWeapon

    Joined:
    Oct 26, 2013
    Posts:
    23
  39. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    265
    We just released SmartFoxServer 2X v2.18.3, which fixes a number of issues in AdminTool:
    • [NEW] Under Server Configurator > Remote Admin it is now possible to use an IP range (using CIDR notation) in the "Allowed client IP addresses" setting.
    • [FIX] When editing a configuration parameter featuring a modal edit panel, hitting the enter key would cause the AdminTool to be reloaded.
    • [FIX] In Analytics, error in log processing for long Room life-cycles (life-cycle >= 24 days).
    • [FIX] In Analytics, when launching log analysis process, locale forced to English instead of system's default.
    You can download the v2.18.3 server patch here.
     
  40. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    265
    Time for a big update of all our Unity examples and tutorials!

    The new package contains the following demo examples:
    • Connector
    • Lobby: Basics
    • Lobby: Buddies
    • Lobby: Matchmaking
    • Tic-Tac-Toe
    • First Person Shooter
    • MMO Basics
    • SpaceWar 2
    What changed?
    • The new Connector example merges the previous Connector and Advanced Connector examples, showing how to perform the connection and login process including optional HTTP tunneling and/or protocol encryption activation.
    • Three Lobby examples substitute and largely improve the previous Lobby and Buddy Messenger examples, showing how to create a progressively more complex lobby scene, featuring game launch, Buddy List management and interaction, match-making, invitations, public and private chat, etc.
    • The Tic-Tac-Toe example (previously called Tris) implements a fully-featured lobby, game spectators and invitations.
    • The MMO Basics example merges and updates the previous Object Movement and MMORoom Demo examples, now featuring a new 3D environment and the implementation of map limits and Area of Interest visualization.
    • SpaceWar 2 is a new version of the old example; other than updating the overall game flow, new features have been added: it is now possible to play with a planet attracting starships and weapon shots, starships have a shield and they can be destroyed, starships can fire a secondary weapon, the game has a defined objective and a proper ending.
    • All examples featuring multiple scenes have been updated to make use of a singleton class acting as a connection manager, representing the best practice when sharing the connection to SmartFoxServer among all the project scenes is needed.
    • All examples feature a new UI.
    • All examples have been upgraded to SFS2X C# API v1.7.17.
    You can download the new example pack here:
    https://smartfoxserver.com/download/sfs2x#p=examples

    And also check the new tutorials in our documentation:
    http://docs2x.smartfoxserver.com/ExamplesUnity/introduction
     
  41. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    945
    What about adding a racing game example?
     
  42. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    265
    This is something we would like to do with the help of third-party developers. Actually the plan now is to look for someone to update our First Person Shooter example, and if everything goes the right way, then commission other examples.

    In any case in the Flash examples section of our documentation you will find a walkthrough on the creation of a racing game. Even if the client is Flash, the multiplayer logic and server-side Extension are perfectly fine and can be ported to Unity entirely. Take a look here: http://docs2x.smartfoxserver.com/ExamplesFlash/space-race
     
unityunity