Special effects processing method, device, electronic device and storage medium in games

By monitoring target events in the game and changing the color of special effects pattern, the problem of large workload and resource occupation of many package designs in game development is solved, and resource conservation and development efficiency are improved.

CN113476844BActive Publication Date: 2024-12-03NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110757953.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-05
Publication Date
2024-12-03
Estimated Expiration
2041-07-05

AI Technical Summary

Technical Problem

Existing game development requires the design of multiple game packages to meet the needs of different users, resulting in large workloads in development and art planning and occupies a lot of storage resources.

Method used

By monitoring the trigger command of the target event in the game, obtain the rendering color of the special effect pattern, and determine whether it is within the pending color range. If it is, the color transformation process will be performed to convert it to the target color that is not within the pending color range to achieve the special effect The rapid transformation of patterns does not require designing multiple game packages.

Benefits of technology

It liberates human resources, reduces the size of the game package and the use of storage resources, and improves game development efficiency and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113476844B_ABST
    Figure CN113476844B_ABST
Patent Text Reader

Abstract

The present application provides a method, device, electronic device and storage medium for special effect processing in a game, the method comprising: when a trigger instruction of a target event in the game is detected, obtaining a special effect pattern of the target event; judging whether the rendering color is within the color range to be processed according to the rendering color of the special effect pattern; and determining whether to transform the rendering color of the special effect pattern according to whether the rendering color is within the color range to be processed. Thus, the special effect pattern can be quickly transformed into a special effect pattern of a suitable color without designing two game packages, thereby freeing up manpower and reducing the total size of the game package.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet technology, and in particular to a method, device, electronic device and storage medium for special effects processing in a game. Background Art

[0002] With the rapid development of terminal technology, mobile phones, tablet computers and other electronic devices are used more and more frequently in users' work and life. In actual applications, users often use electronic devices to play games, and in order to enhance the user's gaming experience, game clients usually output game effects in specific game scenarios during operation.

[0003] Generally, when a game is being developed, in order to meet the needs of different users, at least two game packages need to be developed. Users select the required game package to install the game. However, this greatly increases the workload of development and art planning, and also takes up more storage resources. Summary of the invention

[0004] The embodiment of the present application provides a special effects processing method in a game, so as to free up manpower and reduce occupied resources.

[0005] The embodiment of the present application provides a method for processing special effects in a game, including:

[0006] When a trigger instruction of a target event in the game is detected, a special effect pattern of the target event is obtained;

[0007] According to the rendering color of the special effect pattern, determining whether the rendering color is within the range of colors to be processed;

[0008] Whether to perform a transformation process on the rendering color of the special effect pattern is determined according to whether the rendering color is within the range of colors to be processed.

[0009] In one embodiment, judging whether the rendering color is within a to-be-processed color range according to the rendering color of the special effect pattern includes:

[0010] According to the hue value of the rendered color, it is determined whether the hue value is within a range of a color to be processed.

[0011] In one embodiment, before judging whether the hue value of the rendered color is within the range of the color to be processed according to the hue value of the rendered color, the method further comprises:

[0012] Convert the rendered color from the original RGB color space to the HSV color space;

[0013] The hue value of the rendered color is extracted from the HSV color space.

[0014] In one embodiment, determining whether to transform the rendering color of the special effect pattern according to whether the rendering color is within the to-be-processed color range includes:

[0015] If the rendered color is within the color range to be processed, converting the rendered color of the special effect pattern into a target color that is not within the color range to be processed;

[0016] The special effect pattern is displayed according to the target color.

[0017] In one embodiment, if the rendered color is within the color range to be processed, converting the rendered color of the special effect pattern into a target color that is not within the color range to be processed includes:

[0018] If the hue value of the rendered color is within the range of the color to be processed, transforming the hue value of the special effect pattern into a hue target value that is not within the range of the color to be processed;

[0019] The hue target value, the saturation and the lightness components of the rendering color are converted into an RGB color space to obtain a target color.

[0020] In one embodiment, before judging whether the rendering color of the special effect pattern is within the range of colors to be processed according to the rendering color of the special effect pattern, the method includes:

[0021] According to the custom color of the special effect pattern in the editor, the rendering color of the special effect pattern is calculated using the custom color.

[0022] In one embodiment, the step of calculating the rendering color of the special effect pattern using the custom color of the special effect pattern in the editor includes:

