Virtual flame generation method and device, storage medium and electronic device

CN116983646BActive Publication Date: 2026-09-08NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311013750.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-11
Publication Date
2026-09-08
Estimated Expiration
2043-08-11

AI Technical Summary

Technical Problem

[0003]相关技术中,通过控制火焰喷射器喷出的虚拟火焰在某个方向上的尺寸以匹配游戏中的火焰喷射器的喷射距离,呈现火焰持续喷出并消失在远处的效果,然而,该方法使得在视觉上容易出现尚未“灼烧”到敌方虚拟对象,却已经造成了伤害的现象,降低了虚拟火焰的真实感,使得用户体验较差

Benefits of technology

[0011] On the one hand, when a collideable virtual fireball comes into contact with an attackable object in the game, the damage effect of the virtual flame on the attackable object is determined. Compared with the existing technology where the generation logic of virtual flame and the corresponding damage effect determination logic are independent, this generates a virtual flame that matches the damage effect, effectively improving the realism of the virtual flame and enhancing the user's immersion in the game. On the other hand, inserting non-collision virtual fireballs between collideable virtual fireballs to form virtual flames, while generating virtual flames that match the damage effect, effectively reduces the system's operating pressure and further improves the system's operating efficiency. Furthermore, using collideable and non-collision virtual fireballs to form virtual flames allows for the formation of various virtual flames by adjusting the collideable and non-collision virtual fireballs, improving the flexibility and diversity of virtual flames and further enhancing the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116983646B_ABST
    Figure CN116983646B_ABST
Patent Text Reader

Abstract

The present disclosure provides a virtual flame generation method and device, a storage medium and an electronic device, and relates to the technical field of computers. The virtual flame generation method comprises: in response to a firing instruction for a flame spewer in a game, obtaining positions of a plurality of virtual collidable fireballs according to a position and a spewing direction of the flame spewer; inserting one or more virtual non-collidable fireballs between the virtual collidable fireballs, forming a virtual flame based on the virtual collidable fireballs and the virtual non-collidable fireballs; and in the case that the virtual collidable fireballs contact an attackable object in the game, determining a damage effect of the virtual flame on the attackable object. The present disclosure improves the realism of the generated virtual flame and further improves the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a virtual flame generation method, a virtual flame generation device, a computer-readable storage medium, and an electronic device. Background Technology

[0002] In the game, in addition to various pistols, rifles, sniper rifles, shotguns, etc., there are also weapons with a large damage range and sound and light effects, such as laser cannons and laser guns. Among them, flamethrowers are very popular because of their large damage range and cool sound and light effects.

[0003] In related technologies, the size of the virtual flame emitted by the flamethrower in a certain direction is controlled to match the spray distance of the flamethrower in the game, so as to present the effect of flames continuously shooting out and disappearing in the distance. However, this method makes it easy for the virtual enemy object to be damaged before it has been "burned" visually, which reduces the realism of the virtual flame and makes the user experience poor. Summary of the Invention

[0004] This disclosure provides a method for generating virtual flames, a device for generating virtual flames, a computer-readable storage medium, and an electronic device, thereby improving the problem of weak realism in virtual flames to at least a certain extent.

[0005] Other features and advantages of this disclosure will become apparent from the following detailed description, or may be learned in part from practice of this disclosure.

[0006] According to a first aspect of this disclosure, a method for generating virtual flames is provided, comprising: responding to a firing command for a flamethrower in a game, obtaining the positions of a plurality of collideable virtual fireballs based on the position and firing direction of the flamethrower; inserting one or more non-collision virtual fireballs between the collideable virtual fireballs, forming a virtual flame based on the collideable virtual fireballs and the non-collision virtual fireballs; and determining the damage effect of the virtual flames on the attackable object when the collideable virtual fireballs come into contact with an attackable object in the game.

[0007] According to a second aspect of this disclosure, a virtual flame generation apparatus is provided, comprising: a collisionable virtual fireball position determination module configured to, in response to a firing command for a flamethrower in a game, acquire the positions of a plurality of collisionable virtual fireballs based on the position and firing direction of the flamethrower; a non-collision virtual fireball insertion module configured to insert one or more non-collision virtual fireballs between the collisionable virtual fireballs, thereby forming a virtual flame based on the collisionable virtual fireballs and the non-collision virtual fireballs; and a damage effect determination module configured to, when a collisionable virtual fireball comes into contact with an attackable object in the game, determine the damage effect of the virtual flame on the attackable object.

[0008] According to a third aspect of this disclosure, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the virtual flame generation method of the first aspect described above and its possible implementations.

[0009] According to a fourth aspect of this disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor. The processor is configured to execute the virtual flame generation method of the first aspect and its possible implementations thereof via executing the executable instructions.

[0010] The technical solution disclosed herein has the following beneficial effects:

[0011] On the one hand, when a collideable virtual fireball comes into contact with an attackable object in the game, the damage effect of the virtual flame on the attackable object is determined. Compared with the existing technology where the generation logic of virtual flame and the corresponding damage effect determination logic are independent, this generates a virtual flame that matches the damage effect, effectively improving the realism of the virtual flame and enhancing the user's immersion in the game. On the other hand, inserting non-collision virtual fireballs between collideable virtual fireballs to form virtual flames, while generating virtual flames that match the damage effect, effectively reduces the system's operating pressure and further improves the system's operating efficiency. Furthermore, using collideable and non-collision virtual fireballs to form virtual flames allows for the formation of various virtual flames by adjusting the collideable and non-collision virtual fireballs, improving the flexibility and diversity of virtual flames and further enhancing the user experience.

[0012] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0013] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0014] Figure 1 This diagram illustrates how the size of the virtual flame matches the spray distance along the z-axis of the coordinate system.

[0015] Figure 2 This illustrates the system architecture of the operating environment for this exemplary embodiment;

[0016] Figure 3 This diagram illustrates a flowchart of a virtual flame generation method in this exemplary embodiment;

[0017] Figure 4 This diagram illustrates how collision-free virtual fireballs are positioned between collision-enabled virtual fireballs in this exemplary embodiment.

[0018] Figure 5 This diagram illustrates the direction the flamethrower turns, while the flight direction of the collision-free virtual fireball does not follow the direction of the flamethrower's spray.

[0019] Figure 6A This diagram illustrates how, when the flamethrower moves longitudinally, the virtual flame still sprays from the position it was in before moving.

[0020] Figure 6B This diagram illustrates how virtual fireballs disperse throughout the scene when a flamethrower makes a lateral turn.

[0021] Figure 7 This diagram illustrates a flowchart of determining the flight position and direction of a collideable virtual fireball in this exemplary embodiment.

[0022] Figure 8 This diagram illustrates the direction of the flamethrower in this exemplary embodiment, where the flight direction of the collision-free virtual fireball changes from a first launch direction to a second launch direction.

[0023] Figure 9 This diagram illustrates the "flame trail" effect of the virtual flame after the flamethrower moves in this exemplary embodiment.

[0024] Figure 10 This illustrates a flowchart of adjusting the size of a virtual fireball during a preset fireball change period in this exemplary embodiment;

[0025] Figure 11 This diagram illustrates that the size of the virtual fireball is a random value in this exemplary embodiment.

[0026] Figure 12A This diagram illustrates how the size of a virtual flame changes over time in this exemplary embodiment.

[0027] Figure 12B This diagram illustrates the "airborne residue" effect of a virtual flame when a flamethrower is longitudinally turned in this exemplary embodiment.

[0028] Figure 12C This diagram illustrates the "airborne residue" effect of a virtual flame when a flamethrower makes a lateral turn, according to an exemplary embodiment of the present invention.

[0029] Figure 13 This diagram illustrates the structure of a virtual flame generation device according to this exemplary embodiment.

[0030] Figure 14 A schematic diagram of the structure of an electronic device in this exemplary embodiment is shown. Detailed Implementation

[0031] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this disclosure more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more specific details omitted, or other methods, components, apparatus, steps, etc., can be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this disclosure.

[0032] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0033] In related technologies, the sprayed virtual flame is a single entity, typically achieved by controlling the size of the virtual flame in the z-direction to match the spray distance, thus presenting a similar effect. Figure 1The virtual flame effect is shown; the target point is determined by the spray direction and coordinates of the flamethrower nozzle to assess the damage range and effect. Clearly, the logic for generating the virtual flame and determining the damage effect are independent of each other. This can easily lead to visually apparent damage to virtual enemy objects before they have actually been "burned," reducing the realism of the virtual flame and resulting in a poor user experience.

[0034] In view of one or more of the above-mentioned problems, this disclosure first provides a virtual flame generation method through exemplary embodiments. The following describes a method for generating virtual flames. Figure 2 The system architecture of the operating environment for this exemplary embodiment will be described.

[0035] refer to Figure 2 As shown, the system architecture 200 may include a terminal device 210 and a server 220. The terminal device 210 may be an electronic device such as a laptop, tablet, or desktop computer, and can be used to obtain the position and spray direction of the flamethrower. The server 220 generally refers to the backend system that provides virtual flame generation-related services in this exemplary embodiment, such as a server implementing the virtual flame generation method. The server 220 may be a single server or a cluster of multiple servers; this disclosure does not limit this. The terminal device 210 and the server 220 can be connected via a wired or wireless communication link for data interaction.

[0036] The virtual flame generation method in this exemplary embodiment can be executed by the terminal device 210. For example, in a game scene, the terminal device can be a computer running the game. When the flamethrower in the game is triggered to spray flames, the terminal device 210 can execute the virtual flame generation method to obtain the position of the collideable virtual fireball in the game scene based on the position and spray direction of the flamethrower, and when the collideable virtual fireball comes into contact with an attackable object in the game, determine and display the damage effect of the virtual flame on the attackable object.

