Baking method and playing method of particle system, equipment, medium and product

By generating deterministic parameter sequences and using a segmented storage mechanism in the particle system, the problem of high storage costs for particle reversal effects on low-performance mobile devices is solved, enabling smooth operation of particle reversal effects on low-performance devices and ensuring the determinism and consistency of particle motion.

CN121236239APending Publication Date: 2025-12-30SHANGHAI MIHA YOUHAIYUANCHENG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511333899.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-18
Publication Date
2025-12-30

AI Technical Summary

Technical Problem

In existing technologies, particle reversal effects have high storage costs when implemented on low-performance mobile devices, and cannot effectively solve the problems of randomness in particle motion and reverse simulation.

Method used

By employing a pre-prepared parameter sequence and segmented storage mechanism in the patent, a deterministic parameter sequence is generated, divided into start-up phase and loop phase data. Through the implementation phase data, the generated sequence and segmented data are used to generate start-up phase and loop phase data, ensuring the determinism and loopability of particle behavior, reducing storage requirements, and dynamically calculating the target sampling time point based on the current playback mode and device time during playback, extracting particle state data and driving rendering.

Benefits of technology

It enables smooth operation of particle reverse playback effects on low-performance mobile devices, reduces storage costs and computational load, ensures the determinism and consistency of particle motion, and breaks through the bottleneck of linear growth in data volume with playback duration in traditional solutions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121236239A_ABST
    Figure CN121236239A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to the technical field of computers, and discloses a baking method, a playing method and equipment of a particle system, a medium and a product. The baking method of the particle system comprises the following steps: pre-generating a deterministic parameter sequence; for a continuous emission type particle system, controlling particle behaviors according to the deterministic parameter sequence; according to the particle behavior, starting stage sequence data and circulation stage sequence data are generated; wherein the starting stage sequence data records the process from the first emission of particles to the stable state of the particle system, and the cycle stage sequence data records the particle behavior in a complete operation cycle based on the deterministic parameter sequence. The technical problems that in the related technology, the storage cost is high, and implementation cannot be achieved on low-performance mobile equipment are solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computers, and in particular to a particle system baking method, a playing method, a device, a medium and a product. BACKGROUND

[0002] The development of the particle reverse special effect comes from the demand of gameplays such as "time reversal" in games. Generally, the particle system runs to calculate the parameters of the next frame (such as deriving the motion state of the next frame according to the current particle position and speed every frame). Since the parameters of each frame are generated by dynamic calculation, the particle trajectory is difficult to fix, resulting in greater randomness of the particle motion process. At the same time, since the conventional logic can only "positively deduce the next frame", it cannot deduce the state of the previous frame from the current frame, resulting in difficulty in reverse simulation of particle motion. Therefore, the particle reverse special effect cannot be directly implemented based on the conventional particle running logic, and an independent technical solution needs to be designed for it, which also makes the particle reverse a technical difficulty that needs to be specially tackled in game development. At present, the common solutions in the industry mainly include a baked particle data solution and a frame-by-frame simulation solution.

[0003] However, the inventors have found that at least the following technical problems exist in the related art: the existing baked data or frame-by-frame simulation solution has a high storage cost and cannot be implemented on low-performance mobile devices. SUMMARY

[0004] An object of the present application is to provide a particle system baking method, a playing method, a device, a medium and a product, at least to solve the technical problem of high storage cost and inability to implement on low-performance mobile devices in the related art.

[0005] To achieve the above object, some embodiments of the present application provide the following aspects:

[0006] In a first aspect, some embodiments of the present application provide a particle system baking method, which includes: pre-generating a deterministic parameter sequence; for a continuous emission type particle system, controlling particle behavior according to the deterministic parameter sequence; generating start stage sequence data and cycle stage sequence data according to the particle behavior; wherein the start stage sequence data records the process from the first emission of particles to the stable state of the particle system, and the cycle stage sequence data records the particle behavior in a complete running period based on the deterministic parameter sequence.

[0007] In a second aspect, some embodiments of the present application further provide a playback method of a particle system, characterized by using the baked sequence data generated by the method as described above, the method comprising: obtaining the baked sequence data and initializing a time axis pointer and a playback mode parameter; the playback mode parameter comprising normal playback, reverse playback and fast forward; dynamically calculating a target sampling time point based on a current playback mode and a device time; extracting particle state data corresponding to the target sampling time point from the sequence data and driving particle rendering based on the particle state data and real-time calculation logic; determining whether to continue the steps of dynamically calculating the target sampling time point, extracting the particle state data and driving the particle rendering or terminate the playback according to a current playback progress and a particle system type.

[0008] In a third aspect, some embodiments of the present application further provide an electronic device, comprising: one or more processors; and a memory storing computer program instructions which, when executed, cause the processor to perform the steps of the method as described above.

[0009] In a fourth aspect, some embodiments of the present application further provide a computer readable medium having stored thereon computer program instructions executable by a processor to implement the method as described above.

[0010] In a fifth aspect, some embodiments of the present application further provide a computer program product comprising computer programs / instructions which, when executed by a processor, implement the steps of the method as described above.

[0011] Compared with the related art, the scheme provided in the embodiments of the present application aims to provide a particle system baking method and a playing method suitable for middle and low-end devices, and through fixed cycle mechanism and storage structure optimization, the particle playback effect required by the game is realized with low memory overhead and the high calculation problem of frame-by-frame simulation is avoided. Specifically, the system converts the unpredictable behavior of the traditional particle system based on real-time random algorithm into a deterministic periodic motion of calling parameters in sequence order by pre-generating a fixed-length deterministic parameter sequence, such as the initial velocity of the particle, the color change, and other random parameters are obtained from the sequence cycle, so as to compress the infinite random particle behavior into a finite periodic regular motion, fundamentally change the data recording mode, and avoid the problem of infinite increase of data volume with time in the traditional random mode. On this basis, the system combines the segmented storage mechanism to divide the baked data into the start phase of recording the start transition process and the cycle phase containing the complete deterministic cycle, and only needs to store limited time data to support infinite time special effect playing through cycle reuse, breaking through the technical bottleneck of linear increase of data volume with playing time in the traditional scheme, and realizing the optimization effect of "fixed storage cost supporting infinite running"; and the regularization processing of the particle behavior by the fixed cycle mechanism lays a foundation for the accurate realization of the particle playback from the data dimension, ensuring that the middle and low-end devices can also smoothly run complex particle playback special effects. BRIEF DESCRIPTION OF DRAWINGS

[0012] One or more embodiments are illustrated by way of example in the figures that form a part of this patent document, these example are not intended to limit the embodiments, elements having the same reference numbers in the figures indicate like elements, unless otherwise specifically noted, the figures in the drawings do not constitute a proportional limit.

[0013] Figure 1 An example flowchart of a particle system baking method provided for some embodiments of the present application;

[0014] Figure 2 An example flowchart of an application example of a particle system baking method provided for some embodiments of the present application;

[0015] Figure 3 An example flowchart of a particle system playing method provided for some embodiments of the present application;

[0016] Figure 4 In a particle system playing method provided for some embodiments of the present application, during playback, the world coordinates of the new batch of particle emission are reversely calculated based on the trajectory data provided externally, and the actual display position is calculated in combination with the relative offset amount;

[0017] Figure 5 An example structure diagram of an electronic device provided for some embodiments of the present application. DETAILED DESCRIPTION

[0018] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0019] The following terms are used herein.

[0020] Particle system: A technique used in computer graphics, game development, and visual effects for simulating and rendering large collections of tiny objects. Its basic principle is to use "particles" as the basic unit, and to control the properties of each particle (such as position, velocity, acceleration, color, transparency, life cycle, etc.) independently or in groups, to achieve complex and variable dynamic visual effects such as fire, smoke, explosions, water splashes, magic, etc.

[0021] Particle: Refers to the smallest basic unit that constitutes an effect in a particle system, usually in the form of a single simple model.

[0022] Particle reverse playback: Refers to playing the animation effects generated by the particle system in reverse order of time, so that the dynamic process from front to back presents a reverse effect from back to front.

[0023] The types of particle systems involved in this article are described as follows:

[0024] Normal particle system: Refers to a particle system that only performs a single emission without periodic cycle logic. The core feature is that the particle emission behavior is completed once, that is, only a preset number of particles are emitted at the trigger, there is no subsequent batch emission, and the dynamic effect ends when the last particle ends its life cycle (such as disappearing, being destroyed). Typical application scenarios include one-time visual effects such as explosion effects in games, instantaneous flashes when skills are released, and debris splashing when objects break.

[0025] Continuous emission particle system: A particle system that achieves long-term continuous dynamic effects by periodically emitting particle batches. Its core mechanism is to emit particle batches at fixed or dynamic intervals, and the motion parameters (such as initial velocity direction, color, size, life cycle, etc.) of each batch of particles are randomly generated by the system in real time. Through the logic of "tending to balance between the number of particles emitted per unit time and the number of particles disappearing", the relative stability of the total number of particles in the field is maintained to present a continuous dynamic effect. Among them, the "continuity" of this system only reflects the continuity of the effect, because the particle parameters are randomly generated in real time, the behavior of each batch of particles is different, and there is no fixed periodic cycle in the true sense.

[0026] Cyclic particle system: refers to the particle system of the present application, which realizes the periodic cycle of particle behavior based on the pre-generated deterministic parameter sequence. The core feature is that a fixed-length parameter sequence is pre-generated in the baking stage (each group of parameters defines the motion, morphology and other attributes of particles), and the sequence parameters are called in the order of particle emission batch during playback, and the first group is recycled after all parameter groups are used up, forming a predictable fixed cycle; particle behavior is driven by deterministic parameters, without real-time random calculation, and particles of the same batch present completely consistent motion trajectory and morphology in any scenario, realizing "limited parameter support for unlimited cycle effect".

[0027] World space emission particle system: a subclass of continuous emission particle system, refers to the particle system whose particles are decoupled from the emitter after emission and whose motion trajectory is based on the global coordinate system of the game world. Even if the emitter moves, rotates or scales, the generated particles will still maintain their absolute position and motion trajectory in the world space.

[0028] First embodiment

[0029] The first embodiment of the present application relates to a baking method of a particle system. It aims to balance the playback effect, computational efficiency and memory occupation of particle special effects through deterministic parameter sequence and staged baking, especially suitable for the hardware constraints of low-performance mobile devices. As shown in Figure 1 The method can include the following steps:

[0030] Step S101, pre-generate a deterministic parameter sequence;

[0031] Step S102, for a continuous emission particle system, control particle behavior according to the deterministic parameter sequence;

[0032] Step S103, generate start stage sequence data and cycle stage sequence data according to the particle behavior;

[0033] Wherein, the start stage sequence data records the process from the first emission of particles to the stable state of the particle system, and the cycle stage sequence data records the particle behavior within one complete running period based on the deterministic parameter sequence.

[0034] The above steps are described in detail as follows.

[0035] For step S101, the core logic of the static random sequence is to fix the parameters (such as the birth position, the emission direction, etc.) that need to be randomly calculated for each particle in the traditional particle system as the particle parameters in the first cycle period of the particle system. Specifically, in the recording phase, the particle system still emits particles in the conventional full random way, but the system will record the randomly generated parameters of all particles from the emission of the first particle to the period when the particle system enters the stable state (i.e., the number of particles emitted per unit time and the number of particles disappeared tend to balance) simultaneously. The recorded parameter set constitutes a static sequence.

