CN117462946A - Game object display method and device, storage medium and electronic equipment - Google Patents

Game object display method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN117462946A
CN117462946A CN202311644558.9A CN202311644558A CN117462946A CN 117462946 A CN117462946 A CN 117462946A CN 202311644558 A CN202311644558 A CN 202311644558A CN 117462946 A CN117462946 A CN 117462946A
Authority
CN
China
Prior art keywords
mask
game object
game
target
position relation
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.)
Pending
Application number
CN202311644558.9A
Other languages
Chinese (zh)
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.)
Guangzhou Boguan Information Technology Co Ltd
Original Assignee
Guangzhou Boguan Information Technology 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 Guangzhou Boguan Information Technology Co Ltd filed Critical Guangzhou Boguan Information Technology Co Ltd
Priority to CN202311644558.9A priority Critical patent/CN117462946A/en
Publication of CN117462946A publication Critical patent/CN117462946A/en
Pending legal-status Critical Current

Links

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/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • 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/57Simulating properties, behaviour or motion of objects in the game world, e.g. computing tyre load in a car race game

Abstract

The disclosure belongs to the technical field of games, and relates to a method and a device for displaying a game object, a computer storage medium and electronic equipment. The method comprises the following steps: determining game objects and masks existing in a current game scene; determining a first position relation between the game object and the mask according to the position coordinates of the game object and the mask in the current game scene respectively; for each shade, determining a second position relation between a target game object with a coincidence relation with the shade and a shade region corresponding to the shade; and correcting the first position relation based on the second position relation to obtain a target position relation, and displaying the game object in the current game scene according to the target position relation. In the method, after the first position relation is corrected based on the second position relation to obtain the target position relation, the game object is displayed according to the target position relation, so that the number of times of drawing processing of the game object is reduced, and the efficiency of displaying the game object is improved.

Description

Game object display method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of game technologies, and in particular, to a method for displaying a game object, a device for displaying a game object, a computer-readable storage medium, and an electronic apparatus.
Background
In the scene of a 2D game, in order to simulate the feel of 3D, some of the natural objects on the map are often made to block normal objects, and such natural objects are called masks.
In the drawing process of each common object, all masks intersected with the common object need to be traversed, and whether the common object is blocked by the masks or not is judged according to the coordinates of the common object. If the common object is shielded by the mask, the intersecting area of the mask and the common object needs to be calculated, and the effect that the mask shields the common object is re-drawn, so that the number of times that the common object is drawn is increased, the display efficiency of the common object is reduced, and the game scene is possibly blocked.
In view of the foregoing, there is a need in the art to develop a new game object display method and apparatus.
It should be noted that the information disclosed in the above background section is only for enhancing understanding of the background of the present disclosure and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
An object of the present disclosure is to provide a game object display method, a game object display device, a computer-readable storage medium, and an electronic apparatus, which further overcome, at least to some extent, the problem of low game object display efficiency due to the related art.
Other features and advantages of the present disclosure will be apparent from the following detailed description, or may be learned in part by the practice of the disclosure.
According to a first aspect of an embodiment of the present invention, there is provided a method for displaying a game object, the method including: determining a game object and a mask existing in a current game scene, wherein the mask is used for shielding the game object; determining a first position relation between the game object and the mask according to the position coordinates of the game object and the mask in the current game scene respectively; for each shade, determining a second position relation between a target game object with a coincidence relation with the shade and a shade region corresponding to the shade; and correcting the first position relation based on the second position relation to obtain a target position relation, and displaying the game object in the current game scene according to the target position relation.
According to a second aspect of an embodiment of the present invention, there is provided a display apparatus of a game object, the apparatus including: a determining module configured to determine a game object and a mask present in a current game scene, the mask for occluding the game object; a first positional relationship module configured to determine a first positional relationship between the game object and the mask according to positional coordinates of the game object and the mask, respectively, in the current game scene; a second positional relationship module configured to determine, for each of the masks, a second positional relationship between a target game object having a coincidence relationship with the mask and a mask region corresponding to the mask; and the corrected position relation module is configured to correct the first position relation based on the second position relation to obtain a target position relation, and display the game object in the current game scene according to the target position relation.
According to a third aspect of an embodiment of the present invention, there is provided an electronic apparatus including: a processor and a memory; wherein the memory has stored thereon computer readable instructions which, when executed by the processor, implement the method of displaying a game object of any of the above-described exemplary embodiments.
According to a fourth aspect of embodiments of the present invention, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the display method of a game object in any of the above-described exemplary embodiments.
As can be seen from the above technical solutions, the method for displaying a game object, the device for displaying a game object, the computer storage medium, and the electronic device according to the exemplary embodiments of the present invention have at least the following advantages and positive effects:
in the method and the device provided by the exemplary embodiment of the disclosure, a first position relation between the game object and the mask is determined according to the position coordinates of the game object and the mask in the game scene, a second position relation between the target game object with the overlapping relation with the mask and the mask area corresponding to the mask is determined, and the first position relation is corrected according to the second position relation, so that the game object is displayed according to the corrected target position relation. After the corrected target position relation between the game object and the shade is determined, the game object is drawn according to the target position relation, so that the drawing times of the game object are reduced, the display efficiency of the game object is further improved, and the clamping of a game scene is avoided.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure. It will be apparent to those of ordinary skill in the art that the drawings in the following description are merely examples of the disclosure and that other drawings may be derived from them without undue effort.
FIG. 1 schematically illustrates a flow diagram of a method of displaying a game object in an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flowchart of determining a first positional relationship between a game object and a mask in a display method of the game object in an embodiment of the present disclosure;
FIG. 3 schematically illustrates a flowchart of determining, for each mask, a second positional relationship between a target game object having a coincidence relation with the mask and a mask region corresponding to the mask in a display method of a game object in an embodiment of the present disclosure;
FIG. 4 schematically illustrates a flow chart of determining a target game object having a coincidence relation with each mask in a display method of a game object according to an embodiment of the present disclosure;
FIG. 5 schematically illustrates a flowchart of correcting a first positional relationship based on a second positional relationship to obtain a target positional relationship in a method for displaying a game object according to an embodiment of the present disclosure;
FIG. 6 schematically illustrates an apparatus for a display method of a game object in an embodiment of the present disclosure;
FIG. 7 schematically illustrates an electronic device for a display method of a game object in an embodiment of the present disclosure;
fig. 8 schematically illustrates a computer-readable storage medium for a display method of a game object in an embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the present disclosure. One skilled in the relevant art will recognize, however, that the aspects of the disclosure may be practiced without one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
The terms "a," "an," "the," and "said" are used in this specification to denote the presence of one or more elements/components/etc.; the terms "comprising" and "having" are intended to be inclusive and mean that there may be additional elements/components/etc. in addition to the listed elements/components/etc.; the terms "first" and "second" and the like are used merely as labels, and are not intended to limit the number of their objects.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities.
In view of the problems in the related art, the present disclosure proposes a method of displaying a game object. Fig. 1 shows a flow chart of a method for displaying a game object, and as shown in fig. 1, the method for displaying a game object at least includes the following steps:
s110, determining a game object and a shade existing in the current game scene, wherein the shade is used for shielding the game object.
And S120, determining a first position relation between the game object and the mask according to the position coordinates of the game object and the mask in the current game scene.
Step S130, for each shade, determining a second position relation between the target game object with the coincidence relation with the shade and the shade area corresponding to the shade.
And S140, correcting the first position relation based on the second position relation to obtain a target position relation, and displaying the game object in the current game scene according to the target position relation.
In the method and the device provided by the exemplary embodiment of the disclosure, a first position relation between the game object and the mask is determined according to the position coordinates of the game object and the mask in the game scene, a second position relation between the target game object with the overlapping relation with the mask and the mask area corresponding to the mask is determined, and the first position relation is corrected according to the second position relation, so that the game object is displayed according to the corrected target position relation. After the corrected target position relation between the game object and the shade is determined, the game object is drawn according to the target position relation, so that the drawing times of the game object are reduced, the display efficiency of the game object is further improved, and the clamping of a game scene is avoided.
The respective steps of the display method of the game object will be described in detail below.
In step S110, a game object and a mask that are present in the current game scene are determined, the mask being used to mask the game object.
In an exemplary embodiment of the present disclosure, a current game scene refers to a scene that a user displays in a game display interface when running a game. The game object refers to an object (excluding a mask) that may appear in the current game scene, specifically, the game object may be a game character in the current game scene, may be a virtual creature in the current game scene, may be a game prop in the current game scene, or may be a game carrier in the current game scene, which is not particularly limited in this exemplary embodiment.
The mask, although it may also appear in the current game scene, is typically in a fixed position in the current game scene and may visually act as an occlusion for the game object in order to simulate the effect of 3D in a 2D game. Specifically, the mask may be stone, tree, house, or any object fixedly displayed in the current game scene, which is not particularly limited in this exemplary embodiment.
For example, it is determined that the game object existing in the current game scene includes game character a and virtual creature b, and it is determined that the mask existing in the current game scene includes a stone located in the upper left corner of the current game scene and a house located in the middle of the current game scene.
In the present exemplary embodiment, the game object and the mask in the current game scene are determined, which lays a foundation for the subsequent determination of the positional relationship between the game object and the mask.
In step S120, a first positional relationship between the game object and the mask is determined according to the position coordinates of the game object and the mask, respectively, in the current game scene.
In an exemplary embodiment of the present disclosure, the position coordinates of the game object refer to coordinates corresponding to coordinate axes of key points of the game object in the longitudinal direction, and the position coordinates of the mask refer to coordinates corresponding to coordinate axes of the bottom of the mask in the longitudinal direction. Game objects are typically displayed in the current game scene as key points. For example, the key point of game character a is (1, 2), at which point game character a needs to be displayed at (100 ) of the current game scene. Based on this, in the process of displaying the game character a on the current game scene, it is actually a process of overlapping the key points (1, 2) of the game character a with (100 ) of the current game scene.
The positional relationship (i.e., the first positional relationship) of the game object and the mask in the longitudinal direction can be determined from the positional coordinates. For example, it is determined that the game object existing in the current game scene includes game character a and virtual creature b, and it is determined that the mask existing in the current game scene includes a stone located in the upper left corner of the current game scene and a house located in the middle of the current game scene. The game character A has a position coordinate of 3 on the y axis, the virtual creature b has a position coordinate of 5 on the y axis, the stone has a position coordinate of 12 on the y axis, and the house has a position coordinate of 18 on the y axis.
Based on this, the first positional relationship is determined in which the virtual creature b is located above the game character a in the longitudinal direction, the stone is located above the virtual creature b, and the house is located above the stone.
In an alternative embodiment, fig. 2 is a schematic flow chart of determining a first positional relationship between a game object and a mask in a method for displaying a game object, and as shown in fig. 2, the method at least includes the following steps: in step S210, determining a first position coordinate of the game object in the current game scene, and determining a second position coordinate of the mask in the current game scene; the first position coordinate and the second position coordinate are coordinates corresponding to the same coordinate axis; in step S220, the game object and the mask are position-ordered according to the first position coordinates and the second position coordinates to obtain a first position relationship between the game object and the mask.
The first position coordinates refer to coordinate values corresponding to the longitudinal coordinate axes of the game object in the current game scene, and the second position coordinates refer to coordinate values corresponding to the longitudinal coordinate axes of the mask in the current game scene.
After the first position coordinates of the game object and the second position coordinates of the mask are determined, the first position coordinates and the second position coordinates are subjected to position sorting, so that the position relation (namely, the first position relation) of the game object and the mask in the direction of the longitudinal coordinate axis can be obtained.
For example, game character a has a position coordinate of 3 on the y-axis, virtual creature b has a position coordinate of 5 on the y-axis, stone has a position coordinate of 12 on the y-axis, and house has a position coordinate of 18 on the y-axis. And (3) carrying out position sorting on the four position coordinates according to the sizes of the position coordinates, wherein the obtained position sorting result is that 3 is less than 5,5 is less than 12, and 12 is less than 18. Based on this, the game character a, the virtual creature b, the stone, and the house can be sequentially inserted into one linked list K according to the position sorting result. At this time, a first positional relationship between the game object and the mask is recorded in the linked list K.
In the present exemplary embodiment, a manner is provided in which a first positional relationship between a mask and a game object is determined based on position coordinates so that the first positional relationship is subsequently corrected with a second positional relationship to obtain a target positional relationship for displaying the game object.
In step S130, for each mask, a second positional relationship between the target game object having a coincidence relation with the mask and the mask region corresponding to the mask is determined.
In exemplary embodiments of the present disclosure, there may be a coincidence relation between a mask and a game object that are present in the current game scene. Specifically, when there is coincidence between the object bounding box corresponding to the game object and the mask bounding box corresponding to the mask, it is considered that there is a coincidence relation between the game object and the mask.
One mask may have a coincidence relation with one game object, and one mask may have a coincidence relation with a plurality of game objects, which is not particularly limited in the present exemplary embodiment.
The mask region refers to a region corresponding to a mask designed in advance by an art designer, and may be a rectangular region. The second positional relationship refers to a positional relationship between the game object and the mask determined by judging whether the game object is within the mask region.
It is to be noted that, when the target game object having a coincidence relation with the mask is within the mask region, even if it is described in the first positional relation that the positional coordinates of the target game object are smaller than those of the mask, it is considered that the position of the target game object in the longitudinal coordinate axis direction should be larger than the position of the mask in the longitudinal direction. Thus, the first positional relationship can be corrected based on the second positional relationship.
In an alternative embodiment, fig. 3 shows a schematic flow chart of determining, for each mask, a second positional relationship between a target game object having a coincidence relation with the mask and a mask region corresponding to the mask in a display method of a game object, and as shown in fig. 3, the method at least includes the following steps: in step S310, among the game objects, a target game object having a coincidence relation with each of the masks is determined; in step S320, determining a mask region corresponding to each mask; in step S330, if the object position corresponding to the target game object is located in the mask region, it is determined that the target game object has a second positional relationship with the mask.
Wherein, no matter how many masks exist, a target game object with which a coincidence relation exists needs to be determined for each mask. Specifically, the mask and the target game object having the coincidence relation with the mask may be recorded in one dictionary dovelap, so that the second positional relation between the mask and the corresponding target game object is determined based on the correspondence relation between the mask and the target game object recorded in the dictionary dovelap.
The mask region refers to a region corresponding to a mask designed in advance by an art designer, and may be a rectangular region. Object location refers to the location of a target game object in the current game scene. Specifically, when the object position is located in the mask region, the target game object may be considered to be located in the mask region, at which time it is determined that the target game object has a second positional relationship with the mask. Specifically, the second positional relationship is used to describe that the target game object should be located at a position higher in the direction corresponding to the longitudinal coordinate axis than the mask is located at in the direction corresponding to the longitudinal coordinate axis.
In the present exemplary embodiment, another way of determining the positional relationship between the mask and the target game object is provided, which facilitates subsequent correction of the first positional relationship.
In an alternative embodiment, fig. 4 shows a schematic flow chart of determining a target game object having a coincidence relation with each mask in a display method of a game object, and as shown in fig. 4, the method at least includes the following steps: in step S410, an object bounding box corresponding to the game object is determined, and a mask bounding box corresponding to each mask is determined; in step S420, if there is a coincidence between the object bounding box and the mask bounding box, the game object is determined to be a target game object having a coincidence relation with the mask.
Wherein, the object bounding box refers to a graph which can contain game objects, and the mask bounding box refers to a graph which can contain masks. When there is a coincidence between the two graphics (i.e., when there is a coincidence between the graphics that contain the game object and the graphics that contain the mask), the game object corresponding to the object bounding box is considered to be the target game object that has a coincidence relation with the mask.
For example, if there are 2 masks (mask 1 and mask2, respectively) and 3 game objects (entity 1, entity2, and entity 3) in the current game scene, it is necessary to determine mask bounding boxes (mask box1 and mask box2, respectively) corresponding to the 2 masks and object bounding boxes (entity box1, entity box2, and entity box3, respectively) corresponding to the 3 game objects, respectively.
By determining whether there is a coincidence of mask1 with each of the entitybox1, entitybox2, and entitybox3, and whether there is a coincidence of mask2 with each of the entitybox1, entitybox2, and entitybox3, it is possible to determine that there is a coincidence relationship between mask1 and entity1 with each of the entity2, and that entity3 is a coincidence relationship between mask2 with each of the entitybox 3.
In the present exemplary embodiment, when the game object has a coincidence relation with the mask, it proves that at this time, in terms of visual effect, it is possible to require the mask to hide the target game object. Further, by judging whether the target game object is in the mask area, it is further ensured that the mask is required to cover the target game object in view of visual effect at this time, so that the accuracy of the determined second position relationship is improved.
In step S140, the first positional relationship is corrected based on the second positional relationship to obtain a target positional relationship, and the game object is displayed in the current game scene according to the target positional relationship.
In the exemplary embodiments of the present disclosure, it is worth noting that the second positional relationship is used to describe that the position of the target game object in the direction corresponding to the longitudinal coordinate axis should be higher than the position of the mask in the direction corresponding to the longitudinal coordinate axis. However, the first position coordinates refer to coordinate values corresponding to the longitudinal coordinate axes of the key points of the game object in the current game scene, and the second position coordinates refer to coordinate values corresponding to the longitudinal coordinate axes of the bottom of the mask in the current game scene, so that the first position relationship determined from the first position coordinates and the second position coordinates is not necessarily accurate.
And then the first position relation needs to be corrected according to the second position relation so as to obtain an accurate target position relation. And displaying the game object according to the coordinate value of the game object in the direction of the ordinate axis and the coordinate value of the mask in the direction of the ordinate axis, which are recorded in the target position relation after the target position relation is obtained.
In an alternative embodiment, correcting the first positional relationship based on the second positional relationship to obtain the target positional relationship includes: and if the second position relation between the target game object and the shade is inconsistent with the first position relation between the target game object and the shade, correcting the first position relation between the target game object and the shade based on the second position relation to obtain the target position relation.
Wherein when the first positional relationship and the second positional relationship are inconsistent, it is proved that the coordinate value of the mask in the ordinate axis direction is larger than the coordinate value of the target game object in the ordinate axis direction in the first positional relationship, whereas the coordinate value of the mask in the ordinate axis direction is smaller than the coordinate value of the target game object in the ordinate axis direction in the second positional relationship.
Since the above-described relationship between the coordinate values of the target game object in the ordinate axis direction and the coordinate values of the mask in the ordinate axis direction has a contradiction, it is necessary to correct the first positional relationship according to the second positional relationship, i.e., adjust the coordinate values of the mask in the ordinate axis direction recorded in the first positional relationship to be lower than the coordinate values of the target game object in the ordinate axis direction.
For example, the first position relationship recorded in the linked list dovelap is a mask a, a game object B, a mask C, a mask D, a game object E, and a game object F (the position coordinates corresponding to the mask a, the game object B, the mask C, the mask D, the game object E, and the game object F are from small to large), wherein the game object E is a target game object of the mask D, and the coordinate value of the mask D in the ordinate axis direction is greater than the coordinate value of the game object E in the ordinate axis direction in the second position relationship. Based on this, the linked list Doverlap is modified to mask a, game object B, mask C, game object E, mask D, game object F.
In the present exemplary embodiment, when the second positional relationship is inconsistent with the first positional relationship, the first positional relationship between the target game object and the mask is corrected based on the second positional relationship to obtain the target positional relationship, which not only improves the accuracy of the obtained target positional relationship, but also displays the game object after the target positional relationship is obtained, thereby improving the display efficiency of the game object.
In an alternative embodiment, fig. 5 shows a schematic flow chart of correcting the first positional relationship based on the second positional relationship to obtain the target positional relationship in the method for displaying the game object, and as shown in fig. 5, the method at least includes the following steps: in step S510, if there is a coincidence relation between one game object and a plurality of masks, and the second position relation between one game object and a plurality of masks is inconsistent with the first position relation between one game object and a plurality of masks, a target mask is truly obtained according to the position coordinates corresponding to the plurality of masks; in step S520, the first positional relationship between the target mask and one game object is corrected based on the second positional relationship between the target mask and one game object to obtain a target positional relationship.
Wherein a game object may have a coincidence relation with a plurality of masks. For example, if there is a coincidence relation between one game object entity a and two masks (mask Y and mask Z), and the second positional relation X-1 between the game object entity a and mask Y is inconsistent with the first positional relation E-1 between the game object entity a and mask Y, the second positional relation X-2 between the game object entity a and mask Z is inconsistent with the first positional relation E-2 between the game object entity a and mask Z, and the first positional relation E-1 and the first positional relation E-2 are not corrected at this time.
Determining the size relation between the position coordinates of the mask Y and the position coordinates of the mask Z from the linked list Doverlap; if the position coordinate of the shade Y is larger than that of the shade Z, determining the shade Y as a target shade; otherwise, if the position coordinates of the mask Y are smaller than those of the mask Z, the mask Z is determined to be the target mask.
Based on this, if the target mask is the mask Y, only the first positional relationship between the mask Y and the game object entityA needs to be corrected based on the second positional relationship between the mask Y and the game object entityA.
In the present exemplary embodiment, when there is a coincidence relation between one game object and a plurality of masks, only the first positional relation between the target mask and the game object is adjusted according to the second positional relation between the target mask and the game object, so that an erroneous target positional relation is avoided, and the accuracy of the target positional relation is improved.
In an alternative embodiment, the method further comprises: if the special shade exists in the shade, hiding the special shade in the current game scene; there is no coincidence relation between the special mask and any game object.
The special mask refers to a mask which does not have a superposition relation with any game object, namely, a mask which does not need to shade any game object in vision. Based on this, special masks will be hidden in the current game scene to avoid unnecessary performance loss.
In the method and the device provided by the exemplary embodiment of the disclosure, a first position relation between the game object and the mask is determined according to the position coordinates of the game object and the mask in the game scene, a second position relation between the target game object with the overlapping relation with the mask and the mask area corresponding to the mask is determined, and the first position relation is corrected according to the second position relation, so that the game object is displayed according to the corrected target position relation. After the corrected target position relation between the game object and the shade is determined, the game object is drawn according to the target position relation, so that the drawing times of the game object are reduced, the display efficiency of the game object is further improved, and the clamping of a game scene is avoided.
Further, in an exemplary embodiment of the present disclosure, there is also provided a display device of a game object. Fig. 6 shows a schematic structural diagram of a display device of a game object, and as shown in fig. 6, a display device 600 of a game object may include: the determination module 610, the first positional relationship module 620, the second positional relationship module 630, and the corrected positional relationship module 640.
Wherein:
a determining module 610 configured to determine a game object and a mask present in a current game scene, the mask being used to occlude the game object; a first positional relationship module 620 configured to determine a first positional relationship between the game object and the mask based on the positional coordinates of the game object and the mask, respectively, in the current game scene; a second positional relationship module 630 configured to determine, for each of the masks, a second positional relationship between a target game object having a coincidence relationship with the mask and a mask region corresponding to the mask; the corrected position relation module 640 is configured to correct the first position relation based on the second position relation to obtain a target position relation, and display the game object in the current game scene according to the target position relation.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the first positional relationship module 620 includes: a position coordinate module configured to determine a first position coordinate of the game object in the current game scene, and a second position coordinate of the mask in the current game scene; the first position coordinate and the second position coordinate are coordinates corresponding to the same coordinate axis; and the position ordering module is configured to order the positions of the game object and the mask according to the first position coordinates and the second position coordinates to obtain a first position relation between the game object and the mask.
In one exemplary embodiment of the present disclosure, based on the foregoing, the second positional relationship module 630 includes: the coincidence relation module is configured to determine target game objects with coincidence relation with each shade respectively in the game objects; a mask region determining module configured to determine a mask region to which each mask corresponds, respectively; and the second position relation determining module is configured to determine that the target game object and the shade have a second position relation if the object position corresponding to the target game object is located in the shade area.
In an exemplary embodiment of the present disclosure, based on the foregoing solution, the coincidence relation module includes: a determining bounding box module configured to determine object bounding boxes corresponding to game objects, and determine mask bounding boxes corresponding to each mask respectively; and a coincidence relation determining module configured to determine the game object as a target game object having a coincidence relation with the mask if there is coincidence between the object bounding box and the mask bounding box.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the correction position relationship module includes: the first correction first position relation module is configured to correct the first position relation between the target game object and the mask based on the second position relation to obtain the target position relation if the second position relation between the target game object and the mask is inconsistent with the first position relation between the target game object and the mask.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the correction position relationship module includes: the target mask determining module is configured to determine a target mask according to the position coordinates corresponding to the plurality of masks if a coincidence relation exists between one game object and the plurality of masks and a second position relation between one game object and the plurality of masks is inconsistent with a first position relation between one game object and the plurality of masks; the second correction first position relation module is configured to correct the first position relation between the target shade and the game object based on the second position relation between the target shade and the game object to obtain the target position relation.
In an exemplary embodiment of the present disclosure, based on the foregoing aspect, the display device of a game object further includes: a hiding module configured to hide the special mask in the current game scene if the special mask exists in the mask; there is no coincidence relation between the special mask and any game object.
The specific details of the game object display device 600 are described in detail in the corresponding game object display method, and thus are not described here.
It should be noted that although several modules or units of the display apparatus 600 of game objects are mentioned in the above detailed description, such division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
An electronic device 700 according to such an embodiment of the invention is described below with reference to fig. 7. The electronic device 700 shown in fig. 7 is merely an example, and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in fig. 7, the electronic device 700 is embodied in the form of a general purpose computing device. Components of electronic device 700 may include, but are not limited to: the at least one processing unit 710, the at least one storage unit 720, a bus 730 connecting the different system components (including the storage unit 720 and the processing unit 710), and a display unit 740.
Wherein the storage unit stores program code that is executable by the processing unit 710 such that the processing unit 710 performs steps according to various exemplary embodiments of the present invention described in the above-mentioned "exemplary methods" section of the present specification.
The memory unit 720 may include readable media in the form of volatile memory units, such as Random Access Memory (RAM) 721 and/or cache memory 722, and may further include Read Only Memory (ROM) 723.
The storage unit 720 may also include a program/usage tool 724 having a set (at least one) of program modules 725, such program modules 725 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which may include the reality of a network environment, or some combination thereof.
Bus 730 may be a bus representing one or more of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 700 may also communicate with one or more external devices 770 (e.g., keyboard, pointing device, bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 700, and/or any device (e.g., router, modem, etc.) that enables the electronic device 700 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 750. Also, electronic device 700 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through network adapter 760. As shown, network adapter 760 communicates with other modules of electronic device 700 over bus 730. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 700, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processor in the electronic device may implement the following operations in the virtual background generation method by executing machine executable instructions:
determining a game object and a shade existing in the current game scene, wherein the shade is used for shielding the game object; determining a first position relation between the game object and the mask according to the position coordinates of the game object and the mask in the current game scene respectively; for each shade, determining a second position relation between a target game object with a coincidence relation with the shade and a shade region corresponding to the shade; and correcting the first position relation based on the second position relation to obtain a target position relation, and displaying the game object in the current game scene according to the target position relation.
Determining a first position coordinate of a game object in a current game scene, and determining a second position coordinate of a mask in the current game scene; the first position coordinate and the second position coordinate are coordinates corresponding to the same coordinate axis; and according to the first position coordinates and the second position coordinates, carrying out position sequencing on the game object and the shade to obtain a first position relation between the game object and the shade.
Determining target game objects with coincidence relation with each shade in the game objects; determining a mask region corresponding to each mask respectively; and if the object position corresponding to the target game object is positioned in the shade area, determining that the target game object and the shade have a second position relation.
Determining object bounding boxes corresponding to game objects, and determining mask bounding boxes corresponding to each mask respectively; if there is a coincidence between the object bounding box and the mask bounding box, the game object is determined to be a target game object that has a coincidence relationship with the mask.
And if the second position relation between the target game object and the shade is inconsistent with the first position relation between the target game object and the shade, correcting the first position relation between the target game object and the shade based on the second position relation to obtain the target position relation.
If a coincidence relation exists between one game object and a plurality of masks, and a second position relation between one game object and a plurality of masks is inconsistent with a first position relation between one game object and a plurality of masks, a target mask is truly obtained according to position coordinates corresponding to the plurality of masks; and correcting the first position relation between the target shade and the game object based on the second position relation between the target shade and the game object to obtain the target position relation.
If the special shade exists in the shade, hiding the special shade in the current game scene; there is no coincidence relation between the special mask and any game object.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, and includes several instructions to cause a computing device (may be a personal computer, a server, a terminal device, or a network device, etc.) to perform the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, a computer-readable storage medium having stored thereon a program product capable of implementing the method described above in the present specification is also provided. In some possible embodiments, the various aspects of the invention may also be implemented in the form of a program product comprising program code for causing a terminal device to carry out the steps according to the various exemplary embodiments of the invention as described in the "exemplary methods" section of this specification, when said program product is run on the terminal device.
Referring to fig. 8, a program product 800 for implementing the above-described method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable 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), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable signal medium may include a data signal propagated in baseband or as part of a carrier wave with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (10)