[0037] In one implementation, in response to a firing command for a flamethrower in the game, the terminal device 210 can acquire the position and firing direction of the flamethrower in real time and send the position and firing direction of the flamethrower to the server 220. After receiving the position and firing direction of the flamethrower, the server 220 can acquire the positions of multiple collideable virtual fireballs based on the position and firing direction of the flamethrower, and insert one or more non-collisionable virtual fireballs between the collideable virtual fireballs. A virtual flame is formed based on the collideable and non-collisionable virtual fireballs. When a collideable virtual fireball comes into contact with an attackable object in the game, the damage effect of the virtual flame on the attackable object is determined, and the damage effect is sent to the terminal device 210 for display.

[0038] As can be seen from the above, the virtual flame generation method in this exemplary embodiment can be executed by the terminal device 210 or the server 220.

[0039] The following is combined with Figure 3 The method for generating virtual flames is explained. Figure 3 An exemplary flow of a virtual flame generation method is shown, including the following steps S310 to S330:

[0040] Step S310: In response to the firing command for the flamethrower in the game, obtain the positions of multiple collideable virtual fireballs based on the position and firing direction of the flamethrower;

[0041] Step S320: Insert one or more non-collision virtual fireballs between the collisionable virtual fireballs to form a virtual flame based on the collisionable and non-collision virtual fireballs;

[0042] Step S330: When a collideable virtual fireball comes into contact with an attackable object in the game, determine the damage effect of the virtual fire on the attackable object.

[0043] Based on the above method, on the one hand, when a collideable virtual fireball comes into contact with an attackable object in the game, the damage effect of the virtual flame on the attackable object is determined. Compared with the existing technology where the generation logic of virtual flame and the corresponding damage effect determination logic are independent, this method generates a virtual flame that matches the damage effect, effectively improving the realism of the virtual flame and enhancing the user's immersion in the game. On the other hand, inserting non-collision virtual fireballs between collideable virtual fireballs to form virtual flames not only generates virtual flames that match the damage effect but also effectively reduces the system's operating pressure, further improving system efficiency. Furthermore, using collideable and non-collision virtual fireballs to form virtual flames allows for the formation of various virtual flames by adjusting the collideable and non-collision virtual fireballs, increasing the flexibility and diversity of virtual flames and further improving the user experience.

[0044] The following is about Figure 3 Each step in the process will be explained in detail.

[0045] refer to Figure 3 In step S310, in response to the firing command for the flamethrower in the game, the positions of multiple collideable virtual fireballs are obtained based on the position and firing direction of the flamethrower.

[0046] The flamethrower can be a virtual weapon used in the game to spray flames. The collideable virtual fireball is equipped with a collider to form the virtual flames sprayed by the flamethrower and to determine whether the virtual flames have come into contact with an attackable object through collision detection. Attackable objects can be virtual objects in the game; for example, they can include enemy game characters in a match, or virtual houses, virtual lawns, etc., that can be "burned" in the game.

[0047] By binding colliders to virtual fireballs, collision-capable virtual fireballs can be obtained, and the positions of multiple collision-capable virtual fireballs can be obtained based on the position and direction of the flamethrower. This can effectively improve the realism of the virtual flames formed by the collision-capable virtual fireballs.

[0048] Assigning a collider of a corresponding size to each virtual fireball would place a significant performance burden on the electronic devices running the game, impacting gameplay. To compensate for this, and to reduce performance consumption while maintaining the density of the flamethrower's fireballs, further research was conducted... Figure 3 In step S320, one or more non-collision virtual fireballs are inserted between the collisionable virtual fireballs to form a virtual flame based on the collisionable and non-collision virtual fireballs.

[0049] Among them, the non-collision virtual fireball is a virtual geometry that is not bound to a collider and has the same display effect as the collideable virtual fireball. That is, the non-collision virtual fireball will not trigger a damage effect when it comes into contact with an attackable object.

[0050] refer to Figure 4 As shown, real_bullet represents a collideable virtual fireball, and trick_bullet represents a non-collision virtual fireball. Setting the non-collision virtual fireball between collideable virtual fireballs can produce a virtual flame effect with low performance consumption and strong realism.

[0051] To generate dynamic virtual flames, in one implementation, the above method may further include the following steps:

[0052] Update the position of the non-collision virtual fireballs based on the position of the collisionable virtual fireballs.

[0053] By updating the position of the non-collision virtual fireballs by updating the position of the collisionable virtual fireballs, the positions of the non-collision virtual fireballs can be kept consistent with those of the collisionable virtual fireballs, thus creating a continuous virtual flame effect. This ensures that the virtual flames generated by the flamethrower do not disappear abruptly during movement, but instead have a "flame trail" effect, resulting in a more realistic and dynamic virtual flame. Furthermore, in determining the position of the virtual fireballs, it is not necessary to recalculate the position of the non-collision virtual fireballs using the same method as for the collisionable virtual fireballs, reducing code redundancy, further improving code readability, and effectively alleviating the system's operational pressure.

