You are on page 1of 15

Network Based Games

Members: Yujun Pan, Ziheng Miao

a
Content Table
1st Section: Overview(P1)
Base knowledge of Network Games Design ------ P1

Existing problems and solutions ------ P1

2nd Section: Detailed Introduction(P1-P6)


Introduction of Network Architecture ------ P1

Introduction of Network Protocols ------ P3

3rd Section: Existing Problems and Solutions(P6-P11)


Latency and Lag ------ P6

Cheating in Network Games ------ P8

Conclusion(P11)

References(P13)

b
1. Overview
1.1 Base knowledge of Network Based Games Design
In Network Game design, there are two important tools to make Games and
Network connected and collaborating rightly: Architecture and Protocol.
Since architecture is an integrated concept, it contains Topology, Technologies,
Services, Protocols and so on, we will introduce several components of Architecture
first. Further, because there are several network architectures used in Network Games
designing process, and Client-server architecture is a common and effective way to
design network-based games, we will emphasis on Client -server architecture.
Within the architecture, Server is responsible for client synchronization. We will
introduce how it works.
As for protocols, rules for communication between senders and receivers, they play
a core role in collaborating communicators. We will show you some frequently used
protocol types and how they work.

1.2 Existing Problems and Solutions


Network-based games have become increasingly popular over the years, with
millions of players worldwide logging into their favorite games to play with others
online. However, despite their popularity, network-based games still face several
challenges that can impact player experience. Among them we will introduce three
problems that have not been well-solved: Latency, Cheating, Security problems.

2.Detailed Introduction
2.1 Introduction of Network Architecture
Network architecture refers to the design and structure of a computer network. It
includes the hardware, software, protocols, and technologies used to connect and
communicate between devices on the network. A well-designed network architecture

1
enables efficient data transfer, improved network security, and easy maintenance and
management of the network.
We can assume Architecture as a model which has the functionality of coordinating
the communication between devices.

2.1.1 Detailed introduction of Client-server architecture

Introduction
Client-server architecture: Most network-based games use a client-server
architecture, where the game is hosted on a server and players connect to it. The
server is responsible for managing the game state, enforcing the game rules, and
handling player interactions. The clients, on the other hand, are responsible for
rendering the game graphics, playing sounds, and sending player inputs to the server.

Mechanism
In a client-server architecture, players connect to the game server using a client
program, which communicates with the server using the networking protocols. The
server stores the game state, which includes information about the location, status,
and actions of all the players in the game. When a player performs an action, such as
moving their character or attacking an opponent, the client sends this information to
the server, which updates the game state accordingly. The server then sends updates to
all the connected clients, which render the changes on the player's screens.

Servers: State Synchronization and Frame Synchronization


The game server consists of two parts, the internal server and the external server.
The in-game server is responsible for synchronizing the real-time data of players,
which involves two technologies: State Synchronization and Frame
Synchronization.[1]
The so-called synchronization means that the performance of multiple clients is
consistent. Such like, in a MOBA game, the performance effect of multiple clients
requires that the hero positions displayed on the screens of ten players are exactly the
2
same, and the skill release angles and release time are exactly the same. This is
synchronization.[2]
As for frame synchronization, it simply forwards the command sent by the client
to other clients. For example, player A performs an attack operation, then the player A
client will send an attack command to the server, and the server will synchronize this
command to other players in the game. As for the attack, how much less blood will
kill people, the server does not care, all calculations and judgments are completed by
the client, after the calculation is completed, the client sends the result to the server,
the server then synchronizes the result to other players, and then the client plays the
performance effect. Simply put, the frame synchronization server is to synchronize
data for each game client, and it will send it uninterruptedly. Even if the players in the
game do nothing, the server will still send it. Therefore, the frame synchronization
server charges data traffic. [1]
The difference between the state synchronization server and the frame
synchronization server is that, in addition to the same mechanism for synchronizing
player states, the state synchronization server contains the running logic of the game,
such as players attacking each other and skill damage calculations, all executed on the
server. The execution result is synchronized to the client, and the client only needs to
play the corresponding animation according to the result.[1]

Shortcomings and advantages


Because of the need to run the game logic, state synchronization consumes a lot of
server resources. When the number of players is large, a large number of servers are
required, and the pressure of operation and maintenance management is very high.
The use of frame synchronization can effectively reduce server resource consumption
and reduce the number of servers. However, state synchronization is better than frame
synchronization in terms of disconnection reconnection and anti-cheat.[1]

2.1.2 Detailed introduction of Network Protocols