1. A method of displaying a game object, the method comprising:
determining a game object and a mask existing in a current game scene, wherein the mask is used for shielding the game object;
determining a first position relation between the game object and the mask according to the position coordinates of the game object and the mask in the current game scene respectively;
for each shade, determining a second position relation between a target game object with a coincidence relation with the shade and a shade region corresponding to the shade;
and correcting the first position relation based on the second position relation to obtain a target position relation, and displaying the game object in the current game scene according to the target position relation.
2. The method of claim 1, wherein determining a first positional relationship between the game object and the mask based on the position coordinates of the game object and the mask, respectively, in the current game scene comprises:
determining a first position coordinate of the game object in the current game scene, and determining a second position coordinate of the mask in the current game scene; the first position coordinate and the second position coordinate are coordinates corresponding to the same coordinate axis;
and according to the first position coordinates and the second position coordinates, carrying out position sequencing on the game object and the shade to obtain a first position relation between the game object and the shade.
3. The method according to claim 1, wherein the determining, for each of the masks, a second positional relationship between a target game object having a coincidence relation with the mask and a mask region corresponding to the mask, includes:
determining target game objects which have coincidence relation with each shade respectively in the game objects;
determining a mask area corresponding to each mask respectively;
And if the object position corresponding to the target game object is positioned in the shade area, determining that a second position relationship is provided between the target game object and the shade.
4. A method according to claim 3, wherein said determining a target game object having a coincidence relation with each of said masks, respectively, among said game objects, comprises:
determining object bounding boxes corresponding to the game objects, and determining mask bounding boxes corresponding to each mask respectively;
and if the object bounding box and the mask bounding box are overlapped, determining the game object as a target game object which is overlapped with the mask.
5. The method of claim 1, wherein the correcting the first positional relationship based on the second positional relationship to obtain a target positional relationship comprises:
and if the second position relation between the target game object and the shade is inconsistent with the first position relation between the target game object and the shade, correcting the first position relation between the target game object and the shade based on the second position relation to obtain a target position relation.
6. The method of claim 5, wherein the method further comprises:
if a coincidence relation exists between one game object and a plurality of masks, and the second position relation between one game object and a plurality of masks is inconsistent with the first position relation between one game object and a plurality of masks, a target mask is truly obtained according to the position coordinates corresponding to a plurality of masks;
correcting the first positional relationship between the target mask and one of the game objects based on the second positional relationship between the target mask and one of the game objects to obtain a target positional relationship.
7. The method according to claim 1, wherein the method further comprises:
if a special mask exists in the masks, hiding the special mask in the current game scene; there is no coincidence relation between the special mask and any one of the game objects.
8. A display device for a game object, the device comprising:
a determining module configured to determine a game object and a mask present in a current game scene, the mask for occluding the game object;
A first positional relationship module configured to determine a first positional relationship between the game object and the mask according to positional coordinates of the game object and the mask, respectively, in the current game scene;
a second positional relationship module configured to determine, for each of the masks, a second positional relationship between a target game object having a coincidence relationship with the mask and a mask region corresponding to the mask;
and the corrected position relation module is configured to correct the first position relation based on the second position relation to obtain a target position relation, and display the game object in the current game scene according to the target position relation.
9. An electronic device, comprising:
a processor;
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the method of displaying a game object of any of claims 1-7 via execution of the executable instructions.
10. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the method of displaying a game object according to any one of claims 1-7.
CN202311644558.9A 2023-11-30 2023-11-30 Game object display method and device, storage medium and electronic equipment Pending CN117462946A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311644558.9A CN117462946A (en) 2023-11-30 2023-11-30 Game object display method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311644558.9A CN117462946A (en) 2023-11-30 2023-11-30 Game object display method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN117462946A true CN117462946A (en) 2024-01-30