[0036] On this basis, a set of ordered deterministic parameter sequences can be generated in advance before the particle system is baked. Each parameter group in the deterministic parameter sequence corresponds to the dynamic attribute of the particle emission. The dynamic attribute can include but is not limited to the initial velocity direction of the particle, the color change rule, the size scaling ratio, etc. By defining and storing the deterministic parameter sequence in advance, the random behavior that depends on real-time calculation in the traditional particle system can be converted into a deterministic motion trajectory that can be accurately reproduced.

[0037] For step S102, specifically, the pre-generated deterministic parameter sequence can be called in the order of particle emission batches, that is, the first batch of particles takes the first group of parameters (such as initial velocity (0.2, 1.8, -0.1), color (255, 100, 30)), the second batch takes the second group of parameters (such as initial velocity (-0.3, 2.1, 0.2), color (255, 140, 50)), and so on, until the first group of parameters is reused after all parameter groups in the sequence are used up, forming a fixed-period parameter calling mechanism. Through this mechanism, the behavior of "randomly generating parameters for each particle" of the continuous emission type particle system is converted into a periodic mode of the "batch-level deterministic parameter driven" circulating particle system: the initial velocity, color, size, etc. of each batch of particles are fixed and defined by the pre-set parameter group, ensuring that the motion trajectory and morphology of the same batch of particles are completely consistent in any playback scene, maintaining the dynamic continuity of continuous effects such as flame burning and smoke floating, avoiding the performance overhead of real-time calculation of random parameters, and realizing low-power deterministic particle effects.

[0038] For step S103, by way of example, the behavior of the converted circulating particle system can be solidified into reusable data by recording in stages, specifically including start phase sequence data and loop phase sequence data.

[0039] Wherein, for the start phase sequence data, the complete process from the first particle emission to the stable state can be recorded by the particle system. The stable state is mainly used to characterize the state in which the number of newly emitted particles and the number of disappeared particles in the particle system per unit time tend to be balanced. For example, in the baking bonfire flame particle system, the start phase can be recorded from the moment of ignition. As the flame burns gradually, the number of particles in the field gradually increases from the initial sporadic state until the number of newly added particles per second is basically equal to the number of disappeared particles, and the flame presents a stable burning state.

[0040] In some examples, the determination of the stable state can be assisted by a data entry callback function: when the particle system first emits new particles, the callback function can monitor the system state in real time; if it is monitored that all particles in the first batch have ended their life cycle, it can be determined that the particle system enters a stable state, at this time, the particle system can generate a batch of new particles, and a batch of earlier generated particles can be destroyed at the same time, so that the total number of particles in the field remains constant. In this case, the recording process of the start phase can be terminated immediately.

[0041] In this way, the start phase sequence data can record the transition process of the particles from the first emission to the stable state, and further retain the dynamic transition effect at the start of the special effect. Taking a flame particle system with a length of 15 of the deterministic parameter sequence as an example: after the system emits the first batch of flame particles, the callback function monitors that all particles in the batch are extinguished after 5 seconds, and the number of particles in the field remains stable (one batch is added and one batch is disappeared per second), at this time, it is determined that the system enters a stable state, the first stage recording is ended, and the particle state data in the first 5 seconds is recorded completely. In this way, the integrity of the start phase data can be ensured, and the basis for subsequent recycling of the cycle phase data based on the deterministic parameter sequence can be laid.

[0042] Wherein, for the generation of the cycle phase sequence data, the particle behavior in a complete cycle based on the deterministic parameter sequence can be recorded. When determining the recording integrity, the number of recorded particle batches can be compared with the number of parameter groups in the deterministic parameter sequence: when the two numbers are consistent, it can be determined that the recording of a complete cycle is completed.

[0043] Specifically, the system can pre-set the number of parameter groups (e.g., N groups) of the deterministic parameter sequence. During the baking process, the complete life cycle data of each batch of particles can be recorded in sequence. When the number of recorded particle batches reaches N, it indicates that all parameter groups of the sequence have been called once completely, i.e., a complete running cycle of recording is completed. For example, if the deterministic parameter sequence contains 3 groups of parameters, the cycle phase can be started after the start phase ends, and the complete state data of the 1st batch of particles (calling the 1st group of parameters), the 2nd batch of particles (calling the 2nd group of parameters), and the 3rd batch of particles (calling the 3rd group of parameters) from emission to disappearance are recorded in sequence. When the life cycle of the 3rd batch of particles ends, since 3 batches of particles have been recorded and the number of parameter groups is 3, it can be determined that the recording of the cycle phase sequence data is complete. Since each group of particle parameters corresponds to a unique index in the deterministic parameter sequence, recording the life cycle of N batches of particles can cover all pre-set parameter combinations. During subsequent playback, only these N groups of data need to be recycled, which can realize the playback of special effects for an infinite length without the need for additional data recording.

[0044] In some examples, a counter mechanism can be used to assist in determining the completeness of the recording. A callback function can start a counter, and the counter value is incremented by 1 each time a complete cycle of a batch of particles from generation to disappearance is recorded. When the counter value reaches the number of parameter groups of the deterministic parameter sequence, it can be confirmed that the life cycle of the particles corresponding to all parameter groups has been recorded, and thus the second phase recording is completed.

[0045] In this step, through the start phase sequence data, the natural transition effect at the start of the special effect can be effectively preserved; at the same time, through the recycling of the cycle phase sequence data, the goal of "limited data supporting infinite length playback" can be achieved, thereby avoiding the storage redundancy problem caused by the need to store infinite length data in the traditional scheme. For example, in the baking process of the present embodiment, only two pieces of core data can be stored: one is the start phase sequence data (such as the particle state data of the first 5 seconds), and the other is the cycle phase sequence data (such as recording the particle state data corresponding to 4 seconds for the pre-generated 15 groups of particle parameter sequences). Based on these two pieces of data, the start phase sequence data can be played first during playback, and then the cycle phase sequence data can be recycled, thereby realizing the playback of special effects for an infinite length; in terms of data volume, the huge volume of "length x frame rate" in the traditional scheme can be compressed to the simplified data of a fixed period. For example, in some examples, for a special effect of 10 minutes, only 9 seconds of data needs to be stored to meet the playback requirements.

[0046] In the related art, a traditional baked particle data scheme refers to recording all particle attributes of each frame or key frame in a particle system forward simulation process to form complete "time axis snapshot" data. When playback in reverse is needed, the system only needs to read and restore these snapshot data in reverse order of time to complete the playback in reverse, fast forward, pause, and jumping to an arbitrary time point of the particle effect. The scheme has the following defects: first, the playback duration is strictly bound to the baked data duration, that is, the particle effect needs to be played for how long, and the snapshot data of the same duration needs to be baked in advance (for example, a 10-second effect needs to be baked for 10 seconds, and it is not possible to achieve longer playback by shortening the baking duration), which leads to large runtime memory consumption; second, it cannot support world space particle effects, such as dust raised when an object moves, whose position cannot be determined in advance during the baking stage; third, due to the dependence on fixed time axis snapshots, playback speed is inconsistent on devices with different frame rates.

[0047] A traditional frame-by-frame simulation scheme refers to relying on the deterministic simulation capability of a particle system. When a particle state at a specified time is needed, the system starts from the initial state of the particle and re-computes frame by frame to simulate to the specified time, and then reversely restores the particle state of the particle at the time. At present, most particle playback requirements are implemented using this scheme. The scheme has the following defects: a large amount of computation is required for each frame, for example, to obtain the particle state of the 100th frame, it needs to be re-computed from the 1st frame to the 100th frame, and as the total animation duration increases, the amount of computation per frame increases exponentially (because the longer the duration, the more simulation steps need to be traced back per frame), which makes it difficult to apply the scheme on devices with poor performance.

[0048] Moreover, some requirements require the implementation of particle effect playback, reverse playback, pause, and fast forward functions on low-performance mobile devices, but the traditional technical scheme faces the dual bottleneck of computing efficiency and memory occupation: the traditional frame-by-frame simulation scheme relies on the real-time computing capability of the particle system, and each frame needs to be simulated from the initial state to the target time. As the animation duration increases, the amount of computation per frame increases exponentially, requiring extremely high CPU processing power. Low-performance mobile devices have limited hardware computing power, making it difficult to support such continuous intensive computation, which can easily cause frame rate to drop, animation to lag, and other problems; the traditional baked particle data scheme has problems in resource occupation: the scheme needs to store frame snapshot data (including the position, color, and other full attributes of each frame of particles) that completely match the playback duration, resulting in a linear increase in data volume with the duration of the effect. Since the memory capacity of low-performance mobile devices is usually limited, a large amount of baked data can easily exceed the upper limit of the device memory, causing memory overflow or loading failure, and failing to meet the stable operation requirements.

[0049] The randomness of the traditional particle system further exacerbates the above problems: the motion parameters of each batch of particles are generated by the engine real-time random algorithm, causing differences in the behavior of each batch of particles, which cannot form a fixed cycle; when baking, the dynamic state of all particles needs to be recorded frame by frame, and the data volume increases linearly with the playing time; if the particle system motion path changes (such as the movement of the emission source), the full amount of data needs to be baked separately for each path, which has a huge storage volume and cannot be reused. For example, a necklace special effect worn by a character in a game, the traditional scheme randomly emits a batch of fire particles every 0.1 seconds, and if it lasts for 5 minutes, it needs to store about 9000 frames of data, and if the character's moving path changes, 9000 frames of data for the corresponding path need to be re-baked.

[0050] It should be noted that the continuous emission type particle system may enter a stable state in terms of quantity after running for a period of time due to the fixed particle birth and death cycle, but essentially each emission of particles is an independent random event, that is, the emission direction, birth position and other parameters (most parameters in the particle system are random parameters) of each particle are randomly generated one by one, and the behavior of each batch of particles is different. The traditional baking method regards all particle systems as ordinary particle systems, and records all particle data during the entire motion process frame by frame, and for particles with a long life cycle, a large amount of redundant data needs to be recorded. Therefore, the present application provides an optimization scheme based on baked particle data, which solves the dual bottleneck of computing efficiency and memory occupation by pre-generating deterministic parameter sequences, baking data in stages, and other mechanisms, and can adapt to the hardware constraints of low-performance mobile devices.

[0051] It is not difficult to find that, compared with the related art, the present application aims to provide a particle system baking method that adapts to mid- and low-end devices, optimizes the fixed cycle mechanism and storage structure, realizes the particle playback effect required by the game with low memory overhead, and avoids the high computational problem of frame-by-frame simulation. Specifically, the system pre-generates a fixed-length deterministic parameter sequence, converts the unpredictable behavior of the traditional particle system based on real-time random algorithms into deterministic periodic motion by calling parameters in sequence, such as the initial velocity, color change and other random parameters of particles, which are obtained from the sequence cycle, so as to compress the infinite random particle behavior into a finite periodic regular motion, fundamentally change the data recording mode, and avoid the problem of infinite data growth over time in the traditional random mode. On this basis, the system combines a segmented storage mechanism to divide the baked data into a start phase that records the transition process and a cycle phase that contains a complete deterministic cycle, and only needs to store a limited amount of data to support unlimited playback of special effects through recycling, breaking through the technical bottleneck of linear growth of data volume with playing time in the traditional scheme, and realizing the optimization effect of "fixed storage cost supporting unlimited running"; the regularization of particle behavior by the fixed cycle mechanism lays a foundation for the accurate implementation of particle playback from the data dimension, ensuring that complex particle playback special effects can also run smoothly on mid- and low-end devices.