[0023] According to the custom color of the first area of ​​the special effect pattern in the editor, the basic color of the first area is replaced by the custom color to calculate the rendering color of the first area of ​​the special effect pattern;

[0024] The rendering color of the second area of ​​the special effect pattern is calculated according to the basic color of the second area of ​​the special effect pattern; the rendering color of the special effect pattern includes the rendering color of the first area and the rendering color of the second area.

[0025] The embodiment of the present application provides a special effect processing device in a game, comprising:

[0026] A pattern acquisition module is used to acquire a special effect pattern of a target event when a trigger instruction of a target event in the game is detected;

[0027] A color judgment module, used for judging whether the rendered color is within the range of colors to be processed according to the rendered color of the special effect pattern;

[0028] The color conversion module is used to determine whether to convert the rendering color of the special effect pattern according to whether the rendering color is within the range of colors to be processed.

[0029] An embodiment of the present application provides an electronic device, the electronic device comprising:

[0030] processor;

[0031] a memory for storing processor-executable instructions;

[0032] Wherein, the processor is configured to execute the special effects processing method in the above-mentioned game.

[0033] An embodiment of the present application provides a computer-readable storage medium, which stores a computer program. The computer program can be executed by a processor to implement the special effects processing method in the above-mentioned game.

[0034] The technical solution provided by the above-mentioned embodiments of the present application, when a trigger instruction of a target event in the game is monitored, obtains a special effect pattern of the target event; then, based on the rendering color of the special effect pattern, determines whether the rendering color is within the range of colors to be processed; based on whether the rendering color is within the range of colors to be processed, determines whether to transform the rendering color of the special effect pattern, thereby one special effect pattern can be quickly transformed into a special effect pattern of another color, without the need to design two game packages, thereby freeing up manpower and reducing occupied resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solution of the embodiments of the present application, the drawings required for use in the embodiments of the present application are briefly introduced below.

[0036] Figure 1 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0037] Figure 2 It is a flowchart of a special effect processing method in a game provided by an embodiment of the present application;

[0038] Figure 3 yes Figure 2 Detailed flowchart of step S220 in the corresponding embodiment;

[0039] Figure 4 is a schematic diagram comparing the effects before and after the special effect processing provided in the embodiment of the present application;

[0040] Figure 5is a flowchart of a special effect processing method in a game provided by another embodiment of the present application;

[0041] Figure 6 yes Figure 5 Detailed flowchart of step S500 in the corresponding embodiment;

[0042] Figure 7 is a schematic diagram of special effect processing provided by another embodiment of the present application;

[0043] Figure 8 It is a block diagram of a special effects processing device in a game provided in an embodiment of the present application. DETAILED DESCRIPTION

[0044] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0045] Similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0046] Figure 1 1 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 100 can be used to execute the special effect processing method in the game provided in an embodiment of the present application. Figure 1 As shown, the electronic device 100 includes: one or more processors 102, and one or more memories 104 storing processor executable instructions. The processor 102 is configured to execute the special effect processing method in the game provided in the following embodiment of the present application.

[0047] The processor 102 may be a device including a central processing unit (CPU), a graphics processing unit (GPU), or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may process data of other components in the electronic device 100, and may also control other components in the electronic device 100 to perform desired functions.

[0048] The memory 104 may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 102 may run the program instructions to implement the special effect processing method in the game described below. Various applications and various data may also be stored in the computer-readable storage medium, such as various data used and / or generated by the application.

[0049] In one embodiment, Figure 1 The electronic device 100 shown may also include an input device 106, an output device 108, and a data acquisition device 110, which are interconnected via a bus system 112 and / or other forms of connection mechanisms (not shown). Figure 1 The components and structures of the electronic device 100 shown are merely exemplary and non-limiting. The electronic device 100 may also have other components and structures as required.

[0050] The input device 106 may be a device for a user to input instructions, and may include one or more of a keyboard, a mouse, a microphone, a touch screen, etc. The output device 108 may output various information (e.g., images or sounds) to the outside (e.g., a user), and may include one or more of a display, a speaker, etc. The data acquisition device 110 may acquire an image of an object, and store the acquired image in the memory 104 for use by other components. Exemplarily, the data acquisition device 110 may be a camera.

[0051] In one embodiment, the various components in the example electronic device 100 for implementing the special effects processing method in the game of the embodiment of the present application can be integrated or dispersed, such as integrating the processor 102, memory 104, input device 106 and output device 108 into one, and separately arranging the data acquisition device 110.

[0052] In one embodiment, the example electronic device 100 for implementing the special effects processing method in the game of the embodiment of the present application can be implemented as an intelligent terminal such as a server, a smart phone, a tablet computer, a smart watch, a car-mounted device, etc.

[0053] Figure 2 1 is a flow chart of a special effect processing method in a game provided by an embodiment of the present application. Figure 2As shown, the method includes: step S210-step S230.

[0054] Step S210: when a trigger instruction of a target event in the game is detected, a special effect pattern of the target event is obtained.

[0055] The target event can be an injury event in the game scene, such as being hit by a virtual weapon, which can be a gun, arrow, bullet, etc.; the target event can also be an attack event, such as throwing a virtual weapon, which can be a virtual grenade, a virtual mine, etc.

[0056] Among them, the trigger instruction of monitoring the target event in the game can be monitoring the existence of specified attack operations of each virtual character or virtual animal in the game scene, such as throwing virtual weapons, or judging that a virtual character or virtual animal is injured, such as a virtual character being hit by a virtual weapon.

[0057] In one embodiment, different events may be considered to have occurred based on different attack operations or different types of injuries, and thus different special effect patterns may be corresponding, such as bomb smoke patterns, bleeding patterns, etc. For ease of understanding, the following embodiments take the target event as an injury event and the special effect pattern as a bleeding pattern as an example.

[0058] Step S220: judging whether the rendering color of the special effect pattern is within a range of colors to be processed according to the rendering color of the special effect pattern.

[0059] The rendering color refers to the color that the special effect pattern is originally set to render, for example, it can be red. The color range to be processed refers to the color range that needs to be processed for the color of the special effect pattern. For example, the color range to be processed can be the RGB (red, green, and blue) color value or HSV (hue, saturation, and value) color value corresponding to the blood flow color.

[0060] In one embodiment, the rendering color may be directly in the HSV color space, and according to the hue value H of the rendering color, it may be determined whether the hue value H of the rendering color is within the to-be-processed color range (eg, less than 40).

[0061] In another embodiment, the rendering color may be in RGB color space, such as Figure 3 As shown, the above step S220 may include the following steps: step S221-step S223.

[0062] Step S221: converting the rendering color from the original RGB color space to the HSV color space.

[0063] Among them, the conversion formula from RGB color space to HSV color space is as follows:

[0064]

[0065] Cmax=max(R′,G′,B′)

[0066] Cmin=min(R′,G′,B′)

[0067] Δ=Cmax-Cmin

[0068]

[0069]

[0070] V=Cmax

[0071] Substitute the R value, G value, and B value of the rendered color into the above formula (1) as the R value, G value, and B value, respectively. Through the above formula, the H value, S value, and V value can be calculated, thereby realizing the conversion of the rendered color from the RGB color space to the HSV color space.

[0072] Step S222: extracting the hue value of the rendering color in the HSV color space.

[0073] The hue value is the H value in the HSV color space, which is the H value calculated by the above formula.

[0074] Step S223: judging whether the hue value of the rendered color is within the range of the color to be processed according to the hue value of the rendered color.

[0075] Specifically, it can be determined whether the H value calculated by the above formula is within the color range to be processed. For example, the color range to be processed can be the H value range of blood color, for example, less than 40. In one embodiment, if the hue value H is less than 40, it is considered to be within the color range to be processed, and if it is greater than or equal to 40, it is considered not to be within the color range to be processed.

[0076] Step S230: determining whether to transform the rendering color of the special effect pattern according to whether the rendering color is within the range of colors to be processed.

[0077] For example, the rendered color within the color range to be processed can be considered a color that some users do not like, such as the red color of bleeding. Therefore, the conversion process refers to changing the rendered color of the special effect pattern into another color, such as green, purple, etc., which does not resemble blood, so as to reduce the violent plots in the game.

[0078] like Figure 4 As shown, the rendering color of the pattern on the left is red. By adopting the solution provided in the embodiment of the present application, red can be converted into yellow to obtain a special effect pattern with yellow color (i.e., the pattern on the right).

[0079] The technical solution provided by the above-mentioned embodiments of the present application, when a trigger instruction of a target event in the game is monitored, obtains a special effect pattern of the target event; then, based on the rendering color of the special effect pattern, determines whether the rendering color is within the range of colors to be processed; based on whether the rendering color is within the range of colors to be processed, determines whether to transform the rendering color of the special effect pattern, thereby a special effect pattern of one color can be quickly transformed into a special effect pattern of another color, without the need to design two game packages, thereby freeing up manpower while reducing the total size of the game package and reducing occupied resources.

[0080] In one embodiment, the above step S230 specifically includes: if the rendering color is within the color range to be processed, converting the rendering color of the special effect pattern into a target color that is not within the color range to be processed; and displaying the special effect pattern according to the target color.

[0081] Among them, the target color refers to the rendering color of the special effect pattern after the transformation. The target color can be an RGB color space. In one embodiment, the color range to be processed can be the RGB color of blood. If the rendering color of the special effect pattern is within the RGB color range of blood, the rendering color of the special effect pattern can be changed to any other color other than the blood flow color, such as yellow, green, purple, etc. For distinction, this transformed color can be called the target color. Afterwards, the special effect pattern can be displayed according to the transformed target color, so that the bleeding after injury no longer displays red, but can display yellow, green or purple, etc.

[0082] In one embodiment, if the hue value of the rendered color is within the range of the color to be processed (e.g., less than 40), the hue value of the special effect pattern can be transformed into a hue target value that is not within the range of the color to be processed. The hue target value refers to the hue value after the hue value H of the HSV color space of the special effect pattern is changed. For example, the target hue value can be 40, 50, 60, etc. To distinguish it from the hue value before the change, the changed hue value can be called the hue target value. Afterwards, the hue target value, the saturation and lightness components of the rendered color are converted into the RGB color space to obtain the target color.

[0083] That is to say, the saturation S and lightness V components of the HSV color space of the rendered color remain unchanged, and the hue value becomes the hue target value. According to the existing HSV color space to RGB color space conversion formula, the HSV color space can be further converted to the RGB color space to obtain the target color in RGB format, and then the special effect pattern can be displayed according to the target color.

[0084] In one embodiment, if Figure 5 As shown, before the above step S220, the method provided in the embodiment of the present application further includes:

[0085] Step S500: according to the custom color of the special effect pattern in the editor, the rendering color of the special effect pattern is calculated using the custom color.

[0086] It should be noted that sometimes the special effect color values ​​automatically processed may not be the results that the art designer wants. In order to increase the flexibility of the automatic processing solution, a custom color processing function can be added in the editor.

[0087] The rendering color in step S220 is calculated based on the special effect base color (baseColor) combined with lighting data. If the editor sets a custom color, the custom color can be used instead of the special effect baseColor to calculate the finalColor (i.e., the rendering color), and then the finalColor is automatically processed through the above steps S220 and S230.

[0088] In one embodiment, if Figure 6 As shown, the above step S500 may include the following steps S510 to S520.

[0089] Step S510: According to the custom color of the first area of ​​the special effect pattern in the editor, the basic color of the first area is replaced by the custom color to calculate the rendering color of the first area of ​​the special effect pattern.

[0090] Among them, the first area refers to the area in the special effect pattern where the color can be customized, and the second area refers to the area of ​​the base color of the special effect pattern. For the purpose of distinction, they are respectively called the first area and the second area.

[0091] Taking the special effect pattern of wounded bleeding as an example, the base colors of the first area and the second area can be red, and the custom color of the first area can be green. The custom color (green) is used to replace the base color (red) of the first area, that is, the rendering color of the first area is calculated with green as the basecolor and combined with lighting, etc. The process of calculating finalColor from basecolor can be implemented with reference to the existing technology.

[0092] Step S520: calculating a rendering color of the second area of ​​the special effect pattern according to the basic color of the second area of ​​the special effect pattern; the rendering color of the special effect pattern includes the rendering color of the first area and the rendering color of the second area.

[0093] The second area can directly calculate the rendering color based on the basecolor (red) combined with lighting, etc. Therefore, the rendering color of the special effect pattern may include the green of the first area and the red of the second area. Then, the above steps S220 and S230 can be executed to automatically process the rendering color of the first area and the rendering color of the second area respectively. For example, assuming that the color range to be processed is red, and the red of the second area is within the color range to be processed, the red will be converted to yellow. The green of the first area may not be within the color range to be processed, so it is still green. Therefore, the special effect pattern after the final processing may include two areas of green and yellow, and the effect is as follows: Figure 7 shown.

[0094] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the special effect processing method in the above-mentioned game of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the special effect processing method in the game of the present application.

[0095] Figure 8 FIG. 1 is a block diagram of a special effect processing device in a game shown in an embodiment of the present application. Figure 8 As shown, the device includes: a pattern acquisition module 810, a color judgment module 820 and a color conversion module 830.

[0096] The pattern acquisition module 810 is used to acquire the special effect pattern of the target event when a trigger instruction of the target event in the game is detected;

[0097] A color judgment module 820, configured to judge whether the rendering color of the special effect pattern is within a range of colors to be processed according to the rendering color of the special effect pattern;

[0098] The color conversion module 830 is used to determine whether to convert the rendering color of the special effect pattern according to whether the rendering color is within the range of colors to be processed.

[0099] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the special effects processing method in the above-mentioned game, and will not be repeated here.

[0100] In several embodiments provided in the present application, the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and a part of a module, a program segment or a code contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0101] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0102] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.

Claims

1. A method for processing special effects in a game, characterized in that: include: When a trigger instruction of a target event in the game is detected, a special effect pattern of the target event is obtained, where the target event is an injury event and / or an attack event in the game scene; According to the rendering color of the special effect pattern, determining whether the rendering color is within the range of colors to be processed; Determining whether to transform the rendering color of the special effect pattern according to whether the rendering color is within the range of colors to be processed; Before judging whether the rendering color of the special effect pattern is within the range of colors to be processed according to the rendering color of the special effect pattern, the method includes: According to the custom color of the first area of ​​the special effect pattern in the editor, the basic color of the first area is replaced by the custom color to calculate the rendering color of the first area of ​​the special effect pattern; The rendering color of the second area of ​​the special effect pattern is calculated according to the basic color of the second area of ​​the special effect pattern; the rendering color of the special effect pattern includes the rendering color of the first area and the rendering color of the second area.

2. The method according to claim 1, characterized in that The step of judging whether the rendered color is within a to-be-processed color range according to the rendered color of the special effect pattern includes: According to the hue value of the rendered color, it is determined whether the hue value is within a range of a color to be processed.

3. The method according to claim 2, characterized in that Before judging whether the hue value of the rendered color is within the range of the color to be processed according to the hue value of the rendered color, the method further comprises: Convert the rendered color from the original RGB color space to the HSV color space; The hue value of the rendered color is extracted from the HSV color space.

4. The method according to claim 1, characterized in that: The determining whether to transform the rendering color of the special effect pattern according to whether the rendering color is within the range of colors to be processed includes: If the rendered color is within the color range to be processed, converting the rendered color of the special effect pattern into a target color that is not within the color range to be processed; The special effect pattern is displayed according to the target color.

5. The method according to claim 4, characterized in that If the rendered color is within the color range to be processed, converting the rendered color of the special effect pattern into a target color that is not within the color range to be processed includes: If the hue value of the rendered color is within the range of the color to be processed, transforming the hue value of the special effect pattern into a hue target value that is not within the range of the color to be processed; The hue target value, the saturation and the lightness components of the rendering color are converted into an RGB color space to obtain a target color.

6. A special effect processing device in a game, characterized in that: include: A pattern acquisition module, for acquiring a special effect pattern of a target event in the game when a trigger instruction of the target event is detected, wherein the target event is an injury event and / or an attack event in the game scene; A color judgment module, used for judging whether the rendered color is within the range of colors to be processed according to the rendered color of the special effect pattern; A color conversion module, used for determining whether to convert the rendering color of the special effect pattern according to whether the rendering color is within the range of colors to be processed; The color judgment module is specifically used to calculate the rendering color of the first area of ​​the special effect pattern according to the custom color of the first area of ​​the special effect pattern in the editor, using the custom color to replace the basic color of the first area; The rendering color of the second area of ​​the special effect pattern is calculated according to the basic color of the second area of ​​the special effect pattern; the rendering color of the special effect pattern includes the rendering color of the first area and the rendering color of the second area.

7. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to execute the special effects processing method in the game described in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program can be executed by a processor to complete the special effect processing method in a game as described in any one of claims 1-5.