Method, device, medium and electronic equipment for extracting virtual environment features

By employing polar coordinate system transformation in a virtual environment, the problems of cumbersome virtual character coding and difficulty in extracting features from symmetrical scenes are solved, achieving more efficient and accurate feature representation, which is suitable for interactive applications in virtual environments.

CN116777993BActive Publication Date: 2026-04-24BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING ZITIAO NETWORK TECH CO LTD
Filing Date
2023-06-12
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

In existing technologies, the encoding process of virtual characters in a virtual environment is cumbersome and it is difficult to guarantee the timeliness and accuracy of the interaction, especially in symmetrical scenes where feature extraction is difficult.

Method used

A character coordinate system is adopted, with the current virtual character as the pole and the target virtual character as the polar axis. The feature representation of the environment object is determined by polar coordinate transformation, and the feature representation is generated by combining the environmental coordinate features and the character coordinate features.

Benefits of technology

It improves the efficiency and accuracy of feature extraction in virtual environments, simplifies data volume requirements, is suitable for fast feature representation in symmetrical scenarios, and supports subsequent model processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116777993B_ABST
    Figure CN116777993B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method and device for extracting a virtual environment feature, a medium and an electronic device. The method comprises: obtaining each environment object of a target environment in which a current virtual character is located, wherein the environment objects include the virtual character and objects in the target environment; determining, for each environment object, a first coordinate of the environment object in an environment coordinate system; determining, according to the first coordinate, a second coordinate of the environment object in a character coordinate system, wherein the character coordinate system is a coordinate system formed with the position of the current virtual character as a pole and a ray from the current virtual character to a target opponent virtual character as a polar axis; determining a character coordinate feature corresponding to the environment object according to the second coordinate; and generating a feature representation corresponding to the environment object according to the first coordinate, the second coordinate and the character coordinate feature of the environment object.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and more specifically, to a method, apparatus, medium, and electronic device for extracting features of a virtual environment. Background Technology

[0002] Currently, interactive applications on terminals are increasingly designed to enhance user experience and immersion. For example, users can control virtual objects to operate and observe within a virtual environment. In this process, the virtual character needs to encode the surrounding scene to understand it and take appropriate actions. Related technologies typically encode the positions of nearby objects and use images to represent the surrounding scene. However, this encoding process is cumbersome and complex, making it difficult to guarantee timely and accurate responses to interactions. Summary of the Invention

[0003] This summary section is provided to briefly introduce the concepts, which will be described in detail in the detailed description section below. This summary section is not intended to identify key or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0004] In a first aspect, this disclosure provides a method for extracting features of a virtual environment, the method comprising:

[0005] Obtain all environmental objects of the current virtual character in its target environment, wherein the environmental objects include the virtual character and objects in the target environment;

[0006] For each of the environmental objects, determine the first coordinates of the environmental object in the environmental coordinate system;

[0007] Based on the first coordinates, the second coordinates of the environment object in the character coordinate system are determined, wherein the character coordinate system is a coordinate system formed with the position of the current virtual character as the pole and the ray from the current virtual character to the target virtual character as the polar axis;

[0008] Based on the second coordinates, determine the character coordinate features corresponding to the environment object;

[0009] Based on the first coordinates, the second coordinates, and the character coordinates of the environment object, a feature representation corresponding to the environment object is generated.

[0010] Secondly, this disclosure provides a device for extracting features of a virtual environment, the device comprising:

[0011] The acquisition module is used to acquire various environmental objects of the current virtual character in its target environment, wherein the environmental objects include the virtual character and objects in the target environment;

[0012] The first determining module is used to determine the first coordinates of each environmental object in the environmental coordinate system.

[0013] The second determining module is used to determine the second coordinates of the environment object in the character coordinate system based on the first coordinates, wherein the character coordinate system is a coordinate system formed with the position of the current virtual character as the pole and the ray from the current virtual character to the target virtual character as the polar axis;

[0014] The third determining module is used to determine the character coordinate features corresponding to the environment object based on the second coordinates;

[0015] The generation module is used to generate a feature representation corresponding to the environment object based on the first coordinate, the second coordinate, and the character coordinate features of the environment object.

[0016] Thirdly, this disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the method described in the first aspect.

[0017] Fourthly, this disclosure provides an electronic device, comprising:

[0018] A storage device on which computer programs are stored;

[0019] A processing device for executing the computer program in the storage device to implement the steps of the method described in the first aspect.

[0020] In the above technical solution, a coordinate system can be formed based on the current virtual character's position as the pole and the ray from the current virtual character to the target virtual character as the polar axis. This coordinate system represents the coordinates of various environmental objects in the target environment. Furthermore, the character coordinate features corresponding to the environmental objects can be determined based on the coordinates in the polar coordinate system. Thus, based on the first coordinate, the second coordinate, and the character coordinate features of the environmental objects, a feature representation corresponding to the environmental objects is generated. Therefore, this technical solution allows for more diverse features in the extracted environmental objects. Moreover, features can be directly represented based on feature vectors, which effectively reduces the amount of data required for feature representation compared to related technologies that combine images, thereby improving the efficiency of feature processing. Furthermore, by adding feature representation in the polar coordinate system in this embodiment, symmetrical scenes in the target environment can be represented quickly and directly, further improving the accuracy of feature extraction from environmental objects in the target environment and providing simplified data feature representations for subsequent model processing.

[0021] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description

[0022] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale. In the drawings:

[0023] Figure 1 This is a flowchart of a method for extracting virtual environment features according to one embodiment of the present disclosure.

[0024] Figure 2 This is a block diagram of a virtual environment feature extraction apparatus provided according to one embodiment of the present disclosure.

[0025] Figure 3 A schematic diagram of the structure of an electronic device suitable for implementing embodiments of the present disclosure is shown. Detailed Implementation

[0026] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0027] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.

[0028] The term "comprising" and its variations as used herein are open-ended inclusion, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.

[0029] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.

[0030] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0031] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0032] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.

[0033] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.

[0034] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose whether to "agree" or "disagree" to provide personal information to the electronic device.

[0035] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.

[0036] Meanwhile, it is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.

[0037] Figure 1 The diagram shown is a flowchart of a method for extracting virtual environment features according to an embodiment of this disclosure. Figure 1 As shown, the method includes:

[0038] In step 11, the various environmental objects of the current virtual character in its target environment are obtained, wherein the environmental objects include the virtual character and objects in the target environment.

[0039] For example, a virtual environment can be a game scene where multiple virtual characters can be engaged in combat. Each virtual character can be controlled by a user or by a machine control model; the current virtual character is the one controlled by the currently logged-in player. As an example, image recognition can be performed on the scene image to identify various environmental objects in the target environment, such as the virtual characters controlled by the opposing team and objects in the environment, such as skill attack frames. The types of objects to be identified can be set according to the specific application scenario, thereby identifying various objects in the target environment.

[0040] In step 12, for each environment object, the first coordinate of the environment object in the environment coordinate system is determined. This environment coordinate system can be the coordinate system used in the game, meaning the coordinates of the environment object can be obtained based on the corresponding position function in the game, denoted as (x, y), which is the coordinate of the environment object returned by the game application.

[0041] In step 13, the second coordinates of the environmental object in the character coordinate system are determined based on the first coordinates. The character coordinate system is a coordinate system formed with the position of the current virtual character as the pole and the ray from the current virtual character to the target virtual character as the polar axis. The target virtual character is a character with hostile attributes to the current virtual character, and the target virtual character is one of the target virtual characters.

[0042] The character coordinate system is a polar coordinate system with the current virtual character as the pole. This allows for feature encoding of other objects centered on the current virtual character. Furthermore, the ray from the current virtual character to the target virtual character is used as the polar axis, so that when encoding is performed based on the character coordinate system, the area directly in front of the current virtual character represents the target virtual character.

[0043] In a virtual game environment, such as an open field, if the current virtual character detects an opponent's virtual character 5 meters to the south and another 5 meters to the north, these two opponent virtual characters should be equivalent in combat. However, in related feature extraction methods, the position of each character in the game is encoded separately, making it difficult to reflect the relationship between the two opponent virtual characters and the current virtual character. In other words, the feature extraction methods in related technologies are difficult to apply to scenarios with such symmetry. In this embodiment, by converting the first coordinates into second coordinates in the character coordinate system corresponding to the current virtual character, the rotational symmetry in game environment observation is fully considered, improving the effectiveness and comprehensiveness of the features obtained from feature extraction of environmental objects.

[0044] In step 14, the character coordinate features corresponding to the environment object are determined based on the second coordinate.

