Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[NO CCU LIMIT] Forge Networking now OPEN SOURCE

Discussion in 'Assets and Asset Store' started by Brent_Farris, Dec 22, 2014.

  1. Babars

    Babars

    Joined:
    Sep 16, 2015
    Posts:
    2
    Can you give me an example? Sorry, I'm really new at this networking stuff.
     
  2. FisherM

    FisherM

    Unity Technologies

    Joined:
    Dec 28, 2013
    Posts:
    366
    Code (CSharp):
    1. void OnCollisionEnter(Collider c){
    2. RPC("collision");
    3. }
    4.  
    5. public void collision(){
    6.  
    7. }
     
  3. FisherM

    FisherM

    Unity Technologies

    Joined:
    Dec 28, 2013
    Posts:
    366
    Yes absolutely. And you have full source so we don't prohibit you from taking the code and extending it in whatever way you need and is easiest.

    We don't have specific numbers to quote. Logically the numbers are more than competitive though as we aren't charging any premium.
     
  4. meminmamon

    meminmamon

    Joined:
    Mar 30, 2014
    Posts:
    5
    Hello, We are using the "Unity Independent Master Server" Add-on, and we have being following the Cloud Headless Windows Server tutorial from the wiki. However, We've had difficulties trying to register hosts on the Master server, port's conections are working fine, but the servers just don't get registered in it. We're using EC2 from Amazon AWS. We really apreciate your help.
     
  5. FisherM

    FisherM

    Unity Technologies

    Joined:
    Dec 28, 2013
    Posts:
    366
    Does the AWS receive the request?
     
  6. Spice9

    Spice9

    Joined:
    Jan 3, 2016
    Posts:
    16
    Is their a way to do instances? Say like player apartments :).
    Not sure how I would accomplish that.
     
  7. TCROC

    TCROC

    Joined:
    Aug 15, 2015
    Posts:
    131
    Hello I am new to networking and just purchased forge networking. I have two questions.

    1.) How do I connect players over WAN?

    2.) How to I set up match making?
     
  8. meminmamon

    meminmamon

    Joined:
    Mar 30, 2014
    Posts:
    5
    How can I check if the AWS receives the request?
     
  9. robymv

    robymv

    Joined:
    Oct 28, 2013
    Posts:
    71
    Hi Guys, I need some advice, I am developing the update of this game: https://www.amazon.it/Indibit-di-Ro...F8&qid=1468397324&sr=8-1&keywords=angry+giant
    I am new to networking.
    I bought Forge and I want to figure out which system do you recommend to do this.
    In the game a player spawn soldiers against the giant. The other player uses the giant defense. I managed to run the soldiers and chat, but I can not understand how to move the giant both the server and the client, for now the client remains standing still.
    Give me some advice please, thank you.
     
  10. FisherM

    FisherM

    Unity Technologies

    Joined:
    Dec 28, 2013
    Posts:
    366
    Hey meminmamon,
    I've replied over slack chat.
     
  11. FisherM

    FisherM

    Unity Technologies

    Joined:
    Dec 28, 2013
    Posts:
    366
    The easiest way is to have a server instance for each instance. You would have a master server all players are connected to, when they enter an instance the server sends the IP of the server managing the instance and the client connects to it.
     
  12. FisherM

    FisherM

    Unity Technologies

    Joined:
    Dec 28, 2013
    Posts:
    366
    WAN works exactly the same as normal networking.
    We ship with a server browser you can use and all the networking facilities needed to do matchmaking, but forge doesn't offer a matchmaking algorithm. We are going to be publishing a tutorial about how to do a simple matchmaking algorithm soon.
     
  13. FisherM

    FisherM

    Unity Technologies

    Joined:
    Dec 28, 2013
    Posts:
    366
    Typically you could either sync the position with a NetSync variable or by having the class that controls the player/giant inherit from NetworkedMonoBehaviour. Both are explained in the tutorial available on our developer portal.
    http://developers.forgepowered.com/Tutorials

    Below are two of the most relevant tutorials to this topic:

    NetSync:
    http://developers.forgepowered.com/Tutorials/MasterClassBeginner/Serializing-Fields-And-Properties

    NMB vs SNMB:
    http://developers.forgepowered.com/...etworkedMonoBehavior-vs-NetworkedMonoBehavior
     
  14. robymv

    robymv

    Joined:
    Oct 28, 2013
    Posts:
    71
    Thank you but giant don't move, only show simple animation, sorry but my english il very bad and tutorial is too fast for me :D
     
  15. robymv

    robymv

    Joined:
    Oct 28, 2013
    Posts:
    71
    NetSync, work very good, thank you :D
     
  16. TCROC

    TCROC

    Joined:
    Aug 15, 2015
    Posts:
    131
    I'm sorry but I am very new to networking. I can connect to a LAN Host fine over a LAN. I can also connect via the IP address of the host over LAN. However, when I try to connect the client to that same host with the same IP address over WAN in the example scene (the host is connected to my router and the client is connected to the hotspot on my phone) the client will not connect to the host.

    Btw this is all being done in the example scene.
     
  17. TCROC

    TCROC

    Joined:
    Aug 15, 2015
    Posts:
    131
    I have a few bugs to report.

    1.) I can change the Lerp Speed of a single networked object. However, when I highlight multiple objects and try to change the Lerp Speed (or any networking variable) at the same time, they won't change. They go back to the original value as soon as I click on the individual object again. This bug happens on both my Windows and my Mac computer

    2.) I cannot see the values of the network options such as the Lerp Speed on my Mac. I also cannot see many of the buttons on my mac.
     
    Last edited: Jul 15, 2016
  18. TCROC

    TCROC

    Joined:
    Aug 15, 2015
    Posts:
    131
    Ok so I followed the "Tutorial:Cloud Headless Windows Server" on the wiki page. I have gotten hosts to sync across Amazon AWS Ec2 and the lobbies to appear in the server browser. However, I cannot join the games. I click the join button on the game, but nothing happens. Once I get this up and running fully I would like to make a youtube tutorial as to how to do this. I cannot make the youtube tutorial and expand production on our game until we get this working though. Any help is most appreciated :)
     
    Last edited: Jul 19, 2016
  19. FisherM

    FisherM

    Unity Technologies

    Joined:
    Dec 28, 2013
    Posts:
    366
    Hey TCROC,
    replied to your posts in the slack general chat.
     
  20. MrGky93

    MrGky93

    Joined:
    Feb 27, 2014
    Posts:
    282
    he is there a tut how to make mecanim bool etc??
    I saw many tuts but only tut how to synchron mecanim but how to synchron mecanim when i play a player ??
    Like anry bot with mecanim ??
    Or only two player controller that walking would be enough for me when someone have a example project that only have two or more player controller can walk and jump with a trigger bool int float all in one ??
    Sry but im very noob in this asset.
    Sry bad english
     
    Last edited: Jul 20, 2016
  21. robymv

    robymv

    Joined:
    Oct 28, 2013
    Posts:
    71
    Hello everyone, I have a problem with the sincronize variables.
    I have a static variable in a file, and when I use NetSync as a result that the server sees its value even for the client, while the client sees only its own value and not that of the server.
    I do not understand where I'm wrong.
    I quote here a piece of code as an example:
    Thanks for your help.

    My data Class:

    public class datagame: MonoBehaviour {

    public static int money;
    .....
    ...

    }

    Code for multyplayer:

    public class multiplayer: NetworkedMonoBehavior
    {

    [NetSync ("control", NetworkCallers.Everyone)]
    public int moneyserver;

    [NetSync ("control2", NetworkCallers.Everyone)]
    public int moneyclient;

    void Start () {
    if (Networking.PrimarySocket.IsServer){
    controll();
    }
    else
    {
    controll2();
    }
    }

    public void controll()
    {
    moneyserver = datagame.money;
    }

    public void controll2()
    {
    moneyclient = datagame.money;

    }

    }
     
  22. pratikghodasara

    pratikghodasara

    Joined:
    Jul 20, 2016
    Posts:
    3
    Cheers guys!! I saw the new videos for the remastered version. Pretty impressive. Unfortunately I work with Unreal Engine at work and can't use forge for networking. Just a thought, would you willing to release a version that is independent of Unity or a complete port to Unreal Engine?
     
  23. MrGky93

    MrGky93

    Joined:
    Feb 27, 2014
    Posts:
    282
    have somone a project with mecanim ??
     
  24. ButtonDownBobby

    ButtonDownBobby

    Joined:
    Dec 31, 2013
    Posts:
    7
    GameObject unit = (GameObject)Networking.Instantiate(objectToSpawn, NetworkReceivers.AllBuffered);

    This should be possible. I need access to the instantiated object...
     
  25. FisherM

    FisherM

    Unity Technologies

    Joined:
    Dec 28, 2013
    Posts:
    366
     
  26. FisherM

    FisherM

    Unity Technologies

    Joined:
    Dec 28, 2013
    Posts:
    366
    No, because it is being spawned over the network it cannot simply be accessed in that fashion.
     
  27. MrGky93

    MrGky93

    Joined:
    Feb 27, 2014
    Posts:
    282
    really this is only a project with mecanim but not show a game like someone controller the other and the other the other char with mecanim ??
     
  28. robymv

    robymv

    Joined:
    Oct 28, 2013
    Posts:
    71
    Sorry boys, please, somebody can answer my question N° 2174?
     
  29. FisherM

    FisherM

    Unity Technologies

    Joined:
    Dec 28, 2013
    Posts:
    366
    Hey, I'm not sure I understand perfectly from that description what the issue is. There isn't a static variable with a NetSync on it in your snippet. You are applying the value of the static money member whenever the values are updated causing them to be overridden.

    The moneyclient and moneyserver are also going to only be updated by the NMB on the client that owns it so the either the server will be updating both moneyclient and moneyserver or one of the clients will?

    Perhaps it would be better to describe what the intended purpose is?
     
  30. MrGky93

    MrGky93

    Joined:
    Feb 27, 2014
    Posts:
    282
    why in
    Forge Networking there is no animator synchron script like photon (PhotonAnimatorView) also unet have this but Forge Networking dont have it ??!!

    Code (CSharp):
    1. public class AnimationCharacter : NetworkedMonoBehavior
    2.  
    3.  
    when i want to use it on my script i cant see
    Code (CSharp):
    1. public class AnimationCharacter : myMonoBehavior ,networkmonbehavior dont will working
     
  31. robymv

    robymv

    Joined:
    Oct 28, 2013
    Posts:
    71
    Hello FisherM, thanks for the reply.
    What I do is that before you start the game the two players decide a share of "bet."
    For this I need that both the client and the server are aware of how much money the other possesses, otherwise one of the two can cheat.
    I did not understand how I can synchronize the value of variables, I can not to show on the screen of the players money.
     
  32. FisherM

    FisherM

    Unity Technologies

    Joined:
    Dec 28, 2013
    Posts:
    366
    Hey Rayleigh,
    you don't need to post in large characters, it won't get your question answered faster. The video shows the best way to integrate an Animator or Legacy animation system being driven by sync'ed values. Otherwise if you want to make suggestions on the slack chat please feel free.
     
  33. FisherM

    FisherM

    Unity Technologies

    Joined:
    Dec 28, 2013
    Posts:
    366
    For direct support slack can be a better place to DM advice, are you already on our slack?
     
  34. robymv

    robymv

    Joined:
    Oct 28, 2013
    Posts:
    71
    Yes. I open now.
     
  35. carmine

    carmine

    Joined:
    Jan 4, 2012
    Posts:
    391
    Is there a demo of multiple "rooms". I'm looking for a good LAN solution. I saw some earlier messages about it. Essentially, I wan the "host" to just turn on hosting. And whether they are in the game, or at the main menu or whatever, they can host multiple rooms (that they aren't even in).
     
  36. unaimakua

    unaimakua

    Joined:
    Jul 28, 2016
    Posts:
    5
    Hi
    I have sent some emails to support in forge network page and no one answer me , i am not going to pay 75 dollars for a product that have no support. so sorry
     
  37. robymv

    robymv

    Joined:
    Oct 28, 2013
    Posts:
    71
  38. unaimakua

    unaimakua

    Joined:
    Jul 28, 2016
    Posts:
    5
    HI , i think this is dead , here no one answer, i wanted to buy this asset and no one answer , no support.
     
  39. unaimakua

    unaimakua

    Joined:
    Jul 28, 2016
    Posts:
    5
    Hi , did you had any answer ? could you manage it ? we use models , avatars not cubes , can someone tell me where i can find tutorials with avatars ?
     
  40. DoubleIsLoveDoubleIsLife

    DoubleIsLoveDoubleIsLife

    Joined:
    Nov 29, 2014
    Posts:
    29
    Just use syncvars with the animator component. For example:

    Variable declaration
    Code (CSharp):
    1.     [NetSync] float animSpeed;
    2.     [NetSync] float animSideSpeed;
    3.     [NetSync] bool isCrouching;
    Update()
    Code (CSharp):
    1.         if (IsOwner)
    2.         {
    3.             animSpeed = Input.GetAxis("Vertical");
    4.             animSideSpeed = Input.GetAxis("Horizontal");
    5.             isCrouching = FPSController.crouching;
    6.             aimAtPos = wm.posToAimAt;
    7.         }
    8.  
    9.         thirdPersonScript.speed = animSpeed;
    10.         thirdPersonScript.sideSpeed = animSideSpeed;
    11.         thirdPersonScript.isCrouching = isCrouching;
    12.         thirdPerson.lookAt = aimAtPos;
    In ThirdPersonScript.Update()
    Code (CSharp):
    1.         animator.SetFloat("Speed", speed);
    2.         animator.SetFloat("SideSpeed",sideSpeed);
    3.         animator.SetBool("Crouching", isCrouching);
     
    Xoduz and unaimakua like this.
  41. unaimakua

    unaimakua

    Joined:
    Jul 28, 2016
    Posts:
    5
    Hiiiiiiiiiiiii , this is unity chan , is free you can dowload it from the unity store.
    what i need is this networked , with several unitychan in that plane- So they can move and see each others and chat. THis could be a tutorial for a program that says that everyone can netowork any game. NO cubes , use unity chan moving and jumping , make a unity template so we can use as tutorial. Thanks
    By the way , what can i do with that code ? , where do i use it ? For you i know is simple , for someone that is expecting a program that is easy to use and to network a game is chinese, is useless.
    Thanks you all , just waiting for someone , that is a real expert that do the template. A master is not only the one that have knowledge is the one that can teach.
     

    Attached Files:

  42. FisherM

    FisherM

    Unity Technologies

    Joined:
    Dec 28, 2013
    Posts:
    366
    Hey carmine,
    that question has been answered a few times in here, do try searching the thread. Slack chat can also help you get started with this.
    Essentially you can:
    - Have the server not load the geometry of the room and just transport player locations. Make the clients authoritative, have the server not load the geometry and have some system of your own for RPCing or CustomDataReading directly the clients in each room. This would probably look like an array of Room objects. each room object would have a list of player network ids, which you can then use to RPC/CDR them directly.

    - Have the server load the geometry and have it literally shift the geometry for each room around the scene to prevent collisions. You'd want a similar data structure to the above and you'd have to customise the NetworkMonoBehaviour to apply the player's position with the offset value of the scene geometry.

    - Run a new server for each room (the best option), by having the unity server run another batchmode instance, you can provide startup parameters when you do so, typically you might want to input the port the new server should host on.

    I'd also like to note this is a unity 'thing', there is no way of the server which is just another unity scene running multiple scenes at once that don't interact with each other at all. And it's a little pointless as if you are hosting so many servers that you need multiple instances up, you probably want to be able to put them on a second or third server or your first server will just run out of space.
     
  43. FisherM

    FisherM

    Unity Technologies

    Joined:
    Dec 28, 2013
    Posts:
    366
    It isn't dead at all, I replied to your first message on the first day and have now replied to your other three.
     
  44. FisherM

    FisherM

    Unity Technologies

    Joined:
    Dec 28, 2013
    Posts:
    366
    I've replied to your message version of this. But the best place for requests like this would be on the slack chat.
     
  45. FisherM

    FisherM

    Unity Technologies

    Joined:
    Dec 28, 2013
    Posts:
    366
  46. MrGky93

    MrGky93

    Joined:
    Feb 27, 2014
    Posts:
    282
    this dont work by my code why ??
    Because example when you sue this code
    Code (CSharp):
    1.  charactercontrol: NetworkedMonoBehavior
    its works but my code looks like this
    Code (CSharp):
    1.  public class charactercontrol: MYMonoBehaviour
    so how i can work with this ??
     
  47. ulysses24769

    ulysses24769

    Joined:
    Aug 3, 2016
    Posts:
    2
    I'm trying to learn this forge networking and I'm stuck at the very beginning. I'm using the free version, I believe it to be 16.9 with unity linux 5.4.0f1.

    If I run the ForgeQuickStartMenu in the editor and host it, it does start my scene and instantiate the actor I've made(or a cube if I put the ForgeHelloCube instead of my scene). But when I build this, and try to connect from a client with Find on Lan or Join Server with above Ip Address, it doesn't fire up the scene;

    If I don't start an host on the editor, the find on lan button in the client stay gray for a while like it is trying to find a server, but if I do start the host on the editor, it just click and nothing happens.

    I did input everything in: the address, the scene name, Ive include the scene in the build setting, Ive started again from scratch, Ive tried it with the provided exemple scene "ForgeHelloCube"... Is there something I'm missing here?

    *edit* So I managed to get it to load a scene by switching to TCP as Protocol Type, but when the client join, it looks like it's running his own instance of the scene altho it works once after I've build the client if I had a ServerListenItem prefab in the scene and then nada, even if I restart the host and restart the client... how messed up is that

    *later edit* Anyone running the latest free(16.9) on 5.4.0f1?
     
    Last edited: Aug 4, 2016
  48. DoubleIsLoveDoubleIsLife

    DoubleIsLoveDoubleIsLife

    Joined:
    Nov 29, 2014
    Posts:
    29
    If your deriving 'charactercontrol' from 'MYMonoBehaviour' then 'MYMonoBehaviour' needs to derive from NetworkedMonoBehaviour or SimpleNetworkedMonoBehaviour.

    Code (CSharp):
    1. public class MYMonoBehaviour : NetworkedMonoBehaviour
     
  49. DoubleIsLoveDoubleIsLife

    DoubleIsLoveDoubleIsLife

    Joined:
    Nov 29, 2014
    Posts:
    29
    I've gotta question about forge remastered. Will we need to rewrite our net-code or will the workflow be mostly the same?
     
  50. louis2009

    louis2009

    Joined:
    Jun 4, 2013
    Posts:
    8
    Can we use Forge Networking TCP network function to communicate with another programming application?
     
unityunity