User Tools

Site Tools


global:netcode

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
global:netcode [2018/08/28 00:57]
Mistermind
global:netcode [2024/01/07 06:13]
Mistermind
Line 2: Line 2:
  
 **UFE Netcode** is the second iteration of the network system for UFE. It allows the game to run online matches in a smooth lag-free environment thanks to its native //rollback mechanics// and //deterministic physics//. The netcode also uses raw //manual tracking// to its own core variables, optimizing CPU usage (even mobiles).\\ **UFE Netcode** is the second iteration of the network system for UFE. It allows the game to run online matches in a smooth lag-free environment thanks to its native //rollback mechanics// and //deterministic physics//. The netcode also uses raw //manual tracking// to its own core variables, optimizing CPU usage (even mobiles).\\
-The new network options also comes with its own client/server structure (using Photon Network, UNet, Steam among others) allowing direct player connection without the use of IP.+The new network options also comes with its own client/server structure (powered by Photon Network) allowing direct player connection without the use of IP.
  
-[[http://www.ufe3d.com/demo/ufe2/pc/UFE2.zip|PC]] | [[http://www.ufe3d.com/demo/ufe2/webgl/|WebGL]] | [[http://www.ufe3d.com/demo/ufe2/android/UFE2.apk|Android]] 
  
-  * Hit Online to search for a match (US Server) +The new Rollback netcode is available on [[https://assetstore.unity.com/packages/templates/systems/ufe-2-pro-125472|UFE 2 PRO]] and [[https://assetstore.unity.com/packages/templates/systems/ufe-2-source-126124|UFE 2 Source]]. For more information [[https://forum.unity.com/threads/universal-fighting-engine-2.541442/|click here]].
-  * All builds are **cross-platform**+
  
  
Line 30: Line 28:
  
 {{ :global:netcode_upgrade.jpg?direct&100|}} {{ :global:netcode_upgrade.jpg?direct&100|}}
-One of the key changes made to the code is the use of ''Fixed Point'' (Fix64), a format that replaces all uses of //float// throughout the code. This update copies all serialized Floats and Vectors to a new similar declaration.\\ +One of the key changes made to the code is the use of ''Fixed Point'' (Fix64), a format that replaces all uses of //float// throughout the code. If you are running UFE 1.x and wish to update your files without having to redo them, use this system to update all serialized Floats and Vectors to a new declaration.\\ 
-To run the auto update, right click on one of your UFE files ([[global:introduction|Global]] , [[character:introduction|Character]] or [[move:introduction|Move]]) from the project tab and select "UFE -> Upgrade to 2.0". This will automatically assign all the new variables (including nested files).\\+To run the auto update, right click on one of your UFE files ([[global:introduction|Global]] , [[character:introduction|Character]] or [[move:introduction|Move]]) from the project tab and select "UFE 2.0 -> Update All Definitions". This will automatically assign all the new variables (including nested files).\\
 \\ \\
  
-  * **Step 2: Record Character Maps**+  * **Step 2: Record Character Maps (PRO/Source)**
 Now that we have our asset files converted to //Fix64// we can move to the next step to ensure synchronization: Map the character animations. This is a fairly simple process, but can be a bit time consuming depending on how many characters you have or how often you change your animation files.\\ Now that we have our asset files converted to //Fix64// we can move to the next step to ensure synchronization: Map the character animations. This is a fairly simple process, but can be a bit time consuming depending on how many characters you have or how often you change your animation files.\\
 First, open the scene ''Scenes\MapRecorder.unity'' and under the hierarchy click on the Main Camera. Notice the script attached to it: Animation Recorder.  First, open the scene ''Scenes\MapRecorder.unity'' and under the hierarchy click on the Main Camera. Notice the script attached to it: Animation Recorder. 
Line 52: Line 50:
 \\ \\
  
-  * **Step 4: Photon Setup**+  * **Step 4: Photon Setup (Standard/PRO/Source)**
 In order to have the client-server accessibility you need to download [[https://assetstore.unity.com/packages/tools/network/photon-unity-networking-free-1786|Photon Unity Networking]] and create your own Photon Account. Sign up for free: [[https://www.photonengine.com/en/PUN]]\\ In order to have the client-server accessibility you need to download [[https://assetstore.unity.com/packages/tools/network/photon-unity-networking-free-1786|Photon Unity Networking]] and create your own Photon Account. Sign up for free: [[https://www.photonengine.com/en/PUN]]\\
 Once you have an account go your Public Cloud -> Applications and copy your App ID as displayed here: Once you have an account go your Public Cloud -> Applications and copy your App ID as displayed here:
Line 76: Line 74:
 To solve this, Map Recorder runs and stores the //position maps// (and delta displacements) of all identified hitbox on every frame of animation throughout the character's moveset, saving them in //Fix64// format (deterministic). UFE Engine will then play these maps synchronously to the animation during gameplay.\\ To solve this, Map Recorder runs and stores the //position maps// (and delta displacements) of all identified hitbox on every frame of animation throughout the character's moveset, saving them in //Fix64// format (deterministic). UFE Engine will then play these maps synchronously to the animation during gameplay.\\
 \\ \\
-Map Recorder is located at ''UFE\Scenes\MapRecorder.unity''. Run it whenever you have to add new moves or change one of the character's animation files.+Map Recorder is located at ''UFE\Engine\MapRecorder.unity''. Run it whenever you have to add new moves or change one of the character's animation files.
  
  
Line 136: Line 134:
  [RecordVar] public bool isBroken;  [RecordVar] public bool isBroken;
  
- void UFEFixedUpdate() {+ public override void UFEFixedUpdate() {
  if (position.y > .1f) BreakMe();  if (position.y > .1f) BreakMe();
  }  }
Line 149: Line 147:
 </code> </code>
  
-Notice we only use the //[RecordVar]// attribute to track the variables that can change during gameplay. Weight doesn't need to be tracked because it's assumed that value is persistent.\\+Notice we only use the //[RecordVar]// attribute to track the variables that can change during gameplay. Weight doesn't need to be tracked because it's assumed that value is persistent. //[RecordVar]// variables must be public.\\
 Also, notice we are using //UFEFixedUpdate// instead of //FixedUpdate// and //UFEBehaviour// instead of //MonoBehaviour//. This is so we can have those events deterministic.\\ Also, notice we are using //UFEFixedUpdate// instead of //FixedUpdate// and //UFEBehaviour// instead of //MonoBehaviour//. This is so we can have those events deterministic.\\
 An example of the auto-tracking system can be found under the projectile script: ''UFE\Scripts\ProjectileScripts.cs'' An example of the auto-tracking system can be found under the projectile script: ''UFE\Scripts\ProjectileScripts.cs''
Line 167: Line 165:
 ---- ----
 ===== Network 2.0 Options ===== ===== Network 2.0 Options =====
 +For a detailed explanation on each option [[global:network|click here]].
  
-{{ :global:global_netcode.png?nolink |}}+{{ :global:global_networkoptions.png |}}
  
-For a detailed explanation on each option [[global:network|click here]].+---- 
 +====== Video Tutorials ====== 
 +{{youtube>OSovR17apP0?large}} 
 +{{youtube>-dmVAf_cyN8?large}} 
 +{{youtube>j3B-lhd8JBw?large}}
  
  
Line 184: Line 187:
 ---- ----
  
-[[global:start|< Back to Global Editor]]+[[global:network|< Back to Network]]
global/netcode.txt · Last modified: 2024/01/07 06:17 by Mistermind