CN113476840A - Special effect processing method, device, equipment and storage medium in game - Google Patents

Special effect processing method, device, equipment and storage medium in game Download PDF

Info

Publication number
CN113476840A
CN113476840A CN202110763902.0A CN202110763902A CN113476840A CN 113476840 A CN113476840 A CN 113476840A CN 202110763902 A CN202110763902 A CN 202110763902A CN 113476840 A CN113476840 A CN 113476840A
Authority
CN
China
Prior art keywords
distance
special effect
preset
following
virtual camera
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.)
Granted
Application number
CN202110763902.0A
Other languages
Chinese (zh)
Other versions
CN113476840B (en
Inventor
陈志远
贺一慧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202110763902.0A priority Critical patent/CN113476840B/en
Publication of CN113476840A publication Critical patent/CN113476840A/en
Application granted granted Critical
Publication of CN113476840B publication Critical patent/CN113476840B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • A63F13/525Changing parameters of virtual cameras

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The application provides a special effect processing method, a special effect processing device, special effect processing equipment and a storage medium in a game, and relates to the technical field of games. The method comprises the following steps: detecting a first distance between a virtual camera in a game scene and a special effect of a preset scene; if the first distance is larger than or equal to a preset distance threshold, determining a following moving distance of a preset scene special effect according to the first distance; and controlling the preset scene special effect to move towards the virtual camera according to the following moving distance and preset speed change time. The method and the device can achieve visual experience of a scene special effect in a large range through better simulation of the scene special effect in a small range, reduce performance pressure caused by the scene special effect in the large range, and ensure smooth operation of the game on low-end equipment with lower performance.

Description

Special effect processing method, device, equipment and storage medium in game
Technical Field
The invention relates to the technical field of games, in particular to a special effect processing method, device, equipment and storage medium in a game.
Background
In order to improve the interest of the game, various special effects are usually added in the game scene, such as a scene special effect, a prop special effect, and the like.
The scene special effects usually have a certain coverage range, and when the game scene is in a non-player view angle, namely a virtual camera view angle, the scene special effects can be realized in a large range.
However, the special effect of a large-scale scene has high requirements on the performance of running equipment, and undoubtedly brings great performance pressure, so that smooth running on equipment with low performance is difficult to realize.
Disclosure of Invention
The present invention aims to provide a method, an apparatus, a device and a storage medium for processing special effects in a game, so as to solve the problem that smooth operation is difficult to achieve on a device with low performance due to high operation performance of special effects in a large-scale scene.
In order to achieve the above purpose, the embodiment of the present invention adopts the following technical solutions:
in a first aspect, an embodiment of the present invention provides a special effect processing method in a game, including:
detecting a first distance between a virtual camera in a game scene and a special effect of a preset scene;
if the first distance is larger than or equal to a preset distance threshold, determining a following moving distance of the preset scene special effect according to the first distance;
and controlling the preset scene special effect to move towards the virtual camera according to the following moving distance and preset speed change time.
Optionally, the controlling the preset scene special effect to move towards the virtual camera according to the following movement distance and a preset speed change time includes:
determining the speed change rate in the following process according to the following moving distance and the speed change time;
and controlling the preset scene special effect to move towards the virtual camera by the following movement distance according to the speed change rate.
Optionally, the determining, according to the first distance, a following moving distance of the preset scene special effect includes:
if the first distance does not exceed a preset maximum following distance, determining the first distance as the following moving distance;
and if the first distance exceeds a preset maximum following distance, determining the maximum following distance as the following moving distance.
Optionally, before controlling the preset scene special effect to move towards the virtual camera according to the following movement distance and the preset speed change time, the method further includes:
and controlling the part of the preset scene special effect transient shift exceeding the maximum following distance, so that the distance between the position of the preset scene special effect after transient shift and the virtual camera is equal to the maximum following distance.
Optionally, the preset speed change time includes: acceleration time and deceleration time, the rate of change of speed comprising: a first acceleration during an acceleration phase, and a second acceleration during a deceleration phase;
determining the speed change rate in the following process according to the following moving distance and the speed change time, wherein the determining comprises the following steps:
determining an acceleration distance and a deceleration distance in the following movement distance according to the following movement distance and a preset acceleration distance ratio;
determining the first acceleration according to the acceleration distance, the acceleration time and a preset initial speed;
determining the second acceleration according to the deceleration distance, the acceleration time, the deceleration time and the initial speed;
the controlling the preset scene special effect to move towards the virtual camera by the following movement distance according to the speed change rate comprises the following steps:
controlling the preset scene special effect to move towards the virtual camera in an accelerating manner by the accelerating distance according to the first acceleration;
and controlling the preset scene special effect to move towards the virtual camera in a decelerating manner by the decelerating distance according to the second acceleration.
Optionally, the method further includes:
detecting a second distance between the moved preset scene special effect and the virtual camera;
and if the second distance is greater than or equal to a preset detection distance, adjusting the position of the preset scene special effect according to a preset offset.
Optionally, the detecting a first distance between a virtual camera in a game scene and a special effect of a preset scene includes:
and detecting the first distance between the virtual camera and the special effect of the preset scene according to a preset detection period.
Optionally, the detecting a first distance between a virtual camera in a game scene and a special effect of a preset scene includes:
and responding to the adjustment operation of the visual angle of the virtual camera, and detecting the first distance between the virtual camera and the special effect of the preset scene.
Optionally, the preset scene special effect is a wind and snow special effect, a rain special effect, or a smoke special effect
In a second aspect, an embodiment of the present application further provides an effect processing apparatus in a game, including:
the detection module is used for detecting a first distance between a virtual camera and a special effect of a preset scene in a game scene;
the determining module is used for determining the following movement distance of the preset scene special effect according to the first distance if the first distance is greater than or equal to a preset distance threshold;
and the control module is used for controlling the preset scene special effect to move towards the virtual camera according to the following movement distance and preset speed change time.
In a third aspect, an embodiment of the present application further provides an electronic device, including: a memory and a processor, wherein the memory stores a computer program executable by the processor, and the processor implements the special effect processing method in any game provided by the first aspect when executing the computer program.
In a fourth aspect, an embodiment of the present application further provides a storage medium, where a computer program is stored on the storage medium, and when the computer program is read and executed, the method for processing special effects in any game provided by the first aspect is implemented.
The beneficial effect of this application is:
in the method, the device, the equipment and the storage medium for processing the special effects in the game, which are provided by the application, the first distance between the virtual camera in the game scene and the special effect in the preset scene can be detected, when the first distance is larger than or equal to a preset distance threshold, determining the following moving distance of the special effect of the preset scene according to the first distance, and according to the following moving distance, and the preset speed change time, the preset scene special effect is controlled to move towards the virtual camera, the scene special effect is naturally followed along with the virtual camera in the following movement distance, the visual experience of the scene special effect in a large range is simulated well by the scene special effect in a small range, the designed and operated scene special effects do not need to cover the whole game scene, so that the performance pressure caused by the large-range scene special effects is greatly reduced, and the smooth operation of the game application on low-end equipment with lower performance is ensured.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
FIG. 1 is a schematic flow chart illustrating a method for processing special effects in a game according to an embodiment of the present disclosure;
FIG. 2 is a flowchart of a method for follow-up control in an effect handler in a game according to an embodiment of the present application;
FIG. 3 is a flowchart of a method for determining a following movement distance in an effect processing party in a game according to an embodiment of the present disclosure;
FIG. 4 is a flowchart of another method of follow-up control in an effect processing method in a game according to an embodiment of the present disclosure;
FIG. 5 is a flowchart illustrating a method for correcting a position of a scene special effect in a method for processing a special effect in a game according to an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of an effect processing apparatus in a game according to an embodiment of the present disclosure;
fig. 7 is a schematic view of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention.
It should be noted that the terms "comprises" and "comprising," and any variations thereof, in various portions of this application and in the drawings, are intended to cover non-exclusive inclusions, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The method flow diagrams referred to in the following embodiments of the present application are exemplary only, and do not necessarily include all of the contents and steps, nor do they necessarily have to be performed in the order described. For example, some steps may be broken down, and the steps may be combined or partially combined, so that the order of actual execution may be changed according to actual situations.
In order to reduce the performance pressure of the operation scene special effect, some scene special effect following methods appear in the existing scheme, and the scene special effect can be followed by configuring the position of the scene special effect as the position of the controlled virtual character based on the position of the controlled virtual character in the game scene under the condition that the position of the controlled virtual character is changed. However, the above-mentioned scene-effect following scheme is only applicable to games with a small range of viewing angles, such as a first person viewing angle or a third person viewing angle.
However, for the game with the virtual camera view angle, because the range of the virtual camera view angle is usually far larger than the small view angle range such as the first person view angle or the third person view angle, if the scene special effect is directly followed based on the position of the virtual camera, which is simple and rough, the effect of following the special effect is poor, and it is easy for the player to obviously feel that the scene special effect actually does not cover the whole game scene.
Therefore, for a virtual camera view angle with a large view angle range, the embodiment of the application provides a special effect processing method in various games, which can realize natural following of a scene special effect along with a virtual camera based on a distance between the virtual camera and a preset scene special effect in a game scene and a preset following parameter, so that a user is difficult to perceive the following of the scene special effect, the visual experience of simulating a large-range scene special effect with a small-range scene special effect is realized, the performance pressure brought by the large-range scene special effect is greatly reduced, and the smooth operation of game application on low-end equipment with low performance is ensured.
It should be noted that the virtual camera view angle may also be expressed as "a god view angle" or other descriptions such as a virtual lens view angle, and in general, the virtual camera view angle is an oblique view angle of the overlooking game scene.
The following describes an example of a method for processing special effects in a game provided by the present application by way of examples.
Fig. 1 is a schematic flow chart of a special effect processing method in a game according to an embodiment of the present application, where the special effect processing method in the game is implemented by executing a corresponding software code by a processor in an electronic device equipped with a game application client, or by executing a corresponding software code by the processor of the electronic device, and is implemented by combining with other hardware entities. The electronic device may be any one of devices such as a desktop computer, a notebook, a personal digital assistant, a smart phone, a tablet computer, and a game machine, and may be a non-touch device or a touch device such as a mobile touch device. Specifically, a processor of the electronic device may run a game application and render a Graphical User Interface (GUI), also referred to as a Graphical User Interface or a Graphical User Interface, on a display device of the electronic device, and may render a game scene and a corresponding control on the Graphical User Interface in a process of generating the Graphical User Interface. The graphical interactive interface is generated by rendering when the game application runs on the electronic device, for example, and a user can perform operations such as view angle switching on a game scene by operating on the graphical interactive interface of the display device of the electronic device, so as to play a game.
The special effect processing method in the game can be applied to electronic equipment capable of presenting a graphical user interface, and at least a game scene is displayed in the graphical user interface of the game. The game application for which the embodiments of the present application are directed may be, for example, a game with a virtual camera view.
As shown in fig. 1, the method may include:
s101, detecting a first distance between a virtual camera in a game scene and a special effect of a preset scene.
For a game scene at a virtual camera view angle, the position of the virtual camera in the game scene and the position of the preset scene special effect in the game scene can be acquired, and then the first distance is calculated according to the positions of the virtual camera and the preset scene special effect in the game scene. The position of the virtual camera in the game scene or the position of the preset scene special effect in the game scene is the coordinate position in the three-dimensional coordinate system of the game scene.
The preset scene special effect may be a scene special effect formed by a particle special effect, in one implementation, the preset scene special effect may be a scene special effect having an entity special effect, such as a wind and snow special effect or a smoke special effect, and in another implementation, the preset scene special effect may also be a scene special effect having no entity special effect or a transparent special effect, such as a rain special effect.
The position of the preset scene special effect in the game scene may be a position of a preset position of the preset scene special effect in the game scene, for example, a position of a center position of the preset scene special effect in the game scene. The central position of the preset scene special effect refers to a launching point of the preset scene special effect, and the central position is not limited to the central position of the overall dimension of the preset scene special effect, and can be other positions, and the specific position of the central position can be adjusted by an art engineer.
In a possible implementation manner, the first distance between the virtual camera and the preset scene special effect may be detected according to a preset detection period.
The preset detection period may be, for example, a detection period of the virtual camera. If the preset detection period is less than or equal to the preset time threshold, that is, the detection period is short, for example, 0.1 second, the first distance is detected based on the preset detection period, which may also be considered as detecting the first distance in real time.
The first distance is detected based on the preset detection period, and then the special effect processing method is triggered to be executed, so that the preset scene special effect can better follow the movement of the virtual camera, the following deviation between the movement of the virtual camera and the scene special effect is avoided, and the following effect of the scene special effect is improved.
In another possible implementation manner, the first distance between the virtual camera and the preset scene special effect may be detected in response to an adjustment operation of a viewing angle of the virtual camera.
The virtual camera angle adjustment operation may be an angle adjustment operation for the virtual camera angle input by a user, an angle adjustment operation triggered by a pre-configured automatic change parameter of the virtual camera angle, or an angle adjustment operation triggered by a game state in a game scene or the like. The visual angle adjustment operation input by the user may be, for example, a visual angle adjustment operation input by the user through a visual angle adjustment control on the interface, a visual angle adjustment operation input by the user through a drag operation acting on a game scene, or a visual angle adjustment operation input by the user through an external control device, such as a voice control device or a game control handle.
The first detection is detected in response to the adjustment operation of the virtual camera view angle, and then the special effect processing method is triggered to be executed, so that the power consumption of special effect processing can be reduced, and the performance pressure is reduced.
And S102, if the first distance is larger than or equal to a preset distance threshold, determining the following moving distance of the preset scene special effect according to the first distance.
When the first distance is detected, whether the first distance is greater than or equal to the preset distance threshold value or not can be judged, if yes, the distance between the first distance can be determined to be large, namely, the movement of the virtual camera is determined, so that the virtual camera and the preset scene special effect deviate, and the following movement distance for carrying out special effect following control on the preset scene special effect within the first distance can be determined according to the first distance.
It should be noted that the first distance may be greater than or equal to the following movement distance, that is, part or all of the first distance may be used for the effect following control.
Otherwise, if the first distance is smaller than the preset distance threshold, the preset scene special effect can be directly controlled to instantaneously move to the position of the virtual camera. In specific implementation, the position of the preset scene special effect can be configured to be the position of the virtual camera, so that transient movement control from the preset scene special effect to the position of the virtual camera is realized, and scene special effect following is realized.
S103, controlling the special effect of the preset scene to move towards the virtual camera according to the following moving distance and the preset speed change time.
Before executing the method provided by the embodiment, a plurality of camera following parameters may be configured in advance, and the plurality of camera following parameters may include: and pre-configuring a camera following parameter, wherein the pre-configured camera following parameter is a pre-configured fixed parameter.
In this embodiment, the preset speed change time is one of the preconfigured camera following parameters. The speed change time is actually the following movement duration, so that in possible implementation, in the process of controlling the preset scene special effect to move towards the virtual camera according to the following movement distance and the preset speed change time, the movement speed of the preset scene special effect in the speed change time is controlled to change, the movement time of the preset scene special effect in the following movement distance is the speed change time, and accordingly smooth natural movement in the following movement distance is achieved.
The method for processing the special effect in the game provided by the embodiment of the application can detect the first distance between the virtual camera in the game scene and the special effect in the preset scene, when the first distance is larger than or equal to a preset distance threshold, determining the following moving distance of the special effect of the preset scene according to the first distance, and according to the following moving distance, and the preset speed change time, the preset scene special effect is controlled to move towards the virtual camera, the scene special effect is naturally followed along with the virtual camera in the following movement distance, the visual experience of the scene special effect in a large range is simulated well by the scene special effect in a small range, the designed and operated scene special effects do not need to cover the whole game scene, so that the performance pressure caused by the large-range scene special effects is greatly reduced, and the smooth operation of the game application on low-end equipment with lower performance is ensured.
According to the special effect processing method in the game provided by the embodiment, the following stage in the scene special effect process can be self-customized by customizing the preset camera following parameter, such as the preset speed change time, the size range of the scene special effect is limited and the operation performance consumption of the scene special effect is controlled within an acceptable range.
On the basis of the special effect processing method in the game shown in fig. 1, the embodiment of the present application may also provide a possible implementation example of the follow-up control in the special effect processing method in the game. Fig. 2 is a flowchart of a method for following control in an effect processing party in a game according to an embodiment of the present application. As shown in fig. 2, the controlling the preset scene special effect to move towards the virtual camera according to the following moving distance and the preset speed change time in S103 may include:
s201, determining the speed change rate in the following process according to the following moving distance and the speed change time.
Among the various camera following parameters mentioned above, in addition to the preconfigured camera following parameters, may include: the camera following parameters are varied. The varying camera following parameter may be calculated based on the following movement distance and the preconfigured camera following parameter using a preset formula.
The rate of change of speed involved in this embodiment is one of the changing camera following parameters. In the method provided by this embodiment, the speed change rate may be calculated in real time according to the first distance, instead of a pre-configured fixed parameter, and a dynamic change in a following scene special effect following process is effectively ensured, thereby ensuring a following effect of the scene special effect.
S202, controlling the preset scene special effect to move towards the virtual camera by the following movement distance according to the speed change rate.
In a possible implementation, the preset scene special effect may be controlled to start at a preset initial speed according to the speed change rate, and move the following movement distance toward the position where the virtual camera is located, that is, within the following movement distance, the preset scene special effect is controlled to follow the special effect according to the speed change rate.
In the method provided by this embodiment, the speed change rate in the following process may be determined according to the following movement distance and the speed change time, and then the preset scene special effect is controlled to move towards the virtual camera by the following movement distance according to the speed change rate, so that the smooth natural movement of the preset scene special effect in the following movement process can be ensured, and the following effect of the preset scene special effect is ensured.
On the basis of the special effect processing method in the game shown in fig. 1, the embodiment of the present application may further provide a possible implementation example of determining the following movement distance in the special effect processing method in the game. Fig. 3 is a flowchart of a method for determining a following movement distance in an effect processing party in a game according to an embodiment of the present application. As shown in fig. 3, the determining, according to the first distance in S102, a following moving distance of the preset scene special effect may include:
s301, judging whether the first distance exceeds a preset maximum following distance.
The preset maximum following distance MaxSize, i.e. the maximum distance for the special effect to move, is another preconfigured camera following parameter, which may also be referred to as a special effect following range.
S302, if the first distance does not exceed a preset maximum following distance, determining that the first distance is the following moving distance.
If the first distance does not exceed the preset maximum following distance, namely the first distance is smaller than or equal to the maximum following distance, the first distance can be directly determined as the following moving distance.
S303, if the first distance exceeds the maximum following distance, determining the maximum following distance as the following moving distance.
As an example, the preset maximum following distance may have a parameter value of 40. If the parameter value of the first distance is 180, it exceeds the maximum following distance 40, and thus, the endmost of the first distances, i.e., the maximum following distance close to the virtual camera, can be determined as the following movement distance.
In the method provided by this embodiment, the following movement distance can be determined according to different distance comparison results by comparing the first distance with the maximum following distance, and the following of the scene special effect can be limited within the maximum following distance, so that the phenomenon of group crossing caused by the fact that the scene special effect cannot follow up in a short time after the player suddenly triggers the virtual camera to move in a large range can be effectively avoided.
Optionally, with continuing reference to fig. 3, before the step S103 controls the preset scene special effect to move towards the virtual camera according to the following movement distance and the preset speed change time in the above method, the method may further include:
s304, controlling the part of the preset scene special effect which exceeds the maximum following distance in an instant shift mode, so that the distance between the position of the preset scene special effect after the instant shift and the virtual camera is equal to the maximum following distance.
If the first distance exceeds the maximum following distance, a transient movement target position of the preset scene special effect can be calculated according to the position of the preset scene special effect and a part exceeding the maximum following distance, the distance between the transient movement target position and the position of the virtual camera is the maximum following distance, the preset scene special effect is controlled to instantaneously move to the transient movement target position, and if the position of the preset scene special effect is configured to be the transient movement target position, transient movement control of the preset scene special effect on the part exceeding the maximum following distance is achieved.
The transient shift control of the preset scene special effect is performed S304 for the portion exceeding the maximum following distance, the preset scene special effect is transiently shifted to the transient shift target position, and then the preset scene special effect is controlled to move toward the virtual camera according to the calculated change camera following parameter, such as the above-mentioned velocity change rate.
Continuing with the above example, if the parameter value of the first distance is 180, the maximum following distance is 40, and the portion exceeding the maximum following distance is 140, the moving direction dir1 of the preset scene may be determined according to the position where the special effect of the preset scene is located and the position where the virtual camera is located, and the position where the distance from the position where the special effect of the preset scene is located in the moving direction is equal to the portion exceeding the maximum following distance is determined as the transient target position, that is, the position where the distance from the position where the special effect of the preset scene is located in the moving direction is equal to 140 is determined as the transient target position.
In the method provided by this embodiment, for the part exceeding the maximum following distance, the following of the preset scene special effect is controlled in a special effect transient movement manner, and after transient movement control, for the part after the maximum following distance, the natural following movement of the preset scene special effect can be controlled according to the calculated change camera following parameters including the change rate, so that the natural translation of the preset scene special effect is realized, and a group-crossing phenomenon that the special effect cannot follow up in a short time after a player suddenly triggers a large-range lens movement can be avoided, so that the following of the preset scene special effect is more natural.
On the basis of any one of the above-described special effect processing methods in a game, the embodiment of the present application may also provide another specific implementation example of follow-up control in a special effect processing party in a game. Fig. 4 is a flowchart of another method of following control in an effect processing method in a game according to an embodiment of the present application. In the special effect processing method in the game as described above, for the following control within the following movement distance, the following control may include: acceleration following stage and deceleration following stage, corresponding, preset speed change time includes: acceleration time (AddSpeedTime) and deceleration time (SubSpeedTime). Accordingly, the rate of change of speed includes: a first acceleration a1 during the acceleration phase, and a second acceleration a2 during the deceleration phase.
As shown in fig. 4, determining the speed change rate during the following process according to the following moving distance and the preset speed change time in S201 as shown above may include:
s401, according to the following moving distance and a preset accelerating distance ratio, determining an accelerating distance and a decelerating distance in the following moving distance.
The acceleration distance ratio is used as another following parameter in the following parameters of the pre-configured camera, and means the ratio of the acceleration stage in the following moving distance, and the distance between the acceleration stage and the deceleration stage in the following moving distance can be indirectly changed by adjusting the acceleration distance ratio.
The acceleration time and the deceleration time are combined together, namely the total following time, and the following effect of the acceleration stage in the following movement distance is controlled by the configuration of the ratio of the acceleration time to the acceleration distance, namely, the following effect of the acceleration stage in the following movement distance is changed by changing the acceleration time and/or the ratio of the acceleration distance, so that a player can hardly feel the following action of the scene special effect. For example, the acceleration time may be configured to be 0.03 seconds, and the deceleration time may be configured to be 0.27 seconds, for example.
In response, the control of the following effect of the deceleration stage in the following movement distance can be realized by adjusting the deceleration time and the acceleration distance ratio, that is, the following effect of the deceleration stage in the following movement distance can be changed by changing the deceleration time and/or the acceleration distance ratio, so that the player can stop changing the visual angle of the virtual camera, that is, the player can hardly observe the following of the scene effect even after the virtual camera stops moving.
The acceleration distance ratio can be smaller than or equal to a preset ratio parameter which is smaller than 0.5, the initial speed of the acceleration stage is also smaller than or equal to the preset speed parameter, the special effect of the scene passing through can be seen by the player, in the deceleration process, the player does not feel that the special effect moves along with the player because the player also moves and the following speed of the special effect is lower and lower, after the player stops moving, the following speed of the special effect is very low, the player hardly feels that the special effect follows, and more time, the special effect naturally moves (for example, snowflakes fall in the moving direction).
In a possible implementation, the acceleration distance may be determined according to a product of the following movement distance and the ratio of the acceleration distance, and a remaining distance in the following movement distance is the deceleration distance.
For example, the acceleration distance ratio is AddRate, the following movement distance is dis, and the acceleration distance is dis1, which can be calculated by the following formula (1).
dis1 ═ AddRate ═ dis … … equation (1)
Accordingly, the deceleration distance can be calculated by the following equation (2).
dis2 ═ (1-AddRate) × dis … … equation (2)
Continuing with the above example, if the parameter value of the first distance is 180 and the maximum following distance is 40, the following moving distance dis is 40 and the AddRate is 0.1, and the acceleration distance is 4 calculated by using the above formula (1).
If the acceleration distance occupying ratio AddRate is set to 0.1, 10% of the following movement distance can be realized as the following distance of the acceleration stage, and 90% of the following movement distance can be realized as the following distance of the deceleration stage.
S402, determining the first acceleration according to the acceleration distance, the acceleration time and a preset initial speed.
If the acceleration distance is dis1, the acceleration time is t1, the preset initial velocity is v0, and the first acceleration is a1, the first acceleration can be calculated by using the following formula (3).
a1 ═ 2 (dis 1-v0 ^ t1)/t1^2 … … formula (3)
S403, determining the second acceleration according to the deceleration distance, the acceleration time, the deceleration time and the initial speed.
If the deceleration distance is dis2, the acceleration time is t1, the deceleration time is t2, the initial speed v0, and the first acceleration in the acceleration phase is a1, the second acceleration can be calculated by using the following formula (4).
a2 ═ dis2- (v0+ a 1^ t1) × t2) × 2/t2^2 … … formula (4)
Accordingly, as in the method described above, the controlling the preset scene special effect to move the following moving distance towards the virtual camera according to the speed change rate in S202 may include:
s404, controlling the preset scene special effect to move towards the virtual camera in an accelerating mode by the accelerating distance according to the first acceleration.
S405, controlling the preset scene special effect to move towards the virtual camera in a decelerating way by the decelerating distance according to the second acceleration.
The special effect processing method in the game provided in this embodiment may divide the following movement distance into an acceleration stage and a deceleration stage, and calculate corresponding accelerations for the acceleration stage and the deceleration stage, then, within the following movement distance, control the preset scene special effect to move toward the virtual camera in an acceleration manner based on a first acceleration in the acceleration stage, and then control the preset scene special effect to move toward the virtual camera in a deceleration manner according to a second acceleration in the deceleration stage.
On the basis of the special effect processing method in the game provided by any of the above embodiments, the embodiments of the present application may also provide an example of a method following control in the special effect processing method in the game. Fig. 5 is a flowchart of a method for correcting a position of a scene special effect in a special effect processing method in a game according to an embodiment of the present application. As shown in fig. 5, after the method in S103 controls the preset scene special effect to move towards the virtual camera according to the following movement distance and the preset speed change time, the method may further include:
s501, detecting a second distance between the preset scene special effect and the virtual camera after movement.
And S502, if the second distance is greater than or equal to a preset detection distance, adjusting the position of the preset scene special effect according to a preset offset.
The preset offset may be a preset offset between the scene special effect and the virtual camera, which may be data Position, and the preset offset is also the above-mentioned one preconfigured camera following parameter, which is a coordinate offset in the three-dimensional coordinate system in the game scene.
Because the preset scene special effect usually has a certain coverage range, after the following control is executed, the coverage range of the preset scene special effect may exceed some of the visual angle of the virtual camera, so that the position of the preset scene special effect can be adjusted according to the preset offset under the condition that the second distance is detected to be greater than or equal to the preset detection distance, the adjusted preset scene special effect is enabled to be more matched with the visual range of the visual angle of the virtual camera, the display control after the scene special effect is naturally followed is ensured, and the visual angle effect of the scene special effect is enabled to be better.
The following describes a device, an apparatus, a storage medium, and the like for executing the special effect processing method in the game provided by the present application, and specific implementation procedures and technical effects thereof are referred to above, and will not be described again below.
Fig. 6 is a schematic diagram of an effect processing apparatus in a game according to an embodiment of the present application, and as shown in fig. 6, the effect processing apparatus 600 in a game may include:
the detecting module 601 is configured to detect a first distance between a virtual camera in a game scene and a special effect of a preset scene.
The determining module 602 is configured to determine a following moving distance of a preset scene special effect according to the first distance if the first distance is greater than or equal to a preset distance threshold.
The control module 603 is configured to control the preset scene special effect to move towards the virtual camera according to the following movement distance and a preset speed change time.
Optionally, the control module 603 is specifically configured to determine a speed change rate in the following process according to the following movement distance and the speed change time; and controlling the preset scene special effect to move towards the virtual camera by the following movement distance according to the speed change rate.
Optionally, the determining module 602 is specifically configured to determine that the first distance is the following movement distance if the first distance does not exceed a preset maximum following distance; and if the first distance exceeds a preset maximum following distance, determining the maximum following distance as the following moving distance.
Optionally, the control module 603 is further configured to control a portion of the preset scene special effect that instantaneously moves beyond the maximum following distance before controlling the preset scene special effect to move towards the virtual camera according to the following moving distance and a preset speed change time, so that a distance between a position of the preset scene special effect after the instantaneous movement and the virtual camera is equal to the maximum following distance.
Optionally, the preset speed change time includes: acceleration time and deceleration time, the rate of change of speed comprising: a first acceleration during an acceleration phase, and a second acceleration during a deceleration phase.
The control module 603 is specifically configured to determine an acceleration distance and a deceleration distance in the following movement distance according to the following movement distance and a preset acceleration distance ratio; determining the first acceleration according to the acceleration distance, the acceleration time and a preset initial speed; determining the second acceleration according to the deceleration distance, the acceleration time, the deceleration time and the initial speed; controlling the preset scene special effect to move towards the virtual camera in an accelerating way by the accelerating distance; and controlling the preset scene special effect to move towards the virtual camera in a decelerating way by the decelerating distance according to the second acceleration.
Optionally, the detecting module 601 is further configured to detect a second distance between the preset scene special effect and the virtual camera after the movement; and if the second distance is greater than or equal to the preset detection distance, adjusting the position of the preset scene special effect according to the preset offset.
Optionally, the detecting module 601 is specifically configured to detect the first distance between the virtual camera and the preset scene special effect according to a preset detection period.
Optionally, the detecting module 601 is specifically configured to detect the first distance between the virtual camera and the special effect of the preset scene in response to an operation of adjusting the viewing angle of the virtual camera.
Optionally, the preset scene special effect is a wind and snow special effect, a rain special effect, or a smoke special effect.
The above-mentioned apparatus is used for executing the method provided by the foregoing embodiment, and the implementation principle and technical effect are similar, which are not described herein again.
These above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), among others. For another example, when one of the above modules is implemented in the form of a Processing element scheduler code, the Processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
Fig. 7 is a schematic diagram of an electronic device provided in an embodiment of the present application, where the electronic device may be integrated in a device or a chip of the device.
The electronic device 700 includes: memory 701, processor 702. The memory 701 and the processor 702 are connected by a bus.
The memory 701 is used for storing programs, and the processor 702 calls the programs stored in the memory 701 to execute the above method embodiments. The specific implementation and technical effects are similar, and are not described herein again.
Optionally, the invention also provides a program product, for example a computer-readable storage medium, comprising a program which, when being executed by a processor, is adapted to carry out the above-mentioned method embodiments.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (12)

