2D online game development (network) (1)

xiaoxiao2021-04-05  277

2D online game development (network) (1)

Author: akinggw

"2D online game development", I sometimes think that this title is too much, it is too difficult to achieve it. So, I decided to divide it, I divided it into the following sections according to a online game I want to implement:

l

Client

l

Network end

l

Service-Terminal

l

Web page

Let's talk about it, we have to do anything in each port:

(1)

The client clears network data does not talk, we mainly implement the game interface in the client, and the game interface includes those? For example, the display of the game map, the display of the wizard, the display of the UI (user interface), is also the development of some game rules, etc.

(2)

What do we have to do between the network network? I want mainly including two aspects: Take data from the server side, remove data from the database, then send data to the client, get data from the client, then update the database; and what do we have to do in the client? Remove the data from the network, then update the game variable, get the game variable, then send it to the server. Here, I just talked about the approximate content of the network, and it may still be modified in practice.

(3)

The main content of the server-side server side, I think it is to deal with the database. Because we are registered with users through the website, the main content of the server side is to take the database content and update the database content. It may involve deleting database content, but this is not common.

(4)

The main content of the webpage page is implemented, I think it is the user's registration, modification, information release, player's communication and interaction.

I have explained the content involved in the development and development of 2D online games here, and these content may be modified as actual development.

I think the game client I have made with SDL, the network is used with Raknet, and the database uses mysql, website production JSP.

These contents may not be counted as an article, I want to call the experience. Of course, I also hope that these experience will not make you misuse.

Since this article is called "2D online game development (network)", I will not write some other content, I will write me some feelings in this article, the same, I hope it is You are useful.

Anyway, I think it is useful.

Below, let's start!

Probably in this half year, I have contacted 3 network engines, they are:

l

OpenTNL

http://www.opentnl.org

)

l

SDL_NET

http://www.libsdl.org/projects/sdl_net/

)

l

Radnet

http://www.rakkarsoft.com

)

The three network engines are designed for games. Let me talk about my views on the three engines.

OpenTNL comes from Torque 3D game engine, information about Torque, please visit http://www.garagegames.com/. It should be said that OpenTNL is part of Torque. It can be run across platforms, there are many rich documents and tutorials, but it has a fatal weakness - use too complicated. Because Torque belongs to the early game engine, in OpenTNL, many coding methods are different from what you have learned, you need to spend a lot of time to learn it. I think this is why OpenTNL has not done a number of projects. SDL_NET comes from SDL and is also a cross-platform network engine. SDL_NET is written in C language, and learning is simply clear, but SDL_NET is too young, only a few years. Therefore, SDL_NET also has too many bugs, and the lack of sufficient support file is also the cause of slow development. After all, it is too young.

The RADNET can be said to be an advantage based on the above two engines. It has both OpenTNL documents, and there is a simple use of SDL_NET.

In the next day, we will explain how to use the radnet, let you fully enjoy the pleasure to you.

Radnet is a C network library based on the UDP network transport protocol, allowing programmers to implement efficient network transport services in their own programs. Usually used for games, but can also be used in other items.

Radnet has the following benefits:

l

High performance On the same computer, the radnet can transmit 25,000 information per second;

l

Easy to use radnet with online user manual, video tutorial. Every function and class have a detailed explanation, each of which has its own routine;

l

Cross-platform, current radnet supports Windows, Linux, MACS, can be built on Visual Studio, GCC, Code: Blocks, DEVCPP, and other platforms;

l

Online Technical Support Raknet has an active forum, mailing list, you can send them a letter, they can reply you within a few hours.

l

Safe Transmission Raknet automatically uses SHA1, AES128, SYN in your code, avoiding transmission with RSA

l

Audio transmission is decoded with SPEEX coding, and 8-bit audio only requires 500 bytes per second.

l

Remote Terminal With Raknet, you can manage your program remotely, including the program's setting, password management and log management.

l

The directory server directory server allows the server to enumerate their own clients and connect to them.

l

The AutoPATCher AutoPATCher system will restrict the client to transfer the file to the server, which is to avoid some of the illegal users transfer some of the non-legal files to the server.

l

Object overload system

l

Network Data Compression BitStream class allows compressed vector, matrix, quadular number, and real numbers between -1 to 1.

l

Remote function call

l

Strong communication layer can guarantee information according to different channel transmission

Raknet supports two copyrights, if you are a free game, Raknet will be free. Instead, you must pay a certain fee.

From here you can download to the latest RAKNET:

http://www.rakkarsoft.com/raknet/downloads/raknet.zip

With regard to Raknet settings, we will explain the next article.

转载请注明原文地址:https://www.9cbs.com/read-132167.html

New Post(0)