Particle data loading method, device, electronic device and readable storage medium
By loading particle data in stages on the game client, the problem of long game initialization loading time and multiple players stuttering in battle scenes caused by traditional preloading methods is solved, and faster loading time and lower memory usage are achieved.
Patent Information
- Application Number
- CN202111610272.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-27
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2041-12-27
AI Technical Summary
In large MMO games, traditional preloading methods lead to a long loading time for game initialization, and real-time loading of particle data in multiple players' battle scenarios leads to lag.
By implementing the phased loading of particle data on the game client, the initial particle data is loaded at the start of the game, and the scene particle data is loaded when the scene is triggered, and data management is performed using the preset storage space.
It reduces the loading time of game initialization, alleviates the pressure of memory usage, and avoids the lag caused by real-time loading of particle data in game team battles.
Smart Images

Figure CN114470753B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of game technology, and in particular to a particle data loading method, device, electronic device and readable storage medium. Background Art
[0002] In large-scale MMO (Massive Multiplayer Online Game) games, there are many game special effect resources, especially particle resources. The characters, mounts, and pets in the game all contain a large number of particles, and there are also skill particles when the characters release skills. In some multiplayer game scenes, when multiple characters release skill particles at the same time, it will cause a lag when the skills are first released, that is, the lag caused by loading a large number of particle resources at the same time.
[0003] In order to provide players with a better experience, the traditional preloading method will load all the required particle resources into the memory and video memory during the initialization phase. However, this will result in a long game initialization loading time and slow game startup. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide a particle data loading method, device, electronic device and readable storage medium to improve the above-mentioned problems.
[0005] In order to achieve the above purpose, the technical solution adopted by the embodiment of the present invention is as follows:
[0006] In a first aspect, an embodiment of the present invention provides a particle data loading method, which is applied to a game client, and the method includes:
[0007] When a game start instruction is received, first configuration information is read, where the first configuration information represents a first mapping relationship between the game start instruction and the first file;
[0008] According to the first mapping relationship, read the initial particle data in the first file, the initial particle data being the particle data used for game initialization;
[0009] Loading the initial particle data into a preset storage space;
[0010] When a scene trigger instruction is received, second configuration information is read, where the second configuration information represents a second mapping relationship between the scene trigger instruction and the second file;
[0011] According to the second mapping relationship, read the scene particle data in the second file;
[0012] The scene particle data is loaded into the preset storage space.
[0013] Furthermore, the second file includes a plurality of scene particle files, and when the scene trigger instruction is to enter the first scene, the step of reading the scene particle data in the second file includes:
[0014] Reading first scene particle data in a first scene particle file, where the first scene particle file is one of the scene particle files in the second file;
[0015] The step of loading the scene particle data into the preset storage space comprises:
[0016] The first scene particle data is loaded into the preset storage space.
[0017] Furthermore, after the step of loading the first scene particle data into the preset storage space, the method further comprises:
[0018] When a scene switching instruction is received, clearing the first scene particle data in the preset storage space; the scene switching instruction is to switch from the first scene to the second scene;
[0019] Reading the second configuration information;
[0020] Reading second scene particle data in a second scene particle file according to the second configuration information, where the second scene particle file is one of the scene particle files in the second file;
[0021] The second scene particle data is loaded into the preset storage space.
[0022] Furthermore, after the step of loading the first scene particle data into the preset storage space, the method further includes:
[0023] When the first scene exit instruction is received, the first scene particle data in the preset storage space is cleared.
[0024] Furthermore, after the step of clearing the first scene particle data in the preset storage space, the method further includes:
[0025] When a game exit instruction is received, the initial particle data in the preset storage space is cleared.
[0026] Furthermore, after the step of loading the first scene particle data into the preset storage space, the method further comprises:
[0027] When receiving the archive instruction, saving the current game data to obtain a first archive file, wherein the game data includes the first scene particle data;
[0028] When receiving an archive selection instruction, reading the first archive file; the archive selection instruction is to enter the first archive;
[0029] The game data is loaded according to the first archive file.
[0030] In a second aspect, an embodiment of the present invention provides a particle data loading device, which is applied to a game client, and the device includes:
[0031] A reading module, configured to read first configuration information when receiving a game startup instruction, wherein the first configuration information represents a first mapping relationship between the game startup instruction and the first file;
[0032] The reading module is further used to read the initial particle data in the first file according to the first mapping relationship, wherein the initial particle data is particle data used for game initialization;
[0033] A loading module, used for loading the initial particle data into a preset storage space;
[0034] The reading module is further configured to read second configuration information when receiving a scene trigger instruction, wherein the second configuration information represents a second mapping relationship between the scene trigger instruction and the second file;
[0035] The reading module is further used to read the scene particle data in the second file according to the second mapping relationship;
[0036] The loading module is also used to load the scene particle data into the preset storage space.
[0037] Furthermore, the second file includes a plurality of scene particle files, and when the scene trigger instruction is to enter the first scene, the reading module is specifically used to:
[0038] Reading first scene particle data in a first scene particle file, where the first scene particle file is one of the scene particle files in the second file;
[0039] The loading module is specifically used to load the first scene particle data into the preset storage space.
[0040] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising: a processor, a memory and a bus, wherein the processor comprises a CPU and a memory, and the memory stores a computer program executable by the CPU of the processor. When the electronic device is running, the processor communicates with the memory via the bus, and the CPU executes the computer program, which, when executed, performs any of the above-mentioned particle data loading methods.
[0041] In a fourth aspect, an embodiment of the present invention further provides a readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the particle data loading method described above is implemented.
[0042] Compared with the prior art, the particle data loading method, device, electronic device and readable storage medium provided in the embodiment of the present invention, when the game client receives the game startup instruction, reads the first configuration information, the first configuration information represents the first mapping relationship between the game startup instruction and the first file, and then reads the initial particle data in the first file according to the first mapping relationship, the initial particle data is the particle data used for game initialization, and then loads the initial particle data into the preset storage space; when the game client receives the scene trigger instruction, reads the second configuration information, the second configuration information represents the second mapping relationship between the scene trigger instruction and the second file, and then reads the scene particle data in the second file according to the second mapping relationship, and then loads the scene particle data into the preset storage space. In this way, the particle data is loaded respectively through the game initialization stage and the scene entry stage, thereby reducing the initialization loading time and alleviating the memory occupation pressure. At the same time, it also avoids the jamming caused by real-time loading of particle data in game group battles. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0044] Figure 1 A schematic diagram of the structure of a system architecture provided in an embodiment of the present application.
[0045] Figure 2 A schematic flow chart of a particle data loading method provided in an embodiment of the present invention.
[0046] Figure 3 One of the flowchart diagrams of another particle data loading method provided by an embodiment of the present invention.
[0047] Figure 4 The second flowchart of another particle data loading method provided by an embodiment of the present invention.
[0048] Figure 5 A third flow chart of another particle data loading method provided in an embodiment of the present invention.
[0049] Figure 6A fourth flowchart of another particle data loading method provided in an embodiment of the present invention.
[0050] Figure 7 A fifth flow chart of another particle data loading method provided in an embodiment of the present invention.
[0051] Figure 8 A schematic diagram of a game interface provided in an embodiment of the present application.
[0052] Fig. 9 A schematic diagram of functional modules of a particle data loading device provided in an embodiment of the present invention.
[0053] Fig.10 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention.
[0054] Icons: 100 - system architecture; 110 - graphics processor; 120, 410 - processor; 130 - system storage space; 140, 430 - bus; 111 - GPU; 112 - video memory; 121, 411 - CPU; 122, 412 - memory; 131 - particle data file; 300 - particle data loading device; 310 - reading module; 320 - loading module; 400 - electronic device; 420 - memory. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0056] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0057] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0058] In the description of the present invention, it should be noted that if the terms "upper", "lower", "inside", "outside", etc. appear to indicate an orientation or position relationship, they are based on the orientation or position relationship shown in the accompanying drawings, or are the orientation or position relationship in which the product of the invention is usually placed when used. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.
[0059] In addition, the terms “first”, “second”, etc., if used, are merely used to distinguish between the descriptions and should not be understood as indicating or implying relative importance.
[0060] It should be noted that, in the absence of conflict, the features in the embodiments of the present invention may be combined with each other.
[0061] With the development of game technology, the development of various games is also changing with each passing day, and various game special effects are designed to be more and more gorgeous. The display of game special effects depends on the realization of game special effects resources, especially a large amount of particle data.
[0062] For example, for large-scale MMO games, in the initial stage of game development, game manufacturers will generally plan the prototype of the game and classify the particle data involved in the game. According to the particle type, particles are divided into character attachment particles, magic weapon particles, character skill particles, pet particles, mount particles, mount skill particles, scene particles, etc.
[0063] In addition, the game may contain multiple game scenes, and the game players may choose from multiple characters, multiple mounts, multiple servants, multiple magic weapons, etc. Each character has its own corresponding skills, and each mount also has its own corresponding skills. Then each scene, character, mount, servant, magic weapon and skill has its corresponding particle. A particle has its corresponding particle file, for example, a magic weapon particle corresponds to a particle file, and a servant corresponds to a particle file.
[0064] The particle file contains description files, texture files and model files. The description file includes some relevant parameters for describing particle special effects, the texture file contains relevant texture resources for particle special effects, and the model file contains some model data of particle special effects shapes. In the game, the game screen will only be displayed correctly when the required resources of the screen are loaded. Game special effects are also a kind of required resources. When the particle data corresponding to the game special effects is loaded, the game special effects will be displayed correctly.
[0065] In the prior art, the processing method for particle data of MMO games is usually to load all particle data into memory during initialization, or to load a part of it during initialization and load the particle data in real time in the scene. The former will cause a large number of special effect resources to be loaded during initialization, resulting in a long loading time, slow game initialization process, and excessive memory and video memory will be occupied due to loading too many resources at one time; while the latter, although it alleviates the problem of long initialization time, will cause a large number of particle resources to be loaded at the same time when multiple players are fighting in the game and a team battle breaks out, and multiple people release skill particles at the same time, causing players to release skills at a lag.
[0066] The embodiments of the present application provide a particle data loading method, device, electronic device and storage medium to improve the above-mentioned problems, which are described in detail below through embodiments and in conjunction with the attached drawings.
[0067] The embodiment of the present invention provides a system architecture 100. Figure 1 , Figure 1 A schematic diagram of a system architecture provided in an embodiment of the present application, wherein the system architecture 100 may include: a graphics processor 110, a processor 120, a system storage space 130 and a bus 140;
[0068] The graphics processor 110 includes a GPU 111 and a video memory 112, and the processor 120 includes a CPU 121 and a memory 122. The graphics processor 110 and the processor 120, and the processor 120 and the system storage space 130 can communicate via a bus 140.
[0069] The system storage space 130 includes a particle data file 131. When the player starts the game and enters the initialization state, the CPU 121 of the processor 120 accesses the particle data file 131 in the system storage space 130 through the bus 140, obtains the initial particle data therein, and loads the initial particle data into the memory 122 again through the bus 140.
[0070] When the player selects a game scene to enter the scene loading state, the CPU 121 of the processor 120 accesses the particle data file 131 in the system storage space 130 through the bus 140, obtains the scene particle data therein, and loads the scene particle data into the memory 122 through the bus 140 again.
[0071] Among them, a part of the preset storage space can be divided from the memory 122 for storing the loaded particle data. For example, if the memory 122 is 1GB, 200MB of it is used as the preset storage space for storing the particle data loaded into the memory. It should be noted that this example is only an example and is not limited here.
[0072] When a player releases a skill with game special effects during the game, after the player clicks on the skill, CPU 121 accesses memory 122 through bus 140, loads the particle data corresponding to the skill into video memory 112, and then GPU 111 accesses the particle data corresponding to the skill in video memory 112 through bus 140, and completes the rendering of the skill special effects based on the particle data.
[0073] The system architecture 100 may exist in a device, which may be, but is not limited to, a desktop computer, a smart phone, a tablet, a notebook, etc.
[0074] The embodiment of the present invention also provides a particle data loading method, the execution subject of which is a game client, and the game client can be installed and run in the above-mentioned device. Specifically, Figure 2 For a flow chart of a particle data loading method provided in an embodiment of the present application, please refer to Figure 2 The method steps include:
[0075] S200: When a game start instruction is received, read first configuration information.
[0076] The first configuration information may represent a first mapping relationship between the game startup instruction and the first file.
[0077] S201. Read initial particle data in a first file according to a first mapping relationship.
[0078] The initial particle data is the particle data used for game initialization.
[0079] It can be understood that only after the first mapping relationship between the game startup instruction and the first file in the first configuration information is obtained, the initial particle data in the first file can be read according to the first mapping relationship.
[0080] S202, loading initial particle data into a preset storage space.
[0081] S203: When a scene trigger instruction is received, read the second configuration information.
[0082] The second configuration information may represent a second mapping relationship between the scene trigger instruction and the second file.
[0083] S204. Read the scene particle data in the second file according to the second mapping relationship.
[0084] It can be understood that only after the second mapping relationship between the scene trigger instruction and the second file in the second configuration information is obtained, the scene particle data in the second file can be read according to the second mapping relationship.
[0085] It should be noted that the second file and the first file are both particle data files. The first file contains the particle data loaded during initialization, and the second file contains the particle data loaded when the scene is triggered.
[0086] S205: Load the scene particle data into a preset storage space.
[0087] In a possible implementation, after the player starts the game and completes the initialization, he may choose to enter a certain game scene. In the process of entering the scene, the particle data in the scene needs to be loaded.
[0088] It should be noted that after executing step S202, if the game client does not receive a scene trigger instruction, steps S203, S204 and S205 will not be executed.
[0089] The particle data loading method provided by the embodiment of the present invention reads the first configuration information when the game client receives the game startup instruction, the first configuration information represents the first mapping relationship between the game startup instruction and the first file, and then reads the initial particle data in the first file according to the first mapping relationship, the initial particle data is the particle data used for game initialization, and then loads the initial particle data into the preset storage space; when the game client receives the scene trigger instruction, the second configuration information is read, the second configuration information represents the second mapping relationship between the scene trigger instruction and the second file, and then reads the scene particle data in the second file according to the second mapping relationship, and then loads the scene particle data into the preset storage space. In this way, the particle data is loaded respectively through the game initialization stage and the scene entry stage, thereby reducing the initialization loading time.
[0090] In a possible implementation, when a player enters the game, he may go to the equipment bar to adjust the equipment and preview the equipment; he may also go to the mall to buy things, such as fashion, magic weapons, mounts or pets. Each game character, each piece of equipment and fashion, each magic weapon, mount and pet may have a unique display effect, that is, it has its own particle data.
[0091] In this case, the initial particle data that needs to be initialized and loaded may include particle data of game character particles, equipment particles, fashion particles, magic weapon particles, mount particles, and servant particles. It should be noted that this example is only an example and is not limited here.
[0092] It is understandable that in order to alleviate the pressure of initializing and loading too much particle data, or to alleviate the lag caused by real-time loading of particle data in the scene, the scene particle data needs to be loaded when the scene is triggered.
[0093] Optionally, the scene particle data may be particle data corresponding to a map file in a game scene whose size exceeds 80KB, or particle data corresponding to a model file whose size exceeds 3MB.
[0094] Optionally, the second file may contain multiple scene particle files. When the scene trigger instruction is to enter the first scene, Figure 2 In steps S204 and S205, the embodiment of the present invention provides a possible implementation method to load the particle data of the first scene. Figure 2 On the basis of Figure 3 A flow chart of another particle data loading method provided by an embodiment of the present invention is shown in FIG. Figure 3 , the sub-steps of step S204 include:
[0095] Step S204 - 1 , reading the first scene particle data in the first scene particle file.
[0096] It can be understood that the first scene particle file is one of the scene particle files in the second file.
[0097] The sub-steps of step S205 include:
[0098] Step S205-1, loading the first scene particle data into a preset storage space.
[0099] Optionally, when the player wants to switch scenes in the middle of the game of the first scene, the embodiment of the present invention provides a possible implementation method to load particle data in the case of scene switching. Figure 3 On the basis of Figure 4 A flow chart of another particle data loading method provided by an embodiment of the present invention is shown in FIG. Figure 4 , after step S205-1, further comprising:
[0100] Step S206: When a scene switching instruction is received, the first scene particle data in the preset storage space is cleared.
[0101] It can be understood that step S206 is performed after step S205-1. The game includes multiple scenes, and the scene switching instruction can be to switch from the first scene to the second scene.
[0102] Step S207: read the second configuration information.
[0103] Step S208: Read the second scene particle data in the second scene particle file according to the second configuration information.
[0104] It can be understood that the second file includes multiple scene particle files, and the second scene particle file is one of the scene particle files in the second file.
[0105] Step S209: Load the second scene particle data into a preset storage space.
[0106] It can be understood that in order to reduce the occupation of storage space, when switching from the first scene to the second scene, the first scene particle data in the preset storage space needs to be cleared, and then the second scene particle data is loaded.
[0107] Optionally, when the player wants to exit the game scene in the middle of the game of the first scene, the embodiment of the present invention provides a possible implementation method to realize the processing of particle data in the case of exiting the scene. Figure 3 On the basis of Figure 5 A flow chart of another particle data loading method provided by an embodiment of the present invention is shown in FIG. Figure 5 , after step S205-1, further comprising:
[0108] Step S206a: when the first scene exit instruction is received, clear the first scene particle data in the preset storage space.
[0109] It can be understood that in order to reduce the occupation of storage space, when the first scene is exited, the first scene particle data in the preset storage space needs to be cleared.
[0110] Optionally, when a player needs to exit the game after entering the game, the embodiment of the present invention provides a possible implementation method to process the particle data in the case of game exit. Figure 5 On the basis of Figure 6 A flow chart of another particle data loading method provided by an embodiment of the present invention is shown in FIG. Figure 6 , after step S206a, further comprising:
[0111] Step S207a: when a game exit instruction is received, the initial particle data in the preset storage space is cleared.
[0112] It should be noted that step S207a may also be performed after step 202. Figure 6 The execution of step S207a after step S206a is only an example and is not limited here.
[0113] Optionally, when the game has a save function, the player may save the game in the middle of the scene in order to challenge the scene multiple times. The embodiment of the present invention provides a possible implementation method to realize the processing of particle data when the player saves and reads the game. Figure 3 On the basis of Figure 7A flow chart of another particle data loading method provided by an embodiment of the present invention is shown in FIG. Figure 7 , after step S205-1, further comprising:
[0114] Step S206b: When a save instruction is received, the game data at the current moment is saved to obtain a first save file.
[0115] It can be understood that the game data may include first scene particle data and other game data.
[0116] Step S207b: when an archive selection instruction is received, read the first archive file.
[0117] The archive selection instruction is to enter the first archive.
[0118] Step S208b: loading game data according to the first archive file.
[0119] It should be noted that step S206b may be executed after step S205-1 or after step S209.
[0120] In a possible implementation, the player may perform multiple save operations during the game and obtain multiple saves. The player can enter the save selection interface from the game main interface. Specifically, Figure 8 A schematic diagram of a game interface provided in an embodiment of the present application, see Figure 8 , players can select any archive file in the archive selection interface. After the player selects an archive file, the game client reads the archive file and loads the corresponding game data according to the archive file. The game data contains the particle data corresponding to the archive file.
[0121] Combination Fig. 9 The embodiment of the present invention further provides a particle data loading device 300, which is applied to a game client. It should be noted that its basic principle and technical effects are the same as those of the corresponding method embodiment described above. For the sake of brief description, the parts not mentioned in this embodiment can refer to the corresponding contents in the method embodiment. The particle data loading device may include:
[0122] The reading module 310 is used to read the first configuration information when receiving a game start instruction.
[0123] The first configuration information represents a first mapping relationship between the game startup instruction and the first file.
[0124] The reading module 310 is further used to read the initial particle data in the first file according to the first mapping relationship, where the initial particle data is the particle data used for game initialization.
[0125] In this embodiment, the reading module 310 may be used to execute the above-mentioned step S200 and step S201 .
[0126] The loading module 320 is used to load the initial particle data into a preset storage space.
[0127] In this embodiment, the loading module 320 may be used to execute the above step S202 .
[0128] The reading module 310 is used to read the second configuration information when receiving the scene trigger instruction, where the second configuration information represents the second mapping relationship between the scene trigger instruction and the second file;
[0129] The reading module 310 is further used to read the scene particle data in the second file according to the second mapping relationship.
[0130] In this embodiment, the reading module 310 may be used to execute the above steps S203 and S204.
[0131] The loading module 320 is used to load the scene particle data into a preset storage space.
[0132] In this embodiment, the loading module 320 may be used to execute the above step S205 .
[0133] Furthermore, the second file includes a plurality of scene particle files. When the scene trigger instruction is to enter the first scene, the reading module 310 of the particle data loading device 300 is specifically used for:
[0134] The first scene particle data in the first scene particle file is read, where the first scene particle file is one of the scene particle files in the second file.
[0135] The loading module 320 is specifically used to load the first scene particle data into a preset storage space.
[0136] The above-mentioned device is used to execute the method provided by the aforementioned embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0137] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital dingnal processors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SoC).
[0138] Furthermore, based on the above-mentioned particle data loading method, an embodiment of the present invention also provides an electronic device 400. Fig.10 , Fig.10 A structural schematic diagram of an electronic device provided for an embodiment of the present application, the electronic device may include: a processor 410, a memory 420 and a bus 430, the processor 410 includes a CPU 411 and a memory 412, the memory 420 stores a computer program executable by the CPU 411 of the processor 410, when the electronic device is running, the processor 410 and the memory 420 communicate through the bus 430, the CPU 411 executes the computer program, and the above-mentioned method embodiment is implemented when the computer program is executed.
[0139] Furthermore, based on the above-mentioned particle data loading method, a readable storage medium is also provided in an embodiment of the present invention, on which a computer program is stored, and the above-mentioned method embodiment is implemented when the computer program is executed.
[0140] In summary, the embodiment of the present invention provides a particle data loading method, device, electronic device and readable storage medium. When the game client receives a game startup instruction, the first configuration information is read, and the first configuration information represents the first mapping relationship between the game startup instruction and the first file. Then, according to the first mapping relationship, the initial particle data in the first file is read, and the initial particle data is used for game initialization. Then, the initial particle data is loaded into a preset storage space; when the game client receives a scene trigger instruction, the second configuration information is read, and the second configuration information represents the second mapping relationship between the scene trigger instruction and the second file. Then, according to the second mapping relationship, the scene particle data in the second file is read, and then the scene particle data is loaded into the preset storage space. In this way, the particle data is loaded respectively through the game initialization stage and the scene entry stage, thereby reducing the initialization loading time and alleviating the memory occupation pressure. At the same time, it also avoids the jamming caused by real-time loading of particle data in game group battles.
[0141] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A particle data loading method, characterized in that: Applied to a game client, the method includes: When a game start instruction is received, first configuration information is read, where the first configuration information represents a first mapping relationship between the game start instruction and the first file; According to the first mapping relationship, read the initial particle data in the first file, the initial particle data being the particle data used for game initialization; Loading the initial particle data into a preset storage space; When a scene trigger instruction for entering a first scene is received, second configuration information is read, where the second configuration information represents a second mapping relationship between the scene trigger instruction and a second file; the second file includes a plurality of scene particle files; According to the second mapping relationship, read the first scene particle data in the first scene particle file, where the first scene particle file is one of the scene particle files in the second file; Loading the first scene particle data into the preset storage space; When a scene switching instruction is received, clearing the first scene particle data in the preset storage space; the scene switching instruction is to switch from the first scene to the second scene; Reading the second configuration information; Reading second scene particle data in a second scene particle file according to the second configuration information, where the second scene particle file is one of the scene particle files in the second file; The second scene particle data is loaded into the preset storage space.
2. The method according to claim 1, characterized in that After the step of loading the first scene particle data into the preset storage space, the method further includes: When the first scene exit instruction is received, the first scene particle data in the preset storage space is cleared.
3. The method according to claim 2, characterized in that After the step of clearing the first scene particle data in the preset storage space, the method further includes: When a game exit instruction is received, the initial particle data in the preset storage space is cleared.
4. The method according to claim 1, characterized in that After the step of loading the first scene particle data into the preset storage space, the method further includes: When receiving the archive instruction, saving the current game data to obtain a first archive file, wherein the game data includes the first scene particle data; When receiving an archive selection instruction, reading the first archive file; the archive selection instruction is to enter the first archive; The game data is loaded according to the first archive file.
5. A particle data loading device, characterized in that: Applied to a game client, the device comprises: A reading module, configured to read first configuration information when receiving a game startup instruction, wherein the first configuration information represents a first mapping relationship between the game startup instruction and the first file; The reading module is further used to read the initial particle data in the first file according to the first mapping relationship, wherein the initial particle data is particle data used for game initialization; A loading module, used for loading the initial particle data into a preset storage space; The reading module is further used to read second configuration information when receiving a scene trigger instruction to enter the first scene, wherein the second configuration information represents a second mapping relationship between the scene trigger instruction and a second file; the second file includes a plurality of scene particle files; The reading module is further used to read first scene particle data in a first scene particle file according to the second mapping relationship, where the first scene particle file is one of the scene particle files in the second file; The loading module is further used to load the first scene particle data into the preset storage space; The loading module is further configured to clear the first scene particle data in the preset storage space when receiving a scene switching instruction; the scene switching instruction is to switch from the first scene to the second scene; The reading module is further used to: read the second configuration information; and read the second scene particle data in the second scene particle file according to the second configuration information, where the second scene particle file is one of the scene particle files in the second file; The loading module is further used to load the second scene particle data into the preset storage space.
6. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the processor includes a CPU and a memory, the memory stores a computer program executable by the CPU of the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and the CPU executes the computer program, which executes the steps of the particle data loading method as described in any one of claims 1 to 4.
7. A readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed, the steps of the particle data loading method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Game data processing method and device, storage medium, processor and electronic device
CN111773704A