[0045] Furthermore, the second coordinates can be further encoded to convert the second feature into character coordinate features.

[0046] In step 15, a feature representation corresponding to the environment object is generated based on the first coordinate, second coordinate, and character coordinate features of the environment object.

[0047] For example, for each environment object, its feature array can be initialized as an empty array, and then the first coordinate, second coordinate, and character coordinate features can be added to the feature array to obtain the feature representation.

[0048] In the above technical solution, a coordinate system can be formed based on the current virtual character's position as the pole and the ray from the current virtual character to the target virtual character as the polar axis. This coordinate system represents the coordinates of various environmental objects in the target environment. Furthermore, the character coordinate features corresponding to the environmental objects can be determined based on the coordinates in the polar coordinate system. Thus, based on the first coordinate, the second coordinate, and the character coordinate features of the environmental objects, a feature representation corresponding to the environmental objects is generated. Therefore, this technical solution allows for more diverse features in the extracted environmental objects. Moreover, features can be directly represented based on feature vectors, which effectively reduces the amount of data required for feature representation compared to related technologies that combine images, thereby improving the efficiency of feature processing. Furthermore, by adding feature representation in the polar coordinate system in this embodiment, symmetrical scenes in the target environment can be represented quickly and directly, further improving the accuracy of feature extraction from environmental objects in the target environment and providing simplified data feature representations for subsequent model processing.

[0049] In one possible embodiment, the character coordinate system is established in the following manner:

[0050] Determine the distance between each other virtual character in the target environment and the current virtual character.

[0051] In this context, the opposing virtual character can be a character controlled by a player belonging to a different team in the game and possessing hostile attributes. The player's attributes can be used to determine whether their controlled virtual character is an opposing virtual character. If the game is a single-player team game, all virtual characters except the current virtual character are opposing virtual characters. If the game is a two-player team game, all virtual characters except the current virtual character and the other player in the same team are opposing virtual characters.

[0052] After identifying the other party's virtual character, the distance between them can be determined by using the first coordinates of each other's virtual character in the target environment and the first coordinates of the current virtual character. This distance can be calculated using Euclidean distance, which will not be elaborated here.

[0053] The virtual character with the smallest distance is identified as the target virtual character, and the azimuth angles corresponding to the current virtual character and the target virtual character are determined. The azimuth angle can be the angle between the line connecting the current virtual character and the target virtual character and the axis corresponding to true north in the environment coordinate system. In other words, the azimuth angle of the enemy virtual character closest to the current virtual character is determined.

[0054] The character coordinate system is generated based on the azimuth angle and the coordinates of the current virtual character in the environment coordinate system.

[0055] In this embodiment, the coordinates of the current virtual character in the environmental coordinate system can be used as the polar coordinates of the character coordinate system, and the direction corresponding to the azimuth angle can be used as the direction corresponding to the polar axis of the character coordinate system. This ensures that the nearest opposing virtual character in the generated character coordinate system is always due north, allowing for the representation of other environmental objects based on the target opposing virtual character during gameplay. The features determined in this character coordinate system can possess rotational symmetry, enabling equivalent consideration of other objects at the same distance from the current virtual character in the game scene, providing data support for rapid decision-making in subsequent gameplay.

[0056] In one possible embodiment, the method may further include:

[0057] Based on the first coordinates, determine the environmental coordinate features corresponding to the environmental object.

[0058] The environmental coordinate feature can be obtained by encoding the first coordinate based on the information of the environmental coordinate system, and it can be used to represent the information of the environmental object in the environmental coordinate system.

[0059] As an example, an exemplary implementation of determining the environmental coordinate features corresponding to the environmental object based on the first coordinates is as follows, and this step may include:

[0060] Based on the first coordinates, determine the azimuth angle corresponding to the origin of the environment coordinate system and the environmental object. In the representation of the game environment, due north is typically used as the axis. Therefore, the azimuth angle represents the angle formed by the line connecting the environmental object to the origin (x=0, y=0) in the environment coordinate system and this axis. For example, if the coordinates of the environmental object are (1,0), then the distance to the right of the origin is 1, and the azimuth angle is represented as π / 2. For instance, the azimuth angle is represented as γ = atan2(x,y), where γ is the azimuth angle, and the atan2 function is a function used in this field to determine the azimuth angle.