[0054] In one implementation, updating the position of the non-collision virtual fireball based on the position of the collisionable virtual fireball may include the following steps:

[0055] If the launch orientation of a collision-free virtual fireball is the same as the launch orientation of the collisionable virtual fireball it follows, update the flight position of the collision-free virtual fireball according to the flight position of the collisionable virtual fireball.

[0056] The launch orientation can include the spray position and direction of the flamethrower when it launches the virtual fireball. The spray position can include the position of the flamethrower nozzle or the position of the flamethrower. The same launch orientation means that the flamethrower's spray position and spray direction do not change during the process of launching the non-collision virtual fireball and the collideable virtual fireball that follows it.

[0057] For example, if the launch direction of a non-collision virtual fireball is the same as the launch direction of a collisionable virtual fireball it follows, gravity, damping, and friction can be preset for the collisionable virtual fireball according to pre-defined parameters. Then, the launch position of the collisionable virtual fireball can be determined according to the position of the flamethrower, and the launch direction of the collisionable virtual fireball can be determined based on the spray direction of the flamethrower. After the collisionable virtual fireball is launched, the flight position information of the collisionable virtual fireball can be obtained in each frame of the game scene, and the flight position information of the collisionable virtual fireball can be stored in a circular queue. To store the position information of collideable virtual fireballs in a circular queue, let real_bullet represent collideable virtual fireballs and trick_bullet represent non-collision virtual fireballs. Assume the firing rate of real_bullet is t seconds. Distribute x trick_bullets evenly between two real_bullets and record the flight path of real_bullet at a frequency of f times per second. Then we can obtain that the interval between adjacent virtual fireballs is t / (x+1)*f coordinate points, and the "distance" between real_bullet and its last trick_bullet is t / (x+1)*f*x coordinate points. The maximum length of the circular queue can be determined according to the following formula (1):

[0058] max_length = t * x * f / (x + 1) + 3 (1)

[0059] Where max_length is the maximum length of the circular queue, and 3 is the preset error compensation value.

[0060] After determining the maximum length of the circular queue, the flight position of the real_bullet can be written to the circular queue according to the following code:

[0061] queue[tail] = position / / Store the position at index tail in the queue.

[0062] tail = (tail + 1) % max_length / / Calculate the next position storage location based on max_length tail

[0063] Here, queue represents a circular queue, position can represent the flight position of real_bullet, and tail represents the index in queue.

[0064] After writing the flight position of the collideable virtual bullet (real_bullet) into the circular queue, the flight position of the non-collision virtual bullet (trick_bullet) can be determined based on the flight position of the real_bullet stored in the queue.

[0065] When the launch direction of a collisionless virtual bullet differs from the launch direction of its following collisionable virtual bullet, if the flight position of the real_bullet in the queue is directly used as the flight position of the following trick_bullet, refer to... Figure 5 As shown, a phenomenon occurs where the flamethrower rotates, while the non-collision virtual fireball (trick_bullet) still follows the collisionable virtual fireball (real_bullet). In an actual game scenario, this would result in... Figure 6A and Figure 6B The virtual flame effect shown, in which, Figure 6A This demonstrates that when the flamethrower moves longitudinally, the virtual flame still sprays from the position it was in before moving. Figure 6B This shows the phenomenon where virtual fireballs disperse throughout the scene when the flamethrower turns laterally.

[0066] Therefore, when the launch orientation of a collision-free virtual fireball differs from that of the collisionable virtual fireball it follows, the flight direction and position of the collision-free virtual fireball are updated based on the first launch orientation of the collisionable virtual fireball and the second launch orientation of the collision-free virtual fireball.

[0067] The different launch orientations refer to the changes in the spray position and direction of the flamethrower during the process of launching the non-collision virtual fireball and the following collisionable virtual fireball.

[0068] Compared to existing technologies where virtual flames are treated as a single special effect and their disappearance is too abrupt when the flamethrower moves, this exemplary embodiment updates the flight position and direction of non-collision virtual fireballs based on the position of collideable virtual fireballs, achieving a residual effect of virtual flames while spraying fire and turning, thus further enhancing the realism of the virtual flames.

[0069] In one implementation, the first launch azimuth includes a first launch direction and a first launch position, and the second launch azimuth includes a second launch direction and a second launch position. The flight direction and flight position of the collisionless virtual fireball are updated based on the first launch azimuth of the collidable virtual fireball and the second launch azimuth of the collisionless virtual fireball, with reference to... Figure 7 As shown, steps S710 to S720 may be included:

[0070] Step S710: Determine the flight direction offset based on the first launch direction and the second launch direction, and determine the flight position offset based on the first launch position and the second launch position;

[0071] Step S720: Determine the flight direction based on the offset between the second launch direction and the flight direction, and determine the flight position based on the offset between the second launch position and the flight position.

[0072] Among them, the flight direction offset is used to determine the specific value by which the flight direction of the collision-free virtual fireball needs to be offset from the second launch direction, and the flight position offset is used to determine the specific value by which the flight position of the collision-free virtual fireball needs to be offset from the second launch position.

