1. synchronous mode
- State synchronization
- Frame synchronization
2. Status Synchronization
Client Server received after the operation, the server computing gaming behavior and broadcast to each Client. Various state synchronization server computing will be re-calculated on the line, do not pay attention to the performance of each client has been completely, only the pursuit of their results are consistent on OK, this type of game network latency requirements are not very high.
Synchronization of data:
- Player state
- Server computing in
question: - Synchronous elements more and more, increasing the amount of data synchronization
- MOBA game similar to the real-time requirements are relatively high
3. Frame Sync
3.1 synchronous content
- Player input
- Synchronize only the amount of change
Client computing, anti-cheating is a problem
3.2 Ideally
- Each player has the same parameters and initial screen
- The client runs exactly the same code for all players
- All players are entered in real time and successfully synchronize to each of the other players, that each moment is exactly the same input
Consistent performance results for each client
3.3 difficult point
Problems point two points: certainty (or identity) and timeliness in fact also omitted here to show part of the UI, such as separate display logic (such as logic holding layer 30 / S, but showing the retaining layer 60 /. s) and hand (≈ fluency)
- The biggest challenge is the consistency of the network, especially from the PC-> mobile Internet, latency and packet loss have become more severe, because the next move scene, wifi and 4G Switch to switch between base stations, signal deterioration became very popular .
- The same logic will always remain the same parameters and output it? Think ios / android platform, different compiler and CPU architectures, such as floating-point number. Decimal point and a change like the butterfly effect, results may vary
Delay, the user presses a key to be packed and sent recognition program and at least 16ms, theoretically optimal experience - single game delay, i.e., from the user to press the final screen changes also need to about 40ms, and the delay of the network 4G an average of 40ms, which did not consider the network latency and hardware performance (5G claims to be able to reduce latency to a minimum 1ms, but I skeptical)
3.4 Network
- The reliability of UDP
- UDP redundant information
- Minimize the amount of data
- Each frame of data in MTU look
- Floating-Point Compression
- Serialization
- Loss: 3 before redundancy to the data
- Excessive accumulation of data packets
- Fast forward
- Snapshot
- Restrictions issued
- Players enter the processing delay
3.5 computing consistency
- Calling sequence, timing
- Floating-point calculation
- Fixed-point calculation
- Fix64
- FVector
- Similar Physics.Raycast acquired float -> value truncated
- Sort vessel uncertainty
- Write logic within Coroutine bring uncertainty
- Random value
- Consistency algorithm
- Random Seed
3.6 How to ensure the smooth
1. Data synchronization mode
@w=300
1. Lockstep
- By frame driving game data
- Server collects each player instruction
- Each frame only if the server collect all the player's operation instruction before they can be broadcast
Question: A person latency network, the server will be carried out during the broadcast after waiting for data to arrive, cause everyone Caton
2. Bucket LockStep
- Every time a fixed time broadcast to all users
- By the frame rate interval control server
Each player does not depend on whether the new operation
2. predicted rollback logic, logic Snapshot
Understanding Fighting Game Networking
https://mp.weixin.qq.com/s/cOGn8-rHWLIxdDz-R3pXDg
Talk online synchronization technology
Fast-Paced Multiplayer
3.7 data and presentation separation
Development Notes (12): Location synchronization strategy
@w=300
@w=300
@w=300
Reference:
frame synchronization optimization difficulties and solutions
Talking about the game frame synchronization
online smooth foundation: a frame synchronization game development