Tile based ENGINE design - Elf chain table

xiaoxiao2021-03-06  40

In general, the third person is typically handled separately in 2D games (at least I am such as this), especially on the game console, hardware is supported by the elves. Now our graphics card also supports keycolor in the memory, actual It is used to speed up the elf (also including the scene) wizard during exercise, often based on pixels (although some people like to simplify the design, the elf is still standing in the lattice while stopping) and the scenery is still in the lattice. If you can use more targeted methods, you can improve the speed of the game. This article comes from the design series of tone graphics engines written before the cloud wind early. And in recent practice (production of a business a.rpg). The game is improved. In fact, each frame of the game is not necessarily synthesized each time, especially in the case of a large number of Alpha contours, transparent, etc., the screen is not changed. The area is repeated is very wasted. So we can learn from the game console, the scene is a slightly more than the screen, and only the scene is replaced when the screen is removed, put the wizard, and regenerate each frame. On the scene. The synthetic wizard and the scene have three major problems. One is how to handle the obstruction of the elves, and the ISOMETRIC TILE ENGINE is handled by the article describes the views of the cloud style; the second is how to clear the elves of the previous frame: (Of course this step is also It can be omitted to synthesize the scene layer and the elich layer to the third buffer) If you do not want to build a screen rear buffer, reduce the amount of data movement when the synthetic layer, we can take the original place before drawing the wizard Scene image. Detailed explanation will be explained in detail later. The last major point is to draw the wizard in the right order. Here I want to use a linked list, all the wizards in the scenes, and call it as the wizard chain table. At the same time, we also need another chain list to save the scales on the screen. , Reduce the number of elves to handle the elf. The scenario is created when creating a scene. After a wizard disappears (death), it is deleted from the linked list after a wizard. The elves can be created in the game when the game is created. And the screen wizard chain is a draw screen. Time to generate, to ensure that the elves meet the order beforewards. So we only need to draw the wizard to the screen after generating a list :-) So the entire processing process is as follows: According to the current screen wizard list Clear all the wizards in the frame image Clear the current screen wizard chain to traverse the entire scenario wizard chain table, handle the action and status of each wizard, if the wizard is in the screen, insert it into the screen wizard chain table before and after. Will draw up Scene of the Elf Press the Screen Spirit Chain List Display Elf to the Screen Display A Frame Image Cycle These Steps First Step Clear the specific operation of the previous frame, we can assign a cache map for each wizard, save the scenario before drawing But this is more waste. Because the wizards not on the screen do not need this cache. So we can further optimize it to allocate a cacalog, remove the screen, remove the screen. However, memory allocation is actually a very time consuming time. The process. When the wizard size is similar, the further optimization scheme is to limit the number of elves that can appear on the screen. When initialization, a batch of large cache maps (I call it as a cache pool), each of them Both have accommodated the biggest elves. When a screen wizard requires a cache map, then find a cache for its use, after the wizard is removed from the screen, give up the control of the cache map. About step 3 Plug the screen of the screen into the screen wizard, involving how to determine the front-rear relationship of the elves. We can set the center of gravity of the wizard as a file in its reference point when mapping. Use this reference point The coordinates can be judged before and after the elves ;-) This paper summarizes the experience in the recent game of cloud wind, hoping to learn from the later people. Essay is rushing, the mistake is inevitable. The method is also my personal point of view The charm of game design is that it can not follow the common examples when designing, arbitrarily playing, here, welcome everyone to discuss, point out mistakes and insufficient

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

New Post(0)