[0061] Based on the coordinate values ​​of the first coordinate system, the distance between the environmental object and the origin of the environmental coordinate system is determined. This distance can be determined using Euclidean distance, which will not be elaborated further here.

[0062] The distance is feature-encoded to generate coded features, and the coded features and the azimuth angle are determined as the environmental coordinate features.

[0063] For numerical features like distance, directly using the numerical value as a feature makes it difficult for subsequent models to understand the specific characteristics represented by the real number. For example, for a real number with a minimum value of 0 and a maximum value of 10000, directly inputting the numerical value into a neural network for feature processing after feature extraction is insufficient to determine its features. However, neural networks can effectively process features across multiple dimensions. Therefore, in this embodiment, distance can be feature-encoded to transform it into a multi-dimensional vector representation, i.e., obtaining encoded features. This allows the features corresponding to the distance to be accurately understood and processed by the subsequent neural network model, improving the effectiveness and accuracy of feature processing and providing reliable data support for accurate processing of the extracted features. Furthermore, the azimuth angle corresponding to the environmental object can be combined to form environmental coordinate features, further enhancing the comprehensiveness of the information in these environmental coordinate features.

[0064] Accordingly, generating a feature representation corresponding to the environment object based on the first coordinates, the second coordinates, and the character coordinate features of the environment object may include:

[0065] Based on the first coordinates, the environment coordinate features, the second coordinates, and the character coordinate features of the environment object, a feature representation corresponding to the environment object is generated. For example, these features can be added to the feature array of the environment object to obtain the feature representation.

[0066] Therefore, by using the above technical solution, features in the environmental coordinate system can be further incorporated into the feature representation, thereby improving the comprehensiveness and diversity of features extracted from the environment, enhancing the richness of feature extraction, and thus improving the accuracy of feature extraction to a certain extent.

[0067] In one possible embodiment, an exemplary implementation of determining the character coordinate features corresponding to the environment object based on the second coordinates may include:

[0068] The distance between the environmental object and the current virtual character is determined based on the second coordinates.

[0069] In the polar coordinate system, for any point M in the plane, R represents the length of line segment OM, α represents the angle from Ox to OM, R is called the polar radius of point M, α is called the polar angle of point M, and the ordered pair (α, R) represents the polar coordinates of point M. Therefore, based on the second coordinate, R in this coordinate system can be determined as the distance between the environmental object and the current virtual character.

[0070] Subsequently, the distance is feature-encoded to generate coded features, and the coded features are determined as the character coordinate features.

[0071] Similarly, the distance between the environment object and the current virtual character in the character coordinate system can be encoded as a feature. This distance can be encoded into a multi-dimensional vector feature that can be processed by a neural network, improving the effectiveness and usability of the obtained coordinate features. At the same time, it can broaden the application scenarios of this feature extraction method, making it easier to perform model processing and decision-making based on the extracted features, thereby improving the efficiency of game applications and decision-making to a certain extent.

[0072] In one possible embodiment, the step of generating encoded features by feature encoding the distance includes:

[0073] A first mapping value is determined based on the difference between the distance and the minimum distance corresponding to the distance, and a second mapping value is determined based on the difference between the maximum distance and the minimum distance corresponding to the distance.

[0074] The minimum and maximum distances can be preset according to the actual application scenario. For example, the minimum distance cannot be less than 0, so it can be set to 0; the maximum distance should not be greater than the environment length, so it can be set to the environment length, which can be determined based on the image of the target environment.

[0075] For example, a mapping can be performed using square roots. If the distance is denoted as d, the minimum distance is min_val, and the maximum distance is max_val, then the first mapping value vid can be expressed as: vid = sqrt(d - min_val), and the second mapping value max_vid can be expressed as: max_vid = sqrt(max_val - min_val).

[0076] The mapping ratio is determined based on the first mapping value and the second mapping value;

[0077] The mapping ratio q can be represented as vid / max_vid, which can be used to represent the position of d in the possible value space.

[0078] Then, the feature vector can be initialized according to the feature dimension of the encoded feature, and the value of each dimension in the feature vector can be determined based on the mapping ratio to obtain the encoded feature.

[0079] The feature dimension of the feature encoding can be set according to the actual application scenario. For example, if the dimension is set to 5, the feature vector can be initialized based on the feature dimension. This feature vector can be represented by an array, such as obtaining the initialized feature vector by initializing a 5-dimensional array. Then, the feature vector is updated based on this mapping to obtain the encoded feature, which is represented by a 5-dimensional array.

