Gravity simulation method and device, storage medium and electronic device
By determining the position of game characters and obtaining target gravity information in a three-dimensional game world, the problem of insufficient local gravity quantification in existing technologies has been solved, achieving precise gravity simulation in the game and enhancing the diversity of gameplay.
Patent Information
- Application Number
- CN202211647863.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-21
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2042-12-21
AI Technical Summary
Existing physics engines lack a refined definition of gravity values in local scenes, which limits the diversity of gameplay.
In the three-dimensional game world, by obtaining the position of the game character, it is determined whether the character is located in the local gravity space, the target gravity information is obtained, and then applied to the game character. The shape, priority, and gravity adjustment parameters of the local gravity space are used to achieve a fine gravity effect.
It provides independent and detailed local gravity effects in the 3D game world, enhancing the diversity of gameplay.
Smart Images

Figure CN115779435B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of gaming, and more specifically, to a gravity simulation method, apparatus, storage medium, and electronic device. Background Technology
[0002] In today's 3D games, the simulation of the physical world is quite common. Simulated physics makes the world appear more realistic to players, giving them a better gaming experience. Among these simulations, gravity simulation is often a crucial element that cannot be ignored. However, the definition of gravity in popular physics engines is relatively simplistic, resulting in a lack of refined definition of gravity values for local scenes. Summary of the Invention
[0003] To overcome at least one deficiency in the prior art, this application provides a gravity simulation method, apparatus, storage medium, and electronic device for simulating detailed gravity effects in local locations within a game world, specifically including:
[0004] In a first aspect, this application provides a gravity simulation method, the method comprising:
[0005] Obtain the position of the game character in the three-dimensional game world;
[0006] Based on the character's position, determine whether the game character is located in the local gravity space of the three-dimensional game world;
[0007] If so, then the target gravity information is obtained based on the local gravity space;
[0008] The gravity corresponding to the target gravity information is applied to the game character.
[0009] Secondly, this application provides a gravity simulation device, the device comprising:
[0010] The location acquisition module is used to acquire the position of the game character in the three-dimensional game world;
[0011] The position determination module is used to determine whether the game character is located in the local gravity space of the three-dimensional game world based on the character's position.
[0012] If so, then the target gravity information is obtained based on the local gravity space;
[0013] The gravity corresponding to the target gravity information is applied to the game character.
[0014] Thirdly, this application provides a storage medium storing a computer program, which, when executed by a processor, implements the gravity simulation method described above.
[0015] Fifthly, this application provides an electronic device, which includes a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, it implements the gravity simulation method.
[0016] Compared with the prior art, this application has the following beneficial effects:
[0017] This application provides a gravity simulation method, apparatus, storage medium, and electronic device. The electronic device acquires the position of a game character in a three-dimensional game world; based on the character's position, it determines whether the game character is located in a local gravity space within the three-dimensional game world; if so, it obtains target gravity information based on the local gravity space; and applies gravity corresponding to the target gravity information to the game character. In this way, a local gravity space is provided in the three-dimensional game world, and an independent and precise gravity effect is provided for the game character located in this space, making the gameplay more diverse. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 A schematic flowchart illustrating the gravity simulation method provided in this application embodiment;
[0020] Figure 2 A schematic diagram illustrating the relationship between a local gravity region and the ground, provided in an embodiment of this application;
[0021] Figure 3 This is a schematic diagram illustrating the principle of gravity information superposition provided in an embodiment of this application;
[0022] Figure 4 This is a schematic diagram of the gravity simulation device provided in the embodiments of this application;
[0023] Figure 5 This is a schematic diagram of the electronic device structure provided in an embodiment of this application.
[0024] Icons: 101-Local gravity space; 102-Ground; 201-Position module; 202-Judgment module; 203-Gravity module; 301-Memory; 302-Processor; 303-Communication unit; 304-System bus. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0026] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0027] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0028] In the description of this application, it should be noted that the terms "first," "second," "third," etc., are used only for distinguishing descriptions and should not be construed as indicating or implying relative importance. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0029] As introduced in the background technology, gravity simulation is often a key point that cannot be ignored in game development. However, the definition of gravity in the currently popular physics engines is relatively simple, resulting in a lack of refined definition of gravity values in local scenes.
[0030] For example, a common approach is to describe the global gravity in the entire 3D game world using a single 3D vector. Alternatively, different types of terrain can be defined within the 3D game world to plan different areas, thereby specializing the gravity factors within those areas.
[0031] However, global gravity in a 3D game world is a holistic description and cannot represent the specialization of local gravity. Furthermore, its general implementation only provides gravity in a single vertical direction. While gravity ranges distinguished by regional tiles can specialize gravity values to some extent, regional tiles can only describe a large local area of the world, and there is no definition of height. The regions do not intersect, which effectively breaks down the 3D game world into a 2D game world, resulting in insufficient detail.
[0032] Therefore, the definition of gravity in popular physics engines today is relatively simple. Due to this limitation, there is a lack of refined definition of gravity values in local scenes, which in turn restricts the diversity of gameplay.
[0033] It should be noted that the defects in the solutions in the prior art are all the results of the inventors’ practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed by the embodiments of this application in the following text should be the inventors’ contributions to this application in the process of invention and creation, and should not be understood as technical content known to those skilled in the art.
[0034] Therefore, this embodiment provides a gravity simulation method for electronic devices, which simulates detailed gravity effects in local locations within a game world.
[0035] The electronic device may be, but is not limited to, a mobile terminal, tablet computer, laptop computer, desktop computer, etc. In some embodiments, the mobile terminal may include a smart mobile device, virtual reality device, augmented reality device, etc. In some embodiments, the smart mobile device may include a smartphone, personal digital assistant (PDA), gaming device, navigation device, etc.
[0036] Of course, the electronic device can also be a server, wherein the server group can be centralized or distributed (e.g., the server can be a distributed system). In some embodiments, the server can be local or remote relative to the user terminal. In some embodiments, the server can be implemented on a cloud platform; by way of example only, the cloud platform can include private cloud, public cloud, hybrid cloud, community cloud, distributed cloud, inter-cloud, multi-cloud, etc., or any combination thereof. In some embodiments, the server can be implemented on an electronic device having one or more components.
[0037] Based on the above introduction, the following will combine... Figure 1The steps of this method are described in detail, but it should be understood that the operations in the flowchart may not be implemented in a specific order, and steps without logical contextual relationships may be reversed in order or performed simultaneously. Furthermore, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowchart, or remove one or more operations from the flowchart. Figure 1 As shown, the method includes:
[0038] S101, retrieve the game character's position in the 3D game world.
[0039] S102, based on the character's position, determine whether the game character is located in the local gravity space of the three-dimensional game world.
[0040] The shapes of these local gravity spaces include cuboids, spheres, cylinders, and convex hulls, and there can be multiple of them distributed anywhere in the 3D game world. Therefore, the shape of each local gravity space and its location in the 3D game world are set by the developers as needed.
[0041] For example, such as Figure 2 As shown, it is assumed that the local gravity space 101 is a cuboid, and its vertical distance from the ground 102 in the three-dimensional game world is 30m. When the player controls the game character to enter the cuboid-shaped local gravity space 101, the game character will be affected by the local gravity in the local game space, or by the combined effect of the local gravity in the local gravity space 101 and the global gravity in the three-dimensional game world.
[0042] In an optional implementation, the electronic device can acquire the spatial position of the local gravity space in the three-dimensional game world; if the character's position is within the coverage area of the spatial position, then the game character is located in the local gravity space.
[0043] If yes, proceed to step S103; otherwise, return to step S101.
[0044] S103: Obtain target gravity information based on local gravity space.
[0045] The target gravity information includes the target force and direction of gravity. In some cases, the game character may be located in an overlapping area of multiple local gravity spaces. Therefore, in this embodiment, each local gravity space is assigned a priority level, with higher priority local gravity spaces covering lower priority local gravity spaces. Thus, the specific implementation of step S103 includes:
[0046] S103-1, Obtain the priority of each local gravity space.
[0047] S103-2, based on the priority of each local gravity space, determine the target gravity space with the highest priority.
[0048] For example, assume that the game character is located in three local gravity spaces, where the three local gravity spaces are respectively denoted as G. 1` ,G2,G 3` According to the finite level from low to high, the three local gravity spaces are ordered as G2, G1, and G3. Then, local gravity space G2 is taken as the target gravity space, while the gravity effects of local gravity spaces G1 and G3 on the game character are shielded.
[0049] S103-3, Obtain target gravity information based on the gravity information of the target gravity space.
[0050] In some cases, there may be multiple target gravity spaces with the highest priority. In this case, the electronic device acquires the gravity information of each target gravity space and superimposes the gravity information of each target gravity space to obtain the target gravity information.
[0051] The superposition of gravity can be achieved by performing vector operations on the gravity information of multiple target gravity spaces. For example, such as... Figure 3 As shown, two target gravity spaces are illustrated. The gravity information of one target gravity space is labeled F1, and the gravity information of the other target gravity space is labeled F2. Vector operations are performed on these two spaces to obtain the target gravity information F. t .
[0052] Furthermore, in some cases, the gravity information in the target gravity space is not constant but is affected by gravity adjustment parameters. For example, these gravity adjustment parameters could be the height of the game character above the ground, the game equipment currently used by the game character, the distance or angle between the game character and the target object in the target local game space, etc.
[0053] Therefore, this electronic device can acquire the gravity adjustment parameters of the game character currently in the target gravity space; and determine the gravity information of the target gravity space based on the gravity adjustment parameters. The correspondence between the gravity adjustment parameters and the gravity information in the target gravity space can be adaptively adjusted by technicians according to actual needs when implementing this solution; this embodiment does not impose specific limitations on this.
[0054] S104 applies gravity corresponding to the target gravity information to the game character.
[0055] Since the target gravity information includes the target force and target direction, the electronic device will apply gravity corresponding to the target force and target direction to the game character. In this way, a local gravity space is provided in the three-dimensional game world, and an independent and precise gravity effect is provided for the game character located in this space, making the gameplay more diversified.
[0056] To enable those skilled in the art to use the content of this application, the following implementation methods are further provided from a software design perspective. Those skilled in the art can apply the general principles defined herein to other embodiments and application scenarios without departing from the spirit and scope of this application.
[0057] To implement the above methods, this application can be divided into the following parts at the software logic level:
[0058] Local gravity space:
[0059] This primarily includes geometric information, coordinate information, determining whether the game character's position is within the local gravity space, and summarizing the type of area effect. The most crucial information is the geometric information, specifically the shape of the local gravity region, categorized as cuboid, sphere, planar, cylinder, and convex hull, etc. Further description of the local gravity region's position, rotation, and scaling is required, enabling the local gravity space to be placed as an independent entity anywhere in the 3D game world. The determination of whether the game character is inside or outside the local gravity space is based on the game character's position and the geometric information of the local gravity space. It needs to record the game character's state of "entering," "being within," or "exiting" the local gravity region, and notify the logical entity of the region information.
[0060] Gravity source:
[0061] The description of gravity information in a local gravity space is considered as a gravity source, mainly including information such as force, direction, priority level, reversal, and curve. Force and direction describe the basic properties of gravity, while the priority level determines whether overlapping gravitations in the current local gravity space are superimposed or overlapping. Reversal and curve information adjust the gravity source in direction and magnitude, respectively, creating a gradual effect. The direction of the gravity source is divided into several types, including unidirectional, centripetal, and cylindrical axial directions.
[0062] Gravity source management:
[0063] This function is responsible for registering and deregistering gravity sources, as well as obtaining gravity information. Since the concepts of gravity sources and regions are already established, the next step is to utilize them to obtain the gravity information of a game character's current location, and gravity source management is used to provide this function. During game operation, gravity source management is used to register gravity sources of interest and deregister those no longer needed. Developers can then call the corresponding interface, passing in the game character's world coordinates in the 3D game world, to obtain information such as the magnitude and direction of gravity at that location.
[0064] The above embodiments described a gravity simulation method. Under the same inventive concept, this embodiment also provides a gravity simulation device. This gravity simulation device includes at least one software functional module that can be stored in memory or embedded in the operating system (OS) of an electronic device. The processor in the electronic device executes the executable module stored in memory. For example, the software functional modules and computer programs included in this gravity simulation device. Please refer to... Figure 4 Functionally, this gravity simulation device may include:
[0065] The position module 201 is used to obtain the position of the game character in the three-dimensional game world.
[0066] In this embodiment, the position module 201 is used for testing. Figure 1 For a detailed description of the position module 201, please refer to the detailed introduction of step S101.
[0067] The judgment module 202 is used to determine whether the game character is located in the local gravity space of the three-dimensional game world based on the character's position.
[0068] In this embodiment, the judgment module 202 can also be used to implement Figure 1 For a detailed description of step S102, please refer to the detailed description of step S102.
[0069] Gravity module 203 is used to obtain target gravity information based on the local gravity space if the condition is met.
[0070] Gravity module 203 is also used to apply gravity corresponding to the target gravity information to the game character.
[0071] In this embodiment, the gravity module 203 is also used to implement Figure 1 For a detailed description of the gravity module 203, please refer to the detailed description of steps S103 and S104.
[0072] It is worth noting that, since they share the same inventive concept as the gravity simulation method, the position module 201, the judgment module 202, and the gravity module 203 can also be used to implement other steps or sub-steps of the gravity simulation method. In this embodiment, they will not be described in detail, but can be found in the detailed introduction of the gravity simulation method.
[0073] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0074] It should also be understood that if the above embodiments are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.
[0075] Therefore, this embodiment also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the gravity simulation method provided in this embodiment. The computer-readable storage medium can be any medium capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0076] Please refer to Figure 5 This embodiment also provides an electronic device, which may include a processor 302 and a memory 301. The processor 302 and the memory 301 can communicate via a system bus 304. Furthermore, the memory 301 stores a computer program, and the processor implements the gravity simulation method provided in this embodiment by reading and executing the computer program in the memory 301 corresponding to the above embodiments.
[0077] See also Figure 5 The electronic device may also include a communication unit 303. The memory 301, processor 302 and communication unit 303 are directly or indirectly connected to each other via system bus 304 to realize data transmission or interaction.
[0078] The memory 301 can be an information recording device based on any electronic, magnetic, optical, or other physical principles, used to record execution instructions, data, etc. In some embodiments, the memory 301 can be, but is not limited to, volatile memory, non-volatile memory, memory drive, etc.
[0079] For example only, the volatile memory can be random access memory (RAM). The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable read-only memory (EPROM), electrically erasable read-only memory (EEPROM), flash memory, etc.; the storage drive can be a disk drive, solid-state drive, any type of storage disk (such as optical disc, DVD, etc.), or similar storage media, or a combination thereof.
[0080] The communication unit 303 is used to send and receive data over a network. In some embodiments, the network may include a wired network, a wireless network, a fiber optic network, a telecommunications network, an intranet, the Internet, a local area network (LAN), a wide area network (WAN), a wireless local area network (WLAN), a metropolitan area network (MAN), a public switched telephone network (PSTN), a Bluetooth network, a ZigBee network, or a near field communication (NFC) network, or any combination thereof. In some embodiments, the network may include one or more network access points. For example, the network may include wired or wireless network access points, such as base stations and / or network switching nodes, through which one or more components of the service request processing system can connect to the network to exchange data and / or information.
[0081] The processor 302 may be an integrated circuit chip with signal processing capabilities, and the processor may include one or more processing cores (e.g., a single-core processor or a multi-core processor). By way of example only, the processor described above may include a Central Processing Unit (CPU), an Application-Specific Integrated Circuit (ASIC), an Application-Specific Instruction-set Processor (ASIP), a Graphics Processing Unit (GPU), a Physics Processing Unit (PPU), a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), a Programmable Logic Device (PLD), a controller, a microcontroller unit, a Reduced Instruction Set Computing (RISC) computer, or a microprocessor, or any combination thereof.
[0082] It should be understood that the apparatus and methods disclosed in the above embodiments can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0083] The above descriptions are merely various embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A gravity simulation method, characterized by, The method comprises: obtaining a character position of a game character in a three-dimensional game world; judging whether the game character is located in a local gravity space of the three-dimensional game world according to the character position, wherein the number of the local gravity spaces is multiple; if yes, obtaining target gravity information according to the local gravity spaces, and the step specifically comprises: obtaining a priority of each local gravity space; determining a target gravity space with the highest priority according to the priority of each local gravity space; obtaining the target gravity information according to gravity information of the target gravity space; applying gravity corresponding to the target gravity information to the game character.
2. The gravity simulation method according to claim 1, wherein, The target gravity information comprises target intensity and target direction, and the application of gravity corresponding to the target gravity information to the game character comprises: applying gravity corresponding to the target intensity and target direction to the game character.
3. The gravity simulation method of claim 1, wherein, The number of the target gravity spaces is multiple, and the determination of the target gravity information according to the gravity information of the target gravity space comprises: obtaining gravity information of each target gravity space; superimposing the gravity information of each target gravity space to obtain the target gravity information.
4. The gravity simulation method according to claim 3, wherein The obtaining of the gravity information of each target gravity space comprises: obtaining a gravity adjustment parameter of the game character in the target gravity space at present; determining the gravity information of the target gravity space according to the gravity adjustment parameter.
5. The gravity simulation method of claim 1, wherein, The judgment of whether the game character is located in the local gravity space of the three-dimensional game world according to the character position comprises: obtaining a space position of the local gravity space in the three-dimensional game world; if the character position is located in a coverage range of the space position, the game character is located in the local gravity space.
6. The gravity simulation method of claim 1, wherein, The shape of the local gravity space comprises a cuboid, a sphere, a cylinder and a convex hull.
7. A gravity simulation device, characterized by, The device comprises: a position module for obtaining a character position of a game character in a three-dimensional game world; a judgment module for judging whether the game character is located in a local gravity space of the three-dimensional game world according to the character position, wherein the number of the local gravity spaces is multiple; a gravity module for obtaining target gravity information according to the local gravity spaces if yes, and the gravity module is further specifically used for: obtaining a priority of each local gravity space; determining a target gravity space with the highest priority according to the priority of each local gravity space; obtaining the target gravity information according to gravity information of the target gravity space; applying gravity corresponding to the target gravity information to the game character.
8. A storage medium, characterized by The storage medium stores a computer program, and the computer program is executed by a processor to implement the gravity simulation method in any one of claims 1-6.
9. An electronic device, comprising: The electronic device comprises a processor and a memory, and the memory stores a computer program, and the computer program is executed by the processor to implement the gravity simulation method in any one of claims 1-6.
Citation Information
Patent Citations
Digital jigsaw puzzle game for mobile device platforms
US20130079079A1