Game unit deformation and determination method, device and readable storage medium
By obtaining the volume model of the game unit and the scaling parameters of the collision area in the tower defense game, determining the target volume model and its coordinate position, and determining whether the ground trap is triggered, the problem of inconsistent visual effects of the game unit and the actual model is solved, and the game effect is improved.
Patent Information
- Application Number
- CN202210358757.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-06
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2042-04-06
AI Technical Summary
In tower defense games, the visual effects of the game units are inconsistent with the actual model, resulting in a reduced game effect.
When the game unit enters the collision area, it obtains the scaling parameters of its volume model and collision area, determines the target volume model and its coordinate position, and judges whether the ground trap is triggered based on the relationship between the coordinate position and the ground trap area, thereby realizing the deformation and judgment of the game unit.
By corresponding to the collision animation of the collision body with the collision effect and performing trigger operations on the collision body after the collision, the problem of inconsistent visual effects and actual models is solved, and the game effect is improved.
Smart Images

Figure CN114917588B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for determining the deformation and determination of a game unit, and a readable storage medium. Background Art
[0002] In trap tower defense games, players set up various traps to eliminate "monsters", thereby preventing the players' protected objects from being destroyed by "monsters".
[0003] In order to increase the strategy of the game, tower defense games developed based on the realistic physics engine (Unity3D) will have game units. For the game units, players need to set traps that can attack the game units to eliminate monsters.
[0004] However, limited by the logic rules of the engine, the attacks of traditional trap-type tower defense games on game units are only visual effects, and do not actually deform the corresponding models of the game units. The visual effects are inconsistent with the actual models, thus reducing the game effect.
[0005] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention
[0006] The main purpose of the present invention is to provide a deformation and determination method of a game unit, aiming to solve the problem of inconsistency between visual effects and actual models in tower defense games.
[0007] To achieve the above-mentioned purpose, the present invention provides a deformation and determination method of a game unit, and the deformation and determination method of a game unit comprises:
[0008] When a game unit enters a collision area, a volume model of the game unit and a scaling parameter corresponding to the collision area are obtained;
[0009] determining a target volume model for the game unit based on the volume model and the scaling parameter;
[0010] Determining the coordinate position of the target volume model in a local coordinate system associated with the collision area;
[0011] Whether to trigger the ground trap is determined according to the positional relationship between the coordinate position and the ground trap area.
[0012] Optionally, before the step of obtaining the volume model of the game unit and the scaling parameter corresponding to the collision area when the game unit enters the collision area, the method further includes:
[0013] Based on the preset detection frequency, the relative position relationship between the game unit collision grid and the collision area collision grid is obtained regularly;
[0014] When the collision area collision grid intersects with the game unit collision grid, it is determined that the game unit enters a preset collision area.
[0015] Optionally, the step of determining the target volume model of the game unit according to the volume model and the scaling parameter comprises:
[0016] Acquire the initial coordinates of the volume model based on the global coordinate system associated with the game map, and determine the deformation coefficient of the initial coordinates according to the scaling parameter;
[0017] Determining target coordinates according to the initial coordinates and the deformation coefficient;
[0018] A target volume model of the game unit is determined according to the target coordinates.
[0019] Optionally, the deformation coefficient includes at least one of an X-axis deformation coefficient, a Y-axis deformation coefficient, and a Z-axis deformation coefficient, and the step of determining the target coordinates according to the initial coordinates and the deformation coefficient includes at least one of the following:
[0020] Determine the X-axis coordinate corresponding to the target coordinate according to the X-axis deformation coefficient and the X-axis coordinate corresponding to the initial coordinate;
[0021] Determine the Y-axis coordinate corresponding to the target coordinate according to the Y-axis deformation coefficient and the Y-axis coordinate corresponding to the initial coordinate;
[0022] The Z-axis coordinate corresponding to the target coordinate is determined according to the Z-axis deformation coefficient and the Z-axis coordinate corresponding to the initial coordinate.
[0023] Optionally, the step of determining whether to trigger a trap according to the positional relationship between the coordinate position and the collision area includes:
[0024] Acquire the local coordinate system;
[0025] Determine, according to the local coordinate system, an X-axis coordinate, a Y-axis coordinate and / or a Z-axis coordinate of the target volume model in the local coordinate system;
[0026] When at least one of the X-axis coordinate, the Y-axis coordinate, and the Z-axis coordinate is located within the ground area, the trap is triggered; otherwise, the trap is not triggered.
[0027] Optionally, after the step of determining whether to trigger a trap according to the positional relationship between the coordinate position and the area of the collision area, the method further includes:
[0028] triggering a collision instruction associated with the ground trap;
[0029] The coordinates and / or volume model of the game unit are changed according to the collision instruction to show the user the collision effect of the game unit being deformed in the collision area.
[0030] Optionally, after the step of changing the coordinates and / or volume model of the game unit according to the collision instruction, the step further includes:
[0031] Obtaining the triggering time of the collision effect;
[0032] When the trigger time is greater than or equal to a preset time threshold, the coordinates and / or volume model of the game unit are reset to the coordinates and / or volume model of the game unit before the collision effect is generated.
[0033] Optionally, after the step of changing the coordinates and / or volume model of the game unit according to the collision instruction, the step further includes:
[0034] The attribute parameters associated with the game unit are set to null, and the memory space occupied by the game unit is cleared, so that the game unit disappears from the map after being destroyed by the trap in the game.
[0035] In addition, to achieve the above-mentioned purpose, the present invention further provides a deformation and determination device for a game unit, the deformation and determination device for a game unit comprising:
[0036] An air trap triggering module, used to obtain the volume model of the game unit and the scaling parameters corresponding to the collision area;
[0037] A model transformation module, for determining a target volume model of the game unit according to the volume model and the scaling parameter, and for determining coordinates of the target volume model;
[0038] A ground trap triggering module triggers a collision instruction associated with the ground trap.
[0039] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, on which a deformation and judgment program of a game unit is stored. When the deformation and judgment program of the game unit is executed by a processor, the steps of the deformation and judgment method of the game unit as described in any of the above items are implemented.
[0040] The embodiment of the present invention provides a deformation and determination method and device for a game unit, and a computer-readable storage medium. The method includes: when a game unit enters a collision area, obtaining a volume model of the game unit and a scaling parameter corresponding to the collision area; determining a target volume model of the game unit according to the volume model and the scaling parameter; determining the coordinate position of the target volume model in a local coordinate system associated with the collision area; and determining whether to trigger a ground trap according to the positional relationship between the coordinate position and the ground trap area. By making the collision animation of the collision body correspond to the collision effect, and further performing a trigger operation on the collision body after the collision, the problem of inconsistency between the visual effect and the actual model in the tower defense game is solved, and the game effect is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 A schematic diagram of the hardware architecture of a deformation and determination device for a game unit according to an embodiment of the present invention;
[0042] Figure 2 It is a flowchart of a first embodiment of a method for deformation and determination of a game unit of the present invention;
[0043] Figure 3 It is a flowchart of a second embodiment of the method for deformation and determination of a game unit of the present invention;
[0044] Figure 4 It is a detailed flow chart of step S20 in the third embodiment of the method for deformation and determination of a game unit of the present invention;
[0045] Figure 5 is a flow chart of a fourth embodiment of a method for deformation and determination of a game unit according to the present invention;
[0046] Figure 6 is a flowchart of a fifth embodiment of a method for deformation and determination of a game unit according to the present invention;
[0047] Figure 7 It is a schematic diagram of the structure of the deformation and determination device of the game unit of the present invention.
[0048] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0049] It should be understood that the exemplary embodiments of the present invention are shown in the accompanying drawings of the present invention, and the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.
[0050] As an implementation scheme, the deformation and determination device of the game unit can be as follows: Figure 1 shown.
[0051] The embodiment of the present invention relates to a deformation and determination device for a game unit, which includes: a processor 101, such as a CPU, a memory 102, and a communication bus 103. The communication bus 103 is used to realize connection and communication between these components.
[0052] The memory 102 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. Figure 1 As shown, the memory 102 as a computer-readable storage medium may include a game unit deformation and determination program; and the processor 101 may be used to call the game unit deformation and determination program stored in the memory 102, and perform the following operations:
[0053] When a game unit enters a collision area, a volume model of the game unit and a scaling parameter corresponding to the collision area are obtained;
[0054] determining a target volume model for the game unit based on the volume model and the scaling parameter;
[0055] Determining the coordinate position of the target volume model in a local coordinate system associated with the collision area;
[0056] Whether to trigger the ground trap is determined according to the positional relationship between the coordinate position and the ground trap area.
[0057] In one embodiment, the processor 101 may be used to call the deformation and determination program of the game unit stored in the memory 102, and perform the following operations:
[0058] Based on the preset detection frequency, the relative position relationship between the game unit collision grid and the collision area collision grid is obtained regularly;
[0059] When the collision area collision grid intersects with the game unit collision grid, it is determined that the game unit enters a preset collision area.
[0060] In one embodiment, the processor 101 may be used to call the deformation and determination program of the game unit stored in the memory 102, and perform the following operations:
[0061] Acquire the initial coordinates of the volume model based on the global coordinate system associated with the game map, and determine the deformation coefficient of the initial coordinates according to the scaling parameter;
[0062] Determine the X-axis coordinate corresponding to the target coordinate according to the X-axis deformation coefficient and the X-axis coordinate corresponding to the initial coordinate;
[0063] Determine the Y-axis coordinate corresponding to the target coordinate according to the Y-axis deformation coefficient and the Y-axis coordinate corresponding to the initial coordinate;
[0064] Determine the Z-axis coordinate corresponding to the target coordinate according to the Z-axis deformation coefficient and the Z-axis coordinate corresponding to the initial coordinate;
[0065] A target volume model of the game unit is determined according to the target coordinates.
[0066] In one embodiment, the processor 101 may be used to call the deformation and determination program of the game unit stored in the memory 102, and perform the following operations:
[0067] triggering a collision instruction associated with the ground trap;
[0068] The coordinates and / or volume model of the game unit are changed according to the collision instruction to show the user the collision effect of the game unit being deformed in the collision area.
[0069] After the step of changing the coordinates and / or volume model of the game unit according to the collision instruction, the method further includes:
[0070] Obtaining the triggering time of the collision effect;
[0071] When the trigger time is greater than or equal to a preset time threshold, the coordinates and / or volume model of the game unit are reset to the coordinates and / or volume model of the game unit before the collision effect is generated.
[0072] After the step of changing the coordinates and / or volume model of the game unit according to the collision instruction, the method further includes:
[0073] The attribute parameters associated with the game unit are set to null, and the memory space occupied by the game unit is cleared, so that the game unit disappears from the map after being destroyed by the trap in the game.
[0074] Based on the hardware architecture of the above-mentioned computer-based game unit deformation and determination device, an embodiment of the game unit deformation and determination method of the present invention is proposed.
[0075] In tower defense games, monsters will move to a target location at a certain moving speed and moving trajectory. When the monster moves to the target location, the game system will determine that the player is injured by the monster and trigger the corresponding penalty rules (such as reducing the player's life value according to the corresponding injury value of the game unit, and when the life value is 0, the player's game will be determined to fail). Players need to place traps to attack monsters during the movement of the monster to prevent the movement of the monster. However, in traditional 3D trap-type tower defense games, monsters flying in the air cannot trigger ground traps, that is, they are not injured from the ground. For monsters flying in the air, damage can only be caused to the flying monsters by air traps. In order to ensure the strategy and fun of the game, game developers hope that the air monsters can be attacked from the ground while being injured in the air, that is, create a trap that can simultaneously generate air attacks and ground attacks on monsters. When developers design this trap, the difficulty is how to make the air unit trigger the determination of the ground area while triggering the determination of the air area. Therefore, the present invention proposes a deformation and determination method of a game unit, which can make the flying monsters be attacked from the air and the ground at the same time.
[0076] Reference Figure 2 In the first embodiment, the deformation and determination method of the game unit includes the following steps:
[0077] Step S10, when a game unit enters a collision area, obtaining a volume model of the game unit and a scaling parameter corresponding to the collision area;
[0078] In this embodiment, the game unit is preset with a certain moving speed and moving trajectory. The player needs to set a trap during the flight of the game unit. When the game unit enters the preset collision area in the trap, the trap obtains the volume model of the game unit and the scaling parameters of the collision area. The volume model is an inherent attribute of the model when the developer performs 3D modeling on the monster, and the scaling parameter is a parameter preset in the collision area of the trap in this embodiment for proportionally reducing the volume model of the monster. When it is determined that the game unit enters the collision area, the volume model of the game unit and the scaling parameters corresponding to the collision area are immediately obtained.
[0079] Step S20, determining a target volume model of the game unit according to the volume model and the scaling parameter;
[0080] In this embodiment, after the volume model and scaling parameters are obtained, the volume model of the game unit is scaled in proportion according to the scaling parameters in the trap to obtain the target volume model. In traditional tower defense games, when a judgment effect is triggered, a set animation is often called to show the player the trigger effect of the target unit without actually changing the parameters of the target unit. The defect of this is that if the animation effect is only triggered without actually changing the parameters of the target unit, the "attacked" effect of the unit cannot be truly realized, and further judgment cannot be performed based on the hit effect of the unit.
[0081] Exemplarily, the trap may be a sledgehammer that swings up and down. When the game unit flies into the trap and contacts the sledgehammer, i.e., is visually hit by the sledgehammer, the model of the game unit is scaled accordingly according to the scaling parameters preset in the sledgehammer trap. For example, if the developer wishes to create an effect in which the monster is "smashed flat", the game unit is scaled on the Z axis to obtain a target volume model after the game unit is deformed, thereby creating the effect that the monster is "smashed flat" by the sledgehammer.
[0082] Step S30, determining the coordinate position of the target volume model in the local coordinate system associated with the collision area;
[0083] Step S40: determining whether to trigger the ground trap according to the positional relationship between the coordinate position and the ground trap area.
[0084] In this embodiment, after obtaining the target volume model of the game unit to produce deformation, the game has shown the user the effect of the monster being "smashed flat" by a sledgehammer. We hope to further judge the monster based on the deformation of the monster volume, trigger the operation with the changed collision volume, and use the target volume model obtained after the game unit is deformed as the trigger condition for triggering the ground trap in the trap area. In this embodiment, we further judge the monster by determining the positional relationship between the coordinates of the target volume model and the ground trap area of the collision area. First, a coordinate system is constructed based on the trap area as a local coordinate system. The position of the target volume model after the game unit is deformed relative to the area is determined according to the local coordinate system. When the coordinates of the target volume model are located in the trap triggering area in the local coordinate system, it is determined that the game unit triggers the ground trap.
[0085] For example, the upper side of the trap is a sledgehammer that swings up and down, and the lower side is spikes. After the flying monster is hit by the sledgehammer, it is smashed to the ground by the sledgehammer and further attacked by the spikes. In this process, the monster is deformed after being hit by the sledgehammer, and a "smashed" deformation animation occurs, and the actual monster model is also scaled proportionally according to the scaling parameters of the sledgehammer; after scaling, the relative position of the scaled target volume model in the area is determined based on the local coordinate system established by the trap. When the coordinates of the monster's target volume model are located in the trap triggering area in the local coordinate system, the ground spike trap is triggered to cause the monster to be attacked by the ground spikes.
[0086] In the technical solution provided in this embodiment, a scaling parameter is set in the trap. When a game unit enters the collision area of the trap, the volume model of the game unit is obtained, and the volume model of the game unit is scaled based on the scaling parameter to obtain a target volume model. The coordinate position of the target volume model based on the local coordinate system constructed by the trap is then determined. According to the positional relationship between the coordinate position and the ground trap area, it is determined whether to trigger the ground trap. By matching the collision animation of the collision body with the collision effect, and further triggering the collision body after the collision, the collision unit can receive damage from the ground while maintaining the characteristics of flying in the air, thereby improving the game effect.
[0087] Reference Figure 3 In the second embodiment, based on the first embodiment, before step S10, the following steps are further included:
[0088] Step S50, based on a preset detection frequency, regularly obtaining the relative position relationship between the game unit collision grid and the collision area collision grid;
[0089] Step S60: When the collision area collision grid intersects with the game unit collision grid, it is determined that the game unit enters a preset collision area.
[0090] Optionally, this embodiment provides a method for determining whether a game unit enters a collision area. Before the game unit enters the collision area, based on the refresh rate (0.2S) of the Unity3D engine, the relative position relationship between the collision mesh of the game unit and the collision mesh of the collision area is obtained at a regular interval. The collision mesh is also called a mesh collider. It uses a mesh resource (MeshAsset) and constructs its primitive collider (Collider) based on the mesh. It is a collision detection method with high detection accuracy. The mesh collider constructs its collision representation by attaching it to the mesh of the game object, and reads the attributes of the attached transformation to set its position and scale it correctly.
[0091] It is important to emphasize that there are some limitations when using Mesh Colliders. Generally two Mesh Colliders cannot collide with each other. All Mesh Colliders can collide with any primitive Collider. If a Mesh is marked as Convex, it can collide with other Mesh Colliders. Colliders are used in conjunction with Rigidbodies to make physics in Unity come alive. Rigidbodies allow objects to be controlled by physics, while Colliders allow objects to collide with each other. Colliders must be added to objects independently of Rigidbodies. Colliders do not necessarily need Rigidbodies attached, but they must be attached in order for objects to move due to collision. When a collision occurs between two Colliders and if at least one of them has a Rigidbody attached, three collision messages are sent out to the objects attached to them. These events can be handled in scripts to create unique behaviors with or without NVIDIA's built-in PhysX engine.
[0092] In the technical solution provided in this embodiment, a collision grid (ie, a network collision body) is used to perform collision determination between game units and traps, thereby improving the gaming effect.
[0093] Reference Figure 4 In a third embodiment, based on any one of the embodiments, step S20 includes:
[0094] Step S21, acquiring the initial coordinates of the volume model based on the global coordinate system associated with the game map, and determining the deformation coefficient of the initial coordinates according to the scaling parameter;
[0095] Step S22, determining the target coordinates according to the initial coordinates and the deformation coefficient;
[0096] Step S23, determining a target volume model of the game unit according to the target coordinates;
[0097] The step S22 comprises:
[0098] Step S221, determining the X-axis coordinate corresponding to the target coordinate according to the X-axis deformation coefficient and the X-axis coordinate corresponding to the initial coordinate;
[0099] Step S222, determining the Y-axis coordinate corresponding to the target coordinate according to the Y-axis deformation coefficient and the Y-axis coordinate corresponding to the initial coordinate;
[0100] Step S223, determining the Z-axis coordinate corresponding to the target coordinate according to the Z-axis deformation coefficient and the Z-axis coordinate corresponding to the initial coordinate.
[0101] Optionally, this embodiment provides a method for determining a target volume model. In this embodiment, the initial coordinates of the game unit are first determined. The initial coordinates are obtained based on the global coordinate system of the entire game interface and are used to determine the relative position of the game unit in the entire game map; then the deformation coefficient of the initial coordinates is determined according to the scaling parameter. For example, the coordinates of the game unit in the global coordinate system are (x, y, z). After entering the trap, assuming that the scaling parameter of the trap is reduced by 1 / 2 on the Z axis, the target coordinates of the game unit are determined to be (x, y, 0.5z). Of course, the scaling parameter is not only a parameter on a certain axis, but can be set according to the actual needs of the developer. For example, a trap that collides from the left and right sides can attack the monster from the Y axis or the X axis, producing the effect of "slimming" the monster, and the corresponding scaling parameter is Y axis / X axis reduced by 1 / 2.
[0102] Furthermore, in order to improve the game effect, the effect animation of each trap on the monster can be different. Based on the change in the monster's coordinates, the target model of the monster corresponding to the change is called. For example, if the monster is attacked from above and the Z-axis coordinate is shortened by 1 / 4, the corresponding target model will be proportionally reduced by 1 / 4 on the original basis.
[0103] Optionally, in order to improve the game effect, the process of transforming the monster's coordinates to 1 / 4 can be a gradual process. After determining that the Z-axis coordinate of the monster model is transformed from z to 0.25z, in order to ensure the game effect, z is not directly changed to 0.25z by jumping, but a gradual change process is achieved according to a preset time and a preset jump frequency.
[0104] In the technical solution provided in this embodiment, the initial coordinates of the volume model are obtained through the global coordinate system associated with the game map, and the deformation coefficient of the initial coordinates is determined according to the scaling parameter, and then the target coordinates are determined according to the initial coordinates and the deformation coefficient, and finally the target volume model of the game unit is determined according to the target coordinates. While producing the effect of the monster being "squashed", the model parameters of the monster are actually changed, thereby improving the game effect.
[0105] Reference Figure 5 In a fourth embodiment, based on any embodiment, after step S40, the method further includes:
[0106] Step S70, triggering a collision instruction associated with the ground trap;
[0107] Step S80, changing the coordinates and / or volume model of the game unit according to the collision instruction;
[0108] Step S90, obtaining the triggering time of the collision effect;
[0109] Step S100, when the trigger time is greater than or equal to a preset time threshold, the coordinates and / or volume model of the game unit are reset to the coordinates and / or volume model of the game unit before the collision effect is generated.
[0110] Optionally, after determining that the game unit triggers a ground trap, in order to show the deformation effect to the user, the collision instruction associated with the ground trap is triggered and the coordinates and / or volume model of the game unit is changed according to the collision instruction, thereby showing the user the deformation collision effect caused by the monster being attacked by the trap.
[0111] For example, the collision trap is a sledgehammer that launches a "flattening" attack on the monster from above. When the monster is attacked by the sledgehammer trap and produces a "flattening" effect, the monster model is compressed from the Z axis according to a certain number of frames, and the visual animation effect displayed in the game is the process of the monster being gradually "flattened". In order to achieve this effect, the z-axis coordinate of the monster needs to be gradually reduced, such as reducing it by 0.05z per frame, so that after 15 frames, the length of 0.75z can be reduced to reach the target coordinate of 0.25z. The corresponding animation can also be updated once per frame, so that while producing the effect of the monster being "flattened", the model parameters of the monster are actually changed, thereby improving the game effect.
[0112] Furthermore, when a game unit enters the collision area, it does not trigger the attack judgment of the trap only once. From the moment the game unit enters the trap and triggers the collision command, the trap will continuously judge the game unit's attack at a preset frequency. During this process, the monster always maintains the "squashed" deformation effect, that is, the coordinates and / or volume model of the game unit maintain a certain deformation amount; when the monster leaves the trap, the monster is no longer attacked by the trap, and it no longer maintains the "squashed" state, and returns to the coordinates and / or volume model before the collision effect occurs. Optionally, since the speed attribute of the game unit is usually a constant, the trap triggering time from the game unit entering to leaving is also an easily determined parameter. By setting a time threshold, when the trap triggering time is greater than the time threshold, it is judged that the monster has left the area where the trap is located.
[0113] In the technical solution provided in this embodiment, the monster's coordinates and / or volume model are actually changed to show the user the animation effect of deformation after being damaged. When the trigger time is greater than or equal to the preset time threshold, the monster is judged to have left the trap area, and the monster's coordinates and / or volume model are reset, thereby improving the game effect.
[0114] Reference Figure 6 In a fifth embodiment, based on any embodiment, after step S80, the method further includes:
[0115] Step S110, clearing the attribute parameters associated with the game unit and clearing the memory space occupied by the game unit, so that the game unit disappears from the map after being destroyed by a trap in the game.
[0116] Optionally, the monster may be "defeated" by a trap. When the monster is judged not to be defeated by a trap, it means that the monster has been defeated by the player in the tower defense game. At this time, the monster's "mission" has been completed. Since each monster occupies a certain amount of running memory space, the attribute parameters associated with the monster need to be set to empty to clear the memory space occupied by it, so that the monster disappears. In the subsequent game process, the system will refresh new monsters, and players need to defeat monsters based on existing traps or add new traps.
[0117] In the technical solution provided in this embodiment, the attribute parameters of the monster are set to null after the game unit is defeated by the player, so that the game unit disappears from the map after being destroyed by a trap, thereby improving the game effect.
[0118] In addition, refer to Figure 7 This embodiment further provides a deformation and determination device for a game unit, and the deformation and determination device for a game unit includes:
[0119] The air trap triggering module 100 is used to obtain the volume model of the game unit and the scaling parameters corresponding to the collision area;
[0120] A model transformation module 200, for determining a target volume model of the game unit according to the volume model and the scaling parameter, and for determining coordinates of the target volume model;
[0121] The ground trap triggering module 300 triggers a collision instruction associated with the ground trap.
[0122] In addition, the present invention also provides a deformation and judgment device for a game unit, the deformation and judgment device for a game unit comprising: a memory, a processor, and a deformation and judgment program for a game unit stored in the memory and executable on the processor, the deformation and judgment program for a game unit, when executed by the processor, implements each step of the deformation and judgment method for a game unit as described in any one of the above items.
[0123] In addition, the present invention also provides a computer-readable storage medium, which stores a deformation and determination program of a game unit. When the deformation and determination program of the game unit is executed by a processor, the various steps of the deformation and determination method of the game unit described in the above embodiment are implemented.
[0124] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0125] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a computer-readable storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, etc.) to execute the methods described in each embodiment of the present invention.
[0126] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for deformation and determination of a game unit, characterized in that: The steps of the deformation and determination method of the game unit include: Based on the preset detection frequency, the relative position relationship between the game unit collision body and the collision area collision body is obtained regularly; When the collision area collision body intersects with the game unit collision body, determining that the game unit enters a preset collision area; When a game unit enters a collision area, a 3D volume model of the game unit and scaling parameters of the collision area corresponding to the X, Y and Z axes are obtained; Acquire the initial coordinates of the volume model based on the global coordinate system associated with the game map, and determine the deformation coefficient of the initial coordinates according to the scaling parameter; Determining target coordinates according to the initial coordinates and the deformation coefficient; Determining, according to the target coordinates, a target volume model of the game unit deformed based on the scaling parameter; Constructing a coordinate system based on the ground traps in the collision area to generate a local coordinate system; According to the local coordinate system, determining the X-axis coordinate, Y-axis coordinate and Z-axis coordinate of the target volume model in the local coordinate system; When at least one of the X-axis coordinate, the Y-axis coordinate, and the Z-axis coordinate is located within the ground area of the collision area, the ground trap is triggered.
2. The method for deformation and determination of a game unit according to claim 1, characterized in that: The deformation coefficient includes at least one of an X-axis deformation coefficient, a Y-axis deformation coefficient, and a Z-axis deformation coefficient. The step of determining the target coordinates according to the initial coordinates and the deformation coefficient includes at least one of the following: Determine the X-axis coordinate corresponding to the target coordinate according to the X-axis deformation coefficient and the X-axis coordinate corresponding to the initial coordinate; Determine the Y-axis coordinate corresponding to the target coordinate according to the Y-axis deformation coefficient and the Y-axis coordinate corresponding to the initial coordinate; The Z-axis coordinate corresponding to the target coordinate is determined according to the Z-axis deformation coefficient and the Z-axis coordinate corresponding to the initial coordinate.
3. The method for deformation and determination of a game unit according to claim 1, wherein: After the step of triggering the ground trap when at least one of the X-axis coordinate, the Y-axis coordinate and the Z-axis coordinate is located within the ground area of the collision area, the step further includes: triggering a collision instruction associated with the ground trap; The coordinates and / or volume model of the game unit are changed according to the collision instruction to show the user the collision effect of the game unit being deformed in the collision area.
4. The method for deformation and determination of a game unit according to claim 3, characterized in that: After the step of changing the coordinates and / or volume model of the game unit according to the collision instruction, the method further includes: Obtaining the triggering time of the collision effect; When the trigger time is greater than or equal to a preset time threshold, the coordinates and / or volume model of the game unit are reset to the coordinates and / or volume model of the game unit before the collision effect is generated.
5. The method for deformation and determination of a game unit according to claim 3, characterized in that: After the step of changing the coordinates and / or volume model of the game unit according to the collision instruction, the method further includes: The attribute parameters associated with the game unit are set to null, and the memory space occupied by the game unit is cleared, so that the game unit disappears from the map after being destroyed by the trap in the game.
6. A deformation and determination device for a game unit, characterized in that: The deformation and determination device of the game unit comprises: The air trap trigger module is used to periodically obtain the relative position relationship between the game unit collision body and the collision area collision body based on a preset detection frequency, and when the collision area collision body intersects with the game unit collision body, it is determined that the game unit enters the preset collision area, and the 3D modeled volume model of the game unit and the scaling parameters corresponding to the collision area on the X, Y and Z axes are obtained; A model transformation module, for obtaining the initial coordinates of the volume model based on the global coordinate system associated with the game map, and determining the deformation coefficient of the initial coordinates according to the scaling parameter, determining the target coordinates according to the initial coordinates and the deformation coefficient, and determining the target volume model of the game unit deformed based on the scaling parameter according to the target coordinates; A ground trap trigger module is used to construct a coordinate system based on the ground trap in the collision area to generate a local coordinate system, and determine the X-axis coordinate, Y-axis coordinate and Z-axis coordinate of the target volume model in the local coordinate system according to the local coordinate system. When at least one of the X-axis coordinate, the Y-axis coordinate and the Z-axis coordinate is located in the ground area of the collision area, the ground trap is triggered.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a deformation and determination program of a game unit, and when the deformation and determination program of a game unit is executed by a processor, the steps of the deformation and determination method of a game unit as described in any one of claims 1-5 are implemented.