[0080] In one possible embodiment, initializing a feature vector based on the feature dimensions of the encoded features, and determining the value of each dimension in the feature vector based on the mapping ratio, to obtain the encoded features may include:

[0081] Based on the mapping ratio and the feature dimension, a target mapping value in the feature dimension is determined. This target mapping value can be used to represent the segment to which the given distance falls when the interval between the maximum and minimum distances is divided into segments of length. For example, the target mapping value idx can be determined using the following formula:

[0082] idx = p / (1 / length), where length represents the number of feature dimensions.

[0083] For each dimension of the feature vector, the difference between the target mapping value and the initial value of the dimension is used as the feature value to obtain the update vector.

[0084] For example, if the feature vector has a dimension of 5, its initialization is represented as [0, 1, 2, 3, 4]. In one possible embodiment, the distance d is 8.84, the minimum distance min_val is 4, and the maximum distance max_val is 29. Then, the first mapping value vid = sqrt(d - min_val) = 2.2, the second mapping value max_vid = sqrt(max_val - min_val) = 5, and the mapping ratio p = vid / max_vid = 2.2 / 5. The target mapping value idx can then be further determined as p / (1 / length) = 2.2. The determined update vector can then be represented as [2.2, 1.2, 0.2, -0.8, -1.8].

[0085] Then, the value obtained by applying a function constraint to the value of each dimension in the update vector is used as the target value of the dimension to obtain the encoded feature.

[0086] For example, the `clip` function can be used to apply functional constraints. `clip(f,0,1)` sets the portion of `f` greater than 1 to 1 and the portion less than 0 to 0. The resulting encoded feature after applying this function constraint to each dimension of the update vector is represented as [1,1,0.2,0,0]. Thus, the distance 8.84 can be encoded as the feature [1,1,0.2,0,0], representing the distance through multi-dimensional data. This facilitates the vector representation of the distance feature and allows for the mapping of real numbers to multi-dimensional vectors, enabling subsequent models and networks to accurately and effectively identify and understand the extracted features, thereby improving the effectiveness and usability of the extracted features.

[0087] This disclosure also provides a device for extracting virtual environment features, such as... Figure 2 As shown, the device 10 includes:

[0088] The acquisition module 100 is used to acquire various environmental objects of the current virtual character in its target environment, wherein the environmental objects include the virtual character and objects in the target environment;

[0089] The first determining module 200 is used to determine the first coordinates of each environmental object in the environmental coordinate system.

[0090] The second determining module 300 is used to determine the second coordinates of the environment object in the character coordinate system based on the first coordinates, wherein the character coordinate system is a coordinate system formed with the position of the current virtual character as the pole and the ray from the current virtual character to the target virtual character as the polar axis;

[0091] The third determining module 400 is used to determine the character coordinate features corresponding to the environment object based on the second coordinates;

[0092] The generation module 500 is used to generate a feature representation corresponding to the environment object based on the first coordinate, the second coordinate, and the character coordinate features of the environment object.

[0093] Optionally, the device further includes:

[0094] The fourth determining module is used to determine the environmental coordinate features corresponding to the environmental object based on the first coordinates;

[0095] The generation module is further used for:

[0096] Based on the first coordinates of the environment object, the environment coordinate features, the second coordinates, and the character coordinate features, a feature representation corresponding to the environment object is generated.

[0097] Optionally, the fourth determining module includes:

[0098] The first determining submodule is used to determine the azimuth angle between the environmental object and the origin of the environmental coordinate system based on the first coordinate.

[0099] The second determining submodule is used to determine the distance between the environmental object and the origin of the environmental coordinate system based on the coordinate values ​​of the first coordinate.

[0100] The encoding submodule is used to perform feature encoding on the distance to generate encoded features;

[0101] The third determining submodule is used to determine the encoded features and the azimuth angle as the environmental coordinate features.

[0102] Optionally, the third determining module includes:

[0103] The fourth determining submodule is used to determine the distance between the environmental object and the current virtual character based on the second coordinates;

[0104] The encoding submodule is used to perform feature encoding on the distance to generate encoded features;

[0105] The fifth determining submodule is used to determine the encoded feature as the coordinate feature.

[0106] Optionally, the encoding submodule includes:

[0107] The sixth determining submodule is used to determine a first mapping value based on the difference between the distance and the minimum distance corresponding to the distance, and to determine a second mapping value based on the difference between the maximum distance and the minimum distance corresponding to the distance;

[0108] The seventh determining submodule is used to determine the mapping ratio based on the first mapping value and the second mapping value;

[0109] The eighth determining submodule is used to initialize a feature vector according to the feature dimension of the encoded feature, and determine the value of each dimension in the feature vector based on the mapping ratio to obtain the encoded feature.

[0110] Optionally, the eighth determining submodule includes:

[0111] The ninth determining submodule is used to determine the target mapping value in the feature dimension based on the mapping ratio and the feature dimension;

[0112] The tenth determining submodule is used to obtain an update vector by taking the difference between the target mapping value and the initial value of the dimension as a feature value for each dimension in the feature vector;

[0113] The update submodule is used to apply a function constraint to the values ​​of each dimension in the update vector and use the resulting value as the target value of the dimension to obtain the encoded feature.

[0114] Optionally, the character coordinate system is established in the following way:

[0115] Determine the distance between each other virtual character in the target environment and the current virtual character;

[0116] The virtual character with the smallest distance is identified as the target virtual character, and the azimuth angles corresponding to the current virtual character and the target virtual character are determined.

[0117] The character coordinate system is generated based on the azimuth angle and the coordinates of the current virtual character in the environment coordinate system.

[0118] The following is for reference. Figure 3 The diagram illustrates a structural schematic of an electronic device (e.g., a terminal device or a server) 600 suitable for implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 3 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0119] like Figure 3 As shown, electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 601, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 602 or a program loaded from storage device 608 into random access memory (RAM) 603. RAM 603 also stores various programs and data required for the operation of electronic device 600. Processing device 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.

[0120] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 608 including, for example, magnetic tapes, hard disks, etc.; and communication devices 609. Communication device 609 allows electronic device 600 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 3 An electronic device 600 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0121] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, it performs the functions defined in the methods of embodiments of this disclosure.

[0122] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0123] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0124] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0125] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: acquire various environmental objects of the current virtual character in its target environment, wherein the environmental objects include the virtual character and objects in the target environment; for each environmental object, determine a first coordinate of the environmental object in an environmental coordinate system; determine a second coordinate of the environmental object in a character coordinate system based on the first coordinate, wherein the character coordinate system is a coordinate system formed with the position of the current virtual character as the pole and the ray from the current virtual character to the target virtual character as the polar axis; determine the character coordinate features corresponding to the environmental object based on the second coordinate; and generate a feature representation corresponding to the environmental object based on the first coordinate, the second coordinate, and the character coordinate features of the environmental object.

[0126] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including but not limited to object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0127] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0128] The modules described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a module does not necessarily limit the module itself; for example, an acquisition module can also be described as "a module that acquires various environmental objects of the current virtual character in its target environment".

[0129] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0130] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0131] According to one or more embodiments of this disclosure, Example 1 provides a method for extracting features of a virtual environment, wherein the method includes:

[0132] Obtain all environmental objects of the current virtual character in its target environment, wherein the environmental objects include the virtual character and objects in the target environment;

[0133] For each of the environmental objects, determine the first coordinates of the environmental object in the environmental coordinate system;

[0134] Based on the first coordinates, the second coordinates of the environment object in the character coordinate system are determined, wherein the character coordinate system is a coordinate system formed with the position of the current virtual character as the pole and the ray from the current virtual character to the target virtual character as the polar axis;

[0135] Based on the second coordinates, determine the character coordinate features corresponding to the environment object;

[0136] Based on the first coordinates, the second coordinates, and the character coordinates of the environment object, a feature representation corresponding to the environment object is generated.

[0137] According to one or more embodiments of this disclosure, Example 2 provides the method of Example 1, wherein the method further includes:

[0138] Based on the first coordinates, determine the environmental coordinate features corresponding to the environmental object;

[0139] The step of generating a feature representation corresponding to the environment object based on the first coordinates, the second coordinates, and the character coordinate features of the environment object includes:

[0140] Based on the first coordinates of the environment object, the environment coordinate features, the second coordinates, and the character coordinate features, a feature representation corresponding to the environment object is generated.

