45-degree map editor and game development experience

Source: Internet
Author: User

 

This editor is a fully functional 45-degree map editor specially developed for the company's projects, because the company's products are about to be released and the editor has applied for a patent. Although an experience version will be provided at the end of this post, you need an invitation code to use it. Sorry, the invitation code will be issued in a small amount, and it will be available soon. Sorry. The previous sections will introduce some features of this editor, and I will summarize some experiences of the 45-degree view editor later. I hope it will be useful to you.

Version: V2.0
Author: Wxsr)
Email: Wxsr2008@126.com

Features:

  1. Shared resource library,
  2. Layered Structure of terrain, components, and maps
  3. All files can be added, deleted, saved, and edited;
  4. Automatic deep sorting;
  5. Map live test;
  6. Component Rotation
  7. Scene Rotation
  8. The element can be added to the scenario after the rotation angle.
  9. You can add or delete regions during map editing.
  10. Clear strokes, grid display, item column display;
  11. Import background
  12. Small map Preview

Features

Layered Processing
Divide the map elements into three modules: terrain, component, and map.

The modules are independently edited, saved, and re-edited. After completion, the map module inherits
Terrain: The area module of the map. The main feature is to specify the editing range of the map in advance.
This method is applicable to creating and editing map areas based on background resources in advance.


Click to zoom in

Component: An item module used as a map. Based on the characteristics in the scenario, the blocks, pendants, and surfaces can be subdivided into blocks. Three forms.
Each type of component file has its own attributes. For example, in the coordinates of 45 degrees (height, width, length) and interaction, whether it is a wall, etc.

  • Obstacle type element: After editing, you cannot walk or place items in the occupied area.
  • Pendant type components: the components can still be prevented in the occupied area, and the depth of redundant components is higher than the obstacle components.
  • Terrain element: as a component of the ground surface, its depth is under the obstacle and the pendant element, generally as the background form is wrong.

Resource library management: Click the menu --> Settings Panel (or click the seting button) to add and delete the SWF resource library, after the resource library is read, all components with the Link name are automatically displayed under the tags list. The resource library of this editor is public. That is to say, you can use this component on any map after editing a component. However, it should be noted that when the resource library is updated, the previously edited component images will also be updated, but the data will remain unchanged in the map, in this way, the data of a component is updated at the back end, which may lead to incorrect map editing and data. These features are only reflected in the map file, because the four-level file directly copies all the data and writes it into the file, and the component, this problem does not occur because the resource library can be updated. You only need to re-modify the original component file after the resource library is updated. Note that the file names of each resource library must be unique. If it is developed by a team, you can place the shared resource library to the network neighbor, and then select all the resources to achieve resource synchronization. You can also use SVN or other methods to synchronize the resource library.


Click to zoom in

In terms of terrain rendering, this editor uses a custom rendering mode. You only need to draw the terrain area as needed. The advantage of this is to minimize the data size and save it as an optional file for users to choose when creating a map.

All components and scenarios have the rotation editing function.
When editing a widget, double-click it from the tags Lists List or drag the selected clip.
Set its attributes in the attribute column below as needed. Note: after creating a component, we need to first set the region, which is a three-dimensional contact area in which the item is in contact with the ground at 45 degrees. It is wrong not to draw a picture as much as it is. Then, press the Space key to adjust the coordinate offset values for all the four angles. Press the Space key and the system will automatically rotate the original area to a angle. Then we need to set their three-dimensional height for each component. Note that you must save the file from the first perspective. Otherwise, an error will occur later.

After editing a batch of terrain and components in advance, we can create a map module.


Click to zoom in

In the create map module dialog box, we can see that. If you do not select the previously edited terrain, the system automatically creates a diamond area by default. Of course, you can select the previously edited terrain or modify the rows in a 45-degree view, column. Do not worry that you cannot edit it after it is generated. In map mode, you can click the lock check option in the toolbar to edit it by creating clear options. However, note that you must remember to switch the lock back after editing, to avoid unnecessary problems.

After creating a map, we can drag a component from the items list into the scenario. (Note that the double-click operation is to edit the component and switch to the editing status of the component. If the map file is not saved, the map file cannot be restored) when a component is selected, the angle of view of the component can be reversed in the preview box above. Then drag it into the scenario. What you get is what you see. You can easily create the desired effect. Of course, you can also simply press the 'A' key to rotate the scene's perspective without rotating the element's perspective.

You can select multiple buttons in the edit toolbar to make it easy to work. If you have already felt that the efficiency is slow, you can remove the Grid Bar and directly import the background image if you have used Beijing to plot the terrain and insert map data ,, when editing a component, you can select the colorground check box or the playground check box. In this way, you will not be able to see the obstacles and pendant items in the scenario. You can check the background button to check the background items.

All modules can use the shortcut key 's' or menu bar -- file -- save command to keep the file easy and then re-edit the file.

The test commands are also provided in the menu bar. You can click the commands to select an edited map file for moving, viewing, and other effects.

