Scented design (below)

xiaoxiao2021-03-06  48

Complex wizard control

Special thanks to the eight-claw studio providing the wizard pattern for this article, and provides testing for the engine for my design.

In the English materials in the game design, the word Sprite is often seen, indicating the object of sports in the game. I temporarily use the literal translation of this word "Elf" to express problems ;-)

Here, I use a broader definition. In this engine, I use the multi-frame bitmap to express the same unit object. So the player manipulates the elves, NPC is the elves, and on the ground Burning fire piles and waves on the wall, long-distance attacks, such as arrows (if there is this design in the game) is the elves. In this wizard, we can subdivide it again:

Stationary Elf: Refers to the object of the game world. However, it is possible to block the relationship with other objects, and cannot be treated as a surface process. Sports Elf: Refers to its own motion law, or affected by external factors Sports object

With regard to the stationary elves, it is better to process, just need to redraw it according to the correct bitmap while each time you refresh it. As for the occlusion problem, the movement is handled together.

The elf needs to be carefully analyzed, temporarily I only write the obstruction of the elves and simple movement. More complex exceed the field of image engine, belonging to the battle engine. Of course, I like Diablo's battle form, such as fighting engine and map The image engine is not clearly divided.

The occlusion process of the elves and the above-mentioned objects are basically the same, and the problem is also a problem before and after judging the object. Different, the elves have been drawn after the object of the object, so the drawing scheme is slightly different. Between the same level Processing can be used for the above practice, first sort all the springs on the screen, then process each wizard from the back. For the specific elves, we can draw it in the location where you should, retrieve the tailor The rectangular screen coordinates are below it, and there is an object with the intersecting part. Set the elves to the cutting box when the drawing is drawing (all the points falling outside the cutting frame). Draw the possibility of drawing the previous one The object to which the elf, since the tailor frame is provided, the redrawed object does not destroy the other parts of the screen, and the specific steps can be explained in the figure.

→→→

The elf's movement is more complicated because it is also accompanied by a bitmap when the coordinates are moved. More work, such as the switch, walking path search ... Leave a combat engine part .

The elves may make different actions, and they need to have a vivid effect, walking, running, standing, and their own transitions require different animation performance. Not adding complex battle actions. My practice Yes, handle each type of action, design a function, and related data structures. The elves only have an action state at the same time, and the corresponding function pointer and structural pointer give the wizard in the game main loop, then loop processing on the screen, etc. All wizards. In the process of running to stop such transition action, you can modify the sport status value of the elves to automatically process.

With the most basic walking action as an example, in order to make the wizard can move in the whole direction, at least 8 sets of animation, when using, the direction is closest to which design is closest to which design is used to use a set of pictures. (Thank you again for the eight claw again The fish studio is designed for me to debug this engine, and it is necessary to have 5 frames to have 5 frames in my point of view. It is a pity that many rpgs have been drawn from 3 frames. :-(-( (while the eight-claw studio sent me a few groups of animations, the design is very sophisticated, no matter from the character, or from the action design ;-) (I like it very much, let a group to give you a group) It is said that This is what they will launch the enemy in the RPG "murder" in the Spring Festival next year. I believe that will be a first-class game of a beautiful business, and the domestic game will give the player some new feelings.

Let the scene more vivid

Reflecting the overall art / design level of the game, often inadvertently. It is a lot of ways to show the weather. Let the land are full of snow, which is better to drive the player, so, the picture is last Some special effects are modified, although it is not necessary, but it is more difficult to take out the environmental atmosphere. Finally, this can be said to be the most difficult and most needed in the entire graphics engine. This article has been three easy. The first release The work of the sky, obviously feeling that there is no heart, the writing of the engine code began to keep up with my thinking speed, so when there is no code to write, I introduced some ideas. Later, because I need to be responsible for my text, write The specific code, found a lot of questions, and wrote the second manuscript, and everyone now saw the third draft, unfortunately, just found, my current ability, currently being used, can't be in the engine With reasonable speed, realize the effect of raining or snow, so I deleted this part, staying in the future, I have added a new algorithm or machine upgrade. I will have a full-time completion of the engine. Part and complete this series of articles, to achieve the performance of my work in the past, the performance of our work is used in the first person, and the third person is almost no in the game. It is very good. It seems that there seems to have such RPG before, but the rectangular Tile seems to be more difficult to achieve in the game of the angle, in the case of no reference, the implementation method of the effects that I temporarily think of, About 3 types:

Full screen weather performance, such as rain and snow, bright performance, with color tone and brightness, day and night, dusk, or foggy sunshine, sunbarning

Among them, the first is most complicated, because we can't simply put the rain or snowflakes on the screen surface, which will have no sense of deepness. If the machine speed allows, we can make the object such as the snow, each piece into a 3D surface The film is given to their own sports trajectory, which is drawn in a 3D manner. Unfortunately, it is still not a man who uses fart rabbit plus five poisons. Even if you are, at least Yunfeng's chicken does not have that grade, and design this engine motivation It is a large extent to be self-entertaining ;-) Start my plan is to use some very means 2D simulation 3D effect, and find out that I am using the machine, plus the current level, can't be in this engine Realize this effect, (alone, it occupies almost all of my CPUs) unless the resolution of 320x240x256 is used, the display speed is indeed a big obstacle. After all of the previously described, each frame can be left The time to give the weather effect is only the ability to copy 1 screen after considering transparent color. After all, 640x480x16bit draws more than 7 more K data per frame. Unless a high-speed algorithm is found, it is not necessary to operate directly, Draw a snowflake or rainpoint on the screen, and there is a good perspective effect. Otherwise, I would rather give up this link ... (Fourth time to revise this document: Yunfeng has found a relatively fast way to achieve weather performance, the initial code of the engine I have taken it on time, in the last version, the next version is initially realized. Because of the time relationship, I have not completed this part of the article, sorry. Please look forward to the fourth draft of this article)

The second effect is the easiest implementation, because only the change in tones and brightness, in the middle of the 256 colors, reset the palette, now in the 16bit engine, fortunate :-) As mentioned earlier, In order to reduce the consumption of memory, all of our image information is also stored in palette mechanisms, so things to do are still correct adjustment palettes, of course, because they are 16bit colors, each bitmap can have Different palettes, the engine must operate all palettes.

With regard to the operation of the third sunshine, specifically, the use of alpha mixes to generate halo, or the beam to enhance the expression of the picture, this is from the many games in today's many games, like the sun in the red line, the West is mad In the poetry, it is really giving people to enjoy, I hope that there is this in my engine. The specific code will be published in the source code when the engine is all written.

There are many ways to decorate the game. If the speed is enough, you can realize a lot, new special effects are also left.