[0141] According to one or more embodiments of this disclosure, Example 3 provides the method of Example 2, wherein determining the environmental coordinate features corresponding to the environmental object based on the first coordinates includes:

[0142] Based on the first coordinates, determine the azimuth angle between the environmental object and the origin of the environmental coordinate system;

[0143] Based on the coordinate values ​​of the first coordinate, determine the distance between the environmental object and the origin of the environmental coordinate system;

[0144] The distance is feature-encoded to generate coded features, and the coded features and the azimuth angle are determined as the environmental coordinate features.

[0145] According to one or more embodiments of this disclosure, Example 4 provides the method of Example 1, wherein determining the role coordinate features corresponding to the environment object based on the second coordinates includes:

[0146] Based on the second coordinates, determine the distance between the environmental object and the current virtual character;

[0147] The distance is feature-encoded to generate encoded features, and the encoded features are determined as the character coordinate features.

[0148] According to one or more embodiments of this disclosure, Example 5 provides the method of Example 3 or 4, wherein the step of feature encoding the distance to generate encoded features includes:

[0149] A first mapping value is determined based on the difference between the distance and the minimum distance corresponding to the distance, and a second mapping value is determined based on the difference between the maximum distance and the minimum distance corresponding to the distance.

[0150] The mapping ratio is determined based on the first mapping value and the second mapping value;

[0151] The feature vector is initialized according to the feature dimension of the encoded feature, and the value of each dimension in the feature vector is determined based on the mapping ratio to obtain the encoded feature.

[0152] According to one or more embodiments of this disclosure, Example 6 provides the method of Example 5, wherein the step of initializing a feature vector according to the feature dimensions of the encoded feature and determining the value of each dimension in the feature vector based on the mapping ratio to obtain the encoded feature includes:

[0153] Based on the mapping ratio and the feature dimension, determine the target mapping value in the feature dimension;

[0154] For each dimension of the feature vector, the difference between the target mapping value and the initial value of the dimension is used as the feature value to obtain the update vector;

[0155] The value obtained by applying a function constraint to the value of each dimension in the update vector is used as the target value of the dimension to obtain the encoded feature.

[0156] According to one or more embodiments of this disclosure, Example 7 provides the method of Example 1, wherein the character coordinate system is established in the following manner:

[0157] Determine the distance between each other virtual character in the target environment and the current virtual character;

[0158] The virtual character with the smallest distance is identified as the target virtual character, and the azimuth angles corresponding to the current virtual character and the target virtual character are determined.

[0159] The character coordinate system is generated based on the azimuth angle and the coordinates of the current virtual character in the environment coordinate system.

[0160] According to one or more embodiments of this disclosure, Example 8 provides an apparatus for extracting features of a virtual environment, wherein the apparatus includes:

[0161] The acquisition module is used to acquire various environmental objects of the current virtual character in its target environment, wherein the environmental objects include the virtual character and objects in the target environment;

[0162] The first determining module is used to determine the first coordinates of each environmental object in the environmental coordinate system.

[0163] The second determining module is used to determine the second coordinates of the environment object in the character coordinate system based on the first coordinates, wherein the character coordinate system is a coordinate system formed with the position of the current virtual character as the pole and the ray from the current virtual character to the target virtual character as the polar axis;

[0164] The third determining module is used to determine the character coordinate features corresponding to the environment object based on the second coordinates;

[0165] The generation module is used to generate a feature representation corresponding to the environment object based on the first coordinates, the second coordinates, and the character coordinate features of the environment object.

[0166] According to one or more embodiments of the present disclosure, Example 9 provides a computer-readable medium having a computer program stored thereon that, when executed by a processing device, implements the steps of the method described in any one of Examples 1-7.

[0167] According to one or more embodiments of this disclosure, Example 10 provides an electronic device, including:

[0168] A storage device on which computer programs are stored;

[0169] A processing device for executing the computer program in the storage device to implement the steps of any one of the methods in Examples 1-7.

[0170] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0171] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0172] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative forms of implementing the claims. Regarding the apparatus in the above embodiments, the specific manner in which the various modules perform their operations has been described in detail in the embodiments relating to the method, and will not be elaborated upon here.

Claims