[0073] For example, when a collideable virtual fireball fires a real_bullet, the first launch position (fire_pos) and the first launch direction (fire_forward) of the real_bullet are recorded, and the flight path of the real_bullet is continuously written to a circular queue. When each trick_bullet following this real_bullet is launched, the second launch position (fire_pos') and the second launch direction (fire_forward') corresponding to the trick_bullet can be obtained (the second launch position and the second launch direction are the current position and direction of the flamethrower). Based on fire_pos and fire_pos', the flight position offset (position_offset) can be calculated. The flight direction offset `rotation_offset` can be calculated from `fire_forward` and `fire_forward`. Finally, the flight position `trick_bullet_position` of the collision-free virtual fireball `trick_bullet` can be obtained from `fire_pos` and `position_offset`, and the flight direction `trick_bullet_forward` can be obtained from `fire_forward` and `rotation_offset`. Updating the position of `trick_bullet` based on `trick_bullet_position` and `trick_bullet_forward` achieves the desired result. Figure 8 The effect shown is that when the first launch direction and the second launch direction are different, the flight direction of the trick_bullet changes from the first launch direction to the second launch direction. In actual gameplay, this can be achieved as follows: Figure 9 The virtual flame effect shown is for reference. Figure 9 As shown, Figure 9The diagram shows that after the flamethrower rotates laterally, the virtual flame does not abruptly follow the flamethrower's movement, but instead appears at the second launch position with a "flame trail" effect.

[0074] based on Figure 7 The method modifies the second launch direction and the second launch position based on the flight direction offset and the flight position offset to improve the problem that the virtual flame change process is too abrupt when the flamethrower's orientation changes, further enhancing the realism of the virtual flame and effectively improving the user's immersion in the game.

[0075] To make the virtual flames more realistic and vivid, their size can be adjusted as the flight time increases, creating the visual effect of each virtual flame continuously "diffusing" and "expanding." In one implementation, the method may further include:

[0076] During the preset fireball change period, the size of the collideable virtual fireball and the size of the non-collision virtual fireball are adjusted to form a virtual flame whose size changes with time.

[0077] The preset fireball change period is used to limit the duration of continuous change in fireball size. This disclosure does not impose any special limitation on the duration of the preset fireball change period. For example, the preset fireball change period can be 3 seconds.

[0078] By modifying the size of the collideable and non-collision virtual fireballs within a preset fireball change period, the effect of each virtual flame constantly changing can be presented, making the overall effect of the generated virtual flames more natural and realistic.

[0079] In one implementation, the sizes of the collideable and non-collision virtual fireballs are adjusted during a preset fireball change period, with reference to... Figure 10 As shown, it may include steps S1010 to S1020:

[0080] Step S1010: Obtain the minimum and maximum size of the fireball. The minimum size of the fireball is selected from a preset minimum range of fireball sizes, and the maximum size of the fireball is determined by the sum of the minimum size of the fireball and the increase in fireball size. The increase in fireball size is selected from a preset range of increase in fireball size.

[0081] Step S1020: During the preset fireball change period, adjust the size of the collidable virtual fireball and the size of the non-collidable virtual fireball from the minimum fireball size to the maximum fireball size.

[0082] Among them, the preset minimum range of fireball size can be the range of variation of the minimum value of fireball size, and the preset range of fireball increase can be the range of variation of the increase in fireball size.

[0083] For example, [min_scale_left_boundary, min_scale_right_boundary] can be used to represent the minimum range of the preset fireball size, where min_scale_left_boundary and min_scale_right_boundary represent the minimum and maximum values ​​of the minimum fireball size, respectively. A random value can be selected from the preset minimum range of the fireball size as the minimum fireball size min_scale for either a colliding or non-colliding virtual fireball. [add_scale_left_boundary, add_scale_right_boundary] can be used to represent the range of the preset fireball increase, where add_scale_left_boundary and add_scale_right_boundary can represent the minimum and maximum values ​​of the increase in fireball size, respectively. A random value can be selected from the preset range of the increase in fireball size as the increase in fireball size add_scale for either a colliding or non-colliding virtual fireball. The maximum fireball size max_scale can then be determined according to formula (3).

[0084] max_scale = min_scale + add_scale (3)

[0085] Let `change_duration` be a fixed value representing the preset fireball change period, then refer to... Figure 11 As shown, during the change_duration period after each collisionable or non-collisionable virtual fireball is launched, the size of the virtual fireball can uniformly change from its corresponding min_scale to max_scale. Since the min_scale and add_scale of each virtual fireball are random values ​​within a preset range, the min_scale and max_scale of each virtual fireball are different, so as to present the effect that the size of each virtual fireball is not the same during the flight of the flame.

[0086] based on Figure 10 This method achieves the effect of the virtual flame gradually increasing in size during the duration of flame spraying. At the same time, the size of the virtual flame can be adjusted according to the size of each virtual fireball, making the generation process of virtual flames more flexible and improving the richness and diversity of virtual flames.

