Motion control method and device in game, electronic equipment and readable storage medium
Patent Information
- Application Number
- CN202311490033.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-08
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2043-11-08
AI Technical Summary
[0003]但是在实际操作中,玩家针对球体1进行操控时,实际的操控方向可能会与预期的操控方向有所偏差,而实际操作方向的偏差极易改变球体2在被碰撞时的受力方向,导致球体2在被碰撞后的运动方向与玩家预期不相符
[0015]本公开提供的游戏中的运动控制方法,响应于用于指示游戏中第一球体虚拟对象碰撞第二球体虚拟对象的控制操作,构建第一球体虚拟对象对应的第一立方体包围盒,以及第二球体虚拟对象对应的第二立方体包围盒,然后可以对第一立方体包围盒和第二立方体包围盒进行碰撞检测,以确定第二球体虚拟对象在碰撞后的第一运动方向。在本公开中,通过针对球体虚拟对象对应立方体包围盒的碰撞检测,确定被碰球体虚拟对象在碰撞后的运动方向,可以增大碰撞检测中的碰撞接触面积,从而增大了球体虚拟对象受力偏移的区间,如此,玩家对于球体虚拟对象之间碰撞的方向控制无需过于精准,降低了玩家进行碰撞操控的精度要求。
Smart Images

Figure CN117679741B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of game technology, specifically to a motion control method, a motion control device, an electronic device, and a computer-readable storage medium in a game. Background Technology
[0002] In the game, collisions between spheres are common. When a player controls sphere 1 to collide with another sphere 2, the direction of sphere 2's movement after the collision can be determined based on the collision details.
[0003] However, in actual operation, when the player controls ball 1, the actual control direction may deviate from the expected control direction. The deviation in the actual control direction can easily change the direction of force on ball 2 when it is collided, causing the ball 2 to move in a direction that does not match the player's expectations after being collided. Summary of the Invention
[0004] This disclosure provides a motion control method, a motion control device, an electronic device, and a computer-readable storage medium for games to solve or at least partially solve the above-mentioned problems, as detailed below.
[0005] In a first aspect, this disclosure provides a motion control method for games, the method comprising:
[0006] In response to a control operation that instructs a first sphere virtual object to collide with a second sphere virtual object, a first cube bounding box corresponding to the first sphere virtual object and a second cube bounding box corresponding to the second sphere virtual object are constructed.
[0007] Collision detection is performed on the first and second cube bounding boxes to determine the first direction of motion of the second spherical virtual object after the collision.
[0008] Secondly, this disclosure also provides a motion control device for games, the device comprising:
[0009] A bounding box construction module is used to construct a first cube bounding box corresponding to the first sphere virtual object and a second cube bounding box corresponding to the second sphere virtual object in response to a control operation that instructs a first sphere virtual object to collide with a second sphere virtual object.
[0010] The collision detection module is used to perform collision detection on the first cube bounding box and the second cube bounding box to determine the first motion direction of the second spherical virtual object after the collision.
[0011] Thirdly, this disclosure also provides an electronic device, including: a processor, a memory, and computer program instructions stored in the memory and executable on the processor;
[0012] When the processor executes the computer program instructions, it implements the motion control method in the game as described in the first aspect above.
[0013] Fourthly, this disclosure also provides a computer-readable storage medium storing computer program instructions, which, when executed by a processor, are used to implement the motion control method in the game as described in the first aspect above.
[0014] The exemplary embodiments disclosed herein have the following beneficial effects:
[0015] The motion control method in this disclosure, in response to a control operation instructing a first spherical virtual object to collide with a second spherical virtual object, constructs a first bounding box corresponding to the first spherical virtual object and a second bounding box corresponding to the second spherical virtual object. Collision detection is then performed on the first and second bounding boxes to determine the first direction of motion of the second spherical virtual object after the collision. In this disclosure, by determining the direction of motion of the collided spherical virtual object after the collision through collision detection of the bounding boxes corresponding to the spherical virtual objects, the collision contact area in the collision detection can be increased, thereby increasing the range of force offset for the spherical virtual objects. Thus, the player does not need to be overly precise in controlling the direction of collisions between spherical virtual objects, reducing the precision requirements for collision control. Attached Figure Description
[0016] Figure 1 This is a flowchart of a motion control method in a game provided in one embodiment of this disclosure;
[0017] Figure 2 This is a schematic diagram of a sphere collision provided in one embodiment of the present disclosure;
[0018] Figure 3 This is another schematic diagram of a sphere collision provided in one embodiment of the present disclosure;
[0019] Figure 4 This is a collision diagram of a cube-shaped bounding box provided in one embodiment of the present disclosure;
[0020] Figure 5 This disclosure provides, in one embodiment, an auxiliary identifier displayed in the graphical user interface of a terminal device to indicate a first direction of motion;
[0021] Figure 6This is a schematic diagram of rounding corners of a cube-shaped bounding box according to one embodiment of the present disclosure;
[0022] Figure 7 This is a block diagram of a motion control device for a game provided in one embodiment of the present disclosure;
[0023] Figure 8 This is a schematic diagram of the logic structure of an electronic device for implementing motion control in a game, provided in one embodiment of this disclosure. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. The components of the embodiments of this disclosure described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed disclosure, but merely represents selected embodiments of this disclosure. Based on the embodiments of this disclosure, every other embodiment obtained by those skilled in the art without inventive effort falls within the scope of protection of this disclosure.
[0025] The terms “a,” “an,” “the,” and “the” are used in this specification to indicate the presence of one or more elements / components / etc.; the terms “including” and “having” are used to indicate an open-ended inclusion and to mean that there may be other elements / components / etc. in addition to the listed elements / components / etc.; the terms “first” and “second” are used only as markings and are not a limitation on the number of objects.
[0026] It should be understood that in the embodiments of this disclosure, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "Containing A, B, and / or C" means containing any one, two, or three of A, B, and C.
[0027] It should be understood that in the embodiments of this disclosure, "B corresponding to A", "B corresponding to A", "A corresponds to B", or "B corresponds to A" means that B is associated with A, and B can be determined based on A. Determining B based on A does not mean that B is determined solely based on A; B can also be determined based on A and / or other information.
[0028] In one embodiment of this disclosure, the motion control method in a game can run on a local terminal device or a server. When the motion control method in the game runs on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.
[0029] In an optional implementation, various cloud applications, such as cloud gaming, can run under the cloud interaction system. Taking cloud gaming as an example, cloud gaming refers to a gaming method based on cloud computing. In the cloud gaming operating mode, the game program's execution and the game screen presentation are separated. The storage and execution of motion control methods in the game are completed on the cloud gaming server. The client device is used for data reception, transmission, and game screen presentation. For example, the client device can be a display device with data transmission capabilities located close to the user, such as a mobile terminal, television, computer, or PDA; however, the information processing is performed by the cloud gaming server in the cloud. When playing the game, the player operates the client device to send operation commands to the cloud gaming server. The cloud gaming server runs the game according to the operation commands, encodes and compresses game screen data, returns it to the client device via the network, and finally, the client device decodes and outputs the game screen.
[0030] In an optional implementation, taking a game as an example, the local terminal device stores the game program and is used to display the game screen. The local terminal device is used to interact with the player through a graphical user interface (GUI), i.e., conventionally by downloading, installing, and running the game program via an electronic device. The local terminal device can provide the GUI to the player in various ways, such as rendering it on the terminal's display screen or providing it to the player via holographic projection. For example, the local terminal device can include a display screen for displaying the GUI, which includes game screens, and a processor for running the game, generating the GUI, and controlling the display of the GUI on the display screen.
[0031] In one possible implementation, this invention provides a motion control method for games, which provides a graphical user interface through a terminal device. The terminal device can be either the aforementioned local terminal device or a client device in the aforementioned cloud interaction system.
[0032] The aforementioned local terminal devices and client devices can be desktop computers, laptops, game consoles, smartwatches, tablets, mobile phones, televisions, etc., or other electronic devices; this disclosure does not specifically limit them.
[0033] like Figure 1As shown, one embodiment of this disclosure provides a motion control method in a game that includes the following steps S101 to S102.
[0034] Step S101: In response to a control operation that instructs a first sphere virtual object in the game to collide with a second sphere virtual object, construct a first cube bounding box corresponding to the first sphere virtual object and a second cube bounding box corresponding to the second sphere virtual object.
[0035] The game includes spherical virtual objects, which include virtual objects that are spherical in shape (such as spherical virtual characters, spherical virtual objects, etc.), virtual objects with spherical as the main structure (such as virtual characters with spherical models for head and body and model details such as hands, feet, and ears), and virtual objects that are abstracted as spherical (such as the spherical bounding box of virtual characters with spherical models for head and body and model details such as hands, feet, and ears).
[0036] In one embodiment of this disclosure, the control operation for instructing a first virtual sphere object in a game to collide with a second virtual sphere object may include one or more of the following operations: aiming control operation for controlling the first virtual sphere object to aim at the second virtual sphere object, and collision control operation for controlling the first virtual sphere object to collide with the second virtual sphere object.
[0037] The aiming control operation can be performed during the aiming phase, while the collision control operation can be performed after the aiming control operation. If the collision control operation is not performed after aiming, the first sphere virtual object will not collide with the second sphere virtual object, meaning no real collision will occur. A real collision will only occur after the collision control operation is performed.
[0038] Optionally, aiming control operations may include one or more of the following operations: joystick operation (such as gamepad joystick operation, virtual joystick operation), sliding operation, and long press operation.
[0039] Optionally, the collision control operation may include one or more of the following operations: joystick operation (such as gamepad joystick operation, virtual joystick operation), sliding operation, long press operation, and press and release operation.
[0040] In one embodiment of this disclosure, a first cube bounding box corresponding to a first sphere virtual object and a second cube bounding box corresponding to a second sphere virtual object can be constructed during the aiming phase.
[0041] In one embodiment of this disclosure, a first cube bounding box corresponding to a first sphere virtual object and a second cube bounding box corresponding to a second sphere virtual object can be constructed after a collision control operation is performed.
[0042] In an alternative example, the first cube bounding box can be the outer cube bounding box of the first sphere virtual object, and the second cube bounding box can be the outer cube bounding box of the second sphere virtual object.
[0043] Step S102: Perform collision detection on the first and second cube bounding boxes to determine the first motion direction of the second spherical virtual object after the collision.
[0044] In this step, collision detection can be performed on the first bounding box of the first sphere virtual object and the second bounding box of the second sphere virtual object, thereby converting the collision detection of the sphere virtual object from sphere collision detection to cube collision detection. Based on the collision detection results of the bounding boxes, the first motion direction of the second sphere virtual object after being collided with the first sphere virtual object is determined. The collision detection results include, but are not limited to, the first motion direction of the second sphere virtual object after being collided with the first sphere virtual object and the third motion direction of the first sphere virtual object after colliding with the second sphere virtual object.
[0045] Figure 2 This illustration shows a schematic diagram of a sphere collision according to one embodiment of the present disclosure. Figure 3 A schematic diagram of another sphere collision provided in one embodiment of this disclosure is shown. (Refer to...) Figure 2 and Figure 3 Taking the player controlling the movement of the first spherical virtual object with a joystick as an example, in sphere collision detection, the movement direction D1 of the second spherical virtual object after the collision depends on the joystick input direction D2 and the direction D3 of the line connecting the centers of the first and second spherical virtual objects when they are in contact. Specifically, this line D3 is the direction from the center O1 of the first spherical virtual object to the center O2 of the second spherical virtual object when they are in contact.
[0046] Reference Figure 2 When the joystick input direction D2 is the same as the direction of the line connecting the centers of the circles D3, the force direction of the second spherical virtual object Obj2 is equal to the joystick input direction D2, which is also equal to the direction of the line connecting the centers of the circles D3. Therefore, the first motion direction D1 of the second spherical virtual object Obj2 after the collision is equal to the direction of the line connecting the centers of the circles D3.
[0047] Reference Figure 3When the joystick input direction D2 is different from the direction D3 of the circle's center line, the force (along the direction D2) acting on the second spherical virtual object Obj2 can be decomposed into a component force F1 along the direction D3 of the circle's center line and a component force F2 perpendicular to the direction D3 of the circle's center line. That is, when the joystick input direction D2 is different from the direction D3 of the circle's center line, a force will be generated in the direction D3 of the non-circle's center line. When the component force F2 is greater than the frictional force between the spherical virtual objects, the first motion direction D1 of the second spherical virtual object Obj2 after the collision will deviate in the direction of the component force F2.
[0048] In other words, in ball collision detection, there are very few contact points when balls collide. Even a slight deviation in the player's control direction can change the contact position, causing the direction of motion of the collided ball to change. However, in this embodiment, a bounding box corresponding to the virtual ball object is constructed, thus transforming collision detection between virtual ball objects into collision detection of the bounding boxes corresponding to the virtual ball objects. Cube collisions involve more contact points, meaning the contact area between bounding boxes is larger than the contact area between virtual balls. Therefore, the friction between bounding boxes is greater than the friction between virtual balls. In other words, this embodiment increases the contact area during collision detection, thereby increasing the friction between the contact surfaces. Thus, even a slight deviation in the player's control direction will not change the contact position, ensuring that the direction of motion of the collided ball remains unchanged and that the ball's motion after being collided matches the player's expectations. Therefore, this embodiment, through collision detection using bounding boxes, increases the collision contact area, thereby increasing the range of force deviation for the virtual ball object. This reduces the need for overly precise directional control of collisions between virtual balls, lowering the precision requirements for player collision control.
[0049] Figure 4 This illustration shows a collision diagram of a cube-shaped bounding box according to one embodiment of the present disclosure. Figure 4 In the diagram, Cube1 indicates the first cube bounding box corresponding to the first sphere virtual object Obj1, and Cube2 indicates the second cube bounding box corresponding to the second sphere virtual object Obj2. For example, refer to... Figure 4 ,against Figure 3 When the input direction D2 of the joystick is different from the direction D3 of the line connecting the center of the circle, due to the increase in the contact area, the friction between the cube enclosures is greater than the friction between the spherical virtual objects. When the component force F2 is less than the friction between the cube enclosures, the first motion direction D1 determined by the motion control method in the game provided by this disclosure is still equal to the direction D3 of the line connecting the center of the circle, and will not deviate in the direction of the component force F2.
[0050] The motion control method in this disclosure, in response to a control operation instructing a first spherical virtual object to collide with a second spherical virtual object, constructs a first bounding box corresponding to the first spherical virtual object and a second bounding box corresponding to the second spherical virtual object. Collision detection is then performed on the first and second bounding boxes to determine the first direction of motion of the second spherical virtual object after the collision. In this disclosure, by determining the direction of motion of the collided spherical virtual object after the collision through collision detection of the bounding boxes corresponding to the spherical virtual objects, the collision contact area in the collision detection can be increased, thereby increasing the range of force offset for the spherical virtual objects. Thus, the player does not need to be overly precise in controlling the direction of collisions between spherical virtual objects, reducing the precision requirements for collision control.
[0051] In one embodiment of this disclosure, after determining the first direction of motion of the second spherical virtual object after the collision, when the first spherical virtual object collides with the second spherical virtual object, the following steps can be performed: controlling the second spherical virtual object to move along the first direction of motion after the collision.
[0052] When the first virtual sphere collides with the second virtual sphere, the player can control the second virtual sphere to move along a first direction of motion after the collision. This first direction of motion is determined by the collision detection results of the bounding box of the corresponding cube of the virtual sphere, not by the collision detection results of the virtual sphere itself. Therefore, even if the player's control direction for the collision deviates slightly from the direction of the line connecting the centers of the two virtual spheres at the point of contact, the collided virtual sphere will still move along that line.
[0053] In one embodiment of this disclosure, the motion control method may further include the following step: displaying auxiliary symbols for indicating a first direction of motion in the graphical user interface of the terminal device.
[0054] For example, the auxiliary identifier may include arrows, dashed lines, etc., and this disclosure is not intended to limit it. Figure 5 This illustration shows a schematic diagram of an auxiliary identifier for indicating a first direction of movement displayed in a graphical user interface of a terminal device, according to one embodiment of the present disclosure. Exemplarily, in... Figure 5 In the diagram, the auxiliary identifier S is a dashed line along the first direction of motion. Optionally, the dashed line may also be displayed as a gradually disappearing effect.
[0055] In one optional example, an auxiliary indicator can be displayed during the aiming phase to indicate the first direction of motion. During the aiming phase, the player can continuously adjust the direction of the thrust applied to the first spherical virtual object. Each adjustment determines the first direction of motion of the second spherical virtual object after collision with the current spherical virtual object. An auxiliary indicator indicating the first direction of motion is displayed in real-time during the aiming phase to assist the player in collision control operations, ensuring that the collision results meet the player's expectations.
[0056] In one optional example, an auxiliary indicator to indicate the first direction of movement can be displayed during the collision phase; that is, the auxiliary indicator to indicate the first direction of movement can be displayed in real time after the player performs a collision control operation.
[0057] In another alternative example, auxiliary markers indicating the first direction of motion can be displayed during both the aiming and collision phases.
[0058] In one embodiment of this disclosure, before performing collision detection on the first and second cube bounding boxes, the following processing can be performed on the first and second cube bounding boxes, including rounding the corners of the first and second cube bounding boxes. A schematic diagram of rounding the corners of the cube bounding boxes is shown below. Figure 6 .
[0059] Using a cube bounding box can maximize the collision contact area. In this embodiment, the cube bounding box can be rounded before collision detection, which can increase the collision contact area and make the collision result more in line with the player's expectations of the ball collision.
[0060] In one embodiment of this disclosure, the first cube bounding box corresponding to the first sphere virtual object and the second cube bounding box corresponding to the second sphere virtual object can be constructed in the following manner:
[0061] Based on the line connecting the centers of the circles when the first sphere virtual object and the second sphere virtual object are in contact, construct the first cube bounding box corresponding to the first sphere virtual object and the second cube bounding box corresponding to the second sphere virtual object.
[0062] In this configuration, the first face of the first cubic enclosure is perpendicular to the line connecting the centers of the circles, and the second face of the second cubic enclosure is perpendicular to the line connecting the centers of the circles, with the first face in contact with the second face.
[0063] In this embodiment, for the first spherical virtual object, a first cubic bounding box with at least one face perpendicular to the line connecting the centers of the circles can be constructed, for example, an circumscribed cubic bounding box with at least one face perpendicular to the line connecting the centers of the circles can be constructed. Similarly, for the second spherical virtual object, a second cubic bounding box with at least one face perpendicular to the line connecting the centers of the circles can be constructed, for example, an circumscribed cubic bounding box with at least one face perpendicular to the line connecting the centers of the circles can be constructed.
[0064] In this case, the first face of the first cube enclosure box that is perpendicular to the line connecting the centers of the circles contacts the second face of the second cube enclosure box that is perpendicular to the line connecting the centers of the circles. The contact area between the first face and the second face is the collision contact area between the two cube enclosure boxes.
[0065] Based on the above, the bounding boxes of the cubes corresponding to the two spherical virtual objects need to be constructed according to the situation when the two spherical virtual objects are in contact (i.e., the line connecting the centers of the circles when they are in contact).
[0066] In one embodiment of this disclosure, step S101 can be implemented by steps S1011 to S1012.
[0067] Step S1011: If the first sphere virtual object and the second sphere virtual object are not in contact before the collision, in response to the control operation used to instruct the first sphere virtual object to collide with the second sphere virtual object in the game, predict the contact result when the first sphere virtual object moves along the second movement direction indicated by the control operation and comes into contact with the second sphere virtual object.
[0068] Step S1012: Based on the predicted contact results, construct the first cube bounding box corresponding to the first sphere virtual object and the second cube bounding box corresponding to the second sphere virtual object.
[0069] In the game, the first and second virtual spheres can be in two states before a collision. One state is that the first and second virtual spheres are not in contact before the collision, meaning the first virtual sphere is not adjacent to the second virtual sphere before the collision; the other state is that the first and second virtual spheres are in contact before the collision, meaning the first virtual sphere is adjacent to the second virtual sphere before the collision.
[0070] In the first scenario, the entire collision process consists of two phases. The first phase involves the first virtual sphere moving along the second direction of motion indicated by the control operation to gradually approach the second virtual sphere until they come into contact and collide. The second phase involves the first and second virtual spheres being affected by the collision and moving separately afterward. In the second scenario, the entire collision process only includes the aforementioned second phase.
[0071] In this disclosure, collision detection based on cube bounding boxes is required to determine the motion direction of the second spherical virtual object after the collision, that is, to determine the motion direction of the second spherical virtual object in the aforementioned second stage. Before the second stage, the first spherical virtual object needs to undergo the aforementioned first stage. In this embodiment, before the actual occurrence of the aforementioned first stage, the contact situation when the first spherical virtual object comes into contact with the second spherical virtual object after undergoing the first stage can be predicted. Thus, before the actual occurrence of the entire collision process, two cube bounding boxes can be constructed based on the predicted contact situation to determine the motion direction of the second spherical virtual object in the second stage.
[0072] Optionally, if the control operation is a collision control operation or a targeting control operation, the cube bounding box can be constructed by predicting the contact situation of the sphere virtual object during the collision before the entire collision process actually occurs, and the first motion direction of the second sphere virtual object after the collision can be determined.
[0073] Of course, if the player does not perform a collision control operation after determining the first direction of movement in response to the aiming control operation, the entire collision process will not be completed.
[0074] In one embodiment of this disclosure, before or after step S102, the following step S103 may be performed: controlling the first sphere virtual object to move along the second motion direction indicated by the control operation to collide with the second sphere virtual object.
[0075] In an optional example of this embodiment, after constructing the first and second cube bounding boxes, the first spherical virtual object is first controlled to move along the second movement direction indicated by the player's control operation to achieve the first stage described above; then, step S102 is executed to determine the first movement direction of the second spherical virtual object after the collision by detecting the collision between the first and second cube bounding boxes; next, the second spherical virtual object is controlled to move along the first movement direction after the collision to achieve the second stage described above.
[0076] In another optional example of this embodiment, after constructing the first and second cube bounding boxes, step S102 can be executed first to determine the first direction of motion of the second spherical virtual object after the collision by collision detection of the first and second cube bounding boxes; then, the first spherical virtual object can be controlled to move along the second direction of motion indicated by the player's control operation to achieve the first stage described above; next, the second spherical virtual object can be controlled to move along the first direction of motion after the collision to achieve the second stage described above.
[0077] In one embodiment of this disclosure, for the second case described above before the collision between the first sphere virtual object and the second sphere virtual object, step S101 can be implemented by step S1013.
[0078] Step S1013: If the first sphere virtual object and the second sphere virtual object are in contact before the collision, in response to the control operation used to instruct the first sphere virtual object to collide with the second sphere virtual object in the game, construct the first cube bounding box corresponding to the first sphere virtual object and the second cube bounding box corresponding to the second sphere virtual object.
[0079] In this embodiment, if the first spherical virtual object and the second spherical virtual object are adjacent to each other before the collision, a cube bounding box can be directly constructed for the first spherical virtual object and the second spherical virtual object respectively, and then the first motion direction of the second spherical virtual object after the collision can be determined based on the collision detection result of the cube bounding box.
[0080] If the control operation is an aiming control operation, the second stage described above is implemented only after a corresponding collision control operation is received following the aiming control operation; if the control operation is a collision control operation, the second stage described above is implemented directly. In this embodiment, the first stage described above does not exist.
[0081] In one embodiment of this disclosure, when the control operation is a collision control operation, the above step S101 can be implemented by the following steps S1014 to S1015.
[0082] Step S1014: If the first sphere virtual object and the second sphere virtual object are not in contact before the collision, in response to the collision control operation for controlling the first sphere virtual object to collide with the second sphere virtual object, control the first sphere virtual object to move along the second movement direction indicated by the collision control operation to collide with the second sphere virtual object.
[0083] Step S1015: When the first sphere virtual object comes into contact with the second sphere virtual object, construct the first cube bounding box corresponding to the first sphere virtual object and the second cube bounding box corresponding to the second sphere virtual object.
[0084] In this embodiment, if the first and second virtual sphere objects are not adjacent before the collision and the player performs a collision control operation, it means that a real collision process will definitely occur. Therefore, in response to the collision control operation, the first stage described above can be achieved first, so that the first virtual sphere object and the second virtual sphere object come into contact. Then, a cube bounding box is constructed, the first direction of motion of the second virtual sphere object after the collision is determined, and the second virtual sphere object is controlled to move along the first direction of motion after the collision, thereby achieving the second stage described above.
[0085] When the control operation is a collision control operation, if it is desired to construct the cube bounding box before achieving the first stage, it can be constructed using the construction method based on predicted contact conditions described above. However, when the control operation is an aiming control operation, it is not possible to construct the cube bounding box using this embodiment, but it can still be constructed using the construction method based on predicted contact conditions described above.
[0086] The motion control method in the game disclosed herein determines the direction of motion of the collided sphere after collision by detecting the collision of the corresponding cube bounding box of the sphere virtual object. This increases the collision contact area in the collision detection, thereby increasing the range of force offset of the sphere virtual object. As a result, the player does not need to be too precise in controlling the direction of collision between sphere virtual objects, reducing the precision requirements for the player's collision control.
[0087] Corresponding to the motion control method in games provided in this disclosure, this disclosure also provides a motion control device for games. For example... Figure 7 As shown, the device 700 includes:
[0088] Bounding box construction module 701 is used to construct a first cube bounding box corresponding to the first sphere virtual object and a second cube bounding box corresponding to the second sphere virtual object in response to a control operation for instructing a first sphere virtual object to collide with a second sphere virtual object in the game.
[0089] The collision detection module 702 is used to perform collision detection on the first cube bounding box and the second cube bounding box to determine the first motion direction of the second spherical virtual object after the collision.
[0090] In an optional embodiment, the device further includes:
[0091] The first motion control module is used to control the second spherical virtual object to move along the first motion direction after the collision.
[0092] In an optional embodiment, the device further includes:
[0093] The display module is used to display auxiliary symbols in the graphical user interface of the terminal device to indicate the first direction of motion.
[0094] In an optional embodiment, the device further includes:
[0095] A corner rounding module is used to round the corners of the first cube bounding box and the second cube bounding box.
[0096] In one alternative embodiment, the bounding box building module includes:
[0097] The first construction submodule is used to construct a first cube bounding box corresponding to the first sphere virtual object and a second cube bounding box corresponding to the second sphere virtual object based on the center line connecting the first sphere virtual object and the second sphere virtual object when they are in contact.
[0098] Wherein, the first face of the first cubic enclosure is perpendicular to the line connecting the centers of the circles, the second face of the second cubic enclosure is perpendicular to the line connecting the centers of the circles, and the first face is in contact with the second face.
[0099] In one alternative embodiment, the bounding box building module includes:
[0100] The first contact prediction submodule is used to predict the contact result when the first sphere virtual object and the second sphere virtual object come into contact with each other after the first sphere virtual object moves along the second movement direction indicated by the control operation in the game, in response to the control operation that instructs the first sphere virtual object to collide with the second sphere virtual object, in the case that the first sphere virtual object and the second sphere virtual object have not made contact before the collision.
[0101] The second construction submodule is used to construct a first cube bounding box corresponding to the first sphere virtual object and a second cube bounding box corresponding to the second sphere virtual object based on the predicted contact results.
[0102] In an optional embodiment, the device further includes:
[0103] The second motion control module is used to control the first spherical virtual object to move along the second motion direction indicated by the control operation, so as to collide with the second spherical virtual object.
[0104] In one alternative embodiment, the bounding box building module includes:
[0105] The third construction submodule is used to construct a first cube bounding box corresponding to the first sphere virtual object and a second cube bounding box corresponding to the second sphere virtual object in response to a control operation that instructs the first sphere virtual object to collide with the second sphere virtual object in the game, when the first sphere virtual object and the second sphere virtual object are in contact before the collision.
[0106] In one alternative embodiment, the control operation for instructing the first virtual sphere object in the game to collide with the second virtual sphere object includes a collision control operation for controlling the collision between the first virtual sphere object and the second virtual sphere object.
[0107] In one alternative embodiment, the bounding box building module includes:
[0108] The third motion control module is used to control the first sphere virtual object to move along the second motion direction indicated by the collision control operation to collide with the second sphere virtual object when the first sphere virtual object and the second sphere virtual object are not in contact before the collision.
[0109] The fourth construction submodule is used to construct a first cube bounding box corresponding to the first sphere virtual object and a second cube bounding box corresponding to the second sphere virtual object when the first sphere virtual object comes into contact with the second sphere virtual object.
[0110] In one alternative embodiment, the control operation for instructing the first virtual sphere object in the game to collide with the second virtual sphere object includes a aiming control operation for controlling the first virtual sphere object to aim at the second virtual sphere object.
[0111] The motion control device in this disclosure, in response to a control operation instructing a first spherical virtual object to collide with a second spherical virtual object, constructs a first bounding box corresponding to the first spherical virtual object and a second bounding box corresponding to the second spherical virtual object. Collision detection is then performed on the first and second bounding boxes to determine the first direction of motion of the second spherical virtual object after the collision. In this disclosure, by determining the direction of motion of the collided spherical virtual object after the collision through collision detection of the bounding boxes corresponding to the spherical virtual objects, the collision contact area in the collision detection can be increased, thereby increasing the range of force offset for the spherical virtual objects. Thus, the player does not need to be overly precise in controlling the direction of collisions between spherical virtual objects, reducing the precision requirements for collision control.
[0112] The following describes an electronic device provided by an embodiment of this disclosure. Please refer to [link / reference]. Figure 8 , Figure 8 This is a schematic diagram of an electronic device provided in an embodiment of the present disclosure. The electronic device 800 may be equipped with a motion control device from a game as described in this embodiment, used to implement the functions of this embodiment. Specifically, the electronic device 800 includes: a receiver 801, a transmitter 802, a processor 803, and a memory 804 (wherein the electronic device 800 may have one or more processors 803). Figure 8(Taking a processor as an example), the processor 803 may include an application processor 8031 and a communication processor 8032. In some embodiments of this disclosure, the receiver 801, transmitter 802, processor 803, and memory 804 may be connected via a bus or other means.
[0113] Memory 804 may include read-only memory and random access memory, and provides instructions and data to processor 803. A portion of memory 804 may also include non-volatile random access memory (NVRAM). Memory 804 stores processor and operation instructions, executable modules, or data structures, or subsets thereof, or extended sets thereof, wherein the operation instructions may include various operation instructions for implementing various operations.
[0114] The processor 803 controls the operation of the execution device. In specific applications, the various components of the execution device are coupled together through a bus system, which may include not only the data bus but also power buses, control buses, and status signal buses. However, for clarity, all buses in the diagram are referred to as the bus system.
[0115] The methods disclosed in the above embodiments of this disclosure can be applied to or implemented by processor 803. Processor 803 can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the hardware of processor 803 or by instructions in software form. Processor 803 can be a general-purpose processor, a digital signal processor (DSP), a microprocessor, or a microcontroller, and may further include an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. Processor 803 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this disclosure. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this disclosure can be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 804, and processor 803 reads the information from memory 804 and, in conjunction with its hardware, completes the steps of the above method.
[0116] Receiver 801 can be used to receive input digital or character information, and to generate signal inputs related to the settings and function control of the execution device. Transmitter 802 can be used to output digital or character information through the first interface; transmitter 802 can also be used to send instructions to the disk group through the first interface to modify the data in the disk group; transmitter 802 may also include a display device such as a display screen.
[0117] In this embodiment of the disclosure, the application processor 8031 in the processor 803 is used to execute the motion control method in the game according to this embodiment of the disclosure. It should be noted that the specific way in which the application processor 8031 executes each step is based on the same concept as the various method embodiments in this disclosure, and the resulting technical effects are the same as those in the various method embodiments in this disclosure. For details, please refer to the description in the method embodiments shown above in this disclosure, which will not be repeated here.
[0118] This disclosure also provides a chip for executing instructions, which is used to execute the motion control method in the game described above.
[0119] This disclosure also provides a computer-readable storage medium storing computer instructions that, when executed on a processor, cause the processor to perform the motion control method in the game described above.
[0120] This disclosure also provides a computer program product, including a computer program, which, when executed by a processor, is used to perform the motion control method in the game described above.
[0121] The aforementioned computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to general-purpose or special-purpose servers.
[0122] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
[0123] While this disclosure is presented above with reference to preferred embodiments, it is not intended to limit this disclosure. Any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of this disclosure. Therefore, the scope of protection of this disclosure should be determined by the scope defined in the claims of this disclosure.
Claims
1. A motion control method in a game, characterized in that, The method includes: In response to a control operation that instructs a first virtual sphere object in the game to collide with a second virtual sphere object, a first bounding box corresponding to the first virtual sphere object and a second bounding box corresponding to the second virtual sphere object are constructed. The first and second cube bounding boxes are rounded. Collision detection is performed on the first and second cube bounding boxes to determine the first direction of motion of the second spherical virtual object after the collision.
2. The method according to claim 1, characterized in that, After the step of performing collision detection on the first and second cube bounding boxes to determine the first direction of motion of the second spherical virtual object after the collision, the method further includes: Control the second sphere virtual object to move along the first direction of motion after the collision.
3. The method according to claim 1, characterized in that, The method further includes: An auxiliary identifier is displayed in the graphical user interface of the terminal device to indicate the first direction of motion.
4. The method according to claim 1, characterized in that, The construction of the first cube bounding box corresponding to the first sphere virtual object and the second cube bounding box corresponding to the second sphere virtual object includes: Based on the line connecting the centers of the circles when the first sphere virtual object and the second sphere virtual object are in contact, construct the first cube bounding box corresponding to the first sphere virtual object and the second cube bounding box corresponding to the second sphere virtual object. Wherein, the first face of the first cubic enclosure is perpendicular to the line connecting the centers of the circles, the second face of the second cubic enclosure is perpendicular to the line connecting the centers of the circles, and the first face is in contact with the second face.
5. The method according to claim 1, characterized in that, The step of constructing a first bounding box corresponding to the first virtual sphere and a second bounding box corresponding to the second virtual sphere in response to a control operation instructing a first virtual sphere to collide with a second virtual sphere in the game includes: If the first virtual sphere object and the second virtual sphere object are not in contact before the collision, in response to the control operation for instructing the first virtual sphere object in the game to collide with the second virtual sphere object, the contact result when the first virtual sphere object moves along the second movement direction indicated by the control operation and comes into contact with the second virtual sphere object is predicted; Based on the predicted contact results, a first cube bounding box corresponding to the first sphere virtual object and a second cube bounding box corresponding to the second sphere virtual object are constructed.
6. The method according to claim 5, characterized in that, Before or after the step of performing collision detection on the first and second cube bounding boxes to determine the first direction of motion of the second spherical virtual object after the collision, the method further includes: The first sphere virtual object is controlled to move along the second direction of motion indicated by the control operation, so as to collide with the second sphere virtual object.
7. The method according to claim 1, characterized in that, The step of constructing a first bounding box corresponding to the first virtual sphere and a second bounding box corresponding to the second virtual sphere in response to a control operation instructing a first virtual sphere to collide with a second virtual sphere in the game includes: If the first sphere virtual object and the second sphere virtual object are in contact before the collision, in response to a control operation that instructs the first sphere virtual object to collide with the second sphere virtual object in the game, a first cube bounding box corresponding to the first sphere virtual object and a second cube bounding box corresponding to the second sphere virtual object are constructed.
8. The method according to claim 1, characterized in that, The control operation for instructing the first virtual sphere object in the game to collide with the second virtual sphere object includes a collision control operation for controlling the collision between the first virtual sphere object and the second virtual sphere object.
9. The method according to claim 8, characterized in that, The step of constructing a first bounding box corresponding to the first virtual sphere and a second bounding box corresponding to the second virtual sphere in response to a control operation instructing a first virtual sphere to collide with a second virtual sphere in the game includes: If the first sphere virtual object and the second sphere virtual object are not in contact before the collision, in response to a collision control operation for controlling the first sphere virtual object to collide with the second sphere virtual object, the first sphere virtual object is controlled to move along the second movement direction indicated by the collision control operation to collide with the second sphere virtual object. When the first sphere virtual object comes into contact with the second sphere virtual object, a first cube bounding box corresponding to the first sphere virtual object and a second cube bounding box corresponding to the second sphere virtual object are constructed.
10. The method according to claim 1, characterized in that, The control operation for instructing the first virtual sphere object in the game to collide with the second virtual sphere object includes an aiming control operation for controlling the first virtual sphere object to aim at the second virtual sphere object.
11. A motion control device for games, characterized in that, The device includes: A bounding box construction module is used to construct a first cube bounding box corresponding to the first sphere virtual object and a second cube bounding box corresponding to the second sphere virtual object in response to a control operation that instructs a first sphere virtual object to collide with a second sphere virtual object in the game. A corner rounding module is used to round the corners of the first cube bounding box and the second cube bounding box. The collision detection module is used to perform collision detection on the first cube bounding box and the second cube bounding box to determine the first motion direction of the second spherical virtual object after the collision.
12. An electronic device, characterized in that, include: Processor, memory, and computer program instructions stored in said memory and executable on the processor; When the processor executes the computer program instructions, it implements the motion control method in the game as described in any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed by a processor, are used to implement the motion control method in the game as described in any one of claims 1 to 10.
Citation Information
Patent Citations
Game program, game device, and game control method
JP2022093224A
Systems and Methods for Improved Collision Detection in Video Games
US20220203237A1