[0052] Second embodiment

[0053] The second embodiment of the present application relates to a baking method of a particle system. The second embodiment is an improvement based on the first embodiment, and the specific improvement is that in the present embodiment, a specific implementation of pre-generating a deterministic parameter sequence is provided.

[0054] Specifically, the pre-generated deterministic parameter sequence can include: generating a deterministic parameter sequence containing a corresponding number of parameter groups according to a pre-defined sequence length parameter; wherein each group of parameters contains preset particle control parameters for deterministically driving particle behavior.

[0055] For example, this process can be implemented through a deterministic parameter pre-computation mechanism: an adjustable sequence length parameter (i.e. maximum random number, both represent the same configuration item, used to define the total number of parameter groups contained in the sequence, for example 15) can be set in the configuration of the particle system. The particle system can generate a corresponding number of fixed-length parameter sequences (such as 15 groups) in advance according to the value of the sequence length parameter, to form a complete deterministic parameter sequence.

[0056] Each group of parameters contains various types of random parameters required for particle behavior, including not only particle dynamic attributes such as motion speed, color gradient coefficient, and life cycle, but also randomization features such as initial velocity direction, scaling ratio, and color noise, and the specific values of all parameter groups are pre-determined during the baking phase.

[0057] Based on this, any parameter required by the particle during its life cycle can be sequentially taken from the sequence in the order of emission: the first batch of particles calls the first group of data in the sequence, the second batch calls the second group of data, and so on until the Nth batch (N equals the maximum random number) calls the last group of data in the sequence, and the N+1th batch cycles and reuses the first group of data from the beginning. This mechanism enables "deterministic playback" of particle behavior, that is, no matter when and where the particle system is played, as long as the same pre-generated sequence is called, the motion parameters of each batch of particles will be strictly consistent, completely reproducing the same motion trajectory as the first simulation, rather than the unpredictable real-time random results in traditional schemes. As a result, the particle system does not need to record random state data that grows over time, even if it runs indefinitely, and only needs to store a fixed-length static sequence to support all periodic particle behavior.

[0058] For example, in the skill special effect of a game, if the particle system of an attack skill is set with a sequence length parameter = 6, the system will generate 6 groups of parameters, each group containing random parameters such as the flight speed and diffusion angle of the particles. When the skill is released, the particles emitted in the first frame can use the first group of parameters (such as slower flight speed and smaller diffusion angle), the second frame uses the second group (such as medium flight speed and medium diffusion angle), and so on, the sixth frame uses the sixth group, and the seventh frame reuses the first group, ensuring that the particle motion of the skill special effect forms a fixed cycle every 6 frames, regardless of how many times the skill is triggered, the particles of the same frame sequence always behave consistently.

[0059] It can be found that, in the embodiments of the present application, by generating a deterministic parameter sequence containing a fixed number of parameter groups according to a predefined sequence length parameter, the random parameters that need to be calculated in real time in the traditional particle system are converted into a set of deterministic values calculated in advance. This conversion process ensures that the system does not need to perform real-time random calculation when subsequent particles are emitted, but instead calls parameter groups from the pre-generated sequence in a predetermined order, thereby ensuring that the same batch of particles exhibit completely consistent motion trajectories and visual characteristics in different playback cycles. In this way, not only can the computational overhead of real-time random algorithms be eliminated to improve efficiency, but also precise reproduction of particle behavior and fundamental optimization of storage structure can be achieved: only a limited length of parameter sequence needs to be stored instead of a large amount of random state data, while ensuring the consistency of the effect in an infinite length of playback.

[0060] Third Embodiment

[0061] The third embodiment of the present application relates to a baking method of a particle system. The third embodiment is an improvement based on the first embodiment, and the specific improvement is that in the present embodiment, a specific implementation scheme before controlling particle behavior according to the deterministic parameter sequence is provided.

[0062] Specifically, before the controlling particle behavior according to the deterministic parameter sequence, the method can further include: selecting a corresponding baking process according to the type of the particle system.

[0063] If the particle system is a normal particle type, a single run process from the start of particle emission to the end of the life cycle of all particles is recorded to generate a single sequence data; and the termination condition of the sequence data is the disappearance of the last particle.

[0064] That is, if the particle system is a normal particle type, the corresponding baking process can be as follows: start recording from the first emission of the particle, and continuously record the state data of the particles in each frame during the process, which can include but is not limited to the position, shape, life cycle, etc. of the particles; when the life cycle of all particles in the batch ends, the recording is terminated, and a single complete sequence data is generated without waiting for the cycle process. Since the dynamic effect of the normal particle system ends when all the particles' life cycles end, there is no subsequent particle emission behavior, so when baking, only the single running process needs to be captured, and no additional cycle logic processing is required.

[0065] For example, the muzzle flash effect when a left-handed revolver shoots in a game belongs to a normal particle system effect: the particles from the muzzle to complete extinction are a single complete process, and there is no subsequent batch of particle emission. When baking this effect, only the complete period of the cluster of sparks from appearing, burning to finally disappearing needs to be recorded, and a single sequence data can meet the playback requirements, without considering the recording of the cycle phase as in the continuous emission type particle system, which can simplify the baking process and reduce unnecessary data storage.

[0066] It should be noted that the present embodiment can also be an improvement based on the second embodiment.

[0067] As can be seen, in the present embodiment, before controlling the particle behavior according to the deterministic parameter sequence, the method can further include selecting a corresponding baking process according to the type of the particle system. This step can adapt to the characteristics of different particle systems and avoid the drawbacks of the traditional scheme in which the particle system is baked in a uniform manner regardless of its type. It can be understood that in the traditional scheme, particle parameters need to be generated in real time, and all dynamic data needs to be recorded when baking, which can easily cause resource redundancy. By first determining the type of the particle system and then selecting a baking process, more accurate and efficient baking operations can be achieved.

[0068] Fourth Embodiment

[0069] The fourth embodiment of the present application relates to a baking method of a particle system. The fourth embodiment is an improvement based on the first embodiment, and the specific improvement is that in the present embodiment, a particle system baking improvement method is provided, which decouples data storage from device rendering frame rate and ensures constant playback speed of different frame rate devices.

[0070] Optionally, in some embodiments, the method can further include:

[0071] In step S201, the particle state data is recorded with a fixed time interval as a sampling period;

[0072] In step S202, the recorded particle state data is organized in time sequence to form time-indexed sequence data; wherein the sequence data comprises at least one of single-segment sequence data, start-phase sequence data, and cycle-phase sequence data.

[0073] For example, the sampling period is independent of the device rendering frame rate to ensure the stability and consistency of data collection. Each time the system can record the key state information of all the current surviving particles, including but not limited to spatial position, particle remaining life, color parameter, scaling ratio, and other attributes. For example, in the baking of a magic shield particle effect in a game, a sampling period of every 0.05 seconds can be set. From the first emission of the particle, the system captures the rotation angle, luminous intensity, and other state data of the particle cycle by cycle, ensuring that the data collection is not affected by the device frame rate fluctuations.

[0074] For example, the sequence data comprises at least one of single-segment sequence data, start-phase sequence data, and cycle-phase sequence data. Specifically, the data collected in the first 0.05 seconds can be marked as time index "0-0.05 seconds", the data of the second 0.05 seconds is marked as "0.05-0.1 seconds", and so on, to form a continuous data chain arranged in time stamp order.

[0075] This data recording method is in sharp contrast to the traditional scheme: in the traditional scheme, the particle full-quantity attributes need to be recorded frame by frame at a fixed frame rate, for example, 300 frames (30fps) of particle data need to be recorded for a 10-second effect, resulting in that direct reading of frame data cannot dynamically adapt to device frame rate or path changes, not only causing memory overflow of low-performance devices due to excessive data volume, but also causing inconsistent playback speed of different frame rate devices (e.g., 60fps device playback speed is twice that of 30fps).

[0076] It should be noted that the embodiment can also be improved on the basis of the second embodiment and / or the third embodiment.

[0077] It can be found that, in the embodiment of the application, the innovative frame rate adaptive mechanism can fundamentally solve the problem of inconsistent playback speed caused by device frame rate fluctuations in the traditional particle system. In the traditional scheme, particle data is recorded in "frames" as units at a fixed frame rate (such as 30FPS). This "frame-counting" storage mode strongly binds data with device rendering frame rate. For example, when the device frame rate is increased from 30FPS to 60FPS, the number of frames read per second is doubled, resulting in a doubling of particle state update frequency and a doubling of effect playback speed. Conversely, the speed is halved, which seriously affects the consistency of user experience.

[0078] The application adopts a new logic of recording data according to time scale: the baking stage records the particle state at a fixed time interval (such as 0.01 seconds) as a sampling period, and organizes the data in time sequence into a sequence indexed by a continuous time axis (for example, 100 time node particle attributes are recorded within 1 second), which completely decouples data storage and device frame rate. When playing, the system dynamically calculates the time difference according to the actual frame rate of the device (such as 0.033 seconds per time at 30FPS, and 0.016 seconds per time at 60FPS), extracts the latest node data from the time axis for interpolation calculation. Since data recording and reading are based on "actual time elapsed" rather than "frame number", regardless of device performance fluctuations, the amount of state change of particles in unit time (such as position movement trajectory, color gradient process) is always determined by the recorded data on the time axis. For example, the movement from point A to point B takes 1 second, which is strictly completed in 1 second on a 30FPS or 60FPS device, ensuring that the special effect playback speed is synchronized with the actual time, significantly improving the adaptability of different models and the consistency of user experience. This "time axis indexing + dynamic time difference calculation" mechanism enables the particle system to maintain the stability of the special effect playback speed on mid- and low-end devices, and can avoid the visual distortion problem caused by frame rate differences in traditional solutions.

[0079] Fifth embodiment

[0080] The fifth embodiment of the application relates to a baking method of a particle system. The fifth embodiment is an improvement based on the first embodiment, and the specific improvement lies in that in the embodiment, a specific technical solution is provided for a world space emission particle system in a continuous emission particle system.

[0081] Specifically, if the continuous emission particle system is a world space emission particle system, the method can further include: for the state data of each time sampling point of each particle, associating a corresponding emission batch number; wherein the emission batch number is used to uniquely identify the emission batch to which the particle belongs when playing, and associate the world coordinates of the particle system in the game world when the particles in the batch are emitted.

[0082] Specifically, the world space emission particle system, as a subclass of the continuous emission particle system, inherits the core mechanisms of the segmented storage and static sequence of the circular particle system (storing data in the starting stage and the circular stage, and realizing periodic emission based on a deterministic parameter sequence), and additionally has the characteristics of "particle position fixed to world coordinates at emission time" and "dynamic path adaptation".

[0083] In the baking process, the system can bind a unique emission batch number to each particle data. The emission batch number is used to mark the emission timing of the particle (such as batch 1, batch 2, …, batch N), and is also associated with the absolute coordinates of the particle system in the game world at the moment of the batch particle emission. For example, when simulating a snowstorm covering the entire game map, the system emits a batch of snowflake particles every second, and each batch of particles is assigned a unique emission batch number (such as batch 1 corresponds to coordinates (x0, y0, z0), and batch 2 corresponds to coordinates (x1, y1, z1)). When the player moves in the snow scene, the playback system can quickly retrieve the world coordinates at the time of the corresponding batch snow emission through the emission batch number, and combine the relative position offset recorded in the particle data to calculate the accurate display position of each snowflake in the current scene in real time, ensuring that the falling trajectory of the snowflakes remains consistent with the world space position at the time of initial emission regardless of the player's perspective, achieving accurate rendering of special effects in the global scene.