[0087] Continue to refer to Figure 3 In step S330, when a collideable virtual fireball comes into contact with an attackable object in the game, the damage effect of the virtual flame on the attackable object is determined.

[0088] The damage effect may include the "burning" effect of virtual flames on the attackable object. This disclosure does not specifically limit the specific manifestation of the damage effect. For example, the damage effect may include the continuous decrease of the attackable virtual object's health.

[0089] For example, the following process can be used to determine whether a collideable virtual fireball has come into contact with an attackable object in the game: Let the nozzle position of the flamethrower be fire_pos, the flame direction be fire_direction, and the current flame distance be fire_distance. Then, the target point end_pos of the flamethrower is fire_pos + fire_direction * fire_distance. After determining end_pos, it can be offset by a preset flame spread value in four directions: upper left, upper right, lower left, and lower right, to obtain four target offset points. Ray detection is then performed with the nozzle position fire_pos as the starting point and the four target offset points as the ending points to determine the distance between the nozzle and the target offset points. The damage range max_dist is determined based on the maximum value of the distance. The collideable virtual fireball can perform collision translation detection with fire_pos as the starting point and fire_pos + fire_direction * max_dist as the ending point to detect the attackable virtual objects it comes into contact with as it moves from the starting point to the ending point.

[0090] Since "fake fireballs" do not trigger damage calculation, it is possible that a player may see their flamethrower "hit" an attackable virtual object, but no damage is inflicted. Therefore, in one implementation, the aforementioned damage effect may include a total damage value. Determining the damage effect of the virtual flame on the attackable object may include the following steps:

[0091] The actual damage value is determined by the quotient of the sum of the damage values ​​and the preset display frequency, and the actual damage value is displayed according to the preset display frequency to determine the damage effect.

[0092] The total damage value can represent the specific amount by which the virtual flame reduces the health of the attackable virtual object. For example, the total damage value can be 80. The preset display frequency can represent the specific number of times the actual damage value is displayed. This disclosure does not impose any special limitations on the acquisition method and specific value of the preset display frequency. For example, the preset display frequency can be a random value within a certain range, and the preset display frequency can be 4. The actual displayed damage value can be used to present to the user that the virtual flame achieves multiple damage effects on the attackable object.

[0093] For example, if the total damage value is 80 and the preset display frequency is 4, then the actual damage value of 20 can be displayed 4 times within the time it takes for the virtual flame to come into contact with the attackable virtual object.

[0094] By displaying the total damage value multiple times, the system improves the realism and accuracy of the virtual flames' damage effect on attackable objects, thus addressing situations where the flamethrower "hits" an attackable virtual object but does not cause damage.

[0095] Based on the above method, while ensuring low performance overhead, it is possible to achieve the following: Figure 12A , 12B And the flame effect shown in 12C, among which, Figure 12A It presents the effect of virtual flame size changing over time. Figure 12B This demonstrates the "aerial trail" effect of the virtual flame when the flamethrower turns longitudinally. Figure 12C The image shows the "airborne residue" effect of the virtual flame when the flamethrower turns laterally, demonstrating that the above method generates a more realistic, flexible, and accurate virtual flame.

[0096] Exemplary embodiments of this disclosure also provide a virtual flame generation apparatus. For example... Figure 13 As shown, the virtual flame generation device 1300 may include:

[0097] The collisionable virtual fireball position determination module 1310 is configured to acquire the baseline expression model of the reference face and the sample expression model of the target face, and establish variables about the baseline expression model of the target face and variables about the weights.

[0098] The collision-free virtual fireball insertion module 1320 is configured to respond to a firing command for a flamethrower in a game and obtain the positions of multiple collideable virtual fireballs based on the position and firing direction of the flamethrower.

[0099] The damage effect determination module 1330 is configured to determine the damage effect of the virtual flame on the attackable object when the collideable virtual fireball comes into contact with the attackable object in the game.

[0100] In one embodiment, the above-mentioned apparatus may further include:

[0101] Update the position of the non-collision virtual fireballs based on the position of the collisionable virtual fireballs.

[0102] In one implementation, updating the position of the non-collision virtual fireball based on the position of the collisionable virtual fireball may include:

[0103] If the launch orientation of a collision-free virtual fireball is the same as the launch orientation of a collisionable virtual fireball it follows, the flight position of the collision-free virtual fireball is updated according to the flight position of the collisionable virtual fireball.

[0104] If the launch orientation of the collisionless virtual fireball is different from the launch orientation of the collideable virtual fireball it follows, the flight direction and flight position of the collisionless virtual fireball are updated according to the first launch orientation of the collideable virtual fireball and the second launch orientation of the collisionless virtual fireball.

[0105] In one embodiment, the first launch azimuth includes a first launch direction and a first launch position, and the second launch azimuth includes a second launch direction and a second launch position. Updating the flight direction and flight position of the non-collision virtual fireball based on the first launch azimuth of the collideable virtual fireball and the second launch azimuth of the non-collision virtual fireball may include:

