CN116983646A - Virtual flame generation method and device, storage medium and electronic equipment - Google Patents
Virtual flame generation method and device, storage medium and electronic equipment Download PDFInfo
- Publication number
- CN116983646A CN116983646A CN202311013750.8A CN202311013750A CN116983646A CN 116983646 A CN116983646 A CN 116983646A CN 202311013750 A CN202311013750 A CN 202311013750A CN 116983646 A CN116983646 A CN 116983646A
- Authority
- CN
- China
- Prior art keywords
- virtual
- fire
- collision
- flame
- virtual fire
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 56
- 230000000694 effects Effects 0.000 claims abstract description 67
- 230000006378 damage Effects 0.000 claims abstract description 65
- 208000027418 Wounds and injury Diseases 0.000 claims abstract description 56
- 208000014674 injury Diseases 0.000 claims abstract description 56
- 238000002347 injection Methods 0.000 claims abstract description 20
- 239000007924 injection Substances 0.000 claims abstract description 20
- 230000004044 response Effects 0.000 claims abstract description 6
- 230000008859 change Effects 0.000 claims description 12
- 238000004590 computer program Methods 0.000 claims description 3
- 238000003780 insertion Methods 0.000 claims description 3
- 230000037431 insertion Effects 0.000 claims description 3
- 239000008188 pellet Substances 0.000 description 24
- 230000008569 process Effects 0.000 description 10
- 238000010586 diagram Methods 0.000 description 7
- 238000005507 spraying Methods 0.000 description 5
- 244000027321 Lychnis chalcedonica Species 0.000 description 4
- 235000017899 Spathodea campanulata Nutrition 0.000 description 4
- 238000001514 detection method Methods 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 238000007654 immersion Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 239000000243 solution Substances 0.000 description 3
- 230000006978 adaptation Effects 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 2
- 230000001747 exhibiting effect Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 208000004221 Multiple Trauma Diseases 0.000 description 1
- 208000023637 Multiple injury Diseases 0.000 description 1
- 230000009471 action Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 125000004122 cyclic group Chemical group 0.000 description 1
- 230000000254 damaging effect Effects 0.000 description 1
- 238000013016 damping Methods 0.000 description 1
- 238000009792 diffusion process Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000005484 gravity Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 230000003252 repetitive effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000013519 translation Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Classifications
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/55—Controlling game characters or game objects based on the game progress
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/50—Controlling the output signals based on the game progress
- A63F13/52—Controlling the output signals based on the game progress involving aspects of the displayed game scene
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/70—Determining position or orientation of objects or cameras
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Human Computer Interaction (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Processing Or Creating Images (AREA)
Abstract
The disclosure provides a virtual flame generation method, a virtual flame generation device, a storage medium and electronic equipment, and relates to the technical field of computers. The virtual flame generation method comprises the following steps: in response to an emission instruction for a flame injector in a game, acquiring positions of a plurality of collidable virtual fire groups according to the positions and the injection directions of the flame injector; inserting one or more collision-free virtual fire groups between the collidable virtual fire groups, forming a virtual flame based on the collidable virtual fire groups and the collision-free virtual fire groups; and under the condition that the collidable virtual fire group contacts an assault object in the game, determining the injury effect of the virtual flame on the assault object. The method and the device improve the sense of reality of the generated virtual flame and further improve the user experience.
Description
Technical Field
The disclosure relates to the field of computer technology, and in particular, to a virtual flame generating method, a virtual flame generating device, a computer readable storage medium and an electronic device.
Background
In games, other than various handguns, rifles, sniper guns, shotguns, and the like; also included are weapons with a large range of injury and with an acousto-optic representation, such as laser cannons, laser guns, etc., where flame injectors are popular for their large range of injury, cool acousto-optic representation.
In the related art, by controlling the size of the virtual flame sprayed from the flame sprayer in a certain direction to match the spraying distance of the flame sprayer in the game, the effect that the flame is continuously sprayed and disappears in a far place is presented, however, the method makes the phenomenon that the virtual flame is not burnt to an enemy virtual object but is damaged easily appear visually, the sense of reality of the virtual flame is reduced, and the user experience is poor.
Disclosure of Invention
The present disclosure provides a virtual flame generating method, a virtual flame generating apparatus, a computer-readable storage medium, and an electronic device, thereby improving the problem of weak sense of realism of a virtual flame at least to some extent.
Other features and advantages of the present disclosure will be apparent from the following detailed description, or may be learned in part by the practice of the disclosure.
According to a first aspect of the present disclosure, there is provided a virtual flame generating method, comprising: in response to an emission instruction for a flame injector in a game, acquiring positions of a plurality of collidable virtual fire groups according to the positions and the injection directions of the flame injector; inserting one or more collision-free virtual fire groups between the collidable virtual fire groups, forming a virtual flame based on the collidable virtual fire groups and the collision-free virtual fire groups; and under the condition that the collidable virtual fire group contacts an assault object in the game, determining the injury effect of the virtual flame on the assault object.
According to a second aspect of the present disclosure, there is provided a virtual flame generating apparatus comprising: a position determination module of the collidable virtual fire group, configured to respond to an emission instruction of a flame injector in a game, and acquire the positions of a plurality of collidable virtual fire groups according to the positions and the injection directions of the flame injector; a collision-free virtual fire group insertion module configured to insert one or more collision-free virtual fire groups between the collidable virtual fire groups, forming a virtual flame based on the collidable virtual fire groups and the collision-free virtual fire groups; and the injury effect determining module is configured to determine an injury effect of the virtual flame on an attackeable object in a game under the condition that the colliding virtual fire group contacts the attackeable object.
According to a third aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the virtual flame generation method of the first aspect described above and possible implementations thereof.
According to a fourth aspect of the present disclosure, there is provided an electronic device comprising: a processor; and the memory is used for storing executable instructions of the processor. Wherein the processor is configured to perform the virtual flame generating method of the first aspect described above and possible implementations thereof via execution of the executable instructions.
The technical scheme of the present disclosure has the following beneficial effects:
on the one hand, under the condition that the collidable virtual fire group contacts an attacked object in the game, the damage effect of the virtual flame on the attacked object is determined, compared with the mode that the generation logic of the virtual flame and the damage effect determination logic corresponding to the virtual flame in the prior art are mutually independent, the virtual flame matched with the damage effect is generated, the sense of reality of the virtual flame is effectively improved, and the sense of immersion of a user in the game is improved; on the other hand, a collision-free virtual fire group is inserted between the collision-free virtual fire groups to form virtual flames, so that the system operation pressure is effectively reduced and the system operation efficiency is further improved while the virtual flames matched with the injury effect are generated; in yet another aspect, a virtual flame is formed using the collidable virtual fire group and the collision-free virtual fire group, and multiple virtual flames can be formed by adjusting the collidable virtual fire group and the collision-free virtual fire group, so that flexibility and diversity of the virtual flame are improved, and user experience is further improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure. It will be apparent to those of ordinary skill in the art that the drawings in the following description are merely examples of the disclosure and that other drawings may be derived from them without undue effort.
FIG. 1 shows a schematic diagram of a virtual flame size matching a throw distance in the z-axis direction of a coordinate axis;
FIG. 2 illustrates a system architecture of the operating environment of the present exemplary embodiment;
fig. 3 shows a flowchart of a virtual flame generation method in the present exemplary embodiment;
fig. 4 shows a schematic diagram of the present exemplary embodiment in which collision-free virtual fire groups are disposed between collision-possible virtual fire groups;
FIG. 5 shows a schematic view of a flame injector turning without a collision free virtual fire mass flight direction following the injection direction of the flame injector;
FIG. 6A shows a schematic view of a virtual flame still being ejected from a position prior to movement of the flame injector as the flame injector moves longitudinally;
FIG. 6B shows a schematic of virtual fire mass dispersed throughout a scene as the flame injector turns laterally;
FIG. 7 illustrates a flow chart of one method of determining the location and direction of flight of a collidable virtual fire mass in this exemplary embodiment;
FIG. 8 shows a schematic diagram of a flame injector turning, a collision-free virtual fire mass flight direction changing from a first emission direction to a second emission direction in the present exemplary embodiment;
fig. 9 shows a schematic view of a virtual flame exhibiting a "flame tailing" effect after the flame ejector is moved in the present exemplary embodiment;
fig. 10 shows a flowchart of adjusting the virtual fire group size in a preset fire group variation period in the present exemplary embodiment;
fig. 11 shows a schematic diagram of the virtual fire group size as a random value in the present exemplary embodiment;
FIG. 12A shows a schematic diagram of a virtual flame size as a function of time in the present exemplary embodiment;
fig. 12B shows a schematic view of the "air-borne" effect of a virtual flame when a flame ejector is turned longitudinally in the present exemplary embodiment;
fig. 12C shows a schematic view of the "air-borne" effect of a virtual flame when a flame injector is turned sideways in the present exemplary embodiment;
fig. 13 is a schematic view showing the structure of a virtual flame generating apparatus in the present exemplary embodiment;
Fig. 14 shows a schematic structural diagram of an electronic device in the present exemplary embodiment.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the present disclosure. However, those skilled in the art will recognize that the aspects of the present disclosure may be practiced with one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software or in one or more hardware modules or integrated circuits or in different networks and/or processor devices and/or microcontroller devices.
In the related art, the virtual flame is an integral body, and the virtual flame effect as shown in fig. 1 is presented by controlling the size of the virtual flame in the z direction to match the spraying distance; and determining an injection target point through the injection direction of the injection port coordinates of the flame injector so as to judge the injury scope and determine the injury effect. Obviously, in the process, the virtual flame generation logic and the injury effect determination logic are mutually independent, and the phenomenon that an enemy virtual object is not burned visually and injury is caused easily occurs, so that the sense of reality of the virtual flame is reduced, and the user experience is poor.
In view of one or more of the problems described above, exemplary embodiments of the present disclosure first provide a virtual flame generating method. The system architecture of the operating environment of the present exemplary embodiment is described below in conjunction with fig. 2.
Referring to fig. 2, a 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 notebook computer, a tablet computer, or a desktop computer, and the terminal device 210 may be configured to obtain a position and a spraying direction of the flame sprayer. The server 220 generally refers to a background system that provides a virtual flame generation-related service in the present exemplary embodiment, and may be, for example, a server that implements a virtual flame generation method. Server 220 may be a server or a cluster of servers, which is not limited by this disclosure. The terminal device 210 and the server 220 may form a connection through a wired or wireless communication link for data interaction.
The virtual flame generation method in the present exemplary embodiment may be performed by the terminal device 210. For example, in a game scenario, the terminal device may be a computer running a game, and when a flame injector in the game is triggered to inject a flame effect, the terminal device 210 may obtain a position of a collidable virtual fire group according to a position and an injection direction of the flame injector in the game scenario by performing a virtual flame generation method, and determine and display an injury effect of the virtual flame on an assailable object when the collidable virtual fire group contacts the assailable object in the game.
In one embodiment, in response to an emission instruction for a flame injector in a game, the position and the injection direction of the flame injector may be acquired in real time by the terminal device 210 and transmitted to the server 220, and after receiving the position and the injection direction of the flame injector, the server 220 may acquire the positions of a plurality of collidable virtual fire groups according to the position and the injection direction of the flame injector and insert one or more collision-free virtual fire groups between the collidable virtual fire groups, form a virtual flame based on the collidable virtual fire groups and the collision-free virtual fire groups, determine an injury effect of the virtual flame on the attackeable object in the case that the collidable virtual fire groups contact the attackeable object in the game, and transmit the injury effect to the terminal device 210 for display.
As can be seen from the above, the virtual flame generating method in the present exemplary embodiment may be performed by the terminal device 210 or the server 220 described above.
The virtual flame generation method will be described with reference to fig. 3. Fig. 3 shows an exemplary flow of the virtual flame generation method, including the following steps S310 to S330:
step S310, responding to an emission instruction of a flame ejector in a game, and acquiring a plurality of positions of the collidable virtual fire groups according to the positions and the spraying directions of the flame ejector;
step S320, inserting one or more collision-free virtual fire groups between the collision-free virtual fire groups, and forming virtual flames based on the collision-free virtual fire groups and the collision-free virtual fire groups;
in step S330, in the case that the collidable virtual fire group contacts the attackeable object in the game, an injury effect of the virtual flame on the attackeable object is determined.
Based on the method, on one hand, under the condition that the collidable virtual fire group contacts an attackeable object in the game, the damage effect of the virtual flame on the attackeable object is determined, compared with the mode that the generation logic of the virtual flame and the damage effect determination logic corresponding to the virtual flame in the prior art are mutually independent, the virtual flame matched with the damage effect is generated, the sense of reality of the virtual flame is effectively improved, and the sense of immersion of a user in the game is improved; on the other hand, a collision-free virtual fire group is inserted between the collision-free virtual fire groups to form virtual flames, so that the system operation pressure is effectively reduced and the system operation efficiency is further improved while the virtual flames matched with the injury effect are generated; in yet another aspect, a virtual flame is formed using the collidable virtual fire group and the collision-free virtual fire group, and multiple virtual flames can be formed by adjusting the collidable virtual fire group and the collision-free virtual fire group, so that flexibility and diversity of the virtual flame are improved, and user experience is further improved.
Each step in fig. 3 is specifically described below.
Referring to fig. 3, in step S310, in response to an emission instruction for a flame injector in a game, positions of a plurality of collidable virtual fire groups are acquired according to the positions and the injection directions of the flame injector.
Wherein the flame ejector may be a virtual weapon for ejecting flames in a game, the collidable virtual fire group is provided with a collider for constituting the virtual flames ejected by the flame ejector, and it is determined whether the virtual flames contact an offensive object by collision detection. The attacked object may be a virtual object in the game, for example, the attacked virtual object may include an opponent game character in a game, and may also include a virtual house, virtual lawn, etc. in the game that may be "burned".
The virtual fire groups are bound with the collision body to obtain the collidable virtual fire groups which can be used for collision detection, and the positions of a plurality of collidable virtual fire groups are obtained according to the positions and the spraying directions of the flame sprayers, so that the sense of reality of virtual flames formed by the collidable virtual fire groups can be effectively improved.
Since a collision body with a corresponding size is bound to each virtual fire group, a great performance pressure is brought to the electronic device running the game, and the game effect is affected, in order to fill the fire column density sprayed by the flame sprayer and reduce the performance consumption, with continued reference to fig. 3, step S320, one or more collision-free virtual fire groups are inserted between the collision-free virtual fire groups, and virtual flames are formed based on the collision-free virtual fire groups and the collision-free virtual fire groups.
The collision-free virtual fire group is an unbound collision body and has a virtual geometric body with the same display effect as the collision-free virtual fire group, namely, the collision-free virtual fire group can not trigger the injury effect when contacting an attackeable object.
Referring to fig. 4, real_pellet represents a collidable virtual fire group, pick_pellet represents a non-collided virtual fire group, and the non-collided virtual fire group is arranged between the collidable virtual fire groups, so that a virtual flame effect with low performance consumption and strong sense of realism can be obtained.
In order to generate a dynamic virtual flame, in one embodiment, the method may further comprise the steps of:
the location of the collision free virtual fire mass is updated based on the location of the collidable virtual fire mass.
The position of the collision-free virtual fire group is updated through the position of the collision-free virtual fire group, so that the position of the collision-free virtual fire group is consistent with the position of the collision-free virtual fire group, and a continuous virtual flame effect is formed, so that the generated virtual flame does not suddenly disappear in the moving process of the flame ejector, but has a flame tailing effect, and a dynamic virtual flame with stronger sense of reality is obtained; in the process of determining the virtual fire group position, the position of the collision-free virtual fire group does not need to be recalculated according to the position determining method of the collision-free virtual fire group, so that the code repeatability is reduced, the code readability is further improved, and the running pressure of a system is effectively reduced.
In one embodiment, the updating the location of the collision-free virtual fire group based on the location of the collidable virtual fire group may include the steps of:
updating the flight position of the collision-free virtual fire group according to the flight position of the collision-free virtual fire group under the condition that the emission position of the collision-free virtual fire group is the same as the emission position of the following collision-free virtual fire group;
wherein the emission orientation may include an emission position and an emission direction of the flame injector when the flame injector emits the virtual fire mass, and the emission position may include an emission position of the flame injector or a position of the flame injector; the same emission orientation means that the flame injector does not change its injection position and injection direction during the process of emitting the collision-free virtual fire mass and the collidable virtual fire mass that follows it.
For example, in the case that the emission direction of the collision-free virtual fire group is the same as the emission direction of the following collision-free virtual fire group, gravity, damping, friction, and the like may be set for the collision-free virtual fire group in advance according to preset parameters, then the emission position of the collision-free virtual fire group is determined according to the position of the flame injector, the emission direction of the collision-free virtual fire group is determined based on the emission direction of the flame injector, after the collision-free virtual fire group is emitted, the flight position information of the collision-free virtual fire group is obtained in each frame of game scene, and the flight position information of the collision-free virtual fire group is stored by using a circulation queue. In order to store the position information of the collidable virtual fire groups in the circulation queue, the real_pellet represents the collidable virtual fire groups, the check_pellet represents the non-collided virtual fire groups, the real_pellet is set to have a jet speed of t seconds, x check_pellets are uniformly distributed between two real_pellets, the flight paths of the real_pellets are recorded according to the frequency f times per second, t/(x+1) f coordinate point information can be obtained between adjacent virtual fire groups, the "distance" between the real_pellet and the last check_pellet is t/(x+1) f x coordinate point information, and the maximum length of the circulation queue can be determined according to the following formula (1):
max_length = t * x * f / (x + 1) + 3 (1)
Wherein max_length is the maximum length of the circular queue, and 3 is the preset error compensation value.
After determining the maximum length of the circular queue, the flight position of real_pellet may be written into the circular queue according to the following code:
queue [ tail ] = position// store position at position with queue index of tail
Tail= (Tail+1)% max_length// calculate position Tail stored next position from max_length
Where queue represents a circular queue, position may represent the flight position of real_bullets, and tail represents the index in the queue.
After the flight position of the collidable virtual fire group real_pellet is written into the cyclic queue, the flight position of the collision-free virtual fire group trick_pellet can be determined according to the flight position of the real_pellet stored in the queue.
In the case that the emission orientation of the collision-free virtual fire group is different from the emission orientation of the collidable virtual fire group which it follows, if the flight position of real_pellet in the queue is directly used as the flight position of the following trick_pellet, as shown in fig. 5, the phenomenon that the flame injector rotates while the collision-free virtual fire group trick_pellet still flies following the collidable virtual fire group real_pellet occurs, and in the actual game scene, the virtual flame effect shown in fig. 6A and 6B occurs, wherein fig. 6A shows that the virtual flame is still ejected from the position before the flame injector moves when the flame injector moves longitudinally, and fig. 6B shows the phenomenon that the virtual fire group is scattered throughout the scene when the flame injector turns laterally.
Thus, in the event that the emission orientation of the collision free virtual fire mass differs from the emission orientation of the collidable virtual fire mass that it follows, the flight direction and flight position of the collision free virtual fire mass are updated in accordance with the first emission orientation of the collidable virtual fire mass and the second emission orientation of the collision free virtual fire mass.
Wherein, the different emission directions refer to that the flame injector changes the injection position and the injection direction in the process of emitting the collision-free virtual fire mass and the collision-free virtual fire mass which is followed by the flame injector.
Compared with the prior art that when the virtual flame is taken as a special effect whole, when the flame ejector moves, the vanishing effect of the virtual flame is more abrupt, and in the present exemplary embodiment, the flight position and the flight direction of the collision-free virtual flame are updated according to the position of the collision-free virtual flame according to the situation, so that when the virtual flame is sprayed and turned once, the residual effect of the virtual flame is realized, and the sense of reality of the virtual flame is further improved.
In one embodiment, the first emission direction includes a first emission direction and a first emission position, the second emission direction includes a second emission direction and a second emission position, and updating the flight direction and the flight position of the collision-free virtual fire group according to the first emission direction of the collision-free virtual fire group and the second emission direction of the collision-free virtual fire group, as shown in fig. 7, may include steps S710 to S720:
Step S710, determining a flight direction offset according to the first emission direction and the second emission direction, and determining a flight position offset according to the first emission position and the second emission position;
in step S720, the flight direction is determined based on the second emission direction and the flight direction offset, and the flight position is determined based on the second emission position and the flight position offset.
The flight direction offset is used for determining a specific value of the flight direction of the collision-free virtual fire group needing to be offset on the basis of the second emission direction, and the flight position offset is used for determining a specific value of the flight position of the collision-free virtual fire group needing to be offset on the basis of the second emission position.
For example, when the real_pellet is launched by the collidable virtual fire group, recording a first launching position fire_pos and a first launching direction fire_forward corresponding to the real_pellet, and continuously writing a flight path of the real_pellet into the circular queue; when each trigger_pellet following the real_pellet emits, a second emission position fire_pos 'and a second emission direction fire_forward' corresponding to the trigger_pellet can be obtained (the second emission position and the second emission direction are the current position and the current injection direction of the flame injector); the flight position offset position_offset can be calculated according to fire_pos and fire_pos ', and the flight direction offset rotation_offset can be calculated based on fire_forward' and fire_forward; finally, according to the fire_pos 'and the position_offset, the flight position of the non-collision virtual fire group, namely the fire_position, of the fire_button can be obtained, according to the fire_forward' and the rotation_offset, the flight direction, namely the fire_button, of the non-collision virtual fire group can be obtained, according to the fire_position and the fire_button_forward, the position representation of the fire_button is updated, namely the flight direction of the fire_button is changed from the first emission direction to the second emission direction when the first emission direction is different from the second emission direction, in an actual game, the virtual flame effect shown in fig. 9 can be achieved, and according to fig. 9, after the flame ejector rotates transversely, the virtual flame does not move along with the flame ejector in a sharp manner, but the flame effect is shown in the second emission position with the flame tailing effect.
Based on the method of fig. 7, the second emission direction and the second emission position are modified based on the flight direction offset and the flight position offset, so that the problem that the virtual flame changing process is too abrupt when the orientation of the flame injector is changed is solved, the sense of reality of the virtual flame is further enhanced, and the sense of immersion of a user in a game is effectively improved.
For a more realistic and lively virtual flame, the size of the virtual flame may be modified over time of flight, exhibiting the effect that each bolus of virtual flame is visually constantly "diffuse", "expand", in one embodiment the method may further comprise:
and in a preset fire group change period, adjusting the size of the collidable virtual fire group and the size of the non-collided virtual fire group so as to form a virtual flame with the size changing along with time.
The duration of the preset fire group change period is not particularly limited, and for example, the preset fire group change period may be 3 seconds.
By modifying the size of the collidable virtual fire group and the size of the collision-free virtual fire group within the preset fire group change period, the effect that each group of virtual flame is continuously changed can be presented, so that the whole effect of the generated virtual flame is more natural and has more realism.
In one embodiment, the adjusting the size of the collidable virtual fire group and the size of the non-collided virtual fire group within the preset fire group variation period, as shown in fig. 10, may include steps S1010 to S1020:
step S1010, acquiring a fire bolus size minimum value and a fire bolus size maximum value, wherein the fire bolus size minimum value is selected from a preset fire bolus size minimum range, and the fire bolus size maximum value is determined according to the sum of the fire bolus size minimum value and a fire bolus size increment, and the fire bolus size increment is selected from a preset fire bolus increment range;
in step S1020, in the preset fire group variation period, the size of the collidable virtual fire group and the size of the non-collided virtual fire group are adjusted from the minimum fire group size to the maximum fire group size.
The preset fire ball size minimum range may be a variation range of a fire ball size minimum value, and the preset fire ball increasing amount range may be a variation range of a fire ball size increasing amount.
For example, the minimum range of the size of the fire cluster may be represented by [ min_scale_left_boundary, min_scale_right_boundary ], where min_scale_left_boundary and min_scale_right_boundary represent the minimum value and the maximum value of the minimum value of the size of the fire cluster, respectively, and a random value may be selected from the minimum range of the size of the fire cluster as the minimum value of the size of the fire cluster of the collidable virtual fire cluster or the non-collidable virtual fire cluster, min_scale; the preset fire group increment range may be represented by [ add_scale_left_boundary, add_scale_right_boundary ], wherein add_scale_left_boundary and add_scale_right_boundary may represent a minimum value and a maximum value of the fire group size increment, respectively, and a random value may be selected as the fire group size increment add_scale of the collidable virtual fire group or the non-collidable virtual fire group in the preset fire group increment range; the fire size maximum max_scale may be determined according to equation (3):
max_scale = min_scale + add_scale (3)
When the fixed value change_duration is used to represent the preset fire group change period, referring to fig. 11, in the change_duration time after each collidable virtual fire group or non-collidable virtual fire group is emitted, the size of the virtual fire group can be uniformly changed from its corresponding min_scale to max_scale, and since the min_scale and add_scale of each virtual fire group are random values within the preset range, the min_scale and the max_scale of each virtual fire group are different, so as to present the effect that the size of each virtual fire group is different in the flame flight process.
Based on the method of fig. 10, the effect that the size of the virtual flame gradually becomes larger in the duration of the flame being sprayed is achieved, and meanwhile, the size of the virtual flame can be adjusted according to the size of each virtual fire group, so that the generation process of the virtual flame is more flexible, and meanwhile, the richness and diversity of the virtual flame are improved.
With continued reference to fig. 3, in step S330, in the event that the collidable virtual fire group contacts an assailable object in the game, the damaging effect of the virtual flame on the assailable object is determined.
The injury effect may include a "burning" effect generated by the virtual flame on the attacked object, and the specific expression form of the injury effect is not particularly limited in the present disclosure, and exemplary, the injury effect may include a continuous decrease of a life value of the attacked virtual object.
For example, it may be determined whether the collisionable virtual fire is in contact with an offensive object in the game according to the following procedure: setting the position of the jet orifice of the flame jet as fire_pos, setting the fire jetting direction as fire_direction, and setting the current flame jetting distance as fire_distance, wherein the target point end_pos=fire_pos+fire_direction of flame jetting is fire_distance; after determining the end_pos, the end_pos can be shifted by a preset flame diffusion value along the upper left, upper right, lower left and lower right directions to obtain 4 target shift points; performing ray detection by taking the position of the jet orifice as fire_pos as a starting point and taking 4 target offset points as end points to determine the distance between the jet orifice and the target offset points, and determining an injury range max_dist according to the maximum value in the distances; the collidable virtual fire mass may perform a collision translation detection with fire_pos as a starting point and fire_pos+fire_direction max_dist as an ending point, so as to detect a contacted attacked virtual object in a process of moving the collider from the starting point to the ending point.
Since the "false fire" does not trigger the settlement of injury, it may happen that the player clearly sees that the flame injector controlled by himself "hits" the attackeable virtual object, but does not cause injury to the virtual object, and thus, in one embodiment, the above-mentioned injury effect may include the sum of injury values, and the above-mentioned determination of the injury effect of the virtual flame on the attackeable object may include the following steps:
And determining an actual display injury value according to the quotient of the injury numerical value sum and the preset display frequency, and displaying the actual display injury value according to the preset display frequency to determine an injury effect.
Wherein the injury value sum may be a specific value that characterizes the virtual flame's reduction in life value for the offensive virtual object, e.g., the injury value sum may be 80; the preset display frequency may represent a specific display number of actual injury values, and the method and the specific numerical value for obtaining the preset display frequency are not particularly limited, and by way of example, the preset display frequency may be a random value within a certain numerical range, and the preset display frequency may be 4; the actual display of the injury value may be used to present the virtual flame to the user to achieve a multiple injury effect on the attacked object.
For example, the sum of the injury values may be 80, and the preset display frequency may be 4, and the actual displayed injury value 20 may be displayed for 4 times in the time when the virtual flame contacts the attacked virtual object.
The damage numerical sum is displayed for a plurality of times, so that the situation that the flame injector 'hits' the attacked virtual object but does not damage the virtual object is improved, and the sense of reality and the accuracy of the damage effect of the virtual flame on the attacked object are improved.
Based on the above method, the flame effect as shown in fig. 12A, 12B and 12C can be simultaneously realized with ensured low performance overhead, wherein fig. 12A shows the effect that the virtual flame size changes with time, fig. 12B shows the effect of "air-remaining" of the virtual flame when the flame injector turns longitudinally, and fig. 12C shows the effect of "air-remaining" of the virtual flame when the flame injector turns transversely, and it can be seen that the above method generates a more realistic, flexible and accurate virtual flame.
The exemplary embodiment of the disclosure also provides a virtual flame generating device. As shown in fig. 13, the virtual flame generating apparatus 1300 may include:
a position determination module 1310 of the collidable virtual fire group, configured to acquire a reference expression model of the reference face and a sample expression model of the target face, and establish a variable of the reference expression model and a variable of the weight of the target face;
a collision-free virtual fire group insertion module 1320 configured to acquire a plurality of positions of collision-free virtual fire groups according to a position and a jet direction of a flame jet in response to a jet instruction for the flame jet in a game;
The injury effect determination module 1330 is configured to determine an injury effect of the virtual flame on the attackeable object in the game if the collidable virtual fire group contacts the attackeable object.
In one embodiment, the apparatus may further include:
the location of the collision free virtual fire mass is updated based on the location of the collidable virtual fire mass.
In one embodiment, the updating the location of the collision-free virtual fire group based on the location of the collidable virtual fire group may include:
updating the flight position of the collision-free virtual fire group according to the flight position of the collision-free virtual fire group under the condition that the emission direction of the collision-free virtual fire group is the same as the emission direction of the collision-free virtual fire group followed by the collision-free virtual fire group;
and under the condition that the emission azimuth of the collision-free virtual fire group is different from the emission azimuth of the collision-free virtual fire group which the collision-free virtual fire group follows, updating the flight direction and the flight position of the collision-free virtual fire group according to the first emission azimuth of the collision-free virtual fire group and the second emission azimuth of the collision-free virtual fire group.
In one embodiment, the first emission direction includes a first emission direction and a first emission position, the second emission direction includes a second emission direction and a second emission position, and updating the flight direction and the flight position of the collision-free virtual fire group according to the first emission direction of the collision-free virtual fire group and the second emission direction of the collision-free virtual fire group may include:
Determining a flight direction offset according to the first emission direction and the second emission direction, and determining a flight position offset according to the first emission position and the second emission position;
the flight direction is determined based on the second launch direction and the flight direction offset, and the flight position is determined based on the second launch position and the flight position offset.
In one embodiment, the apparatus may further include:
and in a preset fire group change period, adjusting the size of the collidable virtual fire group and the size of the non-collided virtual fire group so as to form a virtual flame with the size changing along with time.
In an embodiment, the adjusting the size of the collidable virtual fire group and the size of the non-collided virtual fire group within the preset fire group change period may include:
acquiring a fire bolus size minimum value and a fire bolus size maximum value, wherein the fire bolus size minimum value is selected from a preset fire bolus size minimum range, the fire bolus size maximum value is determined according to the sum of the fire bolus size minimum value and a fire bolus size increment, and the fire bolus size increment is selected from a preset fire bolus increment range;
and in a preset fire group change period, adjusting the size of the collidable virtual fire group and the size of the non-collided virtual fire group from the minimum fire group size to the maximum fire group size.
In one embodiment, the injury effect includes a sum of injury values, and the determining the injury effect of the virtual flame on the attacked object includes:
and determining an actual display injury value according to the quotient of the injury numerical value sum and the preset display frequency, and displaying the actual display injury value according to the preset display frequency to determine an injury effect.
The specific details of each part in the above apparatus are already described in the method part embodiments, and thus will not be repeated.
Exemplary embodiments of the present disclosure also provide a computer readable storage medium, which may be implemented in the form of a program product comprising program code for causing an electronic device to carry out the steps according to the various exemplary embodiments of the disclosure as described in the above section of the "exemplary method" when the program product is run on the electronic device. In an alternative embodiment, the program product may be implemented as a portable compact disc read only memory (CD-ROM) and comprises program code and may run on an electronic device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, 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), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable signal medium may include a data signal propagated in baseband or as part of a carrier wave with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
Exemplary embodiments of the present disclosure also provide an electronic device. The electronic device may include a processor and a memory. The memory stores executable instructions of the processor, such as program code. The processor performs the method of the present exemplary embodiment by executing the executable instructions.
An electronic device is illustrated in the form of a general purpose computing device with reference to fig. 14. It should be understood that the electronic device 1400 shown in fig. 14 is merely an example and should not be taken as limiting the functionality and scope of use of the disclosed embodiments.
As shown in fig. 14, the electronic device 1400 may include: processor 1410, memory 1420, bus 1430, I/O (input/output) interface 1440, network adapter 1450.
Processor 710 may include one or more processing units such as, for example: processor 710 may include a central processor (Central Processing Unit, CPU), AP (Application Processor ), modem processor, display processor (Display Process Unit, DPU), GPU (Graphics Processing Unit, graphics processor), ISP (Image Signal Processor ), controller, encoder, decoder, DSP (Digital Signal Processor ), baseband processor, artificial intelligence processor, and the like. In one embodiment, the artificial intelligence processor may respond to the emission instruction of the flame injector in the game, obtain the positions of a plurality of collidable virtual fire groups according to the positions and the injection directions of the flame injector, insert one or more non-collided virtual fire groups between the collidable virtual fire groups to form virtual flames based on the collidable virtual fire groups and the non-collided virtual fire groups, and finally determine the injury effect of the virtual flames on the attackeable objects under the condition that the collidable virtual fire groups contact the attackeable objects in the game.
Memory 1420 can include volatile memory such as RAM 1421, cache units 1422, and nonvolatile 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: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. For example, program modules 1424 may include the modules in apparatus 1300 described above.
Bus 1430 is used to enable connections between the different components of electronic device 1400 and may include a data bus, an address bus, and a control bus.
The electronic device 1400 may communicate with one or more external devices 1500 (e.g., keyboard, mouse, external controller, etc.) via an I/O interface 1440.
The electronic device 1400 may communicate with one or more networks through a network adapter 1450, e.g., the network adapter 1450 may provide mobile communication solutions such as 3G/4G/5G, or wireless communication solutions such as wireless local area networks, bluetooth, near field communications, and the like. The network adapter 1450 may communicate with other modules of the electronic device 1400 through the bus 1430.
Although not shown in fig. 14, other hardware and/or software modules may also be provided in the electronic device 1400, including, but not limited to: displays, microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit in accordance with exemplary embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
Those skilled in the art will appreciate that the various aspects of the present disclosure may be implemented as a system, method, or program product. Accordingly, various aspects of the disclosure may be embodied in the following forms, namely: an entirely hardware embodiment, an entirely software embodiment (including firmware, micro-code, etc.) or an embodiment combining hardware and software aspects may be referred to herein as a "circuit," module "or" system. Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any adaptations, uses, or adaptations of the disclosure following the general principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims (10)
1. A virtual flame generation method, comprising:
in response to an emission instruction for a flame injector in a game, acquiring positions of a plurality of collidable virtual fire groups according to the positions and the injection directions of the flame injector;
inserting one or more collision-free virtual fire groups between the collidable virtual fire groups, forming a virtual flame based on the collidable virtual fire groups and the collision-free virtual fire groups;
and under the condition that the collidable virtual fire group contacts an assault object in the game, determining the injury effect of the virtual flame on the assault object.
2. The method according to claim 1, wherein the method further comprises:
updating the location of the collision free virtual fire mass based on the location of the collidable virtual fire mass.
3. The method of claim 2, wherein the updating the location of the collision free virtual fire mass based on the location of the collidable virtual fire mass comprises:
Updating the flight position of the collision-free virtual fire group according to the flight position of the collision-free virtual fire group under the condition that the emission direction of the collision-free virtual fire group is the same as the emission direction of the collision-free virtual fire group followed by the collision-free virtual fire group;
and under the condition that the emission azimuth of the collision-free virtual fire group is different from the emission azimuth of the collision-free virtual fire group which the collision-free virtual fire group follows, updating the flight direction and the flight position of the collision-free virtual fire group according to the first emission azimuth of the collision-free virtual fire group and the second emission azimuth of the collision-free virtual fire group.
4. A method according to claim 3, wherein the first emission location comprises a first emission direction and a first emission position, the second emission location comprises a second emission direction and a second emission position, and updating the flight direction and flight position of the collision free virtual fire mass based on the first emission location of the collision free virtual fire mass and the second emission location of the collision free virtual fire mass comprises:
determining a flight direction offset according to the first emission direction and the second emission direction, and determining a flight position offset according to the first emission position and the second emission position;
And determining the flight direction based on the second emission direction and the flight direction offset, and determining the flight position based on the second emission position and the flight position offset.
5. The method according to claim 1, wherein the method further comprises:
and in a preset fire group change period, adjusting the size of the collidable virtual fire group and the size of the non-collided virtual fire group to form a virtual flame with the size changing along with time.
6. The method of claim 5, wherein adjusting the size of the collidable virtual fire mass and the size of the collision free virtual fire mass over a preset fire mass change period comprises:
obtaining a fire bolus size minimum value and a fire bolus size maximum value, wherein the fire bolus size minimum value is selected from a preset fire bolus size minimum range, the fire bolus size maximum value is determined according to the sum of the fire bolus size minimum value and a fire bolus size increment, and the fire bolus size increment is selected from a preset fire bolus increment range;
and in the preset fire group change period, adjusting the size of the collidable virtual fire group and the size of the non-collided virtual fire group from the minimum fire group size to the maximum fire group size.
7. The method of claim 1, wherein the injury effect comprises a sum of injury values, and wherein the determining the injury effect of the virtual flame on the aggressor object comprises:
and determining an actual display injury value according to the quotient of the injury numerical value sum and a preset display frequency, and displaying the actual display injury value according to the preset display frequency to determine the injury effect.
8. A virtual flame generating apparatus, comprising:
a position determination module of the collidable virtual fire group, configured to respond to an emission instruction of a flame injector in a game, and acquire the positions of a plurality of collidable virtual fire groups according to the positions and the injection directions of the flame injector;
a collision-free virtual fire group insertion module configured to insert one or more collision-free virtual fire groups between the collidable virtual fire groups, forming a virtual flame based on the collidable virtual fire groups and the collision-free virtual fire groups;
and the injury effect determining module is configured to determine an injury effect of the virtual flame on an attackeable object in a game under the condition that the colliding virtual fire group contacts the attackeable object.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the method of any of claims 1 to 7.
10. An electronic device, comprising:
a processor;
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the method of any one of claims 1 to 7 via execution of the executable instructions.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311013750.8A CN116983646A (en) | 2023-08-11 | 2023-08-11 | Virtual flame generation method and device, storage medium and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311013750.8A CN116983646A (en) | 2023-08-11 | 2023-08-11 | Virtual flame generation method and device, storage medium and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116983646A true CN116983646A (en) | 2023-11-03 |
Family
ID=88526468
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311013750.8A Pending CN116983646A (en) | 2023-08-11 | 2023-08-11 | Virtual flame generation method and device, storage medium and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116983646A (en) |
-
2023
- 2023-08-11 CN CN202311013750.8A patent/CN116983646A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP7350088B2 (en) | Virtual object control method, apparatus, device and computer program | |
JP7476235B2 (en) | Method, apparatus, and computer program for controlling virtual objects | |
US11577171B2 (en) | Method and apparatus for prompting that virtual object is attacked, terminal, and storage medium | |
CN110478895B (en) | Virtual article control method, device, terminal and storage medium | |
CN111437601B (en) | Game playback control method and device, electronic equipment and storage medium | |
CN111084986A (en) | Display control method, display control device, storage medium, and electronic device | |
CN112619134B (en) | Method, device, equipment and storage medium for determining flight distance of transmission target | |
WO2022095672A1 (en) | Screen display method and apparatus, device and storage medium | |
WO2023142617A1 (en) | Virtual environment-based ray display method and apparatus, device, and storage medium | |
WO2022156491A1 (en) | Virtual object control method and apparatus, and device, storage medium and program product | |
CN112619135B (en) | Game resource object control method and device, electronic equipment and storage medium | |
CN112619163B (en) | Flight path control method and device, electronic equipment and storage medium | |
CN112274931B (en) | Shooting track processing method and device and electronic equipment | |
CN112619162A (en) | Resource object management method and device, electronic equipment and storage medium | |
CN116983646A (en) | Virtual flame generation method and device, storage medium and electronic equipment | |
CN113694515B (en) | Interface display method, device, terminal and storage medium | |
KR20230147158A (en) | Information determination methods, devices, devices and storage media | |
CN112121416B (en) | Control method, device, terminal and storage medium of virtual prop | |
CN112619164B (en) | Method, device, equipment and storage medium for determining flying height of transmission target | |
CN112642163A (en) | Motion trajectory prediction method and device, electronic equipment and storage medium | |
CN112057859A (en) | Virtual object control method, device, terminal and storage medium | |
CN113617030B (en) | Virtual object control method, device, terminal and storage medium | |
CN118022330A (en) | Virtual object interaction method, device, equipment, medium and program product | |
CN117298580A (en) | Virtual object interaction method, device, equipment, medium and program product | |
CN113181635A (en) | Virtual item assembling method, device, terminal and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |