CN112190933A - Special effect processing method and device in game scene - Google Patents

Special effect processing method and device in game scene Download PDF

Info

Publication number
CN112190933A
CN112190933A CN202011064274.9A CN202011064274A CN112190933A CN 112190933 A CN112190933 A CN 112190933A CN 202011064274 A CN202011064274 A CN 202011064274A CN 112190933 A CN112190933 A CN 112190933A
Authority
CN
China
Prior art keywords
special effect
elements
game
template
target
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.)
Withdrawn
Application number
CN202011064274.9A
Other languages
Chinese (zh)
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.)
Zhuhai Tianyan Technology Co ltd
Original Assignee
Zhuhai Tianyan Technology 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 Zhuhai Tianyan Technology Co ltd filed Critical Zhuhai Tianyan Technology Co ltd
Priority to CN202011064274.9A priority Critical patent/CN112190933A/en
Publication of CN112190933A publication Critical patent/CN112190933A/en
Withdrawn legal-status Critical Current

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
    • 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/55Controlling game characters or game objects based on the game progress
    • A63F13/56Computing the motion of game characters with respect to other game characters, game objects or elements of the game scene, e.g. for simulating the behaviour of a group of virtual soldiers or for path finding
    • 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/60Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Display Devices Of Pinball Game Machines (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The application discloses a special effect processing method and a device in a game scene, wherein the method comprises the following steps: in the running process of a game, acquiring environmental elements in a game scene; acquiring a target special effect template from a plurality of predetermined special effect templates based on environment elements, wherein the target special effect template comprises special effect elements which are used for carrying out special effect design on the environment elements; acquiring target special effect data from a plurality of predetermined special effect data based on the environment elements, wherein the target special effect data comprises attribute values of the special effect elements, and the attribute values and the special effect elements are used for obtaining special effects of the environment elements; and performing special effect rendering based on the target special effect template and the target special effect data to obtain a special game scene. Because the space occupied by the special effect template and the special effect data is small, the game resource amount can be reduced by carrying out special effect design by using the special effect template and the special effect data, and meanwhile, when the special effect data and the special effect template are loaded, the memory consumption can be reduced, and the game running efficiency is improved.

Description

Special effect processing method and device in game scene
Technical Field
The present application relates to the field of computer technologies, and in particular, to a special effect processing method and apparatus in a game scene.
Background
In the current game, different special effects are usually designed for different game scenes, and when the game scenes change, the special effects can change along with the change, for example, when the game scenes are forest environments, the game special effects can be leaf-falling special effects, and when the game scenes are changed from forest environments to desert environments, the game special effects can also be correspondingly changed into sand-floating special effects.
Generally, in order to realize special effect design in a game scene, different material map maps can be respectively manufactured for different special effects, and when the special effect needs to be rendered, the corresponding material map is loaded. However, in practical applications, the space occupied by the material map is large, which may increase the amount of game resources, and at the same time, additional memory consumption may be caused when loading the material map, thereby affecting the operation efficiency of the game.
Disclosure of Invention
The embodiment of the application provides a special effect processing method and device in a game scene, which are used for solving the problems that in the current game special effect design, the special effect in the game scene is designed in a material chartlet mode, the game resource amount is increased, and meanwhile, extra memory consumption is caused, so that the running efficiency of a game is influenced.
In order to solve the above technical problem, the embodiment of the present application is implemented as follows:
in a first aspect, a special effect processing method in a game scene is provided, including:
in the running process of a game, acquiring environmental elements in a game scene;
acquiring a target special effect template corresponding to the environmental elements from a plurality of predetermined special effect templates based on the environmental elements, wherein the target special effect template comprises the special effect elements, and the special effect elements are used for carrying out special effect design on the environmental elements;
acquiring target special effect data corresponding to the environment elements from a plurality of predetermined special effect data based on the environment elements, wherein the target special effect data comprises attribute values of the special effect elements, and the attribute values and the special effect elements are used for obtaining special effects of the environment elements;
and performing special effect rendering based on the target special effect template and the target special effect data to obtain a special game scene.
In a second aspect, a special effect processing apparatus in a game scene is provided, including:
the game system comprises an acquisition unit, a processing unit and a control unit, wherein the acquisition unit is used for acquiring environmental elements in a game scene in the process of running a game;
a first determining unit, configured to obtain, based on the environment element, a target special effect template corresponding to the environment element from a plurality of predetermined special effect templates, where the target special effect template includes special effect elements, and the special effect elements are used to perform special effect design on the environment element;
a second determining unit, configured to obtain, based on the environment element, target special effect data corresponding to the environment element from a plurality of predetermined special effect data, where the target special effect data includes an attribute value of the special effect element, and the attribute value and the special effect element are used to obtain a special effect of the environment element;
and the special effect rendering unit is used for rendering a special effect based on the target special effect template and the target special effect data to obtain a special game scene.
In a third aspect, an electronic device is provided, which includes:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
in the running process of a game, acquiring environmental elements in a game scene;
acquiring a target special effect template corresponding to the environmental elements from a plurality of predetermined special effect templates based on the environmental elements, wherein the target special effect template comprises the special effect elements, and the special effect elements are used for carrying out special effect design on the environmental elements;
acquiring target special effect data corresponding to the environment elements from a plurality of predetermined special effect data based on the environment elements, wherein the target special effect data comprises attribute values of the special effect elements, and the attribute values and the special effect elements are used for obtaining special effects of the environment elements;
and performing special effect rendering based on the target special effect template and the target special effect data to obtain a special game scene.
In a fourth aspect, a computer-readable storage medium is presented, the computer-readable storage medium storing one or more programs that, when executed by an electronic device comprising a plurality of application programs, cause the electronic device to perform the method of:
in the running process of a game, acquiring environmental elements in a game scene;
acquiring a target special effect template corresponding to the environmental elements from a plurality of predetermined special effect templates based on the environmental elements, wherein the target special effect template comprises the special effect elements, and the special effect elements are used for carrying out special effect design on the environmental elements;
acquiring target special effect data corresponding to the environment elements from a plurality of predetermined special effect data based on the environment elements, wherein the target special effect data comprises attribute values of the special effect elements, and the attribute values and the special effect elements are used for obtaining special effects of the environment elements;
and performing special effect rendering based on the target special effect template and the target special effect data to obtain a special game scene.
The embodiment of the application adopts at least one technical scheme which can achieve the following beneficial effects:
according to the technical scheme provided by the embodiment of the application, corresponding special effect templates and special effect data are determined aiming at different environment elements in a game scene in advance, and in the process of game operation, a target special effect module and target special effect data corresponding to the environment elements can be determined according to the environment elements of the current game scene, wherein the target special effect template comprises special effect elements for carrying out special effect design on the environment elements, and the target special effect data comprises attribute values of the special effect elements, and the attribute values and the special effect elements are used for obtaining the special effects of the environment elements; and performing special effect rendering based on the target special effect template and the target special effect data to obtain a special game scene. Because the space occupied by the special effect template and the special effect data is small, the special effect rendering is carried out through the special effect template and the special effect data, the game resource amount can be reduced, meanwhile, when the special effect data and the special effect template are loaded, the memory consumption can be reduced, and the operation efficiency of the game is further improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without any creative effort.
FIG. 1 is a flow diagram illustrating an effect processing method in a game scenario according to an embodiment of the present application;
FIG. 2 is a flow diagram illustrating an effect processing method in a game scenario according to an embodiment of the present application;
FIG. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an effect processing apparatus in a game scene according to an embodiment of the present application.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
At present, when designing a special effect in a game scene, different material maps are usually designed for different special effects, the material maps are used as a part of game resources, and when the special effect in the game needs to be rendered, the corresponding material maps can be loaded from the game resources, so that the corresponding special effect is obtained. However, the memory space occupied by the texture maps is usually large, which increases the amount of game resources, and in addition, frequent loading of the texture maps also causes extra memory consumption when the game scene changes frequently, which eventually reduces the operating efficiency of the game.
Therefore, in the current game special effect design, the special effect in the game scene is designed in a material chartlet mode, so that the game resource amount is increased, extra memory consumption is caused, and the running efficiency of the game is reduced.
In view of this, embodiments of the present application provide a method and an apparatus for special effect processing in a game scene, which may determine different special effect templates and special effect data in advance for different environment elements in the game scene, and in a game running process, may determine a target special effect module and target special effect data corresponding to the environment elements according to the environment elements of a current game scene, where the target special effect template includes special effect elements for special effect design on the environment elements, and the target special effect data includes attribute values of the special effect elements, and the attribute values and the special effect elements are used to obtain special effects of the environment elements; and performing special effect rendering based on the target special effect template and the target special effect data to obtain a special game scene.
According to the method and the device for rendering the environmental elements in the game scene, the special effect template and the special effect data are used for rendering the environmental elements in the game scene, compared with the special effect rendering in a material chartlet mode, the special effect template and the special effect data occupy smaller space, so that in the game running process, the special effect rendering is carried out based on the special effect template and the special effect data, the game resource amount can be reduced, the memory consumption can be reduced, and the running efficiency of the game can be improved.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Fig. 1 is a flowchart illustrating a special effect processing method in a game scene according to an embodiment of the present application. The method is as follows.
S102: in the process of game running, environmental elements in a game scene are acquired.
In S102, in the running process of the game, when special effect rendering needs to be performed on the current game scene, an environment element in the current game scene may be acquired.
In this embodiment, the environment element in the game scene may be an element that needs to perform special effect rendering in the game scene, and in one implementation, the environment element may specifically be a game background and a game character, the game background may have a background special effect, and the game character may have an attack special effect, where the game background may be a forest background, a desert background, and the like, and the game character may be a player character of a game player in the game, or a non-player character (NPC), and the like.
It should be noted that, in the same game scene, the number of game backgrounds may be one or multiple, and the number of game roles may also be one or multiple, for example, the environment in the current game scene may be a forest environment or a desert environment, or a part of the environment may be a forest environment and another part may be a desert environment; the game characters in the current game scenario may be only player characters or may include both player and non-player characters.
After acquiring the environmental elements in the game scene, S104 and S106 may be executed.
S104: based on the environment elements, obtaining a target special effect template corresponding to the environment elements from a plurality of predetermined special effect templates, wherein the target special effect template comprises special effect elements, and the special effect elements are used for carrying out special effect design on the environment elements.
S106: based on the environment elements, obtaining target special effect data corresponding to the environment elements from a plurality of predetermined special effect data, wherein the target special effect data comprises attribute values of the special effect elements, and the attribute values and the special effect elements are used for obtaining special effects of the environment elements.
The execution sequence of the two steps may be that S104 is executed first and S106 is executed later, that S106 is executed first and S104 is executed later, or that S104 and S106 are executed in parallel, and here, the description is given only by taking the example that S104 is executed first and S106 is executed later.
In this embodiment, a plurality of corresponding different special effect templates and a plurality of corresponding different special effect data may be determined in advance for a plurality of different environment elements in a game, so that in a game running process, when special effect rendering is required, under a condition that an environment element in a current game scene is acquired, a target special effect template and target special effect data corresponding to the current environment element may be acquired from the plurality of predetermined special effect templates and the plurality of special effect data.
The plurality of special effect templates may be determined based on special effects of a plurality of environment elements, and the plurality of special effect data may be determined based on special effect attributes of the plurality of environment elements, where a special effect of an environment element may be understood as a special effect designed for the environment element according to a game requirement (or a player requirement) when a game is developed, generally, a special effect of one environment element may be designed by one or more special effect elements, and a special effect attribute of an environment element may be understood as an attribute of a special effect element for designing a special effect for an environment element, and may specifically include an attribute value.
For example, in the case that the environment element is a game background, it is assumed that the game background is a forest environment, and it is determined that the forest background has a full-screen fallen leaves special effect based on game requirements, and in the full-screen fallen leaves special effect, the fallen leaves have a falling speed a and a full-screen fallen leaves number b, then it may be determined that the special effect element includes fallen leaves, the fallen leaves are used to design the full-screen fallen leaves special effect, corresponding special effect attributes are the falling speed a and the full-screen fallen leaves number b of the fallen leaves, and the attribute values are a and b.
In this embodiment, the special effect template may include one or more special effect elements, and the special effect data may include attribute values of the special effect elements, where the attribute values are used to assign values to the special effect elements in the special effect template to obtain a corresponding special effect through rendering.
It should be noted that the same environmental element may correspond to one or more special effect templates, the special effect elements included in the multiple special effect templates are different, and the multiple special effect templates are used for determining to obtain different special effects, that is, the same environmental element may be designed by different special effect elements to obtain different special effects, and the different special effect elements respectively constitute different special effect templates; in addition, one special effect template may also correspond to one or more special effect data, wherein, in the case that one special effect template corresponds to a plurality of special effect data, the one special effect template and the plurality of special effect data may be rendered to obtain a plurality of different special effects.
For example, when the environmental element is a forest environment, the forest environment may have a full-screen fallen leaf effect and a bird and animal effect, the full-screen fallen leaf effect may correspond to a full-screen fallen leaf template, the bird and animal effect may correspond to a bird and animal template, that is, the forest environment may correspond to a plurality of special effect templates; correspondingly, for the full-screen fallen leaf special effect, the falling speed and the full-screen fallen leaf quantity of fallen leaves can be various, the falling speed and the full-screen fallen leaf quantity of various fallen leaves can correspond to various special effect data, namely, the full-screen fallen leaf template can correspond to a plurality of special effect data.
Because one environment element can correspond to a plurality of special effect templates, one special effect template can correspond to a plurality of different special effect data, and different special effects can be obtained by rendering based on one special effect template and the corresponding different special effect data, the game resource amount can be further reduced, and the memory consumption when the special effect template and the special effect data are loaded can be further reduced.
After the plurality of special effect templates and the plurality of special effect data are determined to be obtained, the plurality of special effect templates may be stored in the first path, and the plurality of special effect templates may be stored in the second path, that is, the plurality of special effect templates and the plurality of special effect data may be stored in different paths, so that when the target special effect template and the target special effect data are obtained, the target special effect template and the target special effect data may be obtained from the first path and the second path, respectively.
Optionally, when the plurality of special effect templates and the plurality of special effect data are respectively stored in the first path and the second path, the plurality of special effect templates and the plurality of special effect data may be stored in the form of json data, so that the storage space occupied by the plurality of special effect templates and the plurality of special effect data may be further reduced, and memory consumption when the special effect templates and the special effect data are loaded may also be reduced while the amount of game resources is reduced.
For convenience of understanding, a forest environment and a desert environment are taken as examples for explanation, and it is assumed that the forest environment number is bg1, the desert environment number is bg2, the desert environment number is bg1 and the desert environment number is bg2 for special effect making, a full-screen special effect template and a skill attack template (e _ model1, e _ model2) are used for making a full-screen falling effect e _1 and an effect e _ s _1 of a leaf attribute for the forest environment, and an effect e _2 of full-screen floating sand and an effect e _ s _2 of a sand attribute for the desert environment.
For e _1, e _ s _1, e _2, and e _ s _2, the data is transformed to obtain corresponding special effect data, for example, for e _1, the special effect data may include: duration, delay time, emission angle, emission speed, rotation angle, color, emission shape, emission particle number, material, mapping, rendering mode and the like are stored in a json data form. Wherein e _1 { "duration": 1, "delay": 1, "angle": 0, "speed": 1, "color" … … }. Effects e _1 and e _ s _1 are specified for bg1 { "eff 1": e _1, "eff 2": e _ s _1}, and effects e _2 and e _ s _2 are specified for bg2 { "eff 1": e _1, "eff 2": e _ s _1 }.
After the plurality of special effect templates are stored in the first path and the plurality of special effect data are stored in the second path, when special effect rendering needs to be performed on the environment elements in the game scene, the target special effect template corresponding to the environment elements can be obtained from the first path based on the environment elements, and the target special effect model data corresponding to the environment elements can be obtained from the second path. The target special effect template may include one or more special effect elements, where the one or more special effect elements are used to perform special effect design on an environment element in a current game scene, and the target special effect data includes an attribute value of the special effect element in the target special effect template, and the attribute value and the special effect element are used to obtain a special effect of the environment element in the current game scene.
In this embodiment, when the target special effect template and the target special effect data are determined based on the environment elements, the environment elements may include a game background and a game role, and accordingly, the game background may have a background special effect, and the game role may have a skill special effect, so the determined target special effect template may include the background special effect template and the skill special effect template, and the target special effect data may include the background special effect data and the skill special effect data, where the background special effect template and the background special effect data may be rendered to obtain a background special effect corresponding to the game background, and the skill special effect template and the skill special effect data may be rendered to obtain a skill special effect corresponding to the game role.
In addition, for a game character, since a skill special effect of the game character is generally related to a game background where the game character is located, when determining a target special effect template (i.e., the skill special effect template) corresponding to the game character, first, a position of the game character in a game scene needs to be determined; secondly, determining the game background where the game role is located based on the position; finally, based on the game background, determining a skill special effect template of the game character under the game background, wherein the game character can have different skill special effect templates under different game backgrounds.
For example, the current game scene includes a forest environment, a desert environment and a game role, and when the skill special effect template corresponding to the game role is determined, if the game role is determined to be located in the forest based on the position of the game role, the determined skill special effect template is the skill special effect template corresponding to the special effect (such as a leaf fall special effect) of the game role in the forest environment; determining that the game role is located in the desert based on the position of the game role, and then determining that the obtained skill special effect template is a skill special effect template corresponding to a special effect (such as a drift sand special effect) of the game role in the desert environment.
After the target special effect template and the target special effect data are obtained, S108 may be performed.
S108: and performing special effect rendering based on the target special effect template and the target special effect data to obtain a special game scene.
In S108, after the target special effect template and the target special effect data are obtained, a game scene having a corresponding special effect can be obtained by performing special effect rendering on the target special effect template and the target special effect data.
When the target special effect template comprises a background special effect template and a skill special effect template, and the target special effect data comprises background special effect data and skill special effect data, when special effect rendering is carried out, specifically, the background special effect is obtained by rendering based on the background special effect template and the background special effect data; rendering to obtain a skill special effect based on the skill special effect template and the skill special effect data; and superposing the background special effect and the skill special effect to obtain a game scene with the background special effect and the skill special effect.
When the special effect rendering is performed based on the skill special effect template and the skill special effect data, the special effect elements in the skill special effect template can be assigned based on the attribute values in the background special effect data, so that the background special effect can be obtained through rendering, and similarly, when the special effect rendering is performed based on the skill special effect template and the skill special effect data, the special effect elements in the skill special effect template can be assigned based on the attribute values in the skill special effect data, so that the skill special effect can be obtained through rendering.
In this embodiment, after obtaining a game scene with a special effect, when an environmental element in the game scene changes, a special effect template and special effect data corresponding to the changed environmental element may be determined based on the methods described in S104 to S106, and then the game scene with a corresponding special effect is obtained through rendering. In this way, the game effect can be made to change following the change of the environmental element.
In the embodiment, the special effect rendering is performed through the special effect template and the special effect data, and compared with the special effect rendering performed through a texture mapping mode, the special effect rendering is performed based on the special effect template and the special effect data because the special effect template and the special effect data occupy smaller space, so that the game resource amount can be reduced, the memory consumption can be reduced, and the operation efficiency of the game can be improved.
Alternatively, the environment element may be stored in the third path in advance, and the environment element may further include other elements constituting the game scene besides the game background and the game character, such as canvas size of the game background, size of the game character, color, and other data. In the process of running the game, when a game scene needs to be loaded, the environment elements forming the game scene can be loaded from the third path, and then the game scene needing to be loaded is obtained through rendering.
For easy understanding of the technical solution of the present application, refer to fig. 2. Fig. 2 is a schematic flowchart of an effect processing method in a game scene according to an embodiment of the present application, which may specifically include the following steps:
s201: determining environment elements in different game scenes, and storing the determined environment elements in the path 1.
The environment elements may be environment elements that need special effect rendering, such as a game background and a game character, and in addition, the environment elements may also include other elements that constitute a game scene, such as a canvas size of the game background, a size color of the game character, and the like.
S202: and determining to obtain a plurality of special effect templates corresponding to the plurality of environment elements according to the special effects of different environment elements.
The special effects of the environmental elements are designed by one or more special effect elements, and the special effect template determined according to the special effects of the environmental elements can comprise one or more special effect elements, wherein the same environmental element can correspond to one or more special effect templates, and the plurality of special effect templates comprise different special effect elements and are used for determining different special effects.
S203: and determining to obtain a plurality of special effect data corresponding to the plurality of environment elements according to the special effect attributes of the different environment elements.
The special effect attribute of the environment element represents the attribute of the special effect element for carrying out special effect design on the environment element, and the special effect attribute comprises an attribute value, wherein one special effect template of the same environment element can correspond to one or more special effect data, and one special effect template and a plurality of special effect data corresponding to the special effect template are used for rendering to obtain a plurality of different special effects corresponding to the environment element.
S204: a plurality of special effect templates are stored in path2 and a plurality of special effect data are stored in path 3.
When storing a plurality of special effect templates and a plurality of special effect data, the storage may be performed in the form of json data.
S205: in the process of running the game, the environment elements are loaded from the path1, and the game scene is rendered based on the environment elements.
The environment elements loaded here may include a game background and a game character.
S206: and acquiring a target special effect template corresponding to the environment element from the path2 based on the environment element.
The target special effect template comprises one or more special effect elements, and the one or more special effect elements are used for carrying out special effect design on the environment elements.
The target special effect template obtained here may include a background special effect template corresponding to a game background and a skill special effect template corresponding to a game character. Specially, when a skill special effect template corresponding to a game role is determined, firstly, the position of the game role in a game scene is determined; secondly, determining the game background where the game role is located based on the position; and finally, determining a skill special effect template of the game role under the game background based on the game background.
S207: based on the environment elements, target special effect data corresponding to the environment elements is acquired from the path 3.
The target special effect data comprises attribute values of special effect elements in the target special effect template, and the attribute values and the special effect elements are used for obtaining the special effects of the environment elements.
The target special effect data acquired here may include background special effect data corresponding to a game background, and skill special effect data corresponding to a game character.
S208: and performing special effect rendering based on the target special effect template and the target special effect data to obtain a special game scene.
The background special effect can be obtained by rendering based on the background special effect template and the background special effect data; rendering to obtain a skill special effect based on the skill special effect template and the skill special effect data; and overlapping the background special effect and the skill special effect to obtain a game scene with the background special effect and the skill special effect.
S209: and after the environmental elements are changed, determining a corresponding target special effect template and target special effect data based on the changed environmental elements.
S210: and performing special effect rendering based on the target special effect template determined by the changed environment elements and the target special effect data to obtain a game scene with the changed special effect.
To facilitate understanding of the above S205 to S210, the following may be exemplified:
when starting the game, loading the forest environment from the path1 into the memory, cloning a forest environment to be placed in the screen, resetting the leftmost position of the forest environment to the starting point 1, cloning a player matchmaker by the same method, and resetting the position of the matchmaker to the starting point 1. And rendering the current screen. It can be assumed here that the current screen display range is 1-10, the size of the forest environment is 20, the 1-20 area is a forest area, and the 20-40 area is a desert area.
Reading the game background and the positions of the matchmen in the screen each frame, if the current game background is a forest and the positions of the matchmen are between 1 and 20 (namely in the forest environment), analyzing the special effect attribute in the forest environment, determining that the special effect needing to be rendered in the current forest background is a full-screen leaf-falling special effect and the leaf-falling attack special effect needing to be rendered by the game character, then reading the corresponding special effect template from the path2, and reading the corresponding special effect data from the path 3.
After the special effect template and the special effect data are obtained, the special effect template can be assigned based on the special effect data. For example, if the special effect data of the full-screen leaf-falling special effect includes duration of 5 seconds, emission size of 0.5, gravity value of 0.1, emission speed of 1, color value (255,255,255,255), rate of change over time of 15, shader "Moblie/partitions/applied Blended", maximum number of emission Particles of 1000, stress (-5,0,0), and the like, a special effect element op in the special effect template can be obtained by a component obtaining method, duration, delay time, and the like in the op are directly assigned, rendering is then performed again, the full-screen leaf-falling special effect is finally rendered into a screen, and the leaf-falling attack special effect can be rendered based on the same method.
Then, if the position of the matchmaker is moved from the position 8 to the position 25, that is, the matchmaker is located in the desert environment, the special effect attribute in the desert environment is analyzed, the special effect needing to be rendered in the current desert environment is determined to be a full-screen floating sand special effect, the special effect needing to be rendered by the game character is determined to be a desert attack special effect, a corresponding special effect template can be read from the path2, and corresponding special effect data can be read from the path 3.
Assuming that the special effect data of the full-screen sand-floating special effect comprises duration of 12 seconds, emission size of 0.05, gravity value of 0.3, emission speed of 1.5, color value (250,165,0,255), rate of change over time of 80, shader "Moblie/Particles/Additive", maximum number of emission Particles of 2000, stress (-10,0,0) and the like, at this time, the special effect template does not need to be reloaded, and only aiming at the current existing full-screen special effect, the duration of the full-screen special effect is modified for 12 seconds, the emission size is modified for 0.05, the emission speed is modified for 1.5, the color value is modified for (250,165,0,255), the rate of change over time is modified for 80, the shader is modified for "Moblie/Particles/Additive", then rendering is carried out, the full-screen sand-floating special effect can be obtained, and desert attack can be obtained based on the same special effect principle.
And then, when a matchmaker attack instruction is received, obtaining the data of the attack skill special effect according to the position of the matchmaker and the method, replacing the skill special effect and superposing the environment special effect, and finally rendering. Therefore, the whole process realizes visual diversity, reduces used mapping resources, reduces the occupation of a memory and improves the running efficiency of the game.
According to the technical scheme provided by the embodiment of the application, corresponding special effect templates and special effect data are determined aiming at different environment elements in a game scene in advance, in the process of game operation, a target special effect module and target special effect data corresponding to the environment elements can be determined according to the environment elements of the current game scene, the target special effect data comprise attribute values of the special effect elements, and the attribute values and the special effect elements are used for obtaining special effects of the environment elements; and performing special effect rendering based on the target special effect template and the target special effect data to obtain a special game scene. Because the space occupied by the special effect template and the special effect data is small, the special effect rendering is carried out through the special effect template and the special effect data, the game resource amount can be reduced, meanwhile, when the special effect data and the special effect template are loaded, the memory consumption can be reduced, and the operation efficiency of the game is further improved.
The foregoing description of specific embodiments of the present application has been presented. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
Fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application. Referring to fig. 3, at a hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory, such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be connected to each other via an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 3, but this does not indicate only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to form the special effect processing device in the game scene on the logic level. The processor is used for executing the program stored in the memory and is specifically used for executing the following operations:
in the running process of a game, acquiring environmental elements in a game scene;
acquiring a target special effect template corresponding to the environmental elements from a plurality of predetermined special effect templates based on the environmental elements, wherein the target special effect template comprises the special effect elements, and the special effect elements are used for carrying out special effect design on the environmental elements;
acquiring target special effect data corresponding to the environment elements from a plurality of predetermined special effect data based on the environment elements, wherein the target special effect data comprises attribute values of the special effect elements, and the attribute values and the special effect elements are used for obtaining special effects of the environment elements;
and performing special effect rendering based on the target special effect template and the target special effect data to obtain a special game scene.
The method executed by the special effect processing device in the game scene according to the embodiment shown in fig. 3 of the present application may be applied to or implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
The electronic device may further execute the method shown in fig. 1 and fig. 2, and implement the function of the special effect processing apparatus in the game scene in the embodiment shown in fig. 1 and fig. 2, which is not described herein again in this embodiment of the present application.
Of course, besides the software implementation, the electronic device of the present application does not exclude other implementations, such as a logic device or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or a logic device.
Embodiments of the present application also propose a computer-readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a portable electronic device comprising a plurality of application programs, enable the portable electronic device to perform the method of the embodiment shown in fig. 1 and 2, and in particular to perform the following operations:
in the running process of a game, acquiring environmental elements in a game scene;
acquiring a target special effect template corresponding to the environmental elements from a plurality of predetermined special effect templates based on the environmental elements, wherein the target special effect template comprises the special effect elements, and the special effect elements are used for carrying out special effect design on the environmental elements;
acquiring target special effect data corresponding to the environment elements from a plurality of predetermined special effect data based on the environment elements, wherein the target special effect data comprises attribute values of the special effect elements, and the attribute values and the special effect elements are used for obtaining special effects of the environment elements;
and performing special effect rendering based on the target special effect template and the target special effect data to obtain a special game scene.
Fig. 4 is a schematic structural diagram of an effect processing apparatus 40 in a game scene according to an embodiment of the present application. Referring to fig. 4, in a software implementation, the special effect processing device 40 in the game scene may include: an acquisition unit 41, a first determination unit 42, a second determination unit 43, and a special effects rendering unit 44, wherein:
an acquisition unit 41 that acquires an environmental element in a game scene during the running of the game;
a first determining unit 42, configured to obtain, based on the environment element, a target special effect template corresponding to the environment element from a plurality of predetermined special effect templates, where the target special effect template includes a special effect element, and the special effect element is used to perform special effect design on the environment element;
a second determining unit 43, configured to obtain, based on the environment element, target special effect data corresponding to the environment element from a plurality of predetermined special effect data, where the target special effect data includes an attribute value of the special effect element, and the attribute value and the special effect element are used to obtain a special effect of the environment element;
and the special effect rendering unit 44 is used for performing special effect rendering based on the target special effect template and the target special effect data to obtain a special game scene.
Optionally, the plurality of special effect templates are pre-stored in the first path, the plurality of special effect templates are determined based on special effects of a plurality of environment elements, and a special effect of one environment element is designed by one or more of the plurality of special effect elements;
the plurality of special effect data are pre-stored in a second path, the plurality of special effect data are determined and obtained based on special effect attributes of the plurality of environment elements, the special effect attribute of one environment element represents the attribute of a special effect element for carrying out special effect design on the environment element, and the special effect attribute comprises an attribute value;
wherein the plurality of special effect templates and the plurality of special effect data are stored in a json format.
Optionally, the same environment element corresponds to one or more different special effect templates, and one special effect template corresponds to one or more different special effect data, where the one special effect template and the plurality of different special effect data corresponding to the one special effect template are used for rendering to obtain a plurality of different special effects.
Optionally, the environment elements comprise a game background and a game character, the game background has a background special effect, and the game character has a skill special effect;
the target special effect template comprises a background special effect template and a skill special effect template, the target special effect data comprises background special effect data and skill special effect data, the background special effect template and the background special effect data are used for rendering to obtain the background special effect, and the skill special effect template and the skill special effect data are used for rendering to obtain the skill special effect.
Optionally, the first determining unit 42, based on the environment element, acquiring a target special effect template corresponding to the environment element from a plurality of predetermined special effect templates, including:
for the game character, determining the position of the game character in the game scene;
determining a game context in which the game character is located based on the location;
and determining skill special effect templates of the game characters under the game background based on the game background, wherein different game backgrounds correspond to different skill special effect templates.
Optionally, the special effect rendering unit 44 performs special effect rendering based on the target special effect template and the target special effect data to obtain a game scene with special effect, including:
rendering to obtain the background special effect based on the background special effect template and the background special effect data;
rendering to obtain the skill special effect based on the skill special effect template and the skill special effect data;
and superposing the background special effect and the skill special effect to obtain a game scene with the background special effect and the skill special effect.
Optionally, the environment elements are pre-stored in the third path, and the environment elements further include other elements constituting the game scene;
wherein, during the game running, the obtaining unit 41:
loading the environmental element from the third path;
and rendering the game scene based on the environment elements.
The special effect processing device 40 in the game scene provided in the embodiment of the present application may also execute the method in fig. 1 and fig. 2, and implement the functions of the special effect processing device in the game scene in the embodiments shown in fig. 1 and fig. 2, which are not described herein again in this embodiment of the present application.
In short, the above description is only a preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The embodiments in the present application are described in a progressive manner, and the same and similar parts among the embodiments can be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.

Claims (10)

1. A special effect processing method in a game scene is characterized by comprising the following steps:
in the running process of a game, acquiring environmental elements in a game scene;
acquiring a target special effect template corresponding to the environmental elements from a plurality of predetermined special effect templates based on the environmental elements, wherein the target special effect template comprises the special effect elements, and the special effect elements are used for carrying out special effect design on the environmental elements;
acquiring target special effect data corresponding to the environment elements from a plurality of predetermined special effect data based on the environment elements, wherein the target special effect data comprises attribute values of the special effect elements, and the attribute values and the special effect elements are used for obtaining special effects of the environment elements;
and performing special effect rendering based on the target special effect template and the target special effect data to obtain a special game scene.
2. The method of claim 1,
the plurality of special effect templates are pre-stored in a first path, the plurality of special effect templates are determined and obtained based on special effects of a plurality of environment elements, and the special effect of one environment element is obtained by designing one or more special effect elements;
the plurality of special effect data are pre-stored in a second path, the plurality of special effect data are determined and obtained based on special effect attributes of the plurality of environment elements, the special effect attribute of one environment element represents the attribute of a special effect element for carrying out special effect design on the environment element, and the special effect attribute comprises an attribute value;
wherein the plurality of special effect templates and the plurality of special effect data are stored in a json format.
3. The method of claim 2,
the same environment element corresponds to one or more different special effect templates, one special effect template corresponds to one or more different special effect data, and one special effect template and the different special effect data corresponding to the special effect template are used for rendering to obtain a plurality of different special effects.
4. The method of claim 1,
the environment elements comprise a game background and a game role, the game background has a background special effect, and the game role has a skill special effect;
the target special effect template comprises a background special effect template and a skill special effect template, the target special effect data comprises background special effect data and skill special effect data, the background special effect template and the background special effect data are used for rendering to obtain the background special effect, and the skill special effect template and the skill special effect data are used for rendering to obtain the skill special effect.
5. The method of claim 4, wherein obtaining a target special effect template corresponding to the environmental element from a predetermined plurality of special effect templates based on the environmental element comprises:
for the game character, determining the position of the game character in the game scene;
determining a game context in which the game character is located based on the location;
and determining skill special effect templates of the game characters under the game background based on the game background, wherein different game backgrounds correspond to different skill special effect templates.
6. The method of claim 4, wherein performing special effect rendering based on the target special effect template and the target special effect data to obtain a game scene with a special effect comprises:
rendering to obtain the background special effect based on the background special effect template and the background special effect data;
rendering to obtain the skill special effect based on the skill special effect template and the skill special effect data;
and superposing the background special effect and the skill special effect to obtain a game scene with the background special effect and the skill special effect.
7. The method of claim 4,
the environment elements are pre-stored in a third path, and the environment elements also comprise other elements forming the game scene;
wherein, in the process of game running, the method further comprises the following steps:
loading the environmental element from the third path;
and rendering the game scene based on the environment elements.
8. An effect processing apparatus in a game scene, comprising:
the game system comprises an acquisition unit, a processing unit and a control unit, wherein the acquisition unit is used for acquiring environmental elements in a game scene in the process of running a game;
a first determining unit, configured to obtain, based on the environment element, a target special effect template corresponding to the environment element from a plurality of predetermined special effect templates, where the target special effect template includes special effect elements, and the special effect elements are used to perform special effect design on the environment element;
a second determining unit, configured to obtain, based on the environment element, target special effect data corresponding to the environment element from a plurality of predetermined special effect data, where the target special effect data includes an attribute value of the special effect element, and the attribute value and the special effect element are used to obtain a special effect of the environment element;
and the special effect rendering unit is used for rendering a special effect based on the target special effect template and the target special effect data to obtain a special game scene.
9. An electronic device, comprising:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
in the running process of a game, acquiring environmental elements in a game scene;
acquiring a target special effect template corresponding to the environmental elements from a plurality of predetermined special effect templates based on the environmental elements, wherein the target special effect template comprises the special effect elements, and the special effect elements are used for carrying out special effect design on the environmental elements;
acquiring target special effect data corresponding to the environment elements from a plurality of predetermined special effect data based on the environment elements, wherein the target special effect data comprises attribute values of the special effect elements, and the attribute values and the special effect elements are used for obtaining special effects of the environment elements;
and performing special effect rendering based on the target special effect template and the target special effect data to obtain a special game scene.
10. A computer-readable storage medium storing one or more programs which, when executed by an electronic device including a plurality of application programs, cause the electronic device to perform a method of:
in the running process of a game, acquiring environmental elements in a game scene;
acquiring a target special effect template corresponding to the environmental elements from a plurality of predetermined special effect templates based on the environmental elements, wherein the target special effect template comprises the special effect elements, and the special effect elements are used for carrying out special effect design on the environmental elements;
acquiring target special effect data corresponding to the environment elements from a plurality of predetermined special effect data based on the environment elements, wherein the target special effect data comprises attribute values of the special effect elements, and the attribute values and the special effect elements are used for obtaining special effects of the environment elements;
and performing special effect rendering based on the target special effect template and the target special effect data to obtain a special game scene.
CN202011064274.9A 2020-09-30 2020-09-30 Special effect processing method and device in game scene Withdrawn CN112190933A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011064274.9A CN112190933A (en) 2020-09-30 2020-09-30 Special effect processing method and device in game scene

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011064274.9A CN112190933A (en) 2020-09-30 2020-09-30 Special effect processing method and device in game scene

Publications (1)

Publication Number Publication Date
CN112190933A true CN112190933A (en) 2021-01-08

Family

ID=74012605

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011064274.9A Withdrawn CN112190933A (en) 2020-09-30 2020-09-30 Special effect processing method and device in game scene

Country Status (1)

Country Link
CN (1) CN112190933A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113144612A (en) * 2021-04-25 2021-07-23 上海雷鸣文化传播有限公司 Game scene design method based on three-dimensional scanning

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103402100A (en) * 2013-08-23 2013-11-20 北京奇艺世纪科技有限公司 Video processing method and mobile terminal
WO2018024179A1 (en) * 2016-08-04 2018-02-08 腾讯科技(深圳)有限公司 Video processing method, server, terminal, and computer storage medium
CN109710255A (en) * 2018-12-24 2019-05-03 网易(杭州)网络有限公司 Effect processing method, special effect processing device, electronic equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103402100A (en) * 2013-08-23 2013-11-20 北京奇艺世纪科技有限公司 Video processing method and mobile terminal
WO2018024179A1 (en) * 2016-08-04 2018-02-08 腾讯科技(深圳)有限公司 Video processing method, server, terminal, and computer storage medium
CN109710255A (en) * 2018-12-24 2019-05-03 网易(杭州)网络有限公司 Effect processing method, special effect processing device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113144612A (en) * 2021-04-25 2021-07-23 上海雷鸣文化传播有限公司 Game scene design method based on three-dimensional scanning

Similar Documents

Publication Publication Date Title
CN107274442B (en) Image identification method and device
AU2017204531B2 (en) Smart and automatic selection of same shaped objects in images
CN111242217A (en) Training method and device of image recognition model, electronic equipment and storage medium
CN110162089B (en) Unmanned driving simulation method and device
JP6882992B2 (en) How and devices to preview moving images, and how and devices to display representation packages
CN111111176B (en) Method and device for managing object LOD in game and electronic equipment
CN109978044B (en) Training data generation method and device, and model training method and device
CN111228816A (en) Scene layout method and device in game
CN113538502A (en) Picture clipping method and device, electronic equipment and storage medium
CN114064594A (en) Data processing method and device
CN112190933A (en) Special effect processing method and device in game scene
CN108280135B (en) Method and device for realizing visualization of data structure and electronic equipment
CN111161283A (en) Method and device for processing picture resources and electronic equipment
CN114268538A (en) Configuration method and device of front-end route
WO2024060949A1 (en) Method and apparatus for augmented reality, device, and storage medium
CN110321190B (en) Method and device for optimizing icons in desktop
CN112449230B (en) Character string display processing method, device, terminal and storage medium
CN111538667A (en) Page testing method and device
US9146720B1 (en) Binary file application processing
CN112560530B (en) Two-dimensional code processing method, device, medium and electronic device
US10872347B2 (en) Transmitting application data for on-device demos
CN110443746B (en) Picture processing method and device based on generation countermeasure network and electronic equipment
CN110287437B (en) Webpage screenshot method and device, storage medium and terminal
CN106802856B (en) Performance testing method of game application program, server and game application client
CN113158620A (en) Bookshelf page editing processing method, electronic equipment and computer 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
WW01 Invention patent application withdrawn after publication

Application publication date: 20210108

WW01 Invention patent application withdrawn after publication