Introduction
Network protocols are a set of rules and procedures that govern the way data is
3
transmitted and received over a network. They provide a standardized way for
different devices and systems to communicate with each other, regardless of their
hardware or software differences. Network protocols are used to establish and
maintain network connections, control the flow of data, and manage errors that may
occur during data transmission.

TCP

Introduction
Some common network protocols include: Transmission Control
Protocol/Internet Protocol (TCP/IP): TCP/IP is the most widely used network
protocol suite for communicating over the internet. It provides reliable, connection-
oriented communication between devices and is used for transmitting data that
requires accuracy, such as emails, web pages, and file transfers.
Internet Protocol (IP): IP is the protocol responsible for addressing and routing
data packets over the internet. It ensures that data packets are sent to the correct
destination.

Mechanism
The main task of TCP is to collect data from the application layer. It splits the data
into packets(segment), assigns each packet a number, and sends the packets to their
destination.
Likewise, it reassembles packets before sending them to the application layer. Since
TCP is a connection-oriented protocol, this connection will be maintained until the
sender and receiver complete the data exchange.

Head
The length of the TCP header must be at least 20 bytes and no more than 60 bytes.

[5]

4
From here, we see ACK (Acknowledgement Number). It is sent by receivers, once the
sender receives ACK, it continues sending next segment.

UDP

Introduction
In UDP, the receiver does not generate an acknowledgment of a packet, nor does
the sender wait for an acknowledgment of a packet.
UDP does not guarantee ordered delivery of packets. It is stateless and does not
provide any congestion control mechanism.

Head

[5]
Source Port is optional in the IP protocol, this part can be ignored if no reply is
required.

[6]
As for Checksum, it is used for error detection.

Application Scene: TCP or UDP?


The human eye is thought to register an average of 36-60 frames per second. The
more frames per second, the smoother and more seamless the display will appear.
(Many games use 30-120 frames per second depending on the type of game with 60
FPS being the preferred frame rate)[6].
Therefore, in some cases you may experience a video or audio degradation quality
5
due to packet losses; however, it’s better than experiencing huge delays and buffering
issues.
The same applies to online games. Being extremely time-sensitive, we can’t
tolerate retransmission of lost packets, using UDP is better, since it does not do
retransmission.
What if a certain amount of latency is tolerable for a game?
There is a typical technology to hide the latency: Performing operations on the client
side immediately after the user makes a request, rather than waiting for the server's
response.
In World of Warcraft, some special effects like initiating attacks and releasing
skills can be executed directly without receiving confirmation from the server. For
example, the effect of showing freezing skills can be done on the client before the
server returns data.
So, if you are developing a game that can tolerate a certain amount of latency (Ex.
Card Game) and apply the latency hiding techniques described above, TCP can
guarantee you a relatively reliable data transmission.

3 Existing Problems and Solutions


3.1 Latency and Lag
Latency and lag are both terms used to describe delays or disruptions in network
performance that can affect the quality of online experiences, such as online gaming,
video conferencing, and streaming.
Latency refers to the amount of time it takes for a data packet to travel from one
point to another on a network. It is often measured in milliseconds (ms) and is
affected by factors such as the distance between devices, the quality of the network
connection, and the processing time of network devices. High latency can cause
delays and interruptions in data transmission, leading to slower response times,
stuttering video, and other performance issues.
Lag, on the other hand, is a term used to describe the visible effects of latency on
6
an online experience. It is often characterized by delays in gameplay, frozen video, or
poor audio quality. Lag can be caused by high latency, packet loss, or other network
issues. In online gaming, lag can be particularly problematic, as it can impact a
player's ability to react in real-time to in-game events and can make the game feel
unresponsive or unplayable.
So why latency and lag become an issue?
Imagine playing a ranked game in League of Legends, suddenly your network
acts up—every time you cast spells, especially those that are direction-targeted, you
can feel a delay between when you click and the spell triggers and as a result, you
miss everything. That is horrible.
Like highway traffic congestion in real life, latency because of network
congestion can be really annoying in the virtual world. A network delay of 500
additional milliseconds can cause online game players to leave the game, and the
abandonment rate can reach 87 percent with a 2-second delay in load time. In order to
keep players playing and to provide a better gaming experience, game developers and
researchers are seeking to improve delay compensation techniques for games. [7]

Solution of latency and lag

Building a Private Network


Manufacturers invest in network infrastructure, like Riot's ISP, to ensure stable
and efficient communication. They deploy access servers near players, connected by
dedicated high-speed channels, creating a reliable network.

Using UDP
Games are switching to UDP for improved packet transmission timeliness,
especially in weak networks. Reliable-UDP is commonly implemented, combining
reliable and unreliable UDP for different types of data.