Family

ID=89631369

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311644558.9A Pending CN117462946A (en) 2023-11-30 2023-11-30 Game object display method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN117462946A (en)

Similar Documents

Publication Publication Date Title
CN109271893B (en) Method, device, equipment and storage medium for generating simulation point cloud data
CN111815755A (en) Method and device for determining shielded area of virtual object and terminal equipment
CN107977141B (en) Interaction control method and device, electronic equipment and storage medium
CN109448137B (en) Interaction method, interaction device, electronic equipment and storage medium
CN107204023B (en) Method and apparatus for avoiding distortion of graphics drawn in canvas
CN108553894B (en) Display control method and device, electronic equipment and storage medium
US7952574B2 (en) Apparatus and method for a frustum culling algorithm suitable for hardware implementation
CN110555900B (en) Rendering instruction processing method and device, storage medium and electronic equipment
CN113010945A (en) BIM model linkage method and system
US20220392101A1 (en) Training method, method of detecting target image, electronic device and medium
CN110782504A (en) Curve determination method, device, computer readable storage medium and equipment
CN113657396A (en) Training method, translation display method, device, electronic equipment and storage medium
CN110992453B (en) Scene object display method and device, electronic equipment and storage medium
CN113205090A (en) Picture rectification method and device, electronic equipment and computer readable storage medium
CN111008934B (en) Scene construction method, device, equipment and storage medium
CN117462946A (en) Game object display method and device, storage medium and electronic equipment
CN115994971A (en) Image rendering time calculation method and device, storage medium and electronic equipment
CN116109792A (en) Method and device for determining model penetration surface, storage medium and electronic equipment
CN114693780A (en) Image processing method, device, equipment, storage medium and program product
CN115794980A (en) Data display method, equipment, device and medium
CN111054072B (en) Method, device, equipment and storage medium for role model tailing
CN114564268A (en) Equipment management method and device, electronic equipment and storage medium
CN109840609B (en) Goods picking point data verification method and device, storage medium and electronic equipment
CN112465692A (en) Image processing method, device, equipment and storage medium
CN111127607A (en) Animation generation method, device, equipment and 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