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 character layer and map layer will change 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:
- Character window (ViewPort)
- Load map block algorithm on demand
- Map Optimization Strategy:
- Map Block Load queue
- Rendering Strategy optimization
- 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.
Map of ARPG web game (i)