1. A method for extracting features of a virtual environment, characterized in that, The method includes: Obtain all environmental objects of the current virtual character in its target environment, wherein the environmental objects include the virtual character and objects in the target environment; For each of the environmental objects, determine the first coordinates of the environmental object in the environmental coordinate system; Based on the first coordinates, the second coordinates of the environment object in the character coordinate system are determined, wherein the character coordinate system is a coordinate system formed with the position of the current virtual character as the pole and the ray from the current virtual character to the target virtual character as the polar axis; Based on the second coordinates, determine the character coordinate features corresponding to the environment object; Based on the first coordinates, the second coordinates, and the character coordinates of the environment object, a feature representation corresponding to the environment object is generated.

2. The method according to claim 1, characterized in that, The method further includes: Based on the first coordinates, determine the environmental coordinate features corresponding to the environmental object; The step of generating a feature representation corresponding to the environment object based on the first coordinates, the second coordinates, and the character coordinate features of the environment object includes: Based on the first coordinates of the environment object, the environment coordinate features, the second coordinates, and the character coordinate features, a feature representation corresponding to the environment object is generated.

3. The method according to claim 2, characterized in that, The step of determining the environmental coordinate features corresponding to the environmental object based on the first coordinate includes: Based on the first coordinates, determine the azimuth angle between the environmental object and the origin of the environmental coordinate system; Based on the coordinate values ​​of the first coordinate, determine the distance between the environmental object and the origin of the environmental coordinate system; The distance is feature-encoded to generate coded features, and the coded features and the azimuth angle are determined as the environmental coordinate features.

4. The method according to claim 1, characterized in that, The step of determining the character coordinate features corresponding to the environment object based on the second coordinate includes: Based on the second coordinates, determine the distance between the environmental object and the current virtual character; The distance is feature-encoded to generate encoded features, and the encoded features are determined as the character coordinate features.

5. The method according to claim 3 or 4, characterized in that, The step of generating encoded features by feature encoding the distance includes: A first mapping value is determined based on the difference between the distance and the minimum distance corresponding to the distance, and a second mapping value is determined based on the difference between the maximum distance and the minimum distance corresponding to the distance. The mapping ratio is determined based on the first mapping value and the second mapping value; The feature vector is initialized according to the feature dimension of the encoded feature, and the value of each dimension in the feature vector is determined based on the mapping ratio to obtain the encoded feature.

6. The method according to claim 5, characterized in that, The step of initializing a feature vector based on the feature dimensions of the encoded features, and determining the value of each dimension in the feature vector based on the mapping ratio to obtain the encoded features includes: Based on the mapping ratio and the feature dimension of the encoded feature, determine the target mapping value in the feature dimension; For each dimension of the feature vector, the difference between the target mapping value and the initial value of the dimension is used as the feature value to obtain the update vector; The value obtained by applying a function constraint to the value of each dimension in the update vector is used as the target value of the dimension to obtain the encoded feature.

7. The method according to claim 1, characterized in that, The character coordinate system is established in the following way: Determine the distance between each other virtual character in the target environment and the current virtual character; The virtual character with the smallest distance is identified as the target virtual character, and the azimuth angles corresponding to the current virtual character and the target virtual character are determined. The character coordinate system is generated based on the azimuth angle and the coordinates of the current virtual character in the environment coordinate system.

8. A device for extracting features of a virtual environment, characterized in that, The device includes: The acquisition module is used to acquire various environmental objects of the current virtual character in its target environment, wherein the environmental objects include the virtual character and objects in the target environment; The first determining module is used to determine the first coordinates of each environmental object in the environmental coordinate system. The second determining module is used to determine the second coordinates of the environment object in the character coordinate system based on the first coordinates, wherein the character coordinate system is a coordinate system formed with the position of the current virtual character as the pole and the ray from the current virtual character to the target virtual character as the polar axis; The third determining module is used to determine the character coordinate features corresponding to the environment object based on the second coordinates; The generation module is used to generate a feature representation corresponding to the environment object based on the first coordinate, the second coordinate, and the character coordinate features of the environment object.

9. A computer-readable medium having a computer program stored thereon, characterized in that, When executed by the processing device, the program implements the steps of the method described in any one of claims 1-7.

10. An electronic device, characterized in that, include: A storage device on which computer programs are stored; A processing device for executing the computer program in the storage device to implement the steps of the method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Method and device for locking object in game

    CN112245909A

  • Point cloud encoding and decoding method and device

    CN112384950A