[0106] The flight direction offset is determined based on the first launch direction and the second launch direction, and the flight position offset is determined based on the first launch position and the second launch position;

[0107] The flight direction is determined based on the offset between the second launch direction and the flight direction, and the flight position is determined based on the offset between the second launch position and the flight position.

[0108] In one embodiment, the above-mentioned apparatus may further include:

[0109] During the preset fireball change period, the size of the collideable virtual fireball and the size of the non-collision virtual fireball are adjusted to form a virtual flame whose size changes with time.

[0110] In one embodiment, adjusting the size of the collideable virtual fireball and the size of the non-collision virtual fireball during a preset fireball change period may include:

[0111] Obtain the minimum and maximum fireball size. The minimum fireball size is selected from a preset minimum fireball size range, and the maximum fireball size is determined by the sum of the minimum fireball size and the increase in fireball size, which is selected from a preset increase range.

[0112] During the preset fireball change period, the size of the collidable virtual fireball and the size of the non-collision virtual fireball are adjusted from the minimum fireball size to the maximum fireball size.

[0113] In one implementation, the aforementioned damage effect includes a total damage value, and determining the damage effect of the virtual flame on the attackable object includes:

[0114] The actual damage value is determined by the quotient of the sum of the damage values ​​and the preset display frequency, and the actual damage value is displayed according to the preset display frequency to determine the damage effect.

[0115] The specific details of each part of the above-mentioned device have been described in detail in the method section of the implementation, and therefore will not be repeated here.

[0116] Exemplary embodiments of this disclosure also provide a computer-readable storage medium that can be implemented as a program product including program code, which, when run on an electronic device, causes the electronic device to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure. In an alternative embodiment, the program product can be implemented as a portable compact disc read-only memory (CD-ROM) including program code and can run on an electronic device, such as a personal computer. However, the program product of this disclosure is not limited thereto. In this document, the readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0117] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0118] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.

[0119] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0120] Program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing devices can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0121] Exemplary embodiments of this disclosure also provide an electronic device. The electronic device may include a processor and a memory. The memory stores executable instructions for the processor, such as program code. The processor executes the executable instructions to perform the methods of this exemplary embodiment.

[0122] The following is for reference. Figure 14 The electronic device is illustrated by way of a general-purpose computing device. It should be understood that... Figure 14 The electronic device 1400 shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0123] like Figure 14 As shown, the electronic device 1400 may include: a processor 1410, a memory 1420, a bus 1430, an I / O (input / output) interface 1440, and a network adapter 1450.

[0124] The processor 710 may include one or more processing units, such as a central processing unit (CPU), an application processor (AP), a modem processor, a display processing unit (DPU), a graphics processing unit (GPU), an image signal processor (ISP), a controller, an encoder, a decoder, a digital signal processor (DSP), a baseband processor, an artificial intelligence processor, etc. In one embodiment, the artificial intelligence processor, in response to a firing command for a flamethrower in a game, obtains the positions of multiple collideable virtual fireballs based on the flamethrower's position and firing direction. It then inserts one or more non-collision-free virtual fireballs between the collideable and non-collision-free virtual fireballs to form a virtual flame. Finally, when a collideable virtual fireball comes into contact with an attackable object in the game, the damage effect of the virtual flame on the attackable object is determined.

[0125] Memory 1420 may include volatile memory, such as RAM 1421 and cache unit 1422, and may also include non-volatile memory, such as ROM 1423. Memory 1420 may also include one or more program modules 1424, such program modules 1424 including, but not limited to: operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. For example, program module 1424 may include the modules in the above-described device 1300.

[0126] Bus 1430 is used to connect different components of electronic device 1400 and may include a data bus, an address bus and a control bus.

[0127] Electronic device 1400 can communicate with one or more external devices 1500 (such as keyboard, mouse, external controller, etc.) through I / O interface 1440.

[0128] Electronic device 1400 can communicate with one or more networks via network adapter 1450. For example, network adapter 1450 can provide mobile communication solutions such as 3G / 4G / 5G, or wireless communication solutions such as wireless LAN, Bluetooth, and near-field communication. Network adapter 1450 can communicate with other modules of electronic device 1400 via bus 1430.

[0129] although Figure 14 Other hardware and / or software modules, including but not limited to: displays, microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, may also be configured in electronic device 1400.

[0130] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to exemplary embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0131] Those skilled in the art will understand that various aspects of this disclosure can be implemented as systems, methods, or program products. Therefore, various aspects of this disclosure can be embodied in entirely hardware implementations, entirely software implementations (including firmware, microcode, etc.), or implementations combining hardware and software aspects, collectively referred to herein as “circuit,” “module,” or “system.” Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.

[0132] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is defined only by the appended claims.

Claims

