Network Contract Wizard (NCW)
The Network Contract Wizard is the new way for you to implement networking for your game/app.
To do so you will need to go to Window->Forge Networking->Network Contract Wizard as shown in the example below.
After opening the window you will be presented with this.
- 1)Toggle lighting on/off for the editor window only. This will make it easier for your eyes depending on what lighting situation you have.
- 2)Create, this will make networked objects for you to use for your game/app. (You will spend most of your time hitting this beautifully designed button).
- 3)Deletion, this will properly delete the networked objects that you have made.
Note: You are able to tap any of the NetworkObjects to modify them as well.
- 1)Name field for you to name your networked object (Do not use the same name as ones already made)
- 2)Add fields (This is where you would add variables to sync across the network)
- 3)Add RPC (This is where you would create callbacks for other clients to messages/data being sent)
Adding a Field
- 1)The name of the variable
- 2)The type of variable this will be
- 3)There are many different types to select from (This is just an example of selecting int for this variable) Note: The trash bin next to this variable will delete it.
Adding an RPC
- 1)Name of the RPC
- 2)Arguments for this RPC that will be sent across the network.
- 3)Value type that can be passed across the network.
- 4)Deletion of this RPC
- 5)Deletion of this Value Type
- 6)Add more Value Types for the arguments
Main Menu Deletion
- 1)This will trash this Networked Object correctly.
- 2)You will be prompted with this window when doing so.
You will notice that all generated code will be located in your project directory under Generated.
Note: This will be changeable from the editor in the future.
Note: if you are getting RPCs lagging, then being called all at once, make sure "autoconnect profiler" is turned off in your build settings.