Netcode

From Wikipedia, the free encyclopedia

Template:Short description Netcode is a blanket term most commonly used by gamers relating to networking in online games, often referring to synchronization issues between clients and servers.

Players often blame "bad netcode" when they experience lag or reverse state transitions when synchronization between players is lost. Although these events are sometimes caused by bugs, other networking-related causes include high latency between server and client, packet loss, or network congestion. Depending on the game implementation, these issues can also be caused by non-network factors such as frame rendering time or inconsistent frame rate.[1][2] Netcode is often designed to mask networking irregularities and create a synchronous and smooth gamestate across multiple users.

Netcode types

Unlike a local game where the inputs of all players are executed instantly in the same simulation or instance of the game, in an online game there are several parallel simulations (one for each player) where the inputs from their respective players are received instantly, while the inputs for the same frame from other players arrive with a certain delay (greater or lesser depending on the physical distance between the players, the quality and speed of the players' network connections, etc.).[3] During an online match, games must receive and process players' input within a certain time for each frame (roughly 16.5 ms per frame at 60 FPS), and if a remote player's input of a particular frame (for example, of frame number 10) arrives when another one is already running (for example, in frame number 20, roughly 170 ms later), desynchronization between player simulations is produced. There are two main resolutions to this conflict implemented in modern games: delay-based and rollback-based resolution.

Delay-based

Diagram on the execution and synchronization of the inputs of two players (with a 90 ms ping between them) in an online game that uses delay-based netcode in a peer-to-peer model.

The classic solution to this problem is the use of a delay-based netcode. When the inputs of a remote player arrive late, the game delays the inputs of the local player accordingly to synchronize the two inputs and run them simultaneously. This added delay can be disruptive for players (especially when latency is high), but overall the change is not very noticeable. However, these delays can be inconsistent due to sudden fluctuations in current latency. Should the latency between players exceed an established buffer window for the remote player, the game must wait, causing the screens to "freeze". This occurs because a delay-based netcode does not allow the simulation to continue until it receives the inputs from all the players in the frame in question.[4] This variable delay causes an inconsistent and unresponsive experience compared to offline play (or to a LAN game), and can negatively affect player performance in timing-sensitive and fast-paced genres such as fighting games.[5]

Rollback

Diagram on the execution and synchronization of the inputs of two players (with a 90 ms ping between them) in an online game that uses rollback netcode in a peer-to-peer model.

An alternative system to the previous netcode is rollback netcode. This system immediately runs the inputs of the local player (so that they are not delayed as with delay-based netcode), as if it were an offline game, and predicts the inputs of the remote player or players instead of waiting for them (assuming they will make the same input as the one in the previous tick). Once these remote inputs arrive (suppose, e.g., 45 ms later), the game can act in two ways: if the prediction is correct, the game continues as-is, in a totally continuous way; if the prediction was incorrect, the game state is reverted and gameplay continues from the corrected state, seen as a "jump" to the other player or players (equivalent to 45 ms, following the example).[1] Some games utilize a hybrid solution in order to disguise these "jumps" (which can become problematic as latency between players grows, as there is less and less time to react to other players' actions) with a fixed input delay and then rollback being used. Rollback is quite effective at concealing lag spikes or other issues related to inconsistencies in the users' connections, as predictions are often correct and players do not even notice. Nevertheless, this system can be troublesome whenever a client's game slows down (usually due to overheating), since rift problems can be caused leading to an exchange of tickets between machines at unequal rates. This generates visual glitches that interrupt the gameplay of those players that receive inputs at a slower pace, while the player whose game is slowed down will have an advantage over the rest by receiving inputs from others at a normal rate (this is known as one-sided rollback).[6] To address this uneven input flow (and consequently, an uneven frame flow as well), there are standard solutions such as waiting for the late entries to arrive to all machines (similar to the delay-based netcode model) or more ingenious[citation needed] solutions as the one currently used in Skullgirls, which consists of the systematic omission of one frame every seven so that when the game encounters the problem in question it can recover the skipped frames in order to gradually synchronize the instances of the games on the various machines.[7]

Rollback netcode requires the game engine to be able to turn back its state, which requires modifications to many existing engines, and therefore, the implementation of this system can be problematic and expensive in AAA type games (which usually have a solid engine and a high-traffic network), as commented by Dragon Ball FighterZ producer Tomoko Hiroki, among others.[8]

Although this system is often associated with a peer-to-peer architecture and fighting games, there are forms of rollback networking that are also commonly used in client-server architectures (for instance, aggressive schedulers found in database management systems include rollback functionality) and in other video game genres.[1]

There is a popular MIT-licensed library named GGPO designed to help implement rollback networking to games (mainly fighting games).[9]

Games using rollback netcode

Page Module:Hatnote/styles.css has no content.

Script error: No such module "Template wrapper".

Potential causes of netcode issues

Latency

Latency is unavoidable in online games, and the quality of the player's experience is strictly tied to this (the more latency there is between players, the greater the feeling that the game is not responsive to their inputs).[1] The latency of the players' network (which is largely out of a game's control) is not the only factor in question, but also the latency inherent in the way the game simulations are run. There are several lag compensation methods used to disguise or cope with latency (especially with high latency values).[73]

Tick rate

A single update of a game simulation is known as a tick. The rate at which the simulation is run on a server is often referred to as the server's tickrate; this is essentially the server equivalent of a client's frame rate, absent any rendering system.[74] Tickrate is limited by the length of time it takes to run the simulation, and is often intentionally limited further to reduce instability introduced by a fluctuating tickrate, and to reduce CPU and data transmission costs. A lower tickrate increases latency in the synchronization of the game simulation between the server and clients.[75] Tickrate for games like first-person shooters is often between 128 ticks per second (such is Valorant's case), 64 ticks per second (in games like Counter-Strike: Global Offensive and Overwatch), 30 ticks per second (like in Fortnite and Battlefield V's console edition)[76] and 20 ticks per second (such are the controversial cases of Call of Duty: Modern Warfare, Call of Duty: Warzone and Apex Legends).[77][78] A lower tickrate also naturally reduces the precision of the simulation,[74] which itself might cause problems if taken too far, or if the client and server simulations are running at significantly different rates.

Because of limitations in the amount of available bandwidth and the CPU time that's taken by network communication, some games prioritize certain vital communications while limiting the frequency and priority of less important information. As with tickrate, this effectively increases synchronization latency. Game engines may limit the number of times that updates (of a simulation) are sent to a particular client and/or particular objects in the game's world in addition to reducing the precision of some values sent over the network to help with bandwidth use. This lack of precision may in some instances be noticeable.[74][79]

Software bugs

Various simulation synchronization errors between machines can also fall under the "netcode issues" blanket. These may include bugs which cause the simulation to proceed differently on one machine than on another, or which cause some things to not be communicated when the user perceives that they ought to be.[2] Traditionally, real-time strategy games (such as Age of Empires) have used lockstep protocol peer-to-peer networking models where it is assumed the simulation will run exactly the same on all clients; if, however, one client falls out of step for any reason, the desynchronization may compound and be unrecoverable.[74][80]

Transport layer protocol and communication code: TCP and UDP

Script error: No such module "Labelled list hatnote". A game's choice of transport layer protocol (and its management and coding) can also affect perceived networking issues.

If a game uses Transmission Control Protocol (TCP), there will be increased latency between players. This protocol is based on the connection between two machines, in which they can exchange data and read it. These types of connections are very reliable, stable, ordered and easy to implement. These connections, however, are not quite suited to the network speeds that fast-action games require, as this type of protocol automatically groups data into packets (which will not be sent until a certain volume of information is reached, unless this algorithm — Nagle's algorithm — is disabled) which will be sent through the connection established between the machines, rather than directly (sacrificing speed for security). This type of protocol also tends to respond very slowly whenever they lose a packet, or when packets arrive in an incorrect order or duplicated, which can be very detrimental to a real-time online game (this protocol was not designed for this type of software).

If the game instead uses a User Datagram Protocol (UDP), the connection between machines will be very fast, because instead of establishing a connection between them the data will be sent and received directly. This protocol is much simpler than the previous one, but it lacks its reliability and stability and requires the implementation of own code to handle indispensable functions for the communication between machines that are handled by TCP (such as data division through packets, automatic packet loss detection, etc.); this increases the engine's complexity and might itself lead to issues.[81]

See also

Notes

Page Template:Reflist/styles.css has no content.

  1. ^ a b c d e f g h i j k l m n Rollback netcode added via fan-made patch.
  2. ^ a b c d e f g h i j k l m n o p q r Rollback netcode added after release via patch.
  3. ^ Super Nintendo version via Teenage Mutant Ninja Turtles: The Cowabunga Collection

References

Page Template:Reflist/styles.css has no content.

  1. ^ a b c d Page Module:Citation/CS1/styles.css has no content.Huynh, Martin; Valarino, Fernando (2019). An analysis of continuous consistency models in real time peer-to-peer fighting games.
  2. ^ a b Page Module:Citation/CS1/styles.css has no content."Addressing "Netcode" in Battlefield 4". EA Digital Illusions CE. March 2014. Retrieved 2014-03-30.
  3. ^ Page Module:Citation/CS1/styles.css has no content."Netcode [p1]: Fightin' Words". ki.infil.net. Retrieved 2020-12-07.
  4. ^ Page Module:Citation/CS1/styles.css has no content.Staff, Ars (2019-10-18). "Explaining how fighting games use delay-based and rollback netcode". Ars Technica. Retrieved 2020-12-07.
  5. ^ Page Module:Citation/CS1/styles.css has no content.Pinnacle. "The difference between LAN and Online esports". Pinnacle. Retrieved 2020-12-01.
  6. ^ Page Module:Citation/CS1/styles.css has no content.Lee, Gerald (2020-04-08). Analysis: Why Rollback Netcode Is Better (Youtube).
  7. ^ Page Module:Citation/CS1/styles.css has no content.Hills, Dakota 'DarkHorse' (2020-04-29). "Skullgirls receives an improved netcode update initially created by a fan of the game". EventHubs. Retrieved 2020-12-11.
  8. ^ Page Module:Citation/CS1/styles.css has no content.Hills, Dakota 'DarkHorse' (2020-12-10). "The era of delay-based netcode may finally be over for good in fighting games depending on what SNK does with The King of Fighters 15". EventHubs. Retrieved 2020-12-10.
  9. ^ Page Module:Citation/CS1/styles.css has no content.Pusch, Ricky (2019-10-18). "Explaining how fighting games use delay-based and rollback netcode". Ars Technica. Retrieved 2020-12-14.
  10. ^ Page Module:Citation/CS1/styles.css has no content.Sirlin, David (18 August 2014). "Street Fighter HD Remix Features". Sirlin.Net. Retrieved 2020-02-06. Note that the networking uses Tony Cannon's ggpo technique, and he consulted to ensure it was done correctly.
  11. ^ Page Module:Citation/CS1/styles.css has no content.Svensson, Christian. "Where's Yo Curleh Mustache? Yes, MVC2 is Real!". capcom-unity.com. Retrieved 2020-02-20. With the game being developed by Backbone, we are using largely the same, critically acclaimed net code that we used in Super Street Fighter 2 Turbo HD Remix and with that will come our player match quarter mode/lobby system that has proven so popular.
  12. ^ Page Module:Citation/CS1/styles.css has no content.Yin-Poole, Wesley (2012-03-09). "Capcom looking to improve Street Fighter x Tekken online sound problems". Eurogamer. Retrieved 2019-10-22.
  13. ^ Page Module:Citation/CS1/styles.css has no content."Touhou Hisoutensoku Rollcaster Official Release". #hisouten@irc.rizon.net. 2012-12-25. Retrieved 2020-07-18. Thanks to Fireseal, Touhou Hisoutensoku can now be played with rollback enabled; long story short, intercontinental play with low delay is now possible.
  14. ^ Page Module:Citation/CS1/styles.css has no content."EXCLUSIVE: Everything We Know About Killer Instinct For Xbox One". Killer Instinct Central. September 9, 2013. Retrieved March 1, 2016.
  15. ^ Page Module:Citation/CS1/styles.css has no content.Sahdev, Ishaan (2014-12-23). "Killer Instinct Classic Getting Online Multiplayer". Siliconera. Retrieved 2019-10-22.
  16. ^ Script error: No such module "cite tweet".
  17. ^ Page Module:Citation/CS1/styles.css has no content.Torres, Josh (2016-04-22). "Branching Path: Melty Blood Actress Again Current Code's Steam Version". RPG Site. Retrieved 2020-05-18. As a matter of fact, two very talented individuals from the Melty Blood community, Mauve and Madscientist, built custom online multiplayer clients for the PC versions of Act Cadenza Ver. B and Actress Again Current Code respectively. While they were easy to use after spending a little bit of time understanding their interface, it still required a separate program. These clients are still impressive to this day because they minimized input lag by incorporating rollback netcode (now seen in Street Fighter V) and kept frame stuttering or "laggy matches" to a minimum.
  18. ^ Script error: No such module "cite tweet".
  19. ^ Page Module:Citation/CS1/styles.css has no content.Nettention (2016-04-06). "Sponsored: Meet the company behind the P2P networking of Street Fighter V". Gamasutra. Archived from the original on April 10, 2016. Retrieved 2019-10-22.
  20. ^ Page Module:Citation/CS1/styles.css has no content.Wright, Steven T. (2017-03-31). "Reviving 'River City Ransom' and Reinventing the Brawler". VICE. Retrieved 2020-01-29. Crenna and co. even coded the online multiplayer around a "rollback driver," a challenging technical feature usually reserved for popular fighting games like Street Fighter.
  21. ^ Page Module:Citation/CS1/styles.css has no content.Paget, Mat (2016-07-14). "E3 2016: Injustice 2 Multiplayer Will Use Popular Fighting Game Netcode". GameSpot. Retrieved 2019-10-04. He talked about the game's loot drops and gear system, but he also revealed that Injustice 2 will use GGPO netcode for its multiplayer.
  22. ^ Page Module:Citation/CS1/styles.css has no content.Walker, Ian (2017-04-27). "Marvel vs. Capcom Infinite Wants Even Newbies To Have A Blast". Kotaku. Retrieved 2020-01-11. Once players have a firm grasp on the fundamentals, they can hop online and test their burgeoning skills against worldwide opponents, one-on-one or in lobbies, using Capcom's proprietary rollback netcode.
  23. ^ Page Module:Citation/CS1/styles.css has no content."Golden Fantasia & Rollback Netplay". MangaGamer Staff Blog. 2017-12-07. Retrieved 2019-10-22. Of course, once a game goes worldwide, this no longer holds true, and something has to be done to account for network issues, which is why we made a point of implementing rollback netplay into our version of Umineko: Golden Fantasia.
  24. ^ Page Module:Citation/CS1/styles.css has no content."Acceleration of SUGURI 2". Steam. Retrieved 2020-01-28. Online and Split-screen Multiplayer with rollback netcode
  25. ^ Page Module:Citation/CS1/styles.css has no content."Rollback Netcode and Chinese UI localization!". Steam Community. 2018-05-10. Retrieved 2019-10-22.
  26. ^ Page Module:Citation/CS1/styles.css has no content.Wong, Andy (2018-03-20). "Street Fighter 30th Anniversary Collection Arrives on May 29, 2018". PlayStation.Blog. Retrieved 2019-10-22. Online play also features rollback technology that provides low-latency matches with the ability to adjust your own input buffer speed via the in-game menu to keep your online experience smooth.
  27. ^ Page Module:Citation/CS1/styles.css has no content.Digital Crafter Team (May 8, 2019). "Jesus is back!! Balance adjustment and new netcode tech (Roll back) online!". Steam Community. Retrieved February 26, 2020. On Net code, we were using delay base before this update. And this time we changed to (Roll Back) method, it should bring you better input experience. Please give it a try!
  28. ^ Script error: No such module "cite tweet".
  29. ^ Script error: No such module "cite tweet".
  30. ^ Script error: No such module "cite tweet".
  31. ^ Page Module:Citation/CS1/styles.css has no content."Maiden & Spell". Retrieved 2020-01-28. And yes, the online battles have rollback netcode.
  32. ^ Script error: No such module "cite tweet".
  33. ^ Script error: No such module "cite tweet".
  34. ^ Script error: No such module "cite tweet".
  35. ^ Page Module:Citation/CS1/styles.css has no content.Smajstrla, Ann (2020-06-23). "Fan mod adds modern online features to 'Super Smash Bros. Melee'". Engadget. Retrieved 2020-08-02.
  36. ^ Page Module:Citation/CS1/styles.css has no content.Wong, Alistair (2020-08-01). "Fighting EX Layer Patched to Rollback Netcode in Latest Update". Siliconera. Retrieved 2020-08-06.
  37. ^ Script error: No such module "cite tweet".
  38. ^ Script error: No such module "cite tweet".
  39. ^ Script error: No such module "cite tweet".
  40. ^ Script error: No such module "cite tweet".
  41. ^ Page Module:Citation/CS1/styles.css has no content."[PRESS RELEASE] Guilty Gear -Strive- Closed Beta Test Sign-ups Start Today!" (Press release). Rolling Hills Estates, California: Arc System Works. 2020-03-18. Retrieved 2020-03-19.
  42. ^ Script error: No such module "cite tweet".
  43. ^ Page Module:Citation/CS1/styles.css has no content.넷마블 TV (2021-03-24). [킹오파올스타] 실시간 PVP 개선 상황 최초 공개! [[King of Fighters All Star] First look at real-time PVP improvements!] (in 한국어). Netmarble. Retrieved 2024-05-21 – via YouTube.
  44. ^ Script error: No such module "cite tweet".
  45. ^ Script error: No such module "cite tweet".
  46. ^ Page Module:Citation/CS1/styles.css has no content.Jarrard, Chris (July 13, 2021). "Nickelodeon All-Star Brawl is from Slap City devs and may have rollback netcode". Shacknews. Retrieved July 13, 2021.
  47. ^ Script error: No such module "cite tweet".
  48. ^ Page Module:Citation/CS1/styles.css has no content.Andy Chalk (2020-12-10). "Windjammers 2 is delayed until 2021 so developers can add rollback netcode". PC Gamer. Retrieved 2020-12-18.
  49. ^ a b Script error: No such module "cite tweet".
  50. ^ Page Module:Citation/CS1/styles.css has no content.""KoF XV Open Beta Test Information"" (PDF). Retrieved 2021-11-17.
  51. ^ Script error: No such module "cite tweet".
  52. ^ Page Module:Citation/CS1/styles.css has no content.Leblanc, Wesley. "MultiVersus Announced, Will Feature Batman, Shaggy, Bugs Bunny, Arya Stark, Steven Universe, And More". Game Informer. Archived from the original on 19 November 2021. Retrieved 19 November 2021.
  53. ^ Script error: No such module "cite tweet".
  54. ^ a b c d e f g Page Module:Citation/CS1/styles.css has no content."Tango". Tango. Retrieved 2022-06-19. Works with every English and Japanese Battle Network game.
  55. ^ Page Module:Citation/CS1/styles.css has no content.mars. "MMBN3 PvP Balance Patch". n1gp.dev. Archived from the original on 2021-10-08. Retrieved 2021-09-26. Lots of changes have been made under the hood in order to make BBN3 work with rollback netcode.
  56. ^ Page Module:Citation/CS1/styles.css has no content.Romano, Sal (4 August 2022). "The Rumble Fish 2 launches this winter for PS5, Xbox Series, PS4, Xbox One, Switch, and PC". Gematsu. Now with widescreen support, rollback netcode, and more.
  57. ^ Script error: No such module "cite tweet".
  58. ^ Page Module:Citation/CS1/styles.css has no content.Romano, Sal (June 10, 2022). "Street Fighter 6 supports rollback netcode, cross-play". Gematsu. Retrieved June 10, 2022.
  59. ^ Page Module:Citation/CS1/styles.css has no content."Q: Will Mortal Kombat 1 have rollback netcode? A: Yes, Mortal Kombat 1 will have rollback netcode to support online gameplay".
  60. ^ Script error: No such module "cite tweet".
  61. ^ Script error: No such module "cite tweet".
  62. ^ Page Module:Citation/CS1/styles.css has no content.Jones, Anthony (2023-12-27). "Does Tekken 8 Have Rollback Netcode?". The Escapist. Retrieved 2024-01-23.
  63. ^ Script error: No such module "cite tweet".
  64. ^ Page Module:Citation/CS1/styles.css has no content.Parker, Jason (March 28, 2025). "Iron Saga VS review: Super Robot Wars, but make it for the FGC". Sportskeeda. Retrieved 2025-04-03.
  65. ^ Page Module:Citation/CS1/styles.css has no content.Bolding, Jonathan (2022-12-10). "An upcoming RTS will incorporate the rollback tech that took Fighting games by storm". PC Gamer. Retrieved 2023-02-07.
  66. ^ Page Module:Citation/CS1/styles.css has no content.Romano, Sal (February 6, 2025). "Team ARCANA fighting game Daemon Bride: Additional Gain coming to PC in 2025". Gematsu. Retrieved February 6, 2025.
  67. ^ Script error: No such module "cite tweet".
  68. ^ Page Module:Citation/CS1/styles.css has no content.Vortex Games. "Rushdown Revolt - Pre-Beta Testing". Steam. Retrieved 2020-08-08. Vortex Rollback been in development for four years to fully embed it into every aspect of our game engine in order to minimize delay and rollback impacts.
  69. ^ Script error: No such module "cite tweet".
  70. ^ Page Module:Citation/CS1/styles.css has no content.@Muno (2025-04-22). "Rollback Netcode Explanation". BlueSky. Retrieved 2025-04-22.
  71. ^ Script error: No such module "cite tweet".
  72. ^ Page Module:Citation/CS1/styles.css has no content."The Entire Nintendo 64 Library Now Has Rollback Netcode".
  73. ^ Page Module:Citation/CS1/styles.css has no content."Latency Compensating Methods in Client/Server In-game Protocol Design and Optimization". Valve Developer Community. Retrieved 2020-12-11.
  74. ^ a b c d Page Module:Citation/CS1/styles.css has no content."Source Multiplayer Networking". Valve. Retrieved 2014-03-30.
  75. ^ Page Module:Citation/CS1/styles.css has no content."Titanfall, de l'importance d'un bon tickrate". gamekult.com. 2014-03-29. Retrieved 2014-03-30.
  76. ^ Page Module:Citation/CS1/styles.css has no content."Battlefield V Server Tick Rate Revealed & Why It Matters". www.glitched.online. Retrieved 2020-12-05.[permanent dead link]
  77. ^ Page Module:Citation/CS1/styles.css has no content.Davison, Ethan. "Valorant's super-fast servers are attracting streamers and pros in droves. Here's why". Washington Post. ISSN 0190-8286. Retrieved 2020-12-05.
  78. ^ Page Module:Citation/CS1/styles.css has no content."How bad is Apex Legends netcode compared to Fortnite and PUBG?". Dexerto. 2019-11-23. Retrieved 2020-12-05.
  79. ^ Page Module:Citation/CS1/styles.css has no content."Unreal Networking Architecture". Epic Games. Retrieved 2014-09-07.
  80. ^ Page Module:Citation/CS1/styles.css has no content.Glenn Fiedler (24 February 2010). "What every programmer needs to know about game networking". Retrieved 2014-09-08.[permanent dead link]
  81. ^ Page Module:Citation/CS1/styles.css has no content.Fiedler, Glenn (2008-10-01). "UDP vs. TCP". Gaffer On Games. Retrieved 2020-12-14.

Lua error in package.lua at line 80: module 'Module:Navbox/configuration' not found.