1. A method for generating virtual flames, characterized in that, include: In response to a firing command for a flamethrower in the game, the positions of multiple collideable virtual fireballs are obtained based on the position and firing direction of the flamethrower; One or more non-collision virtual fireballs are inserted between the collisionable virtual fireballs, and a virtual flame is formed based on the collisionable virtual fireballs and the non-collision virtual fireballs. When the collideable virtual fireball comes into contact with an attackable object in the game, determine the damage effect of the virtual fire on the attackable object; The method further includes: when the launch azimuth of the collisionless virtual fireball is the same as the launch azimuth of the collideable virtual fireball it follows, updating the flight position of the collisionless virtual fireball according to the flight position of the collideable virtual fireball; when the launch azimuth of the collisionless virtual fireball is different from the launch azimuth of the collideable virtual fireball it follows, updating the flight direction and flight position of the collisionless virtual fireball according to the first launch azimuth of the collideable virtual fireball and the second launch azimuth of the collisionless virtual fireball. Wherein, the first launch azimuth includes a first launch direction and a first launch position, and the second launch azimuth includes a second launch direction and a second launch position. The step of updating the flight direction and flight position of the non-collision virtual fireball based on the first launch azimuth of the collideable virtual fireball and the second launch azimuth of the non-collision virtual fireball includes: determining a flight direction offset based on the first launch direction and the second launch direction, and determining a flight position offset based on the first launch position and the second launch position; determining the flight direction based on the second launch direction and the flight direction offset, and determining the flight position based on the second launch position and the flight position offset.

2. The method according to claim 1, characterized in that, The collideable virtual fireball is bound to a collider, while the non-collideable virtual fireball is not bound to a collider.

3. The method according to claim 1, characterized in that, The display effect of the collision-capable virtual fireball is the same as that of the non-collision virtual fireball.

4. The method according to claim 1, characterized in that, The collision-free virtual fireball does not trigger a damage effect when it comes into contact with an attackable object.

5. The method according to claim 1, characterized in that, The method further includes: During a preset fireball change period, the size of the collideable virtual fireball and the size of the non-collision virtual fireball are adjusted to form a virtual flame whose size changes over time.

6. The method according to claim 5, characterized in that, The step of adjusting the size of the collideable virtual fireball and the size of the non-collision virtual fireball during the preset fireball change period includes: Obtain the minimum and maximum fireball size, wherein the minimum fireball size is selected from a preset minimum fireball size range, and the maximum fireball size is determined by the sum of the minimum fireball size and the increase in fireball size, wherein the increase in fireball size is selected from a preset increase range. During the preset fireball change period, the size of the collideable virtual fireball and the size of the non-collision virtual fireball are adjusted from the minimum fireball size to the maximum fireball size.

7. The method according to claim 1, characterized in that, The damage effect includes the total damage value, and determining the damage effect of the virtual flame on the attackable object includes: The actual displayed damage value is determined by the quotient of the sum of the damage values ​​and the preset display frequency, and the actual displayed damage value is displayed according to the preset display frequency to determine the damage effect.

8. A virtual flame generation device, characterized in that, include: The module for determining the position of collideable virtual fireballs is configured to, in response to a firing command for a flamethrower in the game, obtain the positions of multiple collideable virtual fireballs based on the position and firing direction of the flamethrower. A collision-free virtual fireball insertion module is configured to insert one or more collision-free virtual fireballs between the collisionable virtual fireballs, and to form a virtual flame based on the collisionable virtual fireballs and the collision-free virtual fireballs. The damage effect determination module is configured to determine the damage effect of the virtual flame on the attackable object when the collideable virtual fireball comes into contact with the attackable object in the game. The device is further configured to: when the launch azimuth of the collisionless virtual fireball is the same as the launch azimuth of the collideable virtual fireball it follows, update the flight position of the collisionless virtual fireball according to the flight position of the collideable virtual fireball; when the launch azimuth of the collisionless virtual fireball is different from the launch azimuth of the collideable virtual fireball it follows, update the flight direction and flight position of the collisionless virtual fireball according to the first launch azimuth of the collideable virtual fireball and the second launch azimuth of the collisionless virtual fireball. Wherein, the first launch azimuth includes a first launch direction and a first launch position, and the second launch azimuth includes a second launch direction and a second launch position. The step of updating the flight direction and flight position of the non-collision virtual fireball based on the first launch azimuth of the collideable virtual fireball and the second launch azimuth of the non-collision virtual fireball includes: determining a flight direction offset based on the first launch direction and the second launch direction, and determining a flight position offset based on the first launch position and the second launch position; determining the flight direction based on the second launch direction and the flight direction offset, and determining the flight position based on the second launch position and the flight position offset.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1 to 7.

10. An electronic device, characterized in that, include: processor; Memory for storing the executable instructions of the processor; The processor is configured to execute the method of any one of claims 1 to 7 by executing the executable instructions.

Citation Information

Patent Citations

  • Direct flame impingement burner assembly for rapid heat treatments of strip-type metal materials

    KR1020120029120A

  • Robotic kitchen HUB systems and methods for minimanipulation library

    WO2021156647A1