[0084] For example, when the character moves, the sand dust particles are raised. During baking, the system labels each sand dust with a corresponding emission batch number (such as batch 3 corresponds to the particles raised by the character at coordinates (x1, y1, z1)). When the character changes the moving path, the playback system does not need to rebake the data, but can quickly locate the initial emission coordinates of the batch particles through the emission batch number, and dynamically calculate their display positions in the new path based on the motion parameters of the particles themselves, thereby achieving the effect of accurate restoration of particle positions in different paths, preserving the optimization characteristics of the cyclic particle system that supports unlimited running with limited storage, and solving the dynamic path adaptation problem of the world space particle system through "timing-coordinate" mapping.

[0085] Optionally, in some embodiments, the state data includes a position attribute of the particle; and the position attribute is stored in the form of a relative offset.

[0086] Specifically, the traditional baking method has obvious limitations for world space emission particle systems: because the particle position is strongly bound to the motion trajectory of the emitter, if the motion path of the emitter changes (such as the character changes the moving direction), the full amount of particle data needs to be baked separately for each specific motion trajectory, which not only leads to a cumbersome baking process, but also generates a large amount of redundant data, significantly increasing the memory occupancy. To solve this problem, the particle position attribute is stored in the form of a relative offset, which fundamentally decouples the particle data from the emitter path.

[0087] The relative offset, rather than directly recording the absolute position of the particle in the world space, represents the difference between the absolute position of the particle at a certain moment and the world coordinate of the particle system at the time of emission of the batch to which the particle belongs. This storage rule is fundamentally different from the direct recording of absolute position in the world space by ordinary particle systems and cyclic particle systems: the emitter position of ordinary particles and cyclic particles is usually fixed, and direct storage of absolute position can meet the playback requirements; the emitter of the world space emission particle system may move with the character or scene object, and only the offset of the particle relative to the emitter position at the time of emission needs to be recorded, so that the subsequent calculation can be adapted to different motion paths without repeated baking.

[0088] Specifically, when a batch of particles is emitted from a specific coordinate point in the world space, the system first records the world coordinate of the emission point (i.e., the world position of the particle system at the time of emission of the batch of particles), and then calculates and stores the offset value of the position of the particle at each time sampling point in the subsequent motion process relative to the reference coordinate in real time. For example, at the time of emission of a batch of particles, the world coordinate of the particle system is (100, 50, 30); at the sampling time, the absolute position of a particle in the batch in the world space is (102, 55, 31), and the system records the position attribute of the particle as a relative offset (2, 5, 1), that is, the difference between the absolute position of the particle and the world coordinate of the system at the time of emission. Through this recording method, the playback stage does not need to rely on fixed path data, but only needs to combine the world coordinate at the time of emission of the batch of particles and the stored relative offset to accurately restore the actual position of the particle in the current scene, ensuring that the motion trajectory of the particle is consistent with the world space logic at the time of initial emission regardless of subsequent movement of the emitter.

[0089] In actual application scenarios, the advantages of this mechanism are significant. For example, a character moves with a flame particle special effect: when baking, the system records the offset of each batch of flame particles relative to the position of the character at the time of emission of the batch of particles; when the character changes the movement path (such as from walking in a straight line to turning), the playback system can quickly match the world coordinate of the character at the time of emission of the batch of particles through the batch number, and then dynamically calculate the accurate display position of the particle under the new path by combining the stored relative offset. This process does not need to re-bake the full data for the new path, and because the particle state data is decoupled from the device rendering frame rate, the playback speed can be kept consistent on devices with different performance such as 30fps, 60fps, etc.

[0090] It should be noted that the present embodiment can also be an improvement based on any one or more of the second to fourth embodiments.

[0091] It can be understood that the core characteristic of the world space particle emission is that once the particle is generated, its position is fixed in the world coordinate at the emission moment (for example, the sand dust raised by the rolling ball always stays at the ground position when it is raised). This characteristic makes the traditional baking scheme and the scheme of the application significantly different in data processing logic.

[0092] The prior art adopts a "full-path binding" mode for baking the world space particle emission: if the particle system moves along a path A→B, the full amount of data of all particles, such as the position and state of each particle in each frame along the path, needs to be recorded completely; when the path is changed to A→C, since the particle emission position is strongly coupled with the new path, the original data cannot be reused, and the full amount of frame data of the path A→C needs to be baked and stored again. In this mode, the particle data of each path is independent and highly redundant, and the data amount increases linearly with the number of paths, which easily exceeds the memory carrying capacity of low-performance devices in a multi-path scene (such as different moving trajectories of a character).

[0093] It can be found that in the embodiments of the application, the above problems are effectively solved by innovatively constructing a double-layer architecture of a cyclic sequence combined with lightweight metadata: the particle system with a long emission duration is converted into a cyclic particle system, which is abstracted into a cyclic sequence (such as 20 groups of basic motion parameters) with a limited length, and only one set of cyclic data that can be reused infinitely needs to be stored, without repeated baking for different scenes; secondly, the "additional data" is defined as lightweight metadata (rather than full amount of particle state) such as the world coordinate at the emission moment and the emission batch number, and the association between the metadata and the cyclic sequence is established through the emission batch number. When playing, the system restores the particle motion law based on the cyclic sequence, and dynamically calculates the particle position in combination with the metadata and the real-time path coordinate. For example, when the particle system moves along a path A→C, there is no need to store the data of the new path again, but only the same set of cyclic sequence needs to be called, and the world coordinate at the corresponding emission moment is matched through the emission batch number, so that the display position of the particle along the new path can be accurately generated.

[0094] That is, the core difference between the application and the traditional technology lies in the processing logic of the "additional data": the "additional data" of the prior art is the full amount of particle frame data of each path, and the essence is to adapt to different paths by repeatedly storing; the "additional data" of the application is the minimum metadata supporting dynamic calculation, which realizes "baking once to adapt to any path" through cyclic sequence reuse combined with world coordinate mapping, which can greatly reduce the amount of data to be recorded, and solve the problem of strong coupling between the world space particle effect and the running-time particle system motion trajectory, so that each type of particle only needs to be baked once, and can adapt to multiple scenes with different playing durations and different motion trajectories.

[0095] Sixth embodiment

[0096] The sixth embodiment of the present application relates to a baking method of a particle system. The sixth embodiment is an improvement based on the first embodiment, and the specific improvement is that in the present embodiment, when recording the data of the particle behavior, the system adopts a classification storage strategy, and only records the first data, and the remaining parameters are generated by real-time derivation.

[0097] Specifically, when recording the data of the particle behavior, only the first data is recorded; the first data is used to represent the key parameters of the particle that dynamically change over time during the movement process and cannot be generated by derivation of other data.

[0098] Among them, the second data in addition to the first data is generated based on the common configuration of the particle system and the first data.

[0099] Optionally, in some embodiments, the first data includes at least one of the following: particle coordinates, particle lifetime, particle remaining lifetime, particle rotation orientation, and particle random value; and the second data includes at least one of the following: color, size, transparency, and shader custom data.

[0100] Specifically, the first data needs to be captured and stored one by one in the baking stage, and provides a deterministic basis for the motion trajectory, life cycle and personalized behavior of the particle. The first data can include but is not limited to: particle coordinates, particle lifetime, particle remaining lifetime, particle rotation orientation, and particle random value.

[0101] Among them, the particle coordinates are used to represent the three-dimensional position coordinates (such as (x, y, z)) of the particle in the world space, which directly reflects the spatial position of the particle at a certain moment or when the particle is generated; the particle lifetime is used to represent the total time length (such as 5 seconds) from the generation to the disappearance of the particle, which is a fixed attribute of the particle existence period; the particle remaining lifetime is used to represent the remaining time (such as 3 seconds for a particle that has existed for 2 seconds) from the current moment to the disappearance of the particle; the particle rotation orientation is used to represent the rotation angle or direction vector (such as rotating 30° along the Y axis) of the particle itself, which determines the orientation posture of the particle in space; and the particle random value is used to represent a fixed parameter (such as 0.3, 0.7, etc.) from a deterministic parameter sequence generated by the system, and the system stores this value to ensure the determinism of the particle behavior (such as calculating the initial velocity deviation based on this value).

[0102] For example, when recording the special effect of the firework particle, the first data saves the coordinates at the moment of emission of each particle, the initial set 5-second particle lifetime, the particle remaining lifetime at different moments (such as 3 seconds remaining at the 2nd second), and the particle rotation orientation and random initial velocity parameters that control the trajectory of the burst, which together constitute the basic dynamic information of the firework burst and cannot be derived from other parameters.

[0103] Second data, except the first data, is generated in real time based on the shared configuration of the particle system and the first data, without recording specific values in the baking stage. The second data is a parameter that can be derived by a preset rule, and the generation logic is closely related to the global shared configuration of the particle system (such as a color gradient curve, a size scaling formula, a transparency mapping table, etc.), which can ensure the dynamics of the particle effect and greatly reduce the storage amount. The second data can include but is not limited to color, size, transparency, and shader custom data.

[0104] The color is used to represent the RGB color value of the particle (such as from red to transparent), which can be calculated by the system in combination with the remaining life of the particle (such as the color starts to fade when the particle life is more than half); the size is used to represent the scaling ratio of the particle (such as gradually reducing from the initial size 1.0 to 0.2), which can be dynamically calculated by the system in association with the remaining life of the particle or a random value; the transparency is used to represent the opacity of the particle (such as from 1.0 to 0.0), which can be adjusted in real time by the system as the remaining life of the particle changes; and the shader custom data is used to represent the custom parameters for the shader program (such as highlight intensity, texture offset, etc.), which can be calculated by the system based on the first data (such as a random value, the remaining life of the particle) through a specific formula and then passed to the shader to achieve a more refined rendering effect.

[0105] For example, in a bonfire flame particle system, the color of the flame particle is used as the second data, which does not need to be stored in advance: the system can define that the remaining life ≥ 2 seconds displays orange red, 1-2 seconds displays red, and < 1 second displays dark red according to a preset "life-color mapping table" (index MT001). Only the index of the mapping table is recorded during baking, and during playback, the red color can be calculated in real time by calling the mapping table through the index according to the first data of the particle (such as the remaining life of 1.5 seconds). Similarly, the size of the particle can be derived by the shared formula "size = initial size × (remaining life / total life)", and if the total life of a particle is 5 seconds and the remaining life is 3 seconds, the size is 60% of the initial size. By storing the mode derived from the first data and the shared rule, this embodiment can not only ensure the accurate presentation of the particle effect, but also avoid the redundancy of storing all data in the traditional scheme, thereby achieving the purpose of optimizing memory occupation.

[0106] It should be noted that the present embodiment can also be an improvement based on any one or more of the second to fifth embodiments.

[0107] It can be found that in the embodiment of the application, when recording the data of the particle behavior, the system adopts a mechanism combining classified storage and dynamic generation: only the first data (i.e., the key parameters that dynamically change over time in the particle motion and cannot be derived through other data) is recorded, and the second data other than the first data is generated in real time based on the common configuration of the particle system and the recorded first data. This mechanism greatly reduces the storage content of the baking stage, retains only the core dynamic parameters, greatly reduces the storage overhead, ensures the dynamic richness of the particle effect through real-time calculation, and is beneficial to further improving the data storage and use efficiency.