The test instruction already contains the exclusive A × algorithm of the system. And the effect of deep sorting, so the effect you view will be applied to the actual effect of the scenario.

You can create different types of files that are currently opened by clicking the plus sign button under the resource library. You can delete the selected file by reducing the number. You can also open the seting button to add, delete, and copy the data storage address. You can preview the data files directly.


Click to zoom in

Users can copy files and rename files in Windows. The data copied after opening the editor again, or the renamed or deleted data will automatically update the list. To achieve data backup, synchronization and other functions.


Click to zoom in

 


Click to zoom in

 


Click to zoom in

Let's talk about some of the 45-degree editor's experiences below:

1. Why should I develop an editor?

Many developers do not first consider why I want to develop a map editor. It is often because everyone has it. Many games have their own exclusive editors, like those of Warcraft, including map editor, event Editor, battle editor, and AI editor, environment editor and many other editors can be said that a good editor is an essential component of a successful game. We develop an editor to facilitate future development, rather than just for others. When you clarify your game needs, you need to build your editing tools in a targeted manner.
The editor function depends on the needs of the game we want to develop. In addition, we should note that we should organize algorithms and related logic into layers when writing such a tool. Because the editor is an editor after all, we have to re-implement the original logic in the actual game scenario, therefore, the separation of the editor structure and code significantly affects your future development.

2. Some major algorithms used.

Let's talk about the deep hidden algorithms that are difficult to write from a 45-degree perspective. I believe that many developers have a headache and do not know how to start ,. There are many similar deep algorithms on the Internet, but many of the results are not satisfactory, especially when the Y axis is used for determination. In fact, this algorithm is inaccurate because he ignores the issue of unequal length of some items, of course, if the scene and item in your game are all large game games, this algorithm is enough for you to use, but in fact, the 45-degree game or community is usually composed of many non-large items. In some cases, this6 adopts the method of manually sorting the depth of items in FLA in advance, and then achieves the effect of depth by exchanging depth in the scenario, this method is not bad because some dynamic scenarios do not have an accurate depth pre-edited, so the smaller the depth will be poor, we can also see the effect from the Custom User scenarios in the early stages of this6, which is also an inevitable choice for them to narrow down the scenes and avoid poor experience caused by inaccurate sorting. There is also a case like Moore, which is also a typical case in the early stage of Moore sorting only by Y axis. The effect is quite poor, but it is optimized later.

To be accurate, you cannot go either way. We need to unify the size of all items and then sort them by Y axis, or write a set of widely used deep algorithms.

The method I recommended here is also used by many large 2.5D games. 2. The second point is that it can accurately divide the depth and depth of an item in a space. We only need to use an item as the reference object to divide the first and second spaces and then recursive the method just now, below is I previously written the implicit algorithm is based on the method of 2 Write a set of 45 degree angle of view of the implicit algorithm, http://wxsr.blogbus.com/logs/32001884.html
We are talking about the astar algorithm, which is not necessarily used as a game astar algorithm, it is wise to develop our game based on the actual needs of the game. In many cases, we can choose to place the pathfinding part on a small map instead of a map, this is conducive to the efficiency and execution of the entire game. We can use two straight lines to move to a non-accessible place and stop moving to replace astar. This is also a good result. And high efficiency. The saved consumption can be applied to other places. Let's talk about how astar and as3 improve efficiency, now, as long as the astar algorithm is not very redundant, it can basically be around 60-90 milliseconds. The astar algorithm is nothing more than calculating the optimal value to find a tree structure that can connect to the destination, and then using the Regressing method, obtain an optimal path. There are many optimization methods I have mentioned before. We can also use 4-tree or 2-tree methods to optimize efficiency, whether it is 4-tree or 2-tree, the goal is to narrow down the scope of the path. Of course, we need to make achievements in advance. Note that we can also use the quad-tree in the scenario depth algorithm, 2. Check the tree. Here is my improved astar algorithm:
Bytes.

Finally, let's talk about resource management and event management. This is mainly because of flash memory management problems, too scattered management methods will undoubtedly cause a great deal of trouble for us to manage the number of memories. Unified memory management will help us solve a lot of troubles caused by resource loading, some people may think this is troublesome and unnecessary, but what I want to say is, in flash, memory cannot be recycled due to problems that we can easily ignore. The most significant one is the time reference of objects. Many people complain about the weak reference of AS. In fact, as long as you read the help document, you cannot see that the weak reference is actually okay. Because your object has not been deregistered, the event must still be in the reference state. The loaded resources should be all one-time, so they are basically easy to delete. However, some instances of the class cannot be recycled because of many references, which is exactly what I mean by unified management of event registration, in this way, we can better delete all previously registered events. Generally, we recommend that you cancel all the original listeners in a specific scenario to ensure that the events are not referenced and the memory can be recycled smoothly.

In addition, resources and source code are encrypted.
The general practice is to confuse the edited SWF Binary source code and then restore it in the scenario.
Here is my solution:
Http://wxsr.blogbus.com/logs/32850824.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.