1. An effect processing method in a game, the method comprising:
detecting a first distance between a virtual camera in a game scene and a special effect of a preset scene;
if the first distance is larger than or equal to a preset distance threshold, determining a following moving distance of the preset scene special effect according to the first distance;
and controlling the preset scene special effect to move towards the virtual camera according to the following moving distance and preset speed change time.
2. The method according to claim 1, wherein the controlling the preset scene special effect to move towards the virtual camera according to the following movement distance and a preset speed change time comprises:
determining the speed change rate in the following process according to the following moving distance and the speed change time;
and controlling the preset scene special effect to move towards the virtual camera by the following movement distance according to the speed change rate.
3. The method according to claim 1, wherein the determining a following movement distance of the preset scene special effect according to the first distance comprises:
if the first distance does not exceed a preset maximum following distance, determining the first distance as the following moving distance;
and if the first distance exceeds a preset maximum following distance, determining the maximum following distance as the following moving distance.
4. The method according to claim 3, wherein before controlling the preset scene special effect to move towards the virtual camera according to the following movement distance and a preset speed change time, the method further comprises:
and controlling the part of the preset scene special effect transient shift exceeding the maximum following distance, so that the distance between the position of the preset scene special effect after transient shift and the virtual camera is equal to the maximum following distance.
5. The method of claim 2, wherein the preset speed change time comprises: acceleration time and deceleration time, the rate of change of speed comprising: a first acceleration during an acceleration phase, and a second acceleration during a deceleration phase;
determining the speed change rate in the following process according to the following moving distance and the speed change time, wherein the determining comprises the following steps:
determining an acceleration distance and a deceleration distance in the following movement distance according to the following movement distance and a preset acceleration distance ratio;
determining the first acceleration according to the acceleration distance, the acceleration time and a preset initial speed;
determining the second acceleration according to the deceleration distance, the acceleration time, the deceleration time and the initial speed;
the controlling the preset scene special effect to move towards the virtual camera by the following movement distance according to the speed change rate comprises the following steps:
controlling the preset scene special effect to move towards the virtual camera in an accelerating manner by the accelerating distance according to the first acceleration;
and controlling the preset scene special effect to move towards the virtual camera in a decelerating manner by the decelerating distance according to the second acceleration.
6. The method of claim 1, further comprising:
detecting a second distance between the moved preset scene special effect and the virtual camera;
and if the second distance is greater than or equal to a preset detection distance, adjusting the position of the preset scene special effect according to a preset offset.
7. The method of any one of claims 1-6, wherein detecting a first distance between a virtual camera in the game scene and a preset scene special effect comprises:
and detecting the first distance between the virtual camera and the special effect of the preset scene according to a preset detection period.
8. The method of any one of claims 1-6, wherein detecting a first distance between a virtual camera in the game scene and a preset scene special effect comprises:
and responding to the adjustment operation of the visual angle of the virtual camera, and detecting the first distance between the virtual camera and the special effect of the preset scene.
9. The method according to any one of claims 1 to 6, wherein the preset scene effect is a wind and snow effect, a rain effect, or a smoke effect.
10. An in-game special effect processing apparatus, comprising:
the detection module is used for detecting a first distance between a virtual camera and a special effect of a preset scene in a game scene;
the determining module is used for determining the following movement distance of the preset scene special effect according to the first distance if the first distance is greater than or equal to a preset distance threshold;
and the control module is used for controlling the preset scene special effect to move towards the virtual camera according to the following movement distance and preset speed change time.
11. An electronic device, comprising: a memory storing a computer program executable by the processor, and a processor implementing the in-game special effects processing method according to any one of claims 1 to 9 when the processor executes the computer program.
12. A storage medium having stored thereon a computer program which, when read and executed, implements an in-game special effects processing method according to any one of claims 1 to 9.
CN202110763902.0A 2021-07-06 2021-07-06 Special effect processing method, device and equipment in game and storage medium Active CN113476840B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110763902.0A CN113476840B (en) 2021-07-06 2021-07-06 Special effect processing method, device and equipment in game and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110763902.0A CN113476840B (en) 2021-07-06 2021-07-06 Special effect processing method, device and equipment in game and storage medium

Publications (2)

Publication Number Publication Date
CN113476840A true CN113476840A (en) 2021-10-08
CN113476840B CN113476840B (en) 2024-06-04

Family

ID=77941338

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110763902.0A Active CN113476840B (en) 2021-07-06 2021-07-06 Special effect processing method, device and equipment in game and storage medium

Country Status (1)

Country Link
CN (1) CN113476840B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002140724A (en) * 2000-11-01 2002-05-17 Konami Co Ltd Computer readable recording medium recorded with display control program, display controller and display control method
JP2011096018A (en) * 2009-10-29 2011-05-12 Namco Bandai Games Inc Program, information storage medium, terminal, and network system
CN108619720A (en) * 2018-04-11 2018-10-09 腾讯科技(深圳)有限公司 Playing method and device, storage medium, the electronic device of animation
US20190083887A1 (en) * 2017-09-15 2019-03-21 Netease (Hangzhou) Network Co.,Ltd. Information processing method, apparatus and non-transitory storage medium
CN110548280A (en) * 2019-09-11 2019-12-10 珠海金山网络游戏科技有限公司 Control method and device of virtual camera
CN111298435A (en) * 2020-02-12 2020-06-19 网易(杭州)网络有限公司 Visual field control method for VR game, VR display terminal, equipment and medium
CN111905370A (en) * 2020-08-14 2020-11-10 网易(杭州)网络有限公司 Method and device for controlling virtual character in game, electronic equipment and storage medium
CN112156467A (en) * 2020-10-15 2021-01-01 网易(杭州)网络有限公司 Control method and system of virtual camera, storage medium and terminal equipment
CN112190939A (en) * 2020-10-15 2021-01-08 上海米哈游天命科技有限公司 Method, device, equipment and medium for controlling component display in game scene
CN112604279A (en) * 2020-12-29 2021-04-06 珠海金山网络游戏科技有限公司 Special effect display method and device
CN112669372A (en) * 2020-12-21 2021-04-16 北京像素软件科技股份有限公司 Method, device and computer-readable storage medium for rendering

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002140724A (en) * 2000-11-01 2002-05-17 Konami Co Ltd Computer readable recording medium recorded with display control program, display controller and display control method
JP2011096018A (en) * 2009-10-29 2011-05-12 Namco Bandai Games Inc Program, information storage medium, terminal, and network system
US20190083887A1 (en) * 2017-09-15 2019-03-21 Netease (Hangzhou) Network Co.,Ltd. Information processing method, apparatus and non-transitory storage medium
CN108619720A (en) * 2018-04-11 2018-10-09 腾讯科技(深圳)有限公司 Playing method and device, storage medium, the electronic device of animation
CN110548280A (en) * 2019-09-11 2019-12-10 珠海金山网络游戏科技有限公司 Control method and device of virtual camera
CN111298435A (en) * 2020-02-12 2020-06-19 网易(杭州)网络有限公司 Visual field control method for VR game, VR display terminal, equipment and medium
CN111905370A (en) * 2020-08-14 2020-11-10 网易(杭州)网络有限公司 Method and device for controlling virtual character in game, electronic equipment and storage medium
CN112156467A (en) * 2020-10-15 2021-01-01 网易(杭州)网络有限公司 Control method and system of virtual camera, storage medium and terminal equipment
CN112190939A (en) * 2020-10-15 2021-01-08 上海米哈游天命科技有限公司 Method, device, equipment and medium for controlling component display in game scene
CN112669372A (en) * 2020-12-21 2021-04-16 北京像素软件科技股份有限公司 Method, device and computer-readable storage medium for rendering
CN112604279A (en) * 2020-12-29 2021-04-06 珠海金山网络游戏科技有限公司 Special effect display method and device

Also Published As

Publication number Publication date
CN113476840B (en) 2024-06-04

Similar Documents

Publication Publication Date Title
KR102625233B1 (en) Method for controlling virtual objects, and related devices
CA2985870C (en) Information processing method, terminal, and computer storage medium
CN106155553B (en) Virtual object motion control method and device
EP3919145A1 (en) Information interaction method and related device
EP3970819B1 (en) Interface display method and apparatus, and terminal and storage medium
CN106780674B (en) Lens moving method and device
CN113181651B (en) Method, device, electronic equipment and storage medium for controlling virtual object movement in game
JP7137719B2 (en) Virtual object selection method, device, terminal and program
CN113138670B (en) Touch screen interaction gesture control method and device, touch screen and storage medium
CN110665222B (en) Aiming direction control method and device in game, electronic equipment and storage medium
US20220266141A1 (en) Method and apparatus for selecting virtual object interaction mode, device, medium, and product
KR20140135276A (en) Method and Apparatus for processing a gesture input on a game screen
CN113350779A (en) Game virtual character action control method and device, storage medium and electronic equipment
JP2023549753A (en) Mark processing method and device, computer equipment, and computer program
CN113318429B (en) Control method and device for exiting game, processor and electronic device
CN112870701A (en) Control method and device of virtual role
CN110152292B (en) Display control method and device for jumping characters in game, storage medium and electronic equipment
CN113476840A (en) Special effect processing method, device, equipment and storage medium in game
CN115105831A (en) Virtual object switching method and device, storage medium and electronic device
CN114288644A (en) Game display control method, device, equipment and storage medium
CN113769384B (en) In-game field control method, device, equipment and storage medium
CN118045357A (en) Aiming method, device, equipment and storage medium in game
KR20240090702A (en) Method and apparatus for controlling virtual objects, and terminals, storage media, and program products
CN116832438A (en) Virtual object control method, device, terminal and storage medium
CN112516582A (en) Method and device for switching states in game

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
GR01 Patent grant
GR01 Patent grant