[0108] On this basis, the actual storage amount can be further compressed through storage optimization technology and real-time calculation strategy: for example, at the storage level, the Delta compression technology can be used to record only the change amount of the particle state (rather than the full amount of attributes), and at the same time, the dynamic and efficient allocation of memory is realized through the block particle pool, thereby reducing redundant occupation. This mode of storing core data and deriving data in real time, combined with structured storage optimization, can not only reduce the total amount of static storage data, but also improve the memory utilization efficiency through accurate allocation. Compared with the traditional scheme that needs to store the full amount of data of multiple paths, the technical scheme of the embodiment can greatly reduce the memory occupation, effectively solve the storage bottleneck of the pure baking scheme on low-performance mobile devices, and adapt to the hardware constraints of mid-end and low-end devices.

[0109] Seventh embodiment

[0110] The seventh embodiment of the application relates to a baking method of a particle system. The embodiment provides an application example of the baking method of the particle system.

[0111] As shown in Figure 2 , the particle baking overall process can include:

[0112] 1. Start baking: the developer selects the target particle system in the engine and executes the "start baking" instruction to trigger the particle data recording program. The program starts from the first particle emission of the particle system, and frame by frame collects the particle core state data, including the real-time world coordinates of each particle, the remaining life of the particle, the rotation direction of the particle, and synchronously records the real-time position of the particle emission source (such as the world coordinates of the character and the prop).

[0113] 2. Data file preprocessing: the system first detects whether there is a historical baking file (i.e., the data file in the figure) of the particle system: if it already exists, directly register the data entry callback function for incremental recording of new particle data; if it does not exist (first baking), first create a blank data file, and then register the callback function to ensure the integrity of data recording.

[0114] 3. Animation playing and data recording: start playing the particle animation, the callback function continuously records the particle state data of each frame during the playing process, and determines the animation end condition according to the characteristics of the particle type. If the animation has not ended, continue to record the particle state data of each frame and repeat the detection; after meeting the end condition, the system saves all the recorded data to the data file according to a specific structure (such as segmented storage, batch annotation, etc.), and completes the baking.

[0115] The operation differences of different types of particle systems in baking mainly manifest in the following three aspects:

[0116] Animation end determination: the ordinary particle system takes the end of all particle life as the termination condition; the continuous emission type particle system usually sets a fixed baking time, and ends when the time is exceeded; the world space emission particle system: in addition to the time length, it also needs to ensure that the state of each batch of particles is recorded completely.

[0117] Data storage rules: the ordinary particle system usually stores continuously according to the time sequence; the continuous emission type particle system adopts a segmented storage structure and supports loop playing; the world space emission particle system adds the emission batch number on the basis of segmentation and associates the world coordinates of the emission time.

[0118] Additional recording requirements: the world space emission particle system needs to record the world coordinates of the system at each batch of particle emission; the ordinary and continuous emission type particle systems usually do not need additional coordinate recording and rely on the local coordinate system of the emitter.

[0119] Further, in the actual development of particle special effects, the traditional technology often faces problems such as large storage pressure, sensitive performance fluctuations, and difficult resource reuse. To overcome these bottlenecks, the present application proposes an innovative baking scheme, which realizes the determinacy of particle behavior and the high reuse of data through pre-computation and static serialization. The following Table 1 compares the essential differences and advantages of the traditional scheme and the present application from five dimensions of randomness control, storage mode, path adaptability, device frame rate influence and storage efficiency:

[0120] Table 1

[0121]

[0122]

[0123] Eighth embodiment

[0124] The eighth embodiment of the present application relates to a playing method of a particle system, which uses sequence data baked by the method according to any one or more of the first to seventh embodiments. As shown in the following figure, the method can include the following steps: Figure 3

[0125] ​In step S301, the baked sequence data is obtained, and a time axis pointer and a play mode parameter are initialized. The play mode parameter includes normal play, reverse play, and fast forward.

[0126] In step S302, a target sampling time point is dynamically calculated based on a current play mode and a device time.

[0127] In step S303, particle state data corresponding to the target sampling time point is extracted from the sequence data, and a particle is rendered based on the particle state data and real-time calculation logic.

[0128] In step S304, it is determined whether to continue the steps of dynamically calculating the target sampling time point, extracting the particle state data, and driving the particle rendering, or to terminate the play, according to a current play progress and a particle system type.

[0129] The above steps are described below.

[0130] For step S301, for example, baked sequence data such as single-segment sequence data, start phase sequence data, or cycle phase sequence data can be obtained, and a time axis pointer and a play mode parameter are initialized. The time axis pointer is used to mark the current play time position (for example, starting from 0 seconds), and the play mode parameter can include, but is not limited to, control options such as normal play, reverse play, and fast forward. For example, when playing a bonfire flame special effect, the system can call the baked “start phase (ignition to stable combustion) + cycle phase (stable combustion period)” sequence data, and set the time axis pointer to 0 seconds. At the same time, according to user input, the play mode is set to normal play (1 times speed) or fast forward (2 times speed).

[0131] Optionally, in some embodiments, the playback mode parameter further comprises an initial time point configuration, supporting starting playback from an arbitrary time point in the sequence, including the start point, the middle point or the end point. Illustratively, the initial time point configuration in the playback mode parameter supports user customizing the playback start time of the particle system, and starting playback from an arbitrary time point in the sequence data, including the start point, the middle point or the end point. For example, when debugging a game skill special effect, the developer can set the initial time point to the middle point of the sequence (e.g., the 3rd second), and directly view the effect of the flame particles burning to the stable stage without waiting for the ignition transition process of the first 3 seconds; for a snowstorm special effect that plays in a loop, if the initial time point is set to the 2nd second of the loop stage (e.g., the middle position of an 8-second loop cycle), the system will start playback from the particle state corresponding to this time point (e.g., a batch of snowflakes have fallen to a position in the air), and continue to deduce the subsequent trajectory according to the forward playback / reverse playback logic. This configuration mechanism, by flexibly positioning the initial position of the time axis pointer, can not only meet the quick preview needs during special effect debugging, but also support triggering particle effects from a specific time in a story animation, compared to the limitation of traditional solutions that can only play from the start of the sequence, can significantly improve the control flexibility and application scenario adaptability of the particle system.

[0132] For step S302, illustratively, the device time refers to the system running time of the playback device (e.g., a game console, a mobile phone, a computer, etc.), which is a time reference at the hardware level, used to measure the duration of the device from startup to the current time. During the playback process of the particle system, the device time is used as a basic variable calculated dynamically, to reflect the elapse speed of the actual playback process.

[0133] Among them, the target sampling time point is a logical time point calculated based on the device time and the playback mode parameter, and its role is to accurately locate the corresponding particle state in the sequence data. This time point is not a direct mapping of the device physical time, but a logical timestamp for indexing sequence data after the playback logic conversion. For example, when the device time has elapsed for 1 second, if the playback mode is set to 2x forward playback, the target sampling time point will advance to 2 seconds to match the particle state at the 2nd second in the sequence data.

[0134] For step S303, illustratively, the system can extract particle state data corresponding to the target sampling time point from the sequence data, i.e., the first data, such as particle coordinates, particle remaining life, particle random values, etc., and generate second data, such as color, size, transparency, in combination with real-time calculation logic to drive particle rendering. The real-time calculation logic converts the direct recording data into rendering required parameters based on the common configuration of the particle system, such as the color gradient table, the scaling formula. For example, the remaining life (first data) of a certain flame particle is 1.5 seconds, and the system calculates its color to be red through the preset "life-color mapping table", and then obtains the current size to be 30% of the initial size according to the scaling formula (size = initial size x remaining life / total life). The parameters such as coordinates, color, size are passed to the rendering engine to present the dynamic burning effect.

[0135] For step S304, illustratively, the system can determine whether to continue playing or terminate according to the current playing progress and the particle system type.

[0136] Optionally, in some embodiments, if the particle system is a normal particle system, the operation of terminating playing is to terminate playing when the time point exceeds the total duration of the sequence. That is, for a normal particle system, when the time axis pointer exceeds the termination time of the sequence data (the moment when the last particle disappears), the playing is automatically terminated.

[0137] It is not difficult to find that the particle system playing method in the embodiment avoids the computational overhead caused by real-time simulation of particle behavior in the data acquisition stage by using pre-baked sequence data; based on the initialized time axis pointer and the playing mode parameter, the system can dynamically calculate the target sampling time point according to the device time and the playing mode, so that the playing process can adapt to the frame rate difference of different performance devices, and ensure the consistency of the playing speed; by directly extracting the particle state data of the corresponding time point from the sequence data and driving rendering in combination with real-time calculation logic, the accuracy of the particle effect can be ensured, and the runtime calculation complexity can be greatly reduced; by dynamically determining the playing progress and the system type to determine whether to continue playing or terminate, efficient management of resources is realized. The playing mechanism based on pre-baked data and dynamic time axis calculation provided in the embodiment can effectively solve the problems of inconsistent playing speed caused by device frame rate difference, waste of computing resources of high-performance devices, and inability to adapt to low-performance devices in the traditional scheme.

[0138] Ninth Embodiment

[0139] The ninth embodiment of the present application relates to a particle system playing method. The ninth embodiment is an improvement on the basis of the eighth embodiment, and the specific improvement is that in the present embodiment, a specific implementation manner of dynamically calculating a target sampling time point based on a current playing mode and a device time is provided.

[0140] Specifically, the target sampling time point is dynamically calculated based on the current playing mode and the device time, i.e., step S302 can include the following steps:

[0141] If the current playing mode is normal playing, a time interval is determined based on the device time, the current time point is incremented by the time interval, and the incremented current time point is taken as the target sampling time point.

[0142] If the current playing mode is reverse playing, a time interval is determined based on the device time, the current time point is decremented by the time interval, and the decremented current time point is taken as the target sampling time point.

[0143] If the current playing mode is fast-forward, a reference time interval is determined based on the device time, the current time point is incremented by the reference time interval amplified by a preset multiple, and the incremented current time point is taken as the target sampling time point, and the target sampling time point is aligned with the sampling period of the baking stage.

[0144] Specifically, if the current playing mode is normal playing, the system can determine a time interval (i.e., the time difference of each frame of the device) based on the elapse of the device time, increment the current time point by the interval, and take the incremented time point as the target sampling time point. For example, a snow particle system with a sampling period of 0.05 seconds is set during baking, and the initial time point is set to 0 seconds. After the device runs for 0.05 seconds, the normal playing mode calculates at 1 times speed, and the current time point is incremented by 0.05 seconds to 0.05 seconds. The time point is aligned with the baking sampling period, and the system can directly extract the initial falling state of the snowflake particles corresponding to 0.05 seconds. If the device runs for another 0.05 seconds, the time point is incremented to 0.1 seconds, and the position data of the snowflakes after falling for 0.1 seconds at that time is extracted, ensuring that the particle motion is accurately deduced in the normal order.

[0145] Specifically, when the playing mode is reverse playing, the system can also determine a time interval based on the device time, but decrement the current time point by the interval. For example, the sequence data of a certain flame particle system records the process from ignition (0 seconds) to extinguishment (5 seconds). If the initial time point is set to 3 seconds (flame stable combustion stage), after the device runs for 0.05 seconds, the reverse playing mode calculates at 1 times speed, and the current time point is decremented to 2.95 seconds. The system extracts the state data of the flame particles at that time (e.g., the flame size is slightly larger than that at 3 seconds), achieving the reverse playing effect of flame contraction. Continuing to run for another 0.05 seconds, the time point is decremented to 2.9 seconds, corresponding to the extraction of the reverse motion state of the flame at the middle stage of combustion, ensuring the continuity of the reverse trajectory.

[0146] Specifically, in the fast-forward mode, the system can first determine a reference time interval based on the device time, then enlarge the interval by a preset multiple (such as 2 times) and increment the current time point, and the target sampling time point needs to be aligned with the sampling period of the baking stage. For example, the baking sampling period of the bonfire flame particle system is 0.05 seconds, the fast-forward mode is set to 2 times, the device runs for 0.05 seconds, the reference time interval 0.05 seconds is enlarged by 2 times to 0.1 seconds, the current time point is incremented from 0 seconds to 0.1 seconds (aligned with the integer multiple of the sampling period 0.05 seconds), and the system extracts the particle state at 0.1 seconds; the device runs for another 0.05 seconds, the time point is incremented to 0.2 seconds, the non-sampling point of 0.15 seconds is skipped, and the flame state corresponding to 0.2 seconds is directly extracted, so that the playing speed is increased to 2 times, and the particle state fault caused by sampling misalignment is avoided.

[0147] It can be found that, in the embodiment, the application adopts different time point calculation strategies according to the playing mode, so that the playing process of the particle system can intelligently adapt to different playing requirements: in the normal playing mode, the time interval is incremented to ensure that the playing progress is synchronized with the real-time elapse, and the normal visual effect is maintained; in the reverse playing mode, the time interval is decremented to realize reverse tracking of the time axis, and reverse display of special effects is supported; in the fast-forward mode, the time interval is enlarged and aligned with the baking sampling period, so that the accelerated playing effect can be realized, and data distortion or abnormal effect caused by misalignment of the sampling point can be avoided, thereby effectively ensuring the accuracy, smoothness and consistency of the particle special effect in various playing scenarios.

[0148] Tenth embodiment

[0149] The tenth embodiment of the application relates to a playing method of a particle system. The tenth embodiment is an improvement on the basis of the eighth embodiment, and specifically, the improvement lies in that in the embodiment, a specific implementation manner of determining, according to the current playing progress and the particle system type, whether to continue to execute the steps of dynamically calculating the target sampling time point, extracting the particle state data and driving the particle rendering, or to terminate the playing.

[0150] Specifically, the step of determining, according to the current playing progress and the particle system type, whether to continue to execute the steps of dynamically calculating the target sampling time point, extracting the particle state data and driving the particle rendering, or to terminate the playing, that is, the step S304 can include:

[0151] If the sequence end is not reached, after the time point is offset according to the playing mode, the steps of dynamically calculating the target sampling time point, extracting the particle state data and driving the particle rendering are continued to be executed;

[0152] If the end of the sequence is reached, the corresponding operation is performed according to the particle system type: the normal particle system terminates playback; the continuous emission particle system switches to the cycle stage sequence or resets the timeline pointer to continue playback; the world space emission particle system continues to calculate the particle display position by binding the world coordinates in batches.

[0153] For example, if the current playback progress does not reach the time end of the sequence data, i.e., the timeline pointer does not exceed the maximum timestamp of the sequence, the dynamic calculation and rendering process can be continued after the current time point is offset according to the playback mode (normal playback / reverse playback / fast forward). For example, the sequence data of the muzzle flash special effect of a certain normal particle system has a duration of 0.5 seconds. When the playback reaches 0.3 seconds (not yet at the end), the timeline pointer is incremented by 0.05 seconds in normal playback mode to 0.35 seconds. The system extracts the decay state data of the flash particles at this time, and drives the rendering engine to present the process of the flash gradually dying out, until the playback reaches 0.5 seconds and reaches the end of the sequence.

[0154] For example, if the playback progress reaches the end of the sequence (e.g., the timeline pointer is greater than or equal to the maximum timestamp of the sequence) and it is a normal particle system, the playback can be terminated directly. For example, the "ice shock" special effect (normal particle system) released by a character in the game records the complete process from particle eruption (0 seconds) to complete dissipation (2 seconds) in the sequence data. When the playback reaches 2 seconds, all ice particles have disappeared, and the system determines that the end of the sequence has been reached, terminating the playback process and no longer generating new particles or rendering residual states.

[0155] If it is a continuous emission particle system, it automatically switches to the cycle stage sequence or resets the timeline pointer to continue playback after reaching the end of the sequence. For example, the sequence data of a certain bonfire flame particle system includes a "start stage (0-5 seconds, ignition to stable combustion)" and a "cycle stage (5-9 seconds, stable combustion period)". When the playback reaches 9 seconds (end of the cycle stage), the system automatically resets the timeline pointer to 5 seconds and starts playing from the beginning of the cycle stage, so that the flame continues to present a stable combustion effect. If the sequence only includes a cycle stage (e.g., a preset 10-second cycle period), it will continue from the 0-second cycle point directly after reaching the end, achieving infinite duration playback.

[0156] If the particle system is a world space particle system, the world coordinates bound by batch are continuously calculated for particle display positions after the end of the sequence. For example, the sequence data of a snowstorm special effect records the emission process of 10 batches of snowflake particles (each batch corresponds to a different emission batch number and initial world coordinates), when playing to the end of the 10th batch of particle life cycle (the end of the sequence), the system is based on the emission batch number associated with the emission time world coordinates (such as batch 5 corresponds to the snowflake emitted by the player at coordinates (x1, y1, z1)), combined with the relative offset of the particle (such as the falling distance), continuously dynamically calculates the new scene coordinates of each snowflake after the player moves (such as when the player moves to (x2, y2, z2), the display position of batch 5 snowflakes is (x1 + offset x, y1 + offset y, z1 + offset z)), without terminating playback or rebaking, ensuring that the snowflake trajectory and world space position remain logically consistent.

[0157] Optionally, in some embodiments, if the particle system is a continuous emission particle system, the determination to continue performing the steps of dynamically calculating the target sampling time point, extracting particle state data, and driving particle rendering can include:

[0158] During playback, the start phase sequence is played first, and after the duration of the phase is exceeded, the cycle phase is switched to and the time point is reset to the start of the cycle phase, and thereafter the time point is reset every time the end of the cycle phase is reached to achieve loop playback;

[0159] During playback, if in the start phase, playback is reversed to the time point 0 and then terminated; if in the cycle phase and without an end marker, playback is reversed to the time point 0 and then jumps to the end of the cycle phase to continue reverse looping; if in the cycle phase and with an end marker, playback is reversed to the time point 0 and then switches to the end of the start phase, and continues to reverse play to the start of the start phase and then terminates.

[0160] Specifically, when the continuous emission particle system is in the playback mode, the system can first complete the playback of the start phase sequence data (such as the transition process from the first emission to the stable state), and after the duration of the phase is exceeded, it is automatically switched to the cycle phase, and the time axis pointer is reset to the start of the cycle phase, and thereafter, the time point is repeatedly reset every time the end of the cycle phase is reached to achieve infinite loop playback. For example, the start phase of a certain bonfire flame particle system is 0-5 seconds (records the process of lighting to stable burning), and the cycle phase is 5-9 seconds (4-second cycle of stable burning): during playback, the system starts playing from 0 seconds, enters the cycle phase after 5 seconds, the time point is reset to 5 seconds (the start of the cycle), and is reset to 5 seconds again when playing to 9 seconds (the end of the cycle), so that the flame continues to present the cycle effect of stable burning, without additional data to support infinite duration playback.

[0161] Specifically, for the processing logic of the start phase in the reverse playback, if the continuously emitting particle system is in the start phase (i.e., the time axis pointer is located in the start phase time range) in the reverse playback, the system plays in the reverse order of time until the time point is 0 seconds and then terminates. For example, the start phase of the bonfire flame is 0-5 seconds, and if the initial time point is set to 3 seconds (in the middle of the start phase) in the reverse playback mode, the system can play the flame state in the reverse playback speed in the order of 3 seconds, 2 seconds, 1 second, and 0 second (e.g., the flame is inversely pushed from the stable combustion to the ignition moment), and when the time point reaches 0 second, the start phase reverse playback is completed, and the system terminates the playback and no longer continues to advance to the negative time.

[0162] The processing logic of the cycle phase (without an end marker) in the reverse playback can be as follows: if the cycle phase is in the reverse playback and the phase has no end marker (i.e., the phase is designed as an infinite loop logic), the system plays in the reverse direction until the cycle phase time point is 0 seconds, and then automatically jumps to the end of the cycle phase to continue the reverse cycle. For example, the cycle phase of a certain snowstorm particle system is 0-8 seconds (without an end marker), and the system plays from 5 seconds in the reverse playback mode, decreases to 0 seconds, and then immediately jumps to 8 seconds (the end of the cycle) to continue the reverse playback of 8 seconds, 7 seconds,..., 0 second, forming an inverse cycle of "8 seconds, 0 seconds, 8 seconds", so that the snowflakes present an infinite reverse motion effect of "falling to the ground, rising into the air, and falling to the ground".

[0163] The processing logic of the cycle phase (with an end marker) in the reverse playback can be as follows: if the cycle phase has an end marker (i.e., a preset cycle termination condition), the system switches to the end time point of the start phase after the cycle phase 0 seconds in the reverse playback, and then continues to play in the reverse direction until the start phase starts and then terminates. For example, the cycle phase of a certain continuously emitting magic shield particle system is 5-10 seconds (with an end marker), and the start phase is 0-5 seconds: the system plays from 7 seconds (the cycle phase) in the reverse playback, decreases to 5 seconds (the cycle start point), and then switches to 5 seconds (the end of the start phase), and continues to play in the reverse direction of 5 seconds, 4 seconds,..., 0 second (the start phase start point). At this time, the magic shield particle is inversely pushed from the stable state to the disappearance, and the system determines that the playback is completed and terminates the process.

[0164] It should be noted that the present embodiment can also be improved on the basis of the ninth embodiment.

[0165] It can be found that, in the embodiment, the intelligent decision of subsequent operations according to the playing progress and the particle system type is implemented, thereby realizing efficient management and resource optimization of the playing process: when the sequence end is not reached, the time point is continuously offset according to the mode and the rendering step is executed, thereby ensuring the continuity of the playing process; when the sequence end is reached, the differentiated operation is executed by distinguishing the particle system type. Specifically, the ordinary particle system directly terminates the playing to avoid invalid calculation, the continuous emission type particle system realizes the infinite time length playing by switching to the cycle stage or resetting the time axis, and the world space emission particle system dynamically adapts the path change by batch binding the world coordinates, which enables each type of particle system to process the logic of playing termination or continuation in the optimal way, thereby significantly improving the calculation efficiency and resource utilization while ensuring the continuity of the visual effect.

[0166] Eleventh embodiment

[0167] The eleventh embodiment of the present application relates to a playing method of a particle system. The eleventh embodiment is an improvement on the basis of the eighth embodiment, and the specific improvement lies in that in the embodiment, a specific implementation manner of driving particle rendering when the particle system is a world space emission particle system is provided.

[0168] Specifically, if the particle system is a world space emission particle system, the driving particle rendering can include:

[0169] record the world coordinates when each batch of particles is emitted and bind the world coordinates with the emission batch number;

[0170] During the playing, the actual display position of the particles is obtained by superimposing the relative offset in the baking data and the world coordinates when the corresponding batch is emitted;

[0171] During the playing in reverse, the world coordinates when the new batch of particles is emitted are reversely calculated based on the externally provided trajectory data, and the actual display position is calculated in combination with the relative offset.

[0172] Specifically, for example, in a sand dust particle system simulating the sand dust raised when a player walks, the baking stage marks the emission batch number 001 for the first batch of sand dust (the character emits at the coordinate (10, 20, 30)), the second batch (the character moves to (15, 20, 30) and emits) is marked with the number 002, and so on. These emission batch numbers and the world coordinates when emitted form a mapping relationship.

[0173] In the forward play mode, the actual display position of a particle is obtained by superimposing the relative offset in the baked data and the world coordinates at the time of corresponding batch emission. For example, the sand dust particle of emission batch No. 001 has a relative offset of (2, 0, -1) recorded in the baked data, and the world coordinates at the time of emission are (10, 20, 30), so at a certain time, the actual display position of the particle is (10+2, 20+0, 30+(-1))=(12, 20, 29). This calculation method of absolute coordinates combined with relative offset can ensure that the particle motion trajectory is consistent with the absolute position logic of the world space, that is, even if the player moves the character, the position of the emitted particle is still calculated based on the world coordinates at the time of emission, and is not affected by the subsequent movement of the emitter. For example, the snowflakes that have fallen in the snowstorm will not suddenly change their trajectories due to the movement of the player.

[0174] Optionally, in some embodiments, in the reverse play, the actual display position of the new batch of particles is calculated based on the world coordinates at the time of emission of the new batch of particles obtained by inversely calculating the trajectory data provided externally and the relative offset recorded in the baked data.

[0175] detecting the appearance of the new batch of particles;

[0176] in response to detecting the new batch of particles, determining the emission time point of the batch of particles in the forward play based on the external trajectory data;

[0177] obtaining the particle system world coordinates at the corresponding time from the external trajectory data according to the emission time point;

[0178] superimposing and calculating the particle system world coordinates and the relative offset recorded in the baked data;

[0179] generating the actual display position of the current frame of particles according to the superimposition calculation result.

[0180] Specifically, in the reverse play process, the system monitors the emission event of the new batch of particles in real time. For example, when playing back the special effect of the player raising sand dust when moving from point A (10, 20, 30) to point B (20, 20, 30), the reverse play logic will trigger the emission of particles in reverse, and the system needs to timely detect the “appearance” (actually the reverse emission at the time of reverse play) of the new batch of sand dust particles

[0181] In response to the detection of the new batch of particles, the system can inversely calculate the original emission time point of the batch of particles in the forward play based on the trajectory data provided externally (such as the path time stamp of the player’s movement). For example, the third batch of sand dust particles “appears” in the reverse play, and the external trajectory data records that the player emits the batch of particles from the coordinates (18, 20, 30) at the 5th second in the forward play, so the system determines that the forward play emission time point is the 5th second.

[0182] Further, the world coordinate of the particle system at the time of emission can be extracted from the external trajectory data according to the determined emission time point. For example, if the external trajectory data records the position of the player (i.e., the particle system emitter) at the 5th second as (18, 20, 30), this coordinate is taken as the world coordinate at the time of emission of the batch of particles. Then, the obtained world coordinate can be superimposed with the relative offset recorded in the baking data to generate the actual display position in the current frame. Assuming that the relative offset of the batch of dust is (-3, 0, 1), the actual display position is (18-3, 20+0, 30+1) = (15, 20, 31), so that the dust particles in the playback show the reverse trajectory of "flying back" from the end point to the emission point, and the position accurately matches the movement path of the player in the playback. Through this reverse calculation mechanism, the world space particle system can dynamically adjust the particle emission coordinate based on the external trajectory data in the playback, ensuring that the special effect remains logically consistent with the world space in the reverse playback.

[0183] Reference Figure 4 Suppose that a particle system emits particles of different colors in different batches during the forward playback, and the timing is as follows (the numbers 1, 2, 3, and 4 in the figure represent the batches of particles of different colors):

[0184] Forward playback process (T = 0 to T = 3 frames): T = 0 frame: the emitter emits the first batch of red particles (corresponding to "1" in the figure) at position P0 (here, the initial position in the world coordinate system, corresponding to the "initial position" in the figure, which is the emission time coordinate that needs to be known at runtime), and the particles start their life cycle; T = 1 frame: the emitter continues to emit the second batch of particles (2 in the figure), and the existing particles move according to the physical rules. The system continuously records the displacement of each batch of particles relative to their emission time coordinates, i.e., the "recorded displacement" shown in the figure; T = 2 frame: the third batch of particles (3 in the figure) is emitted, and the particles continue to move, and the system continues to record the displacement data; the fourth batch of particles (4 in the figure) is emitted, and the first batch of red particles reaches the end of the life cycle and disappears. The position of this batch of particles at this time is P_final, which can be represented as P0 + ΔP(3), where ΔP(3) is the recorded displacement of the particle relative to the emission coordinate P0 at T = 3 extracted from the sequence.

[0185] Reverse play (start from T=3 frame): At the beginning of reverse play (corresponding to normal play T=3 frame), the newly appeared red particles in the screen correspond to the first batch of particles that are about to disappear in normal play. Since the actual emission time point of this batch of particles is T=0 frame in normal play, the emission time coordinate P0 that needs to be known at runtime is the basis for the calculation of the reverse play position. In reverse play, the position calculation formula of the particle at any time is: position=P0+ΔP(t), where P0 is the emission time coordinate (taken from normal play T=0 frame) that needs to be recorded and passed at runtime; ΔP(t) is the displacement recorded by the particle at normal play time t (i.e. the offset relative to P0 pre-stored in the sequence data). For example, at the initial frame of reverse play (corresponding to normal play T=3 frame), the particle position is: P0+ΔP(3), by superimposing the emission time coordinate P0 stored at runtime and the pre-recorded displacement data ΔP(3), the motion path at normal play is accurately restored.

[0186] Optionally, in some embodiments, the sequence data is a time-indexed particle state array; if the particle system is a world space emission particle system, the state data is associated with an emission batch number, supporting retrieval and interpolation calculation at a time point.

[0187] Specifically, the sequence data adopts a time-indexed particle state array structure, that is, the particle state data collected at a fixed sampling period (such as 0.05 seconds) in the baking stage is organized in time sequence into an array that can be quickly retrieved by timestamp. For example, for a world space emission snowstorm particle system, the sequence data with time index "0-0.05 seconds" corresponds to the initial state (such as relative offset, remaining life, etc.) of the first batch of snowflake particles stored in the array, and "0.05-0.1 seconds" array stores the state of all surviving snowflakes (first batch+second batch) at 0.05 seconds. This storage method enables the system to quickly locate to adjacent time indexes (0.05 seconds and 0.1 seconds) according to the target sampling time point (such as 0.07 seconds) at play, providing data basis for subsequent interpolation calculation, and ensuring smooth transition of particle motion trajectory.

[0188] For example, a snowflake particle with a batch number of 003 is recorded in the particle state data array at a time index of 0.1-0.15 seconds, and the world coordinate at the time of emission is (100, 50, 30), and the relative offset is (2, 5, 1). When the target playback time point is 0.12 seconds (not a sampling point): the system locates the particle state arrays at 0.1 seconds and 0.15 seconds through the time index, extracts the relative offset of batch 003 at the two time points (for example, (2, 5, 1) at 0.1 seconds and (3, 6, 1.5) at 0.15 seconds), to achieve fast retrieval; and based on the time ratio ((0.12-0.1) / (0.15-0.1)=0.4), the offset is linearly interpolated to obtain the offset at 0.12 seconds (2+1*0.4, 5+1*0.4, 1+0.5*0.4)=(2.4, 5.4, 1.2), which is then superimposed with the emission coordinate to generate the actual display position (102.4, 55.4, 31.2).

[0189] This mechanism ensures the accuracy and real-time performance of particle position calculation through dual indexing of emission batch number and time index, and can generate smooth motion trajectories through interpolation even at non-sampling time points, avoiding the picture discontinuity problem caused by fixed frame rate in traditional frame sequence storage.

[0190] It should be noted that the present embodiment can also be improved on the basis of the ninth and / or tenth embodiments.

[0191] It can be found that, in the present embodiment, by designing a coordinate processing mechanism for the world space emission particle system, the technical problems of dynamic path adaptation and reverse playback support are effectively solved: by recording the world coordinates of each batch of particles at the time of emission and binding them with the emission batch number, a precise association between particle data and spatial position is established; in normal playback, by superimposing the relative offset in the baked data with the world coordinate at the time of emission of the corresponding batch in real time, both the relative regularity of particle motion and the dynamic adaptation of the emission source movement path can be achieved, without the need to repeatedly bake data for different paths; in reverse playback, by inversely calculating the emission coordinates of new batches of particles based on external trajectory data and calculating the display position in combination with the relative offset, the technical limitation of the traditional scheme that cannot support reverse playback is broken. This coordinate binding and dynamic calculation mechanism based on emission batch number not only ensures the spatial accuracy of particles in various playback modes, but also achieves the effect of "one baking, multiple path reuse", greatly reducing the storage demand and computational overhead.

[0192] The division of steps in the above methods is only for the purpose of clear description, and in actual implementation, one step can be combined or some steps can be split and decomposed into multiple steps, as long as the same logical relationship is included, and all are within the protection scope of the present application; adding insignificant modifications or introducing insignificant designs in the algorithm or flow, but not changing the core design of the algorithm and flow, are within the protection scope of the present application.

[0193] In addition, some embodiments of the present application also provide an electronic device. The electronic device can be various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and the like. The electronic device can also be various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices.

[0194] The electronic device includes one or more processors, and a memory storing computer program instructions which, when executed, cause the processor to perform the steps of the method provided by any one or more embodiments described above. Figure 5 An exemplary structural diagram of the electronic device is disclosed. The electronic device includes one or more processors 1101, a memory 1102, and an interface for connecting components, including a high-speed interface and a low-speed interface. Various components are connected to each other by different buses, and can be installed on a common motherboard or in other ways as needed. The processor can process instructions executed within the electronic device, including instructions stored in the memory or memory to display graphical information on a GUI on an external input / output device, such as a display device coupled to the interface. In some other embodiments, multiple processors and / or multiple buses can be used with multiple memories and multiple memories, if necessary. Similarly, multiple electronic devices can be connected, each providing part of the necessary operations. Among them, the components shown herein, their connections and relationships, and their functions are only examples, and are not intended to limit the implementation of the present application described and / or claimed herein.

[0195] The electronic device can also include an input device 1103 and an output device 1104. The processor 1101, the memory 1102, the input device 1103 and the output device 1104 can be connected by bus or other means, and in the figure, they are connected by bus.

[0196] The input device 1103 can receive input of a number or character information, and generate a key signal corresponding to a user's setting and function control of the electronic device, such as a touch screen, a keypad, a mouse, a trackpad, a touchpad, a pointing stick, one or more mouse buttons, a trackball, a joystick, etc. The output device 1104 can include a display device, an auxiliary lighting device (e.g., an LED), a haptic feedback device (e.g., a vibration motor), etc. The display device can include, but is not limited to, a liquid crystal display, a light emitting diode display, and a plasma display. In some embodiments, the display device can be a touch screen.

[0197] To provide the interaction with the user, the electronic device can be a computer. The computer has a display device (e.g., a cathode ray tube or an LCD monitor) for displaying information to the user, and a keyboard and a pointing device (e.g., a mouse) through which the user can provide input to the computer. Other kinds of devices can also be used for providing the interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback), and the input from the user can be received in any form (e.g., voice input or tactile input).

[0198] In the embodiments of the present application, the computer program / instruction is stored on the computer readable medium, and the computer program / instruction is executed by the processor to implement the steps of the method provided by any one or more of the embodiments. The computer readable medium can be included in the electronic device described in the above embodiments; or can exist separately without being assembled into the device. The computer readable medium carries one or more computer readable instructions.

[0199] The memory 1102 can be used as a non-transitory computer readable storage medium for storing non-transitory software programs, non-transitory computer executable programs and modules. The processor 1101 executes various functions and data processing of the server by running the non-transitory software programs, instructions and modules stored in the memory 1102, so as to implement the program instructions / modules corresponding to the method provided by any one or more of the embodiments in the present application.

[0200] The memory 1102 can include a program region and a data region, where the program region can store an operating system, an application required by at least one function, and the like, and the data region can store data created according to use of the electronic device, and the like. In addition, the memory 1102 can include a high-speed random access memory, and can further include a non-transitory memory such as at least one of a magnetic disk storage device, a flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 1102 can optionally include a memory disposed remotely with respect to the processor 1101, and these remote memories can be connected to the electronic device through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0201] It should be noted that the computer-readable medium described in the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical fiber, a portable compact disk read-only memory, an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer-readable medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or apparatus.

[0202] The computer-readable medium includes permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory, static random access memory, dynamic random access memory, other types of random access memory, read-only memory, electrically erasable programmable read-only memory, flash memory or other memory technology, read-only optical disc, digital versatile disc or other optical storage, magnetic cassette, magnetic tape disk storage or other magnetic storage device, or any other non-transmission medium that can be used to store information accessible by a computing device.

[0203] Computer program code for carrying out operations of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network ("LAN") or a wide area network ("WAN"), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0204] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. For example, the embodiments can be implemented by an application specific integrated circuit, a general purpose computer or any other similar hardware device. In some embodiments, the software programs of the embodiments can be executed by a processor to implement the above steps or functions. Similarly, the software programs of the embodiments (including related data structures) can be stored in a computer readable recording medium, such as a RAM memory, a magnetic or optical drive or a floppy disk and the like. In addition, some steps or functions of the embodiments can be implemented by hardware, such as a circuit cooperating with a processor to perform the steps or functions.

[0205] The computer program product provided by the embodiments of the present application includes one or more computer programs / instructions, which, when executed by a processor, generate all or part of the processes or functions described in the embodiments of the present application. The computer can be a general purpose computer, a special purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer readable storage medium can be any available medium accessible by a computer or a data storage device such as a server, data center and the like integrated with one or more available media. The available media can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk) and the like.

[0206] The computer program product of the present application can be a computer program including a plurality of program instructions that control at least one processing unit of a computer to implement the method according to the embodiments of the present application. The computer program product of the present application can be stored in a computer readable storage medium (media), including but not limited to: optical read only memory (ROM), RAM, soft disc, and the like, which is coupled to the computer system bus via a coupling means, which enables the computer to read information in the computer program product, so as to implement the methods or achieve the device according to the embodiments of the present application.

[0207] The scope of the present application is defined by the appended claims rather than the description preceding it, therefore, all changes and modifications that come within the meaning and range of equivalency of the claims are to be embraced by the application. No feature of the application should be considered critical unless expressly stated in the claims. In addition, no single feature or combination of features should be considered essential unless expressly stated in the claims. Further, the mention herein of certain terms in the description and / or the claims should not be considered limiting, unless expressly stated to that effect. Specifically, any use of the terms "include", "have", "with", or the like, is not meant to exclude the presence of other elements or steps. It should be further noted that the terms "comprise", "comprising", "have", "has", "including", "including", "containing", "including" or any other variation thereof, are not meant to exclude other elements or steps. The terms "first", "second", "third", "fourth", "fifth" or the like are used merely to distinguish one element from another, and do not require a particular order or sequence. The use of the terms "first", "second", "third", "fourth", "fifth" or the like does not indicate relative importance.

[0208] The above description is merely one specific example of the application, and the scope of the application is not limited to this specific example. Any person skilled in the art who understands the technology disclosed in the present application can easily make changes or replacements within the scope of the technology disclosed in the present application, which should be covered by the scope of the present application. Therefore, the scope of the present application should be limited to the scope of the claims, and the above examples should be regarded as exemplary and non-limiting.

Claims

1. A method of baking a particle system, characterized by, The method comprises: pre-generating a deterministic parameter sequence; for a continuous emission particle system, controlling particle behavior according to the deterministic parameter sequence; generating start phase sequence data and cycle phase sequence data according to the particle behavior; wherein the start phase sequence data records the process from the first emission particle to the stable state of the particle system, and the cycle phase sequence data records the particle behavior within one complete running cycle based on the deterministic parameter sequence.

2. The method of claim 1, wherein, The pre-generating a deterministic parameter sequence comprises: generating a deterministic parameter sequence containing a corresponding number of parameter groups according to a pre-defined sequence length parameter; wherein each group of parameters contains a pre-set particle control parameter for deterministically driving particle behavior.

3. The method of claim 1, wherein, Before the controlling particle behavior according to the deterministic parameter sequence, the method further comprises: selecting a corresponding baking process according to the type of the particle system; wherein if the particle system is a normal particle type, a single running process from the start of particle emission to the end of the life cycle of all particles is recorded to generate single-segment sequence data; and the termination condition of the sequence data is the disappearance of the last particle.

4. The method according to any one of claims 1 to 3, characterized in that, The method further comprises: recording particle state data at a fixed time interval as a sampling period; organizing the recorded particle state data in chronological order to form time-indexed sequence data; wherein the sequence data includes at least one of single-segment sequence data, start phase sequence data, and cycle phase sequence data.

5. The method of claim 1, wherein, If the continuous emission particle system is a world space emission particle system, the method further comprises: associating a corresponding emission batch number with the state data of each time sampling point of each particle; wherein the emission batch number is used to uniquely identify the emission batch to which the particle belongs when playing, and is associated with the world coordinates of the particle system in the game world at the time of the batch particle emission.

6. The method of claim 5, wherein, The state data includes the position attribute of the particle; and the position attribute is stored in the form of relative offset.

7. The method of claim 1, wherein, When recording the data of the particle behavior, only first data is recorded; the first data is used to represent the key parameters that dynamically change with time during the motion process of the particle and cannot be generated by other data; wherein second data other than the first data is generated based on the common configuration of the particle system and the first data.

8. The method of claim 7, wherein: the first data includes at least one of the following: particle coordinates, particle lifetime, particle remaining lifetime, particle rotation orientation, and random value; the second data includes at least one of the following: color, size, transparency, and shader custom data.

9. A method of playing a particle system, characterized by, The method for baking generated sequence data using any one of claims 1-8 comprises: obtaining the baked generated sequence data and initializing a time axis pointer and a play mode parameter; the play mode parameter includes normal play, reverse play, and fast forward; dynamically calculating a target sampling time point based on the current play mode and the device time; extracting particle state data corresponding to the target sampling time point from the sequence data and driving particle rendering based on the particle state data and real-time calculation logic; determining whether to continue the steps of dynamically calculating the target sampling time point, extracting particle state data, and driving particle rendering, or to terminate the playback according to the current playback progress and the particle system type.

10. The method of claim 9, wherein, dynamically calculating the target sampling time point based on the current playback mode and the device time includes: if the current playback mode is forward playback, determining a time interval based on the device time, incrementing the current time point by the time interval, and taking the incremented current time point as the target sampling time point; if the current playback mode is reverse playback, determining a time interval based on the device time, decrementing the current time point by the time interval, and taking the decremented current time point as the target sampling time point; if the current playback mode is fast-forward playback, determining a reference time interval based on the device time, incrementing the current time point by a preset multiple of the reference time interval, and taking the incremented current time point as the target sampling time point, wherein the target sampling time point is aligned with the sampling period of the baking stage.

11. The method of claim 9, wherein, determining whether to continue the steps of dynamically calculating the target sampling time point, extracting particle state data, and driving particle rendering, or to terminate the playback according to the current playback progress and the particle system type includes: if the sequence end has not been reached, offsetting the time point according to the playback mode and continuing the steps of dynamically calculating the target sampling time point, extracting particle state data, and driving particle rendering; if the sequence end has been reached, performing corresponding operations according to the particle system type: terminating the playback for a normal particle system; switching to a loop stage sequence or resetting the time axis pointer for a continuous emission particle system and continuing the playback; and continuing to calculate the particle display position for a world space emission particle system by batch binding world coordinates.

12. The method of claim 9, wherein, if the particle system is a normal particle system, the operation of terminating the playback is to terminate the playback when the time point exceeds the total duration of the sequence.

13. The method of claim 9, wherein, if the particle system is a continuous emission particle system, the determination to continue the steps of dynamically calculating the target sampling time point, extracting particle state data, and driving particle rendering includes: for forward playback, first playing the start stage sequence, switching to the loop stage and resetting the time point to the start of the loop stage after the duration of the start stage is exceeded, and then resetting the time point to the end of the loop stage every time the end of the loop stage is reached to achieve loop playback; for reverse playback, if in the start stage, playing in reverse to the time point 0 and then terminating; if in the loop stage and without an end marker, playing in reverse to the time point 0 and then jumping to the end of the loop stage to continue reverse loop playback; if in the loop stage and with an end marker, playing in reverse to the time point 0, switching to the end of the start stage, and then continuing reverse playback to the start of the start stage and terminating.

14. The method of claim 9, wherein, if the particle system is a world space emission particle system, the driving of particle rendering includes: recording the world coordinates at the emission of each batch of particles and binding them with the emission batch number; for forward playback, the actual display position of the particles is obtained by superimposing the relative offset in the baking data and the world coordinates at the emission of the corresponding batch; When playing backward, the world coordinates of the new batch of particle emission time are reversely calculated based on the externally provided trajectory data, and the actual display position is calculated in combination with the relative offset.

15. The method of claim 14, wherein, When playing backward, the world coordinates of the new batch of particle emission time are reversely calculated based on the externally provided trajectory data, and the actual display position is calculated in combination with the relative offset. detecting the appearance of a new batch of particles; in response to detecting the new batch of particles, determining the emission time point of the batch of particles in the forward play based on the external trajectory data; according to the emission time point, obtaining the particle system world coordinates at the corresponding time from the external trajectory data; superimposing the particle system world coordinates and the relative offset recorded in the baking data for calculation; generating the actual display position of the current frame of particles according to the superimposition calculation result.

16. The method of claim 9, wherein, The play mode parameter further includes an initial time point configuration, which supports starting play from any time point in the sequence, including the start point, the midway point, or the end point of the sequence.

17. The method of claim 9, wherein, The sequence data is a particle state array indexed by time; if the particle system is a world space emission particle system, the state data is associated with an emission batch number, supporting retrieval and interpolation calculation at time points.

18. An electronic device, comprising: The electronic device comprises: one or more processors; and a memory storing computer program instructions which, when executed, cause the processor to perform the steps of the method of any one of claims 1 to 17.

19. A computer readable medium having stored thereon computer programs / instructions, characterized in that, The computer program / instructions, when executed by the processor, implement the steps of the method of any one of claims 1 to 17.

20. A computer program product comprising computer programs / instructions, characterized in that, The computer program / instructions, when executed by the processor, implement the steps of the method of any one of claims 1 to 17.