Buffering Mechanism
In online games, buffering is used to address input jitter caused by network
7
instability. It involves caching frames of data to provide stable input to the game
logic. Balancing buffer size and latency is crucial for a smooth gaming experience.

Reducing Buffer Size


To maintain smooth gameplay with a smaller buffer, stable frame rates and
predictive algorithms are necessary. The server predicts player behavior during
network interruptions, ensuring smooth movement upon recovery. Hiding a lag --
Example: Throwing a grenade

After the button is pressed, the client immediately plays the forward shake
animation, but waits until the server process ends before notifying the client to fly
out the grenade. It is equivalent to lengthening the front shake on the client side.
Doing so solves the above problems and provides a good user experience:
Players get immediate feedback after pressing a button, so the operating
experience is very good.
The generation of grenades complies with the authority of the server and
prevents strange performances caused by interruptions.
Although there is a delay in the flying of the grenade, the arm at the end of the
animation occupies most of the screen, and the player can barely perceive this delay.
Even if players notice this delay, it won't have much impact.[8]

3.2 Cheating in Network Games

3.2.1 Different types of cheating:

Cheating in League of Legends


Cheating in League of Legends, commonly known as scripting, refers to the act
of using third-party software or scripts to gain an unfair advantage in the game.
Scripting allows players to automate their actions, such as skillshots, dodging, and
8
timing abilities, with incredible precision and reaction time beyond human
capabilities.
These scripts manipulate the game's mechanics by granting players enhanced
accuracy, instantaneous spellcasting, and predictive movement. They can also provide
crucial information about enemy positions, map awareness, and cooldown tracking,
giving script users a significant edge over legitimate players.
Scripting not only undermines the integrity of the game but also creates an
imbalanced playing field. It diminishes the importance of skill, strategy, and fair
competition, as the cheating player gains an unfair advantage over others. This
behavior is not only against the game's terms of service but also frowned upon by the
League of Legends community.

Solutions
Riot Games, the developer of League of Legends, actively combats scripting by
implementing advanced detection systems and regularly updating their anti-cheat
measures. Players caught using scripts face severe consequences, including permanent
bans from the game.
It is important for players to uphold the spirit of fair play and competitive integrity in
League of Legends, fostering a positive and enjoyable gaming environment for all
participants.

Cheating in CSGO
Cheating in Counter-Strike: Global Offensive (CS:GO) is a prevalent issue that
undermines the competitive integrity of the game. Cheaters employ various methods,
such as aimbots, wallhacks, and recoil scripts, to gain an unfair advantage over
legitimate players.
Aimbots are software programs that automatically aim and shoot at opponents
with incredible accuracy, eliminating the need for skill and precision. Wallhacks
enable cheaters to see through walls, revealing the positions of enemies and providing
an unfair informational advantage. Recoil scripts control weapon recoil, ensuring
perfect spray patterns and reducing the difficulty of controlling weapons.
9
By using these cheats, players can dominate matches, win engagements
effortlessly, and disrupt the balance of fair competition. This not only ruins the
experience for honest players but also damages the credibility of the competitive

CS:GO scene.

Solutions
To combat cheating, Valve, the developer of CS:GO, has implemented anti-cheat
measures like VAC (Valve Anti-Cheat) and Overwatch, a community-driven system
that allows players to review and report suspicious behavior. Valve continuously
updates and improves these systems to detect and ban cheaters, striving to maintain
the integrity of the game.
Cheating in CS:GO is a violation of the game's terms of service and can result in
severe penalties, including permanent bans from online play. It is crucial for players
to uphold fair play, maintain a level playing field, and ensure the integrity of
competitive matches.
By reporting suspected cheaters and actively supporting anti-cheat efforts, the
CS:GO community can work together to create a fair and enjoyable gaming
environment for everyone involved.
Cheating in any game will greatly reduce the game experience of other players,
so both game companies and players are vigorously resisting cheating.

3.2.2 Protection against cheating


Many tools and processes are available to game developers to address cheating.
Here are the most effective approaches to solve the problem:

Smart design
Truly effective anti-cheat starts at the first line of game code. Assume your clients
cannot be trusted and design games with authoritative servers. Restrict clients to
receiving only the data they absolutely need. This is the most effective first step to
limit cheating.

Patch prevention
10
Use tools that encrypt and secure critical variables to enable gameplay elements to
resist in-memory attacks. Tools that perform integrity verification of game files can
prevent cheaters from offline tampering with game logic, data, or assets.

Communication protection
To prevent man-in-the-middle attacks and manipulation of player data,
absolutely use data encryption. In this way, you protect client-server communication
protocols.

Process isolation
Use Anti-Hooking, Anti-Debug and process handle hiding techniques to make it
harder for cheats to access the running game process.

