Role play game (RPG) is a game that is popular with the majority of games, which attracts countless players with unique interactive and story. It provides people with a broad virtual world that exceeds real life, enabling people to try to play different roles, experience and experience a variety of different life journey or fantasy experience. These experiences are unable to be implemented in real life. After playing a lot of games, many players no longer only satisfied with a game player's identity, and thinking about how the game is made, and intend to make a game, all kinds of game production groups on the Internet are like the spring bamboo shoots. Emerging. Below I will introduce you to the principle and production of the role playing the game engine, hoping to help the game making enthusiasts. The principle of a game engine speaks the engine, and the game fans are very familiar. The game engine is a collection of machine-identified code (instructions) that can be identified by machines that run a type of game. It looks like a engine to control the game's operation. A game work can be divided into two parts: game engine and game resources. Game resources include images, sounds, animations and other parts, column a formula is: game = engine (program code) resource (image, sound, animation, etc.). The game engine is called these resources in the order design of the game design. The production of two-character playing games A complete role-playing game can be divided into: planning, programming, art, music production, project management, post-test test, etc. The main task of planning is to design the plot, type, and mode of the game, and analyze how much the complexity of the game is, how much is content, and the planning progress is more fast. The programming task is to use some programming language to complete the game design and cooperate with planning to achieve the desired purpose. The American work is mainly based on the game of the game. Scene and the image of the topic design game. Music production is based on the game's plot and background making game music and sound effects. Project management is mainly to control the process of game production, take full advantage of existing resources (personnel, funds, equipment, etc.) to achieve maximum benefits with as little funds as possible. The late test is also a very important part. For a few dozens of games that have been made for a few months or even a few years, tests often find a lot of problems, only improved procedures to ensure the safety issuance of the game. Since the article is mainly explaining the production of the game program, the reader will refer to other articles aspects, and I will tell the design of the game program. (1) Development tools and main techniques 1. There are many developing tools for the development tools, and there are different development tools on different game platforms. On your personal computer, you can use currently fluid software development tools, such as: C, C , VC , Delphi, C Builder, etc. Due to the popularity of the Windows operating system and its powerful multimedia features, more and more games support the Windows operating system. Since VC is Microsoft's product, use it to write a strong program interface and rich development resources support, plus VC rigorous memory management, a good distribution process on the stack, generating a small size, high stability The advantage, so VC has become the mainstream development tool for the current game. 2. DirectX Components Talk about the game development under the Windows system, we have to talk about Microsoft's DirectX SDK. A main advantage of the Windows system is the independence between applications and devices.
However, the application's device-independent is through the sacrifice of partial speed and efficiency, Windows adds an intermediate abstraction layer between hardware and software, through these intermediate layers, our applications, thereof can be over different hardware. However, we will not completely utilize hardware features to get the maximum operation and display speed. This is fatal when writing a Windows game, DirectX is designed to solve this problem. DirectX consists of a fast underlying library and does not add too much constraint to the game design. Microsoft's DirectX Software Development Kit (SDK) provides an excellent application programming interface (APIS), which can provide you to develop high quality and real-time applications. 6 components of DirectX are: DirectDraw: Use the page switching method to implement animation, which can not only access system memory, but also access to display memory. Direct3D: Provides a 3D hardware interface. DirectSound: Stereo and 3D sound effects, and manage the memory of the sound card. Directplay: Supports developing multi-person online games and can handle communication between networks in the game. DirectInput: Provides input support for a large number of devices. DirectSetup: Automatically install the DirectX driver. As the DirectX version is improved, the DirectMusic played by music is also added. 3. Alphablend technology now uses alphablend technology in order to achieve a transparent effect of light and images. The so-called alphablend technology is actually mixing the source pixels and target pixels in accordance with the value of "alpha" mixed vector, generally used to process translucent effects. The image in the computer can be represented by R (red), G (green), B (blue) three primary colors. Assuming an image is a, another transparent image is B, then taken through b, it looks at the image C is the mixed image of B and A, and the transparency of the B image is Alpha ( The value is 0-1, 0 is completely transparent, and 1 is completely opaque), Alpha mixed formula is as follows: R (c) = alpha * R (b) (1-alpha) * R (a) g (c) = Alpha * g (b) (1-alpha) * g (a) b (c) = alpha * b (b) (1-alpha) * b (a) r (x), g (x), b (x) Refers to the RGB component original color value of color X, respectively. From the above formula, Alpha is actually a value that determines the mixed transparency. Applying Alpha hybrid technology, many effects in the game, such as fire, smoke, shadow, dynamic source and other translucent effects. 4. A * Algorithm In many games, you should use the mouse to control the figures, and let the people walk from the current position to the target location should take the shortest path. This is to use the shortest path search algorithm, which is a * algorithm. A * Algorithm is actually a heuristic search, so-called heuristic search, the use of an estimated function to evaluate the value of each decision, which is determined which solution is tried first. If an valuation function can find the shortest path, we call it adopt. A * algorithm is an adopted best priority algorithm. The value of the A * algorithm can be represented as: f (n) = g (n) h (n) Here, f (n) is the estimating function of Node N, G (n) is the shortest path value of the starting point to the end point, H (n) is the inspiration value of the maximum path of the target. Since the A * algorithm is more complicated, it is limited to the space, in this brief introduction, specific theoretical friends can see a detailed situation in artificial intelligence.
Other technologies include particle system, audio and video calls, image file formats and information storage, etc., you can gradually learn more technologies on the basis of learning DirectX. (2) The specific production of the game 1. Map Editor's production RPG game often has a large number of scenes, and the scene can be grazed, lake, trees, houses, furniture, and the map needs a lot of scenes and the map is getting bigger and larger. In order to save space, Increasing the reusability of the image file, the screen of the RPG game uses a lot of repeated units (which can be called "Figure"), which is to use the map editor. Before we make the game engine, we have to finish the production of map editors. In the RPG game, the configuration of the scene is a record of the sequence of the drawing block. First, a scene format format is made, and in this file records the ranks of the tile required to constitute the scenario, because we have established an index for each tile, so you can only record these indexes. The composition of a scene is to be divided into several layers: ground, building and plant, furniture arrangement, and characters or objects in the scene (such as a fluttering banner), display them in a certain order to the screen. A rich scene has been formed. We can use arrays to represent the generated process of map scenes. Mapdata [x] [y]; // map data, x represents the map width, y indicates that the map height Picture [NUM]; // props picture, NUM represents the total number of props VOID MAKEBACKGROUND () // Generate Scene Function {INT N For (int i = 0; i