Game map and Starcraft MAP Technology

Source: Internet
Author: User
Matrix map:

The game contains a matrix structure that represents a map. Each matrix element represents a node. The movement of game roles is discrete. The moving end point must be a node, rather than the path between the two nodes, that is, if. The game role must be in the "moving" status when it is located in the path between two nodes ". If a game role is in the stopped State, it must be on a node. in simple words, it is a map like chess, and each time the pawns stop in the grid. There are many such games and familiar ones are: scenarios where heroes are invincible, and RPG games such as the legend of xianjing also use this method. Starcraft seems to be like this, however, the role of the game in the interstellar space is added to the concept of volume, that is, different troops occupy different grids. The smallest volume is the Zerg puppies, which occupy only one grid and each movement is also a grid.

This type of game collision detection generally sets the node to a specific value, and then checks the value of the node. For example:

Figure 1

The number in the upper-right corner indicates whether the grid is an obstacle. 1 indicates that the obstacle cannot pass, and 0 indicates that the obstacle can pass. Therefore, the red points in Figure 1 can only move downward (in four directions ).

Using this map structure, you can easily write pathtracing.AlgorithmBut it is not free enough, and the game role is always restricted in the grid.

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.