Obfuscation and virtualization


If you obfuscate and virtualize code, you limit static analysis of critical game
logic. This helps prevent data mining of preloaded content, special events or late-
game secrets.

Analyze behavior
Statistical analysis of player behavior can identify many cheat techniques such as
scripts, aim bots and trigger bots.

Monitor and enforce


Hire expert cyber intelligence and enforcement to rapidly identify and disrupt
sites that promote cheating tools or techniques. On top of everything, they damage
your game’s reputation. Never underestimate cheat prevention![9]

Conclusion
In summary, network-based games present their own set of challenges that need
to be addressed. The characteristics of different types of servers, such as state
synchronization server and the frame synchronization server, offer distinct advantages
and disadvantages. state synchronization servers offer precise consistency and
centralized game logic execution at the cost of high server resource consumption and
11
management pressure. Frame synchronization servers reduce resource consumption
but sacrifice some consistency and centralized control. Each server type has its
advantages and disadvantages, and the choice depends on the specific requirements
and constraints of the game.
When it comes to network protocols, selecting the appropriate one is crucial.
TCP ensures reliable data delivery, but it introduces higher latency, which may not be
ideal for real-time gaming. On the other hand, UDP offers lower latency but lacks
reliability, potentially leading to data loss or out-of-order packets. The choice of
protocol depends on the specific requirements of the game and the desired balance
between reliability and latency.
In network-based games, several common problems exist. These can include
latency issues and cheating in some online games. To address these challenges,
developers can implement various solutions. For latency, addressing latency and lag
in online games involves building a private network, using UDP for faster packet
transmission, implementing buffering mechanisms, hiding lag through client-side
animations, and optimizing gameplay experience. These strategies help minimize the
impact of latency and lag, enhancing the overall gaming experience for players. The
fight against cheating in games involves implementing advanced detection systems,
regularly updating anti-cheat measures, imposing severe consequences on cheaters,
encouraging community reporting, utilizing community-driven systems, and
continuously improving anti-cheat methods. By combining these approaches, game
developers and players can strive for fair play, maintain competitive integrity, and
create enjoyable gaming environments.
In conclusion, when developing network-based games, understanding the
characteristics of different server types, evaluating the pros and cons of network
protocols, and implementing appropriate solutions to address common problems are
vital for creating a smooth and secure gaming experience.

12
References
[1] Chen Daxia. "Zhihu Question: Why do network latency and network jitter become
issues?" Zhihu. Available at: https://www.zhihu.com/question/23508968 . Accessed:
Date 20.06.2023.
[2] Yun Ying. "Zhihu Column Article: Technical issues in network game development
related to network latency." Zhihu Column. Available at:
https://zhuanlan.zhihu.com/p/36884005 . Accessed: Date 20.06.2023.
[3] Luo Jiao. "CSDN Blog Post: The relationship between network latency and
bandwidth." CSDN Blog. Available at 20.06.2023:
https://blog.csdn.net/luojiaoqq/article/details/12949783 . Accessed: Date 20.06.2023.
[4]DannyIdea. "Juejin Article: The impact of latency and network jitter on online
gaming." Juejin. Available at: https://juejin.cn/post/7070871301807669278 .
Accessed: Date 20.06.2023.
[5]Sean Bei. "FreeCodeCamp Article: TCP vs. UDP - Which is faster?"
FreeCodeCamp. Available at: https://www.freecodecamp.org/chinese/news/tcp-vs-
udp-which-is-faster/ . Accessed: Date 20.06.2023.
[6]SAVVY SECURITY. "Blog Post: How UDP works - A look at the User Datagram
Protocol in computer networks." Cheap SSL Security. Available at: 20.06.2023.
https://cheapsslsecurity.com/blog/how-udp-works-a-look-at-the-user-datagram-
protocol-in-computer-networks/ . Accessed: Date 20.06.2023.
[7] Mei Xintong Zha, Ying Zhang. "Paper: Title of the Paper." Available at: chrome-
extension://efaidnbmnnnibpcajpcglclefindmkaj/https://core.ac.uk/download/pdf/2130
02493.pdf . Accessed: Date 20.06.2023.
[8] waltercao. "News Article: Title of the News." Toutiao. Available at:
https://urlzs.com/w68Mw .Accessed: Date 20.06.2023.
[9] Reinhard Blaukovitsch. "Blog Post: Cheating in games - Everything you always
wanted to know about it." Irdeto Blog. Available at: https://blog.irdeto.com/video-
gaming/cheating-in-games-everything-you-always-wanted-to-know-about-it/
Accessed: Date 20.06.2023.

13

You might also like