Menu -> gameplay vs gameplay and ElympicsConfig.DevelopmentMode
Local Server With Bots
How to turn on
Fast testing - 1 editor to check gameplay
Special IElympics values
What won’t be tested
Missing inputs / snapshots
State deserialization and ValueChanged
How to set ParrelSync
Test players data
Connecting flow with logs and possible errors
1 - Common problems
Common problems that might occur during development
My inputs seem to work for a split second, but then they are reversed
Example: you press a spacebar, the player jumps for a few miliseconds but then teleports back to the ground.
This usually happens when you modify the game state immediately on player input, instead of sending your input through the IInputHandler. This causes the server to overwrite your local changes on the next tick.
The only way for a player to modify the game state is through Player Inputs, sent and received via IInputHandler.
The input is jittery and feels unresponsive
Example: you press a spacebar and sometimes the player jumps, but sometimes this input is ignored.
Inputs are collected in IInputHandler during Elympics Update, which happens during FixedUpdate, not every frame! This means that you should avoid using methods like GetKeyDown or GetKeyUp.
Reconciliation happens every frame and kills my framerate
Example: the game starts and the framerate immediately drops and in the console window I see a lot of “Reconcilation” warnings
Your client is probably trying to predict something that is not predictable for them, like other player movements. Only use prediction on objects you control, or objects no one controls.
My input is visible in my game, but not for other players
Example: I press a spacebar and I see myself jump, but other players don’t see this.
Either you don’t send your input through IInputHandler or you don’t synchronize its effects. Every input has to be sent using IInputHandler, and the code that applies it in IInputHandler must modify a custom ElympicsVar or a synchronised component on a ElympicsBehaviour, like rigidbody or transform.
The same object has different positions on connected clients
Example: two players ale playing football and the ball has a different position for everyone
This basically means that the position of this object is not synchronised. This can happen for a couple of reasons:
This object doesn’t have an ElympicsBehaviour component
This object has an ElympicsBehaviour component, but doesn’t have position synchronisation turned on
You have some custom logic that moves the object that is not a synchronised input (see “My input is visible in my game, but not for other players”)
You instantiated an object without using ElympicsInstantiate
You tried to add the ElympicsBehaviour component dynamically to an existing object - this is not supported
You created a new ElympicsVar instance after scene initialization - this is not supported
2 - Networked Simulation Analyzer
A tool for analyzing the state of subsequent Ticks of synchronized simulation determined by the Authority (server).
“Networked Simulation Analyzer” is a tool for authoritative gameplay state analysis which aims to make debugging of networked simulation easier. It also allows you to understand implemented networked mechanics better.
The unique feature of the tool is its ability to re-apply collected state on demand, what gives you a chance not only to analyze data as text, but also to observe actual changes to the gameplay scene dynamically!
It also lets you save and load gameplay replay files, which may be helpful in collaborative troubleshooting or introducing new developers to the project.
The tool supports only Unity 2020.2 and above.
What information does it provide?
At the end of every Tick, the tool collects data synchronized in ElympicsBehaviours along with received inputs. It also estimates the size of each collected state.
Provided sizes of synchronized data are not the sizes of snapshots Clients receive. It’s because Tick state provided by the tool is complete, and thus sizes provided in the tool are maximal estimates for given ElympicsBehaviours. On the other hand, Client is unlikely to receive complete state every Tick – it depends on StateUpdateFrequency of ElympicsBehaviours and frequency of synchronized state changes.
Very important part of the tool is estimating Tick execution time of the Authority (likely a Server) in relation to the constant maximum (TickDuration). If it’s close to the threshold, you will notice yellow color instead of standard – green. If it’s equal or above, it becomes red. You should be aware of these situations, because exceeding TickDuration means we can no longer keep constant TicksPerSecond ratio, which is against our core architecture and can cause problems with further synchronization (until it catches up with the TicksPerSecond value). Especially, watch out for subsequent high-load Ticks. In such cases reconsider your scripts or decrease the TicksPerSecond value in ElympicsConfig.
You will likely notice exceeding maximum execution time (red color) on game initialization and when a Client connects to the Authority. It’s common behavior and should not be considered as a problem.
At the moment, input content isn’t displayed, but in many cases information about receiving it or not should be sufficient. Note that Missing means Client input hasn’t reached Authority on time, and thus it was omitted. In such a case, the previous input could be used as shown here. On the other hand, Received (0B) signifies that connection was established but no data was sent (which may be correct in most turn-based games but rarely in real-time ones).
How to use it?
Currently, Networked Simulation Analyzer is available only on Half Remote and Local Player And Bots modes, which also means it can’t be used in builds. Unity version 2020.2 or newer is required. You can open the tool by choosing Tools/Elympics/Networked Simulation Analyzer from the menu bar.
In order to collect Tick data, you need to have the tool opened and the game running. The state is automatically collected and appended to the list on the left. The list is cleared every time the game is started (so even if you load the data from a file it will be overriden nonetheless). The tool state doesn’t persist, so closing it will result in losing collected data.
You can view chosen Tick state by selecting corresponding entry from the list pane on the left.
Networked simulation can be paused to halt the collection of Tick data and enable remaining features, described below. Note that this pause differs from well-known Unity Editor pause – local simulation such as basic animations will not be paused as it is not synchronized! You can switch it by using the pause toggle on the top bar. (From now on we will refer to networked simulation pause simply as pause, do not mistake it for Unity pause.)
Applying Tick state
You can apply the state of the selected Tick by clicking “Apply State” button in the Tick view when the game is running and networked simulation is paused. You will notice visible changes on the game scene (if any occured). It’s important to understand that only the synchronized state is applied to the game scene. Non-synchronized state is not changed.
There is also a possibility to do it automatically on Tick selection instead of using the button, but it requires checking the corresponding checkbox first. It won’t do anything if the game isn’t paused.
You can go through subsequent Ticks rapidly by choosing one Tick and using up/down arrow keys.
If you apply some state and then unpause, the tool will automatically restore the state from before pausing to preserve the gameplay consistency.
Saving/loading from a file
Once the simulation is paused, you can save collected data to a file by using corresponding button on the top bar.
Then, the file can be loaded if pause is applied or the game isn’t running. Note that it will override previously collected data and you will be unable to unpause until you restart the game.
When loading a file, the game scene must be in the same version as when the file was created. Any change on the scene or in the code can render the file incompatible. Keep that in mind as precise verification of file validitiy is yet to be implemented.
If you are stuck using the tool, you can always find this page by clicking the “How to use?” label on the top bar.
There are also useful tooltips to the controls which can be seen by hovering the mouse over a certain control element, but only when the game is in the Edit Mode.
If there is something you still don’t understand or you encounter any issues with the tool, we would be glad to hear from you at our support server, which you can find in the top bar of the documentation site.