CN111760290A - Information processing method and device, computer equipment and storage medium - Google Patents

Information processing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN111760290A
CN111760290A CN202010531076.2A CN202010531076A CN111760290A CN 111760290 A CN111760290 A CN 111760290A CN 202010531076 A CN202010531076 A CN 202010531076A CN 111760290 A CN111760290 A CN 111760290A
Authority
CN
China
Prior art keywords
area
points
preset map
map area
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010531076.2A
Other languages
Chinese (zh)
Other versions
CN111760290B (en
Inventor
蔡康
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202010531076.2A priority Critical patent/CN111760290B/en
Publication of CN111760290A publication Critical patent/CN111760290A/en
Application granted granted Critical
Publication of CN111760290B publication Critical patent/CN111760290B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • A63F13/56Computing the motion of game characters with respect to other game characters, game objects or elements of the game scene, e.g. for simulating the behaviour of a group of virtual soldiers or for path finding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Human Computer Interaction (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses an information processing method, an information processing device, computer equipment and a storage medium, which can acquire a sampling point set corresponding to a preset map area in a virtual map; extracting shape feature information from a preset map area; determining the number of characterization points required by a preset map area based on the shape feature information; clustering the area sampling points to obtain a sampling point cluster based on the number of the characterization points and distribution information of the area sampling points in the preset map area; the representation points of the preset map area are determined from the sampling point cluster, therefore, the representation points are selected based on the shape characteristics of the preset map area, the selection accuracy of the representation points in the preset map areas with different shapes is improved, when a calculation task related to the preset map area needs to be executed, the representation points of the preset map area can replace the preset map area to participate in calculation, the overlarge calculated amount can be avoided, and the high accuracy of the representation points can also improve the accuracy of the calculation result of the calculation task.

Description

Information processing method and device, computer equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to an information processing method, an information processing apparatus, a computer device, and a storage medium.
Background
In the development of the virtual map, a developer often designs some specific preset map areas in the virtual map, such as a block wall, a beach or a water area. When a virtual object needs to interact with some preset map areas in the virtual map, related calculations involving these preset map areas often occur.
Most of the special preset map areas are irregular, and if geometric operation is carried out on the irregular preset map areas in real time in the game process of the virtual object, the performance is consumed. In order to optimize performance, a small number of characteristic points are used to represent special areas of the irregular shapes in the related art, and geometric operations related to the irregular shapes are converted into operations related to the small number of characteristic points, so that the computational complexity is reduced. However, in the related art, these characterization points are generally selected randomly or manually by a developer, and the number and positions of the characterization points do not have a uniform selection standard, so that the characterization points cannot be selected quickly and accurately for special areas of various shapes, and the accuracy of path calculation related to a preset map area is ensured.
Disclosure of Invention
Embodiments of the present invention provide an information processing method, an information processing apparatus, a computer device, and a storage medium, which can quickly and accurately determine a characterization point of each preset map area for preset map areas of various shapes, and improve the accuracy of the characterization point.
The embodiment of the invention provides an information processing method, which comprises the following steps:
acquiring a sampling point set corresponding to a preset map area in a virtual map, wherein the sampling point set comprises area sampling points of the preset map area;
carrying out shape feature extraction on a preset map area to obtain shape feature information of the preset map area;
determining the number of characterization points required by a preset map area based on shape feature information of the preset map area;
clustering the area sampling points of the preset map area based on the number of the characterization points and distribution information of the area sampling points in the preset map area to obtain a sampling point cluster;
and determining the representation points of the preset map area in the virtual map from the sampling point cluster.
In an optional embodiment, obtaining a set of sampling points corresponding to a preset map area in a virtual map includes:
discretizing and sampling the virtual map to obtain a map sampling point of the virtual map;
determining map sampling points meeting the preset sampling point judgment condition as area sampling points belonging to a preset map area, and determining the rest map sampling points as non-area sampling points;
determining a connected region formed by the region sampling points in the virtual map based on the distribution information of the region sampling points and the non-region sampling points in the virtual map;
and determining the connected region as a preset map region in the virtual map, and acquiring a sampling point set corresponding to the preset map region.
In an optional embodiment, determining a connected region formed by the region sampling points in the virtual map based on distribution information of the region sampling points and the non-region sampling points in the virtual map includes:
determining profile points in the area sampling points and a connected area which comprises the profile points and is formed by the area sampling points based on distribution information of the area sampling points and non-area sampling points in the map sampling points adjacent to the area sampling points.
In an optional embodiment, the shape feature information includes contour feature information, and performing shape feature extraction on the preset map area to obtain shape feature information of the preset map area, including:
extracting contour features of a preset map area based on contour points of the preset map area to obtain contour feature information of the preset map area;
determining the number of characterization points required by the preset map area based on the shape feature information of the preset map area, wherein the method comprises the following steps:
and determining the number of characterization points required by the preset map area based on the contour feature information of the preset map area.
In an optional embodiment, the contour feature information includes a number of contour points, and contour feature extraction is performed on the preset map area based on the contour points of the preset map area to obtain the contour feature information of the preset map area, including:
determining the number of contour points of a preset map area based on the contour points of the preset map area;
determining the number of characterization points required by the preset map area based on the contour feature information of the preset map area, wherein the method comprises the following steps:
acquiring a contour point number weight coefficient corresponding to a preset map area;
and carrying out weighted summation on the number weight coefficient and the number of the contour points of the preset map area to obtain the number of the characterization points of the preset map area.
In an optional embodiment, obtaining a weight coefficient of the number of contour points corresponding to the preset map area includes:
determining a contour line of a preset map area in the virtual map based on the contour points of the preset map area;
obtaining curvature change information of the contour line and a preset corresponding relation between the curvature change information and a contour point number weight coefficient;
and determining the number weight coefficient of the contour points in the preset map area based on the curvature change information of the contour lines and the preset corresponding relation.
In an optional embodiment, clustering the area sampling points in the preset map area based on the number of the characterization points and distribution information of the area sampling points in the preset map area to obtain a sampling point cluster, including:
selecting the area sampling points representing the number of points from the area sampling points of a preset map area as cluster center points;
determining the distance between the area sampling point and the central point of each cluster based on the distribution information of the area sampling point in the preset map area;
dividing the region sampling points into sampling point cluster clusters where cluster center points closest to the region sampling points are located;
when the clustering finishing condition is met, finishing clustering the preset map area, otherwise determining a new cluster center point in each sampling point clustering cluster, and returning to execute the step of determining the distance between the area sampling point and each cluster center point based on the distribution information of the area sampling point in the preset map area;
determining a representation point of a preset map area in the virtual map from the sampling point cluster, wherein the representation point comprises the following steps:
and determining a new cluster center point in the cluster of the sampling points of the preset map area as a representation point of the preset map area.
In an optional embodiment, the shape feature information includes profile feature information, and selecting, from the area sampling points of the preset map area, an area sampling point representing the number of points as a cluster center point includes:
determining a contour line of the preset map area in the virtual map based on the contour feature information of the preset map area;
and based on the contour line, selecting the area sampling points of the representation points in the preset map area as cluster center points.
In an optional embodiment, the information processing method further includes:
and executing a path calculation task of the virtual object based on the representation points of the preset map area in the virtual map, and displaying path information in the virtual map based on a task execution result.
In an optional embodiment, the method includes executing a path calculation task of a virtual object based on a characterization point of a preset map area in a virtual map, and displaying path information in the virtual map based on a task execution result, including:
when the path calculation task of the virtual object is detected, determining a target preset map area participating in the path calculation task from a preset map area of the virtual map;
executing a path calculation task based on the representation points of the target preset map area and the position information of the virtual object in the virtual map to obtain a task execution result;
and displaying the path information in the virtual map based on the task execution result.
An embodiment of the present invention further provides an information processing apparatus, including:
the sampling point determining unit is used for acquiring a sampling point set corresponding to a preset map area in the virtual map, and the sampling point set comprises area sampling points of the preset map area;
the characteristic extraction unit is used for extracting the shape characteristic of the preset map area to obtain the shape characteristic information of the preset map area;
the quantity determining unit is used for determining the quantity of the characterization points required by the preset map area based on the shape feature information of the preset map area;
the clustering unit is used for clustering the area sampling points in the preset map area based on the number of the characterization points and the distribution information of the area sampling points in the preset map area to obtain a sampling point cluster;
and the characterization point determining unit is used for determining the characterization points of the preset map area in the virtual map from the sampling point cluster.
In an alternative embodiment, the sampling point determining unit includes:
the discrete sub-unit is used for carrying out discretization sampling on the virtual map to obtain a map sampling point of the virtual map;
the determining subunit is used for determining the map sampling points meeting the preset sampling point judgment condition as area sampling points belonging to a preset map area, and determining the rest map sampling points as non-area sampling points;
the connected region searching subunit is used for determining a connected region formed by the region sampling points in the virtual map based on the distribution information of the region sampling points and the non-region sampling points in the virtual map;
and the set acquisition subunit is used for determining the connected region as a preset map region in the virtual map and acquiring a sampling point set corresponding to the preset map region.
In an optional embodiment, the connected region searching subunit is configured to determine, based on distribution information of area sampling points and non-area sampling points in map sampling points adjacent to each area sampling point, a contour point in the area sampling points, and a connected region that includes the contour point and is formed by the area sampling points.
In an optional embodiment, the shape feature information includes contour feature information, and the feature extraction unit is configured to perform contour feature extraction on a preset map area based on contour points of the preset map area to obtain contour feature information of the preset map area;
and the quantity determining unit is used for determining the quantity of the characterization points required by the preset map area based on the outline characteristic information of the preset map area.
In an optional embodiment, the contour feature information includes a number of contour points, and the feature extraction unit is configured to determine the number of contour points of the preset map area based on the contour points of the preset map area;
a quantity determination unit comprising:
the coefficient acquisition subunit is used for acquiring the number weight coefficient of the contour points corresponding to the preset map area;
and the number determining subunit is used for performing weighted summation on the contour point number weight coefficient and the contour point number of the preset map area to obtain the number of the characterization points of the preset map area.
In an optional embodiment, the coefficient obtaining subunit is configured to determine, based on contour points of a preset map area, a contour line of the preset map area in the virtual map; obtaining curvature change information of the contour line and a preset corresponding relation between the curvature change information and a contour point number weight coefficient; and determining the number weight coefficient of the contour points in the preset map area based on the curvature change information of the contour lines and the preset corresponding relation.
In an optional embodiment, the clustering unit includes:
the central point determining subunit is used for selecting the area sampling points with the quantity of the characterization points from the area sampling points of the preset map area as cluster central points;
the distance determining subunit is used for determining the distance between the area sampling point and the central point of each cluster based on the distribution information of the area sampling points in the preset map area;
the clustering subunit is used for dividing the region sampling points into sampling point clustering clusters where cluster center points closest to the region sampling points are located;
the iteration control subunit is used for finishing clustering on the preset map area when a clustering finishing condition is met, otherwise determining a new cluster center point in each sampling point clustering cluster, and triggering the distance determination subunit to execute the step of determining the distance between the area sampling point and each cluster center point based on the distribution information of the area sampling point in the preset map area;
and the characterization point determining unit is used for determining the cluster center point of the sampling point cluster of the preset map area as the characterization point of the preset map area.
In an optional embodiment, the shape feature information includes contour feature information, and the central point determining subunit is configured to determine, based on the contour feature information of the preset map area, a contour line of the preset map area in the virtual map; and based on the contour line, selecting the area sampling points of the representation points in the preset map area as cluster center points.
In an optional embodiment, the information processing apparatus further includes:
a task execution unit for executing a path calculation task of the virtual object based on the representation points of the preset map area in the virtual map, and displaying path information in the virtual map based on the task execution result
In an alternative embodiment, the task execution unit includes:
the area determining subunit is used for determining a target preset map area participating in the path calculation task from the preset map area of the virtual map when the path calculation task of the virtual object is detected;
the task execution subunit is used for executing the path calculation task based on the representation points of the target preset map area and the position information of the virtual object in the virtual map to obtain a task execution result;
and the display subunit is used for displaying the path information in the virtual map based on the task execution result.
Embodiments of the present invention further provide a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method when executing the computer program.
Embodiments of the present invention further provide a storage medium having a computer program stored thereon, where the computer program is executed by a processor to implement the steps of the method.
The embodiment of the invention provides an information processing method, an information processing device, computer equipment and a storage medium, wherein a sampling point set corresponding to a preset map area in a virtual map can be obtained by the method of the embodiment, and the sampling point set comprises area sampling points of the preset map area; carrying out shape feature extraction on a preset map area to obtain shape feature information of the preset map area; determining the number of characterization points required by a preset map area based on shape feature information of the preset map area; therefore, the quantity of the characterization points is selected based on the shape characteristics of the preset map area, the quantity of the characterization points can be reasonably set for the preset map areas with various shapes, and then the area sampling points of the preset map area are clustered based on the quantity of the characterization points and the distribution information of the area sampling points in the preset map area to obtain a sampling point cluster; determining a representation point of a preset map area in the virtual map from the sampling point cluster; therefore, the selection of the characterization points is realized based on the shape features of the preset map area, the selection accuracy of the characterization points in the preset map areas with different shapes is improved, when a calculation task related to the preset map area needs to be executed, the characterization points of the preset map area can replace the preset map area to participate in calculation, the too large calculation amount of the calculation task can be avoided, the consumption of calculation resources is reduced, the high accuracy of the characterization points can also improve the accuracy of a calculation result, and the user experience of a user in the virtual map is favorably improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic view of a scene of an information processing method according to an embodiment of the present invention;
FIG. 2a is a flow chart of an information processing method according to an embodiment of the present invention;
FIG. 2b is a schematic diagram of a discretized virtual map provided by embodiments of the present invention;
FIG. 3a is a schematic diagram of performing a connected component search on a virtual map according to an embodiment of the present invention;
FIG. 3b is a flowchart illustrating a method for searching a connected region of a virtual map according to an embodiment of the present invention;
FIG. 3c is a schematic diagram of contour points of a predetermined map area according to an embodiment of the present invention;
FIG. 4a is a schematic flow chart illustrating a method for clustering area sampling points according to an embodiment of the present invention;
FIG. 4b is a schematic diagram of a representation point of a preset map area according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of an information processing apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides an information processing method, an information processing device, computer equipment and a storage medium. Specifically, the present embodiment provides an information processing method applicable to an information processing apparatus that can be integrated in a computer device.
The computer device may be a terminal or other device, such as a mobile phone, a tablet computer, a notebook computer, a desktop computer, or other device.
The computer device may also be a device such as a server, and the server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, middleware service, a domain name service, a security service, a CDN, and a big data and artificial intelligence platform, but is not limited thereto.
In this embodiment, the computer device may be configured to: acquiring a sampling point set corresponding to a preset map area in a virtual map, wherein the sampling point set comprises area sampling points of the preset map area; carrying out shape feature extraction on the preset map area to obtain shape feature information of the preset map area; determining the number of characterization points required by the preset map area based on the shape feature information of the preset map area; clustering the area sampling points of the preset map area based on the number of the characterization points and the distribution information of the area sampling points in the preset map area to obtain a sampling point cluster; and determining the representation points of the preset map area in the virtual map from the sampling point cluster.
The virtual map of the present embodiment may be a map in a virtual scene, and the virtual scene of the present embodiment includes, but is not limited to, a game scene.
The process of acquiring the representation points of the preset area by the computer device can be in the development process of the virtual map; or realized in the development process of the game to which the virtual map belongs; or the process may be performed after the game deployment to which the virtual map belongs, for example, after the game deployment, if the virtual map is updated, the representation points of the preset map area may be calculated for the updated virtual map by using the scheme of the embodiment. The computer device may be a terminal device of a developer, a game server, or the like, which is not limited in this embodiment.
In this embodiment, after the game to which the virtual map belongs is developed, the game may be deployed on a corresponding game server (such as the game server 20 in fig. 1), and a user may interact with the game server 20 through the terminal 10. The terminal 10 may be integrated with a game client, and the user may interact with the game server through the game client on the terminal, or the user may log in a web page provided by the game server through the terminal 10 and interact with the game server through the web page.
The terminal 10 and the server 20 are connected via a network, such as a wired or wireless network connection.
In one example, after the game is deployed on the game server, the information about the token points in the preset map area may be stored in the game server, or may be sent to the terminal by the server, and stored locally by the terminal and used when needed, or may be transmitted to the terminal by the server together with the information about the token points calculated in the virtual map each time the map data of the virtual map is transmitted to the terminal.
In an example in which the representation points are stored in the terminal in advance, the terminal 10 may be configured to display an operation page of a virtual scene, where the operation page includes a virtual map, execute a path calculation task of a virtual object based on the representation points in a preset map area in the virtual map, and display path information in the virtual map based on a task execution result.
In an example in which the representation points are not stored in the terminal in advance, the terminal 10 may be configured to display an operation page of a virtual scene, the operation page includes a virtual map, when a path calculation task of a virtual object is detected, a task calculation request is sent to the game server 20, the task calculation request carries task information of the path calculation task, the game server 20 may be configured to receive the task calculation request, determine the path calculation task of the virtual object according to the task information in the task calculation request, execute the path calculation task based on the representation points in a preset map area in the virtual map, and send a task execution result to the terminal 10, and the terminal 10 may be configured to display the path information in the virtual map based on the task execution result.
The following are detailed below. It should be noted that the following description of the embodiments is not intended to limit the preferred order of the embodiments.
Embodiments of the present invention will be described from the perspective of an information processing apparatus, which may be particularly integrated in a computer device.
An embodiment of the present invention provides an information processing method, and as shown in fig. 2a, a flow of the information processing method of the embodiment may be as follows:
201. acquiring a sampling point set corresponding to a preset map area in a virtual map, wherein the sampling point set comprises area sampling points of the preset map area;
the information processing method of this embodiment may accurately obtain the representation points of the preset map area in the virtual map, and the steps of this embodiment may be implemented when the game is not running, or implemented in the development stage of the virtual map, which is not limited in this embodiment.
In this embodiment, the virtual map may be a map used by a virtual object in a virtual scene, the virtual object may be an object operated by a user through a terminal in the virtual scene, and an action of the virtual object in the virtual scene may be controlled by the user through the terminal.
In this embodiment, the virtual scene may be a game scene, and the virtual map may be a game map in the game scene. In this embodiment, the game corresponding to the virtual map includes, but is not limited to, a MOBA (multiplayer online battle arena games).
The preset map area may be an obstacle area set in the virtual map, and the type of the obstacle includes, but is not limited to, a city pool, an ocean, a house, a tree, a city wall, and the like.
In an optional example, in order to obtain the set of sampling points, the virtual map may be discretized, and a preset map area in the virtual map and a corresponding set of sampling points are determined based on the area sampling points obtained after discretization.
The step of obtaining a set of sampling points corresponding to a preset map area in the virtual map, where the set of sampling points includes area sampling points of the preset map area, may include:
discretizing and sampling the virtual map to obtain a map sampling point of the virtual map;
determining map sampling points meeting the preset sampling point judgment condition as area sampling points belonging to a preset map area, and determining the rest map sampling points as non-area sampling points;
determining a connected region formed by the region sampling points in the virtual map based on the distribution information of the region sampling points and the non-region sampling points in the virtual map;
and determining the connected region as a preset map region in the virtual map, and acquiring a sampling point set corresponding to the preset map region.
When the virtual map is subjected to discretization sampling, sampling parameters such as the number of map sampling points or the size of the map sampling points can be reasonably selected according to the length and the width of the virtual map. The shape of the map sampling point can be set according to the requirement, for example, it is set as rectangle, hexagon, etc., this embodiment has no limitation,
for example, the length and width of the virtual map are determined, and are respectively represented by W and H, size information of map sampling points is obtained, where the size information includes shape and side length, and if the map sampling points are squares with side length U, the total number of map sampling points of the entire map is determined to be round (W/U) × round (H/U), where round is a function of rounding nearby.
Judging whether each map sampling point belongs to a designated area, and if so, setting the sampling point value to be 1; if not, the sampling point value is set to 0.
In an alternative example, the preset sampling point determination condition may be set based on the height of the map sampling point. In one example, the preset sampling point determination condition may include: and the map sampling points with the heights not belonging to the preset height range are area sampling points belonging to a preset map area.
The preset height range may be a numerical range or a value, for example, the preset height range is 0, and a map sampling point with a height not belonging to 0 is determined as a sampling point belonging to the preset map area. It is understood that the height of some preset map areas, such as oceans, traps, etc., may be negative, and map sampling points having heights greater than 0 and less than 0 may be determined as area sampling points when determining the preset map areas. A map sampling point having a height of 0 may be determined as a sampling point belonging to a normal walkable area, i.e., the above-described non-area sampling point.
In one example, to distinguish between an area sampling point and a non-area sampling point in the virtual map, the two sampling points may be marked differently, for example, the area sampling point and the non-area sampling point are marked with different colors, or the area sampling point and the non-area sampling point take different values, for example, the area sampling point value is set to 1, and the non-area sampling point value is set to 0. For example, referring to fig. 2b, fig. 2b is a virtual map obtained by discretizing the virtual map and marking an area sampling point and a non-area sampling point. The black points are area sampling points, and the white points are non-area sampling points.
If the virtual map itself is a map represented in a discretization form, in step 201, the preset map area may be determined directly according to information of the map sampling point in the discretization virtual map.
For example, if the virtual map is a discretized map, the step "obtaining a set of sampling points corresponding to a preset map area in the virtual map, where the set of sampling points includes area sampling points of the preset map area", may include:
determining map sampling points meeting the preset sampling point judgment condition as area sampling points belonging to a preset map area, and determining the rest map sampling points as non-area sampling points;
determining a connected region formed by the region sampling points in the virtual map based on the distribution information of the region sampling points and the non-region sampling points in the virtual map;
and determining the connected region as a preset map region in the virtual map, and acquiring a sampling point set corresponding to the preset map region.
The connected region may be a single connected region or a multiple connected region, which is not limited in this embodiment.
The distribution information of the area sampling points and the non-area sampling points in the virtual map can include the position information of the area sampling points and the non-area sampling points in the virtual map.
In the two examples, the determination manner of the connected region may be implemented by any feasible connected region search method, for example, the connected region search method may be implemented based on a depth-first search method or a breadth-first search method.
In one example, the step of "determining a connected region composed of the area sampling points in the virtual map based on distribution information of the area sampling points and non-area sampling points in the virtual map" may include:
determining profile points in the area sampling points and a connected area which comprises the profile points and is formed by the area sampling points based on distribution information of the area sampling points and non-area sampling points in the map sampling points adjacent to the area sampling points.
The contour point in the present embodiment may be understood as an area sampling point located on the contour of a map area, and of map sampling points adjacent to the contour point, at least one non-area sampling point exists. For example, referring to fig. 2b, the sampling point represented by the icon 21 is a contour point because there are two area sampling points (black points) and two non-area sampling points (white points) in the four adjacent map sampling points, upper, lower, left and right.
In one example, the contour points and connected regions may be determined based on a depth-first search.
The following describes an example of determining contour points and connected regions based on depth-first search with reference to fig. 3a and 3 b. Before searching, the virtual map can be converted into a two-dimensional matrix by setting the regional sampling point value to be 1 and the non-regional point value to be 0 in the discretized map, and then searching is performed based on the two-dimensional matrix. Referring to fig. 3b, the detailed search step of the connected component includes:
step 301, traversing the lattice of the discretized virtual map M, naming the point as A when each map sampling point x is traversed, and judging in step 302;
wherein, the area sampling point which does not belong to the determined connected region can be selected as the point A at the beginning of each round of traversal.
Step 302, judging whether traversal is completed or not, if the traversal is completed, ending the process, and returning to the sampling point sets Mi of all the connected areas; if the traversal is not completed, the judgment of the step 303 is carried out;
whether the traversal in step 302 is completed means whether the traversal of the virtual map is completed, that is, whether all connected regions in the map region are searched, wherein whether the traversal is completed may be determined based on whether there is a region feature point in the virtual map that does not belong to a connected region. For example, if there are regional feature points that do not belong to a connected region in the virtual map, the traversal is not completed.
Step 303, judging whether the point A is visited in the current search, or whether the point A is a non-area sampling point, and if not, performing step 304; if yes, go to step 307;
if the point a is not visited in the search of the current round and the point a belongs to the area sampling point, the point a may be added to the sampling point set Mi corresponding to the search of the current round.
Step 304, judging whether the point A is adjacent to a non-area sampling point, if so, performing step 305; if not, go to step 306;
step 305, recording the point A as a contour point and storing the contour point into a sampling point set Ci, and then performing step 306;
the set Ci can be understood as a set for storing contour points, each sampling point set Mi has a corresponding set Ci, and the contour points can be stored in the sampling point set Mi corresponding to the set Ci.
Step 306, traversing the map sampling points adjacent to the point A according to the upper-right-lower-left sequence, taking the point as a new point A when traversing each adjacent map sampling point, and returning to the step 303, wherein the original point A is a father node of the four adjacent new points A;
307, judging whether the point A is the point x initially traversed in the current round, if so, performing a step 310; if not, go to step 308;
step 308, returning to the parent node at the upper layer of the point A, and judging in step 309;
step 309, judging whether the traversal of the upper right, the lower right and the left is finished, if not, returning to the step 306; if yes, go back to step 308.
Step 310, recording a sampling point set formed by the area sampling points of the round of traversal, if the set is not empty, determining the round of traversal as the ith round of traversal, wherein the sampling point set is Mi, and then returning to step 301; otherwise, returning to step 301, the i count is incremented by 1.
In this embodiment, all connected regions in the virtual map may be searched based on the above search method.
For example, referring to fig. 3c, the black dots in fig. 3c are contour points of the preset map area obtained by performing connected area search on the virtual map in fig. 2 b.
202. Carrying out shape feature extraction on a preset map area to obtain shape feature information of the preset map area;
203. determining the number of characterization points required by a preset map area based on shape feature information of the preset map area;
the shape feature information in this embodiment includes, but is not limited to, contour feature information of a preset map area, and area feature information.
In an optional example, the step of "extracting shape features of the preset map area to obtain shape feature information of the preset map area" may include:
determining the position of a preset map area in the virtual map based on area sampling points of the preset map area;
segmenting the preset map area from the virtual map based on the position of the preset map area;
and extracting regional characteristic information of the divided preset map region.
The region feature information includes, but is not limited to, shape representation parameters, such as area, perimeter, and the like.
In this example, the step of "determining the number of characterization points required for the preset map area based on the shape feature information of the preset map area" may include:
and determining the number of the characterization points required by the preset map area based on the area characteristic information of the preset map area.
If the area feature information includes the area parameter, the number of feature points needed by the preset map area may be determined based on the area of the preset map area, for example, based on the number k of feature points being round (area S/area weight coefficient a), where round represents a nearest rounding function, a is a numerical value greater than 1, and the numerical value of a is specified by a developer, which is not limited in this embodiment.
Alternatively, the region feature information further includes a shape parameter, and the area weight coefficient a may be determined based on the shape parameter.
In an optional example, the shape feature information may include contour feature information, and the step of "extracting the shape feature of the preset map area to obtain the shape feature information of the preset map area" may include: and extracting the contour features of the preset map area based on the contour points of the preset map area to obtain the contour feature information of the preset map area.
Correspondingly, the step "determining the number of characterization points required for the preset map area based on the shape feature information of the preset map area" may include:
and determining the number of the characterization points required by the preset map area based on the contour feature information of the preset map area.
Wherein the contour feature information is information for describing a contour feature of the preset map area. The contour feature information includes, but is not limited to, the number of contour points of the preset map area, curvature change information of the contour line, and the like.
Further, the step of extracting the contour feature of the preset map area based on the contour points of the preset map area to obtain the contour feature information of the preset map area may include:
and determining the number of contour points of the preset map area based on the contour points of the preset map area.
The step of determining the number of characterization points required by the preset map area based on the contour feature information of the preset map area may include:
acquiring a contour point number weight coefficient corresponding to the preset map area;
and carrying out weighted summation on the number weight coefficient and the number of the contour points of the preset map area to obtain the number of the characterization points of the preset map area.
For example, the number of characterization points k equals round (B × ci). And B is a weight coefficient of the number of contour points, and ci is the number of contour points of the ith preset map area.
The contour point number weighting coefficient B may be a fixed value, and the fixed value may be set by a developer. Or the contour point number weight coefficient B may also be determined based on the characteristics of a preset map area.
Optionally, the step of "obtaining the number weight coefficient of contour points corresponding to the preset map area" may include:
determining a contour line of the preset map area in the virtual map based on the contour points of the preset map area;
acquiring curvature change information of the contour line and a preset corresponding relation between the curvature change information and a contour point number weight coefficient;
and determining the number weight coefficient of the contour points of the preset map area based on the curvature change information of the contour lines and the preset corresponding relation.
The curvature change information may be any information related to the curvature change of the contour line, for example, the curvature change information may include curvature change range information, and the curvature change range information may be a difference between the maximum curvature and the minimum curvature of the contour line.
In this embodiment, the correspondence between the curvature variation range and the contour point weight coefficient may be preset. The correspondence may be stored in the form of a table or key-value pairs.
204. Clustering sampling points of a preset map area based on the number of the characterization points and distribution information of the sampling points in the preset map area to obtain a sampling point cluster;
the clustering manner in this embodiment is not limited, for example, a K-means (K-means) algorithm, a hierarchical clustering method, a maximum-minimum distance clustering algorithm, and the like. And clustering a plurality of preset map areas respectively and independently, and acquiring the representation points from the sampling point cluster of the preset map area after the clustering is finished.
For example, the step "clustering the area sampling points of the preset map area based on the number of the characterization points and the distribution information of the area sampling points in the preset map area to obtain a sampling point cluster", may include:
regarding each area sampling point in a preset map area as a class;
calculating the inter-class distance between every two classes, and then combining the two classes with the minimum inter-class distance to form a new larger class;
if the number of the classes is the number of the sampling points, finishing clustering, wherein each class is the sampling clustering cluster, otherwise, returning to the step of executing, namely calculating the distance between every two classes, and then combining the two classes with the minimum distance between the classes to form a new larger class.
The distance between classes may be calculated in many ways, and may be the distance between the closest region sampling points in the two classes, or the distance between the farthest region sampling points in the two classes, or the distance between the region sampling points in the center positions in the two classes.
If the number of classes (for distinction, referred to as a second class) having the smallest inter-class distance from a certain class (for distinction, referred to as a first class) is not less than two, the smallest class in the second class may be selected to be merged with the first class.
In this example, the step of "determining the characterization point of the preset map region in the virtual map from the cluster of sample points" may include: and determining a cluster center point in the sampling point cluster of the preset map area, and determining the cluster center point as a characterization point of the preset map area.
In another example, the cluster of sample points in the present embodiment may be determined based on a K-means clustering method. Optionally, the step of "clustering the area sampling points of the preset map area based on the number of the characterization points and distribution information of the area sampling points in the preset map area to obtain a sampling point cluster", may include:
selecting the area sampling points of the representation point quantity from the area sampling points of the preset map area as cluster center points;
determining the distance between the area sampling point and the center point of each cluster based on the distribution information of the area sampling point in the preset map area;
dividing the region sampling points into sampling point cluster clusters where cluster center points closest to the region sampling points are located;
and when a clustering finishing condition is met, finishing clustering the preset map area, otherwise determining a new cluster center point in each sampling point clustering cluster, and returning to execute the step of determining the distance between the area sampling point and each cluster center point based on the distribution information of the area sampling point in the preset map area.
Correspondingly, the step of determining the characteristic point of the preset map area in the virtual map from the cluster of sampling points may include: and determining a new cluster center point in the cluster of the sampling points of the preset map area as a characterization point of the preset map area.
The distribution information of the area sampling points includes, but is not limited to, position information of the area sampling points.
The clustering ending condition may be set according to actual needs, for example, the clustering frequency of the area sampling points in the preset map area is set to reach a preset frequency threshold, or the clustering frequency of the current sampling point is set to be completely the same as the clustering frequency of the last sampling point.
For example, referring to fig. 4a, fig. 4a shows a detailed flow of clustering region sample points in a preset map region. As shown in fig. 4a, the specific steps of clustering the area sampling points of the preset map area include:
step 401, randomly selecting area sampling points from a preset map area, wherein K area sampling points are used as initial cluster center points;
wherein k is the number of the sampling points determined above.
Step 403, calculating the distance between all the area sampling points and the K cluster centers, and distributing each area sampling point to the sampling point cluster where the closest cluster center is located;
step 403, if the current distribution result of the sampling points in all the areas is completely consistent with the last distribution result, ending the current clustering of the preset map areas, and returning the information of the sampling point clustering; otherwise, go to step 404;
and step 404, calculating a new cluster center point of each sample point cluster for the new sample point cluster, and returning to the step 402.
In this embodiment, the cluster center point is an area sampling point located at the center of gravity of the cluster in the sampling point cluster.
In this embodiment, when clustering starts, in addition to the scheme of randomly selecting the cluster center point, a cluster center point more conforming to the contour shape of the preset map area may be selected based on the contour feature information of the preset map area.
Optionally, the step of selecting the area sampling points of the number of the characterization points from the area sampling points of the preset map area as cluster center points may include:
determining a contour line of the preset map area in the virtual map based on the contour feature information of the preset map area;
and selecting the area sampling points of the characterization point quantity in the map area as cluster center points based on the contour lines.
After the contour line is determined, the length of the contour line can be calculated, and the shortest distance between the two closest cluster center points is determined based on the length and the number of the characterization points.
For example, the shortest distance is C round (contour length L/number of characterization points k), where C is a distance weight coefficient and takes a value between 0 and 1.
In this embodiment, a region characterization point may be selected near a contour line of a preset map region as a first cluster center point, a point having a distance from the first cluster center that is the shortest distance is found along the contour line as a second cluster center point, a point having a distance from the second cluster center that is the shortest distance is found along the contour line as a third cluster center point, and so on until a kth cluster center point is found.
In another example, the cluster center point needed at the beginning of the clustering may be determined based on the distance-farthest principle.
The step of selecting the area sampling points of the number of the characterization points from the area sampling points of the preset map area as cluster center points may include:
firstly, selecting an area sampling point as a cluster center point from the area sampling points of the preset map area;
selecting an area sampling point with the maximum closest distance with the center point of the existing cluster as the cluster center point;
and when the number of the existing cluster center points is the number of the sampling points, ending the selection, otherwise, returning to the execution step of selecting the area sampling point with the largest closest distance with the existing cluster center point as the cluster center point.
205. Determining a representation point of a preset map area in the virtual map from the sampling point cluster;
in this embodiment, the cluster center point of the final sampling point cluster of each preset map area may be determined as the characterization point of the preset map area.
Or, the cluster center point of the final sampling point cluster of the preset map area may be determined, and then a part of the cluster center points of the sampling point cluster may be selected as the representation point of the preset map area.
For example, referring to fig. 4b, the black dots in fig. 4b are the characterization points of the preset map area of the curve.
In this embodiment, through the step 201 and the step 205, the representation points of the preset map area in the virtual map can be accurately obtained. After the characterization points are obtained, in the running process of a virtual scene such as a game to which the virtual map belongs, when a calculation task related to a preset map area needs to be executed, the characterization points of the preset map area are obtained, the calculation task is executed based on the characterization points, and a task result is obtained.
Optionally, the information processing method of this embodiment may further include: and executing a path calculation task of the virtual object based on the representation points of the preset map area in the virtual map, and displaying path information in the virtual map based on the task execution result.
The route calculation task in the present embodiment may be a route calculation task related to an arbitrary preset map area. There may be at least one preset map area involved in one route calculation task.
The path calculation task may be triggered based on an operation of a user on the terminal, or may be automatically triggered when the terminal or the server detects that a trigger condition of the path calculation task is met. The present embodiment does not limit this.
The path information includes, but is not limited to, shortest path information, shortest path direction information, nearest interaction point information of a preset map area, and the like. The display mode of the path information includes, but is not limited to, a graphic display mode and the like.
Optionally, in an example, the step "executing a path calculation task of a virtual object based on a characterization point of a preset map area in the virtual map, and displaying path information in the virtual map based on a task execution result" may include:
when a path calculation task of a virtual object is detected, determining a target preset map area participating in the path calculation task from a preset map area of the virtual map;
executing the path calculation task based on the representation points of the target preset map area and the position information of the virtual object in the virtual map to obtain a task execution result;
and displaying path information in the virtual map based on the task execution result.
In an example, the path calculation task may be a shortest path calculation task for a target preset map area, the path calculation task is executed based on the representation points of the target preset map area and the position information of the virtual object in the virtual map, and a task execution result is obtained. When the path information is displayed, a prompt mark can be displayed at the position of the target representation point in the virtual map, or a path mark of the shortest feasible path between the virtual object and the target representation point can be displayed in the virtual map.
For example, taking a game scene as an example, assuming that the virtual character is currently in the ocean and needs to calculate the shortest path to the land, the shortest feasible path between the virtual object and each characterization point may be determined based on the positions of the characterization points in the ocean and the positions of the virtual object in the ocean, so as to determine a target characterization point closest to the virtual object, and use the shortest feasible path between the position of the virtual object and the target characterization point as the shortest path.
For another example, in the MOBA game, if there is a virtual object such as hero that can go to the wall in the game, the hero needs to calculate the nearest wall point to him when releasing a certain skill, and then jump to the wall point to release the skill. Then, based on the current position of the virtual object, the wall body near the virtual object is determined, the positions of the characterization points corresponding to the wall body are obtained, the characterization point closest to the virtual object among the characterization points is determined, and then prompt information, such as a circular icon and the like, is displayed at the position of the characterization point to prompt the user that the characterization point is the closest wall-climbing point.
By adopting the information processing method of the embodiment, the number of the characterization points of the preset map area can be determined based on the shape characteristic information of the preset map area, and the area sampling points of the preset map area are clustered based on the number of the characterization points and the distribution information of the area sampling points in the preset map area to obtain a sampling point cluster; determining a representation point of a preset map area in the virtual map from the sampling point cluster; the method comprises the steps of executing a path calculation task of a virtual object based on characterization points of a preset map area in a virtual map, and displaying path information in the virtual map based on a task execution result, so that the selection of the number and the position of the characterization points can be realized based on shape features of the preset map area, the selection accuracy of the characterization points in the preset map areas with different shapes is improved, the accuracy of the task execution result and the accuracy of the path information are improved, and better game experience is brought to users.
In order to better implement the method, correspondingly, the embodiment of the invention also provides an information processing device, which can be specifically integrated in the terminal, for example, in the form of a client.
Referring to fig. 5, the information processing apparatus includes:
the sampling point determining unit 501 is configured to obtain a sampling point set corresponding to a preset map area in a virtual map, where the sampling point set includes area sampling points of the preset map area;
a feature extraction unit 502, configured to perform shape feature extraction on a preset map area to obtain shape feature information of the preset map area;
a number determination unit 503, configured to determine the number of characterization points required by the preset map area based on the shape feature information of the preset map area;
the clustering unit 504 is configured to cluster the area sampling points in the preset map area based on the number of the characterization points and distribution information of the area sampling points in the preset map area to obtain a sampling point cluster;
and a characterization point determining unit 505, configured to determine a characterization point of a preset map area in the virtual map from the sample point cluster.
In one example, the information processing apparatus may further include: and the task execution unit is used for executing the path calculation task of the virtual object based on the representation points of the preset map area in the virtual map and displaying the path information in the virtual map based on the task execution result.
In an alternative embodiment, the sampling point determining unit includes:
the discrete sub-unit is used for carrying out discretization sampling on the virtual map to obtain a map sampling point of the virtual map;
the determining subunit is used for determining the map sampling points meeting the preset sampling point judgment condition as area sampling points belonging to a preset map area, and determining the rest map sampling points as non-area sampling points;
the connected region searching subunit is used for determining a connected region formed by the region sampling points in the virtual map based on the distribution information of the region sampling points and the non-region sampling points in the virtual map;
and the set acquisition subunit is used for determining the connected region as a preset map region in the virtual map and acquiring a sampling point set corresponding to the preset map region.
In an alternative embodiment, the connected component searching subunit is configured to:
determining profile points in the area sampling points and a connected area which comprises the profile points and is formed by the area sampling points based on the distribution of the area sampling points and non-area sampling points in the map sampling points adjacent to the area sampling points in the virtual map.
In an optional embodiment, the shape feature information includes contour feature information, and the feature extraction unit is configured to perform contour feature extraction on a preset map area based on contour points of the preset map area to obtain contour feature information of the preset map area;
and the quantity determining unit is used for determining the quantity of the characterization points required by the preset map area based on the outline characteristic information of the preset map area.
In an optional embodiment, the contour feature information includes a number of contour points, and the feature extraction unit is configured to determine the number of contour points of the preset map area based on the contour points of the preset map area;
a quantity determination unit comprising:
the coefficient acquisition subunit is used for acquiring the number weight coefficient of the contour points corresponding to the preset map area;
and the number determining subunit is used for performing weighted summation on the contour point number weight coefficient and the contour point number of the preset map area to obtain the number of the characterization points of the preset map area.
In an optional embodiment, the coefficient obtaining subunit is configured to determine, based on contour points of a preset map area, a contour line of the preset map area in the virtual map; obtaining curvature change information of the contour line and a preset corresponding relation between the curvature change information and a contour point number weight coefficient; and determining the number weight coefficient of the contour points in the preset map area based on the curvature change information of the contour lines and the preset corresponding relation.
In an optional embodiment, the clustering unit includes:
the central point determining subunit is used for selecting the area sampling points with the quantity of the characterization points from the area sampling points of the preset map area as cluster central points;
the distance determining subunit is used for determining the distance between the area sampling point and the central point of each cluster based on the distribution information of the area sampling points in the preset map area;
the clustering subunit is used for dividing the region sampling points into sampling point clustering clusters where cluster center points closest to the region sampling points are located;
the iteration control subunit is used for finishing clustering on the preset map area when a clustering finishing condition is met, otherwise determining a new cluster center point in each sampling point clustering cluster, and triggering the distance determination subunit to execute the step of determining the distance between the area sampling point and each cluster center point based on the distribution information of the area sampling point in the preset map area;
and the characterization point determining unit is used for determining a new cluster center point in the sampling point cluster of the preset map area as a characterization point of the preset map area.
In an optional embodiment, the shape feature information includes contour feature information, and the central point determining subunit is configured to determine, based on the contour feature information of the preset map area, a contour line of the preset map area in the virtual map; and based on the contour line, selecting the area sampling points of the representation points in the preset map area as cluster center points.
In an alternative embodiment, the task execution unit includes:
the area determining subunit is used for determining a target preset map area participating in the path calculation task from the preset map area of the virtual map when the path calculation task of the virtual object is detected;
the task execution subunit is used for executing the path calculation task based on the representation points of the target preset map area and the position information of the virtual object in the virtual map to obtain a task execution result;
and the display subunit is used for displaying the path information in the virtual map based on the task execution result.
By adopting the information processing device of the embodiment, the representation point data can be selected and the representation point position can be determined in a targeted manner for the preset map areas with different shape characteristics, so that the selection accuracy of the representation points in the preset map areas with different shapes is improved, the accuracy of the task execution result and the accuracy of the path information are improved, and better game experience is brought to users.
In addition, the embodiment of the present application further provides a computer device, where the computer device may be a terminal, and the terminal may be a terminal device such as a smart phone, a tablet computer, a notebook computer, a touch screen, a game machine, a Personal Computer (PC), a Personal Digital Assistant (PDA), and the like. As shown in fig. 6, fig. 6 is a schematic structural diagram of a computer device according to an embodiment of the present application. The computer device 1000 includes a processor 601 with one or more processing cores, a memory 602 with one or more computer-readable storage media, and a computer program stored on the memory 602 and executable on the processor. The processor 601 is electrically connected to the memory 602. Those skilled in the art will appreciate that the computer device configurations illustrated in the figures are not meant to be limiting of computer devices and may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components.
The processor 601 is a control center of the computer apparatus 1000, connects various parts of the entire computer apparatus 1000 using various interfaces and lines, performs various functions of the computer apparatus 1000 and processes data by running or loading software programs and/or modules stored in the memory 602, and calling data stored in the memory 602, thereby performing overall monitoring of the computer apparatus 1000.
In the embodiment of the present application, the processor 601 in the computer device 1000 loads instructions corresponding to processes of one or more applications into the memory 602, and the processor 601 executes the applications stored in the memory 602 according to the following steps, so as to implement various functions:
acquiring a sampling point set corresponding to a preset map area in a virtual map, wherein the sampling point set comprises area sampling points of the preset map area;
carrying out shape feature extraction on the preset map area to obtain shape feature information of the preset map area;
determining the number of characterization points required by the preset map area based on the shape feature information of the preset map area;
clustering the area sampling points of the preset map area based on the number of the characterization points and the distribution information of the area sampling points in the preset map area to obtain a sampling point cluster;
and determining the representation points of the preset map area in the virtual map from the sampling point cluster.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Optionally, as shown in fig. 6, the computer device 1000 further includes: a touch display screen 603, a radio frequency circuit 604, an audio circuit 605, an input unit 606, and a power supply 607. The processor 601 is electrically connected to the touch display screen 603, the radio frequency circuit 604, the audio circuit 605, the input unit 606, and the power supply 607. Those skilled in the art will appreciate that the computer device configuration illustrated in FIG. 6 does not constitute a limitation of computer devices, and may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components.
The touch display screen 603 can be used for displaying a graphical user interface and receiving operation instructions generated by a user acting on the graphical user interface. The touch display screen 603 may include a display panel and a touch panel. The display panel may be used, among other things, to display information entered by or provided to a user and various graphical user interfaces of the computer device, which may be made up of graphics, text, icons, video, and any combination thereof. Alternatively, the Display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-emitting diode (OLED), or the like. The touch panel may be used to collect touch operations of a user on or near the touch panel (for example, operations of the user on or near the touch panel using any suitable object or accessory such as a finger, a stylus pen, and the like), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Alternatively, the touch panel may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 601, and can receive and execute commands sent by the processor 601. The touch panel may overlay the display panel, and when the touch panel detects a touch operation thereon or nearby, the touch panel transmits the touch operation to the processor 601 to determine the type of the touch event, and then the processor 601 provides a corresponding visual output on the display panel according to the type of the touch event. In the embodiment of the present application, the touch panel and the display panel may be integrated into the touch display screen 603 to implement input and output functions. However, in some embodiments, the touch panel and the touch panel can be implemented as two separate components to perform the input and output functions. That is, the touch display screen 603 can also be used as a part of the input unit 606 to implement an input function.
In the embodiment of the present application, a game application is executed by the processor 601 to generate a graphical user interface on the touch display screen 603, and a virtual scene on the graphical user interface includes a virtual map. After the path calculation task is completed, the touch display screen 603 is used to present path information in the virtual map.
The rf circuit 604 may be used for transceiving rf signals to establish wireless communication with a network device or other computer device via wireless communication, and for transceiving signals with the network device or other computer device.
The audio circuit 605 may be used to provide an audio interface between the user and the computer device through speakers, microphones. The audio circuit 605 may transmit the electrical signal converted from the received audio data to a speaker, and convert the electrical signal into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 605 and converted into audio data, which is then processed by the audio data output processor 601, and then transmitted to, for example, another computer device via the radio frequency circuit 604, or output to the memory 602 for further processing. The audio circuit 605 may also include an earbud jack to provide communication of peripheral headphones with the computer device.
The input unit 606 may be used to receive input numbers, character information, or user characteristic information (e.g., fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
The power supply 607 is used to power the various components of the computer device 1000. Optionally, the power supply 607 may be logically connected to the processor 601 through a power management system, so as to implement functions of managing charging, discharging, and power consumption management through the power management system. The power supply 607 may also include any component including one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Although not shown in fig. 6, the computer device 1000 may further include a camera, a sensor, a wireless fidelity module, a bluetooth module, etc., which are not described in detail herein.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
Therefore, the computer device provided by the embodiment can improve the accuracy of the representation points of the preset map area, and is beneficial to improving the interactive experience of the user in the virtual map.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, embodiments of the present application provide a computer-readable storage medium, in which a plurality of computer programs are stored, and the computer programs can be loaded by a processor to execute the steps in any one of the information processing methods provided by the embodiments of the present application. For example, the computer program may perform the steps of:
acquiring a sampling point set corresponding to a preset map area in a virtual map, wherein the sampling point set comprises area sampling points of the preset map area;
carrying out shape feature extraction on the preset map area to obtain shape feature information of the preset map area;
determining the number of characterization points required by the preset map area based on the shape feature information of the preset map area;
clustering the area sampling points of the preset map area based on the number of the characterization points and the distribution information of the area sampling points in the preset map area to obtain a sampling point cluster;
and determining the representation points of the preset map area in the virtual map from the sampling point cluster.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the computer program stored in the storage medium can execute the steps in any information processing method provided in the embodiments of the present application, the beneficial effects that can be achieved by any information processing method provided in the embodiments of the present application can be achieved, and detailed descriptions are omitted here for the foregoing embodiments.
The foregoing detailed description has provided an information processing method, an information processing apparatus, a storage medium, and a computer device according to embodiments of the present application, and specific examples have been applied in the present application to explain the principles and implementations of the present application, and the descriptions of the foregoing embodiments are only used to help understand the method and the core ideas of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (13)

1. An information processing method characterized by comprising:
acquiring a sampling point set corresponding to a preset map area in a virtual map, wherein the sampling point set comprises area sampling points of the preset map area;
carrying out shape feature extraction on the preset map area to obtain shape feature information of the preset map area;
determining the number of characterization points required by the preset map area based on the shape feature information of the preset map area;
clustering the area sampling points of the preset map area based on the number of the characterization points and the distribution information of the area sampling points in the preset map area to obtain a sampling point cluster;
and determining the representation points of the preset map area in the virtual map from the sampling point cluster.
2. The information processing method according to claim 1, wherein the obtaining of the set of sampling points corresponding to the preset map area in the virtual map comprises:
discretizing and sampling the virtual map to obtain a map sampling point of the virtual map;
determining map sampling points meeting the preset sampling point judgment condition as area sampling points belonging to a preset map area, and determining the rest map sampling points as non-area sampling points;
determining a connected region formed by the region sampling points in the virtual map based on the distribution information of the region sampling points and the non-region sampling points in the virtual map;
and determining the connected region as a preset map region in the virtual map, and acquiring a sampling point set corresponding to the preset map region.
3. The information processing method according to claim 2, wherein the determining of the connected region in the virtual map, which is made up of the area sampling points, based on distribution information of the area sampling points and non-area sampling points in the virtual map, includes:
determining profile points in the area sampling points and a connected area which comprises the profile points and is formed by the area sampling points based on distribution information of the area sampling points and non-area sampling points in the map sampling points adjacent to the area sampling points.
4. The information processing method according to claim 3, wherein the shape feature information includes contour feature information, and the performing shape feature extraction on the preset map area to obtain the shape feature information of the preset map area includes:
extracting contour features of the preset map area based on the contour points of the preset map area to obtain contour feature information of the preset map area;
the determining the number of the characterization points required by the preset map area based on the shape feature information of the preset map area includes:
and determining the number of the characterization points required by the preset map area based on the contour feature information of the preset map area.
5. The information processing method according to claim 4, wherein the contour feature information includes a number of contour points, and the extracting contour features from the preset map area based on the contour points of the preset map area to obtain the contour feature information of the preset map area includes:
determining the number of contour points of the preset map area based on the contour points of the preset map area;
the determining the number of the characterization points required by the preset map area based on the contour feature information of the preset map area comprises:
acquiring a contour point number weight coefficient corresponding to the preset map area;
and carrying out weighted summation on the number weight coefficient and the number of the contour points of the preset map area to obtain the number of the characterization points of the preset map area.
6. The information processing method according to claim 5, wherein the obtaining of the weighting coefficient of the number of contour points corresponding to the preset map area comprises:
determining a contour line of the preset map area in the virtual map based on the contour points of the preset map area;
acquiring curvature change information of the contour line and a preset corresponding relation between the curvature change information and a contour point number weight coefficient;
and determining the number weight coefficient of the contour points of the preset map area based on the curvature change information of the contour lines and the preset corresponding relation.
7. The information processing method according to any one of claims 1 to 6, wherein the clustering the area sampling points of the preset map area based on the number of the characterization points and distribution information of the area sampling points in the preset map area to obtain a sampling point cluster comprises:
selecting the area sampling points of the representation point quantity from the area sampling points of the preset map area as cluster center points;
determining the distance between the area sampling point and the central point of each cluster based on the distribution information of the area sampling point in the preset map area;
dividing the region sampling points into sampling point cluster clusters where cluster center points closest to the region sampling points are located;
when a clustering finishing condition is met, finishing clustering on the preset map area, otherwise determining a new cluster center point in each sampling point clustering cluster, and returning to execute the step of determining the distance between the area sampling point and each cluster center point based on the distribution information of the area sampling point in the preset map area;
the determining the characterization points of the preset map area in the virtual map from the sampling point cluster comprises:
and determining a cluster center point in the cluster of the sampling points of the preset map area as a characterization point of the preset map area.
8. The information processing method according to claim 7, wherein the shape feature information includes profile feature information, and the selecting, from among the area sampling points of the preset map area, an area sampling point of the token number as a cluster center point includes:
determining a contour line of the preset map area in the virtual map based on the contour feature information of the preset map area;
and based on the contour line, selecting the area sampling points of the representation points in the preset map area as cluster center points.
9. The information processing method according to any one of claims 1 to 6, further comprising:
and executing a path calculation task of the virtual object based on the representation points of the preset map area in the virtual map, and displaying path information in the virtual map based on a task execution result.
10. The information processing method according to claim 9, wherein the executing a route calculation task of a virtual object based on the characterization point of a preset map area in the virtual map, and presenting route information in the virtual map based on a task execution result includes:
when a path calculation task of a virtual object is detected, determining a target preset map area participating in the path calculation task from a preset map area of the virtual map;
executing the path calculation task to obtain a task execution result based on the representation points of the target preset map area and the position information of the virtual object in the virtual map;
and displaying path information in the virtual map based on the task execution result.
11. An information processing apparatus characterized by comprising:
the virtual map processing device comprises a sampling point determining unit, a processing unit and a processing unit, wherein the sampling point determining unit is used for acquiring a sampling point set corresponding to a preset map area in a virtual map, and the sampling point set comprises area sampling points of the preset map area;
the characteristic extraction unit is used for extracting shape characteristics of the preset map area to obtain shape characteristic information of the preset map area;
the quantity determining unit is used for determining the quantity of the characterization points required by the preset map area based on the shape feature information of the preset map area;
the clustering unit is used for clustering the area sampling points of the preset map area based on the number of the characterization points and the distribution information of the area sampling points in the preset map area to obtain a sampling point cluster;
and the characterization point determining unit is used for determining the characterization points of the preset map area in the virtual map from the sampling point cluster.
12. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the method according to any of claims 1-10 are implemented when the computer program is executed by the processor.
13. A storage medium having a computer program stored thereon, wherein the computer program when executed by a processor implements the steps of the method according to any of claims 1-10.
CN202010531076.2A 2020-06-11 2020-06-11 Information processing method, device, computer equipment and storage medium Active CN111760290B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010531076.2A CN111760290B (en) 2020-06-11 2020-06-11 Information processing method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010531076.2A CN111760290B (en) 2020-06-11 2020-06-11 Information processing method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111760290A true CN111760290A (en) 2020-10-13
CN111760290B CN111760290B (en) 2024-06-14

Family

ID=72720725

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010531076.2A Active CN111760290B (en) 2020-06-11 2020-06-11 Information processing method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111760290B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010016189A1 (en) * 2008-08-08 2010-02-11 株式会社セガ Game program and game device
CN105046710A (en) * 2015-07-23 2015-11-11 北京林业大学 Depth image partitioning and agent geometry based virtual and real collision interaction method and apparatus
CN105825672A (en) * 2016-04-11 2016-08-03 中山大学 City guidance area extraction method based on floating car data
CN106295639A (en) * 2016-08-01 2017-01-04 乐视控股(北京)有限公司 A kind of virtual reality terminal and the extracting method of target image and device
WO2017090273A1 (en) * 2015-11-27 2017-06-01 株式会社アースビート Game object control system and program
CN109550247A (en) * 2019-01-09 2019-04-02 网易(杭州)网络有限公司 Virtual scene method of adjustment, device, electronic equipment and storage medium in game
CN110047152A (en) * 2019-04-12 2019-07-23 腾讯科技(深圳)有限公司 Object construction method, device and readable storage medium storing program for executing based on virtual environment
CN111127576A (en) * 2019-12-18 2020-05-08 北京像素软件科技股份有限公司 Game picture rendering method and device and electronic equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010016189A1 (en) * 2008-08-08 2010-02-11 株式会社セガ Game program and game device
CN105046710A (en) * 2015-07-23 2015-11-11 北京林业大学 Depth image partitioning and agent geometry based virtual and real collision interaction method and apparatus
WO2017090273A1 (en) * 2015-11-27 2017-06-01 株式会社アースビート Game object control system and program
CN105825672A (en) * 2016-04-11 2016-08-03 中山大学 City guidance area extraction method based on floating car data
CN106295639A (en) * 2016-08-01 2017-01-04 乐视控股(北京)有限公司 A kind of virtual reality terminal and the extracting method of target image and device
CN109550247A (en) * 2019-01-09 2019-04-02 网易(杭州)网络有限公司 Virtual scene method of adjustment, device, electronic equipment and storage medium in game
CN110047152A (en) * 2019-04-12 2019-07-23 腾讯科技(深圳)有限公司 Object construction method, device and readable storage medium storing program for executing based on virtual environment
CN111127576A (en) * 2019-12-18 2020-05-08 北京像素软件科技股份有限公司 Game picture rendering method and device and electronic equipment

Also Published As

Publication number Publication date
CN111760290B (en) 2024-06-14

Similar Documents

Publication Publication Date Title
CN112044074B (en) Method, device, storage medium and computer equipment for seeking path for non-player character
CN105431813B (en) It is acted based on biometric identity home subscriber
CN111325204B (en) Target detection method, target detection device, electronic equipment and storage medium
CN113350793B (en) Interface element setting method and device, electronic equipment and storage medium
CN113101665B (en) Road network generation method and device, storage medium and computer equipment
CN113952720A (en) Game scene rendering method and device, electronic equipment and storage medium
CN112138406A (en) Virtual resource distribution method and device, computer equipment and storage medium
CN112206541B (en) Game plug-in identification method and device, storage medium and computer equipment
CN111310072B (en) Keyword extraction method, keyword extraction device and computer-readable storage medium
CN112221151A (en) Map generation method and device, computer equipment and storage medium
CN111760290B (en) Information processing method, device, computer equipment and storage medium
CN113332722B (en) Map generation method, device, terminal and storage medium
CN112348955B (en) Object rendering method
CN112619139A (en) Virtual vehicle display method and device, storage medium and computer equipment
CN115088007A (en) Risk assessment method and device, electronic equipment and storage medium
CN117899468A (en) Scene content generation method, device and computer readable storage medium
CN116644933A (en) Virtual land block evaluation method and device, storage medium and computer equipment
CN113827973A (en) Map path finding method, device, terminal and storage medium
CN114416921A (en) Plot text generation method, plot text generation device, plot text generation terminal and storage medium
CN117919720A (en) Configuration method and device of game interaction points, computer equipment and storage medium
CN117725294A (en) Region-based content distribution method, device, electronic equipment and storage medium
CN113975818A (en) Abnormal role determination method and device, computer equipment and storage medium
CN115564916A (en) Editing method and device of virtual scene, computer equipment and storage medium
CN115430137A (en) Game process processing method and device, computer equipment and storage medium
CN117679747A (en) Model construction method, apparatus, computer device, and computer-readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant