Map of ARPG web game (i)

Source: Internet
Author: User

"turn" http://www.cnblogs.com/BlueWoods/p/4681572.html?from=timeline&isappinstalled=1

A more important difficulty in developing ARPG Web games is the game push Graph. The game of the main city map is larger, I met the biggest is the 8000*6000 map, smaller than the copy map, there may not be a Screen. Larger maps, like this one, are generally loaded in chunks, and it is not possible to add the entire map to the stage at once, depending on the character's mobile WINDOW. This time will encounter three kinds of situations: human movement, map movement, people do not move, map movement, human movement, The map does not Move. I tried the first two weeks, people move, map movement, This situation screen looks more fluent, people do not move, map movement, not too smooth. So chose the Former.

What is human motion and what is a map motion? The development of web games are layered, generally divided into: map layer, map effects layer, character layer, special effects layer, UI layer, Information Tips Layer. Human motion means the change of the xy coordinate of the character layer, and the map movement is the xy coordinate change of the map layer. The map layer changes depending on the movement of the Character's window.

The characters move around the map, all in accordance with the lattice Calculation. In the early days of the tour, the lattice was diamond-like, and then it seemed to be in the right Direction. The only difference: the speed of movement varies in different directions. As I now use a square, each lattice size is 25*25. That means there will be 8000*6000/25*25 in the 8000*6000 map. The server compute location is the xy coordinate of the lattice. So the coordinates of the people shown on the small map are grid coordinates, not pixel Coordinates. There is also a concept is the map block, map block How big there are, not the bigger the better, nor the smaller the Better. The map block I used is 200*200, so calculate the extent of the map you want to display, based on the grid coordinates and the map block Size.

The game push graph, also involves the following several questions:

    1. Character Window (ViewPort)
    2. Load map block algorithm on demand
    3. Map Optimization strategy:
      1. Map Block Load queue
      2. Rendering Strategy optimization
      3. Show mosaic boost player experience before loading

finally, explain why the map block is not as small as possible, and it is not as big as it gets better. As the Addchild and removechild in as can trigger the return event of as, affecting Efficiency. The smaller the map block, the more times the add and remove will be, and the larger the map, the larger the area will be, and the efficiency will be affected. So the medium is best, and there is no definite rule. I am referring to the size of the map of the proud Sword.

Reprint please indicate the source

Map of ARPG web game (i)

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.