WO2020133894A1 - Method and apparatus for displaying aiming region of game weapon, and electronic device - Google Patents

Method and apparatus for displaying aiming region of game weapon, and electronic device Download PDF

Info

Publication number
WO2020133894A1
WO2020133894A1 PCT/CN2019/088140 CN2019088140W WO2020133894A1 WO 2020133894 A1 WO2020133894 A1 WO 2020133894A1 CN 2019088140 W CN2019088140 W CN 2019088140W WO 2020133894 A1 WO2020133894 A1 WO 2020133894A1
Authority
WO
WIPO (PCT)
Prior art keywords
area
cast
game
coordinate system
obstacle
Prior art date
Application number
PCT/CN2019/088140
Other languages
French (fr)
Chinese (zh)
Inventor
钟伟
Original Assignee
北京金山安全软件有限公司
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 北京金山安全软件有限公司 filed Critical 北京金山安全软件有限公司
Publication of WO2020133894A1 publication Critical patent/WO2020133894A1/en

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/20Input arrangements for video game devices
    • A63F13/21Input arrangements for video game devices characterised by their sensors, purposes or types
    • A63F13/219Input arrangements for video game devices characterised by their sensors, purposes or types for aiming at specific areas on the display, e.g. light-guns
    • 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/40Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment
    • A63F13/42Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment by mapping the input signals into game commands, e.g. mapping the displacement of a stylus on a touch screen to the steering angle of a virtual vehicle
    • A63F13/426Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment by mapping the input signals into game commands, e.g. mapping the displacement of a stylus on a touch screen to the steering angle of a virtual vehicle involving on-screen location information, e.g. screen coordinates of an area at which the player is aiming with a light gun
    • 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/80Special adaptations for executing a specific game genre or game mode
    • A63F13/837Shooting of targets

Definitions

  • the present application relates to the technical field of computer technology, and in particular to a method, device and electronic device for displaying an aiming area of a game weapon.
  • the aiming area of the game weapon can be displayed in the game scene to remind the game player of the area of the game weapon to be cast, thereby improving the hit rate of the game player to hit the enemy.
  • each game weapon will have a skill effect, and the entire area where the skill effect will be displayed is called the area of the game weapon to be cast.
  • the inventor found that when the game weapon is aimed in the direction where there is an obstacle, the displayed aiming area can still only prompt the area of the game weapon to be cast, but cannot prompt the game player: when the game When the skill effect of the weapon encounters an obstacle, the effective area of the game's weapon casting. In this way, the hit rate of the game player hitting the enemy is affected, which reduces the game player's game experience.
  • the purpose of the embodiments of the present application is to provide a method, device and electronic device for displaying the aiming area of a game weapon, so as to be able to prompt the game player of the effective area of the game weapon's casting, so as to further improve the hit rate of the game player hitting the enemy, and Improve the gaming experience for gamers.
  • the specific technical solutions are as follows:
  • an embodiment of the present application provides a method for displaying an aiming area of a game weapon.
  • the method may include:
  • the effective casting area of the game weapon is determined as the aiming area
  • the step of determining the effective casting area of the game weapon as the aiming area according to the position of the game character in the game scene, the area to be cast and the obstacle area may include:
  • the pole position of the polar coordinate system is: game The position of the character in the game scene; in a rectangular coordinate system, the X axis represents the polar angle and the Y axis represents the polar diameter;
  • the area starting from the boundary of the second area and along the positive direction of the Y axis is determined as the blocking area
  • the target area in the first area without the blocking area is mapped into the polar coordinate system to obtain the effective casting area of the game weapon, and the effective casting area is used as the aiming area.
  • the step of determining the area starting from the boundary of the second area and along the positive direction of the Y axis as the blocking area may include:
  • each boundary line on the X axis Based on the value range of each boundary line on the X axis, mark the area starting from the first type of boundary line and along the positive direction of the Y axis as a blocking area; where, when a boundary line of the second area is on the X axis When the value range is covered by the value range of another boundary line in the second region on the X axis, the other boundary line is the first type boundary line.
  • the area to be cast and the obstacle area in the polar coordinate system are mapped to the rectangular coordinate system to obtain the first area corresponding to the area to be cast and the second corresponding to the obstacle area
  • the regional steps can include:
  • the area to be cast and the obstacle area in the polar coordinate system are mapped to the rectangular coordinate system to obtain the first area corresponding to the area to be cast and the corresponding
  • the steps in the second area include:
  • the area to be cast and the polygon area in the polar coordinate system are mapped to the rectangular coordinate system to obtain the first area corresponding to the area to be cast and the second area corresponding to the polygon area.
  • the area to be cast and the obstacle area in the polar coordinate system are mapped to the rectangular coordinate system to obtain the first area corresponding to the area to be cast and the corresponding
  • the steps in the second area may include:
  • the area to be cast and the obstacle area in the polar coordinate system are mapped to the rectangular coordinate system to obtain the first area corresponding to the area to be cast and the second area corresponding to the obstacle area.
  • the area to be cast and the obstacle area in the polar coordinate system are mapped to the rectangular coordinate system to obtain the first area corresponding to the area to be cast and the corresponding
  • the steps in the second area may include:
  • the target area of the first area where the blocking area is removed is mapped into a polar coordinate system to obtain a cast weapon effective area of the game weapon, and the cast effective area is used as a step of the aiming area,
  • Can include:
  • the target area after the highlight rendering is mapped into the polar coordinate system to obtain the cast effective area, and the cast effective area is used as the aiming area.
  • the step of determining the to-be-casted area of the game weapon in the game scene and the obstacle area in the to-be-casted area may include:
  • the area to be cast may include: a fan ring to be cast area, a rectangular to be cast area, or a ring to be cast area.
  • an aiming area display device for game weapons which may include:
  • the first determining module is used to determine the to-be-casted area and the obstacle area in the to-be-casted area of the game weapon in the game scene;
  • the second determination module is used to determine the effective casting area of the game weapon as the aiming area according to the position of the game character in the game scene, the area to be cast and the obstacle area;
  • the display module is used to display the aiming area in the game scene.
  • the second determination module may include:
  • the first mapping unit is used to map the area to be cast and the obstacle area in the polar coordinate system to the rectangular coordinate system to obtain the first area corresponding to the area to be cast and the second area corresponding to the obstacle area; wherein, the polar coordinates
  • the pole position of the system is: the position of the game character in the game scene; in the rectangular coordinate system, the X axis represents the polar angle and the Y axis represents the polar diameter;
  • the second mapping unit is used to map the target area of the first area without the blocking area into the polar coordinate system to obtain the effective casting area of the game weapon, and use the effective casting area as the aiming area.
  • the first determining unit may specifically be used for:
  • each boundary line on the X axis Based on the value range of each boundary line on the X axis, mark the area starting from the first type of boundary line and along the positive direction of the Y axis as a blocking area; where, when a boundary line of the second area is on the X axis When the value range is covered by the value range of another boundary line in the second region on the X axis, the other boundary line is the first type boundary line.
  • the judgment subunit is used to judge whether the obstacle area is a polygonal area
  • the first mapping subunit is used to map the area to be cast and the obstacle area in the polar coordinate system to the rectangular coordinate system when the obstacle area is a polygonal area to obtain the correspondence between the first area corresponding to the area to be cast and the obstacle area The second area.
  • the first mapping unit may include:
  • the judgment subunit is used to judge whether the obstacle area is a polygonal area
  • the processing subunit is used to process the obstacle area into a polygonal area when the obstacle area is not a polygonal area;
  • the second mapping subunit is used to map the area to be cast and the polygon area in the polar coordinate system to the rectangular coordinate system to obtain the first area corresponding to the area to be cast and the second area corresponding to the polygon area.
  • the area to be cast and the obstacle area in the polar coordinate system are mapped to the rectangular coordinate system to obtain the first area corresponding to the area to be cast and the second area corresponding to the obstacle area.
  • the first mapping unit may specifically be used for:
  • the second mapping unit may include:
  • the removal subunit is used to map the target area in the first area to remove the blocking area into the polar coordinate system to obtain the effective area for casting;
  • the second mapping unit may include:
  • the third mapping subunit is used to map the target area after the highlight rendering to the polar coordinate system to obtain the cast effective area, and use the cast effective area as the aiming area.
  • the first determining module may include:
  • the second determining unit is used to determine the area of the game weapon to be cast in the game scene according to the position of the game character in the game scene and the direction pointed by the aiming instruction;
  • the third determining unit is used to determine the obstacle area in the area to be cast according to the position of each obstacle in the game scene.
  • Memory used to store computer programs
  • the processor when used to execute the program stored in the memory, implements the method steps of any of the above-mentioned aiming area display methods of the game weapon.
  • an embodiment of the present application provides a readable storage medium in which a computer program is stored.
  • the computer program is executed by a processor, the method steps of any of the above-mentioned aiming area display methods for game weapons are implemented.
  • an embodiment of the present application further provides a computer program product which, when it runs on an electronic device, causes the electronic device to perform: the method steps of any one of the above-mentioned aiming area display methods of game weapons.
  • the electronic device can obtain the aiming instruction of the game weapon used by the game character, and then can determine the game weapon in the game scene to be cast area and the obstacle area in the game cast area. Then, the effective cast area of the game weapon in the area to be cast may be determined according to the position of the game character in the game scene and the determined area to be cast and the obstacle area. And take the effective area of the cast as the aiming area. Then, the aiming area can be displayed in the game scene. In this way, the game player can be prompted with the effective area of the game weapon casting spell, which can further improve the hit rate of the game player to hit the enemy and improve the game player's game experience.
  • FIG. 1 is a flowchart of a method for displaying an aiming area of a game weapon according to an embodiment of the present application
  • FIG. 3 is a schematic diagram of an area to be cast and an obstacle area in a polar coordinate system provided by an embodiment of the present application;
  • FIG. 4 is a schematic diagram of a first area and a second area obtained after mapping the area to be cast and the obstacle area shown in FIG. 3 to a rectangular coordinate system;
  • FIG. 6 is a schematic diagram of the cast-ineffective area removed from the aiming area shown in FIG. 5;
  • FIG. 7 is a schematic structural diagram of an aiming area display device for a game weapon provided by an embodiment of this application.
  • the method for displaying the aiming area of the game weapon can be applied to electronic devices.
  • the electronic device includes but is not limited to computers, smart phones and smart watches. Among them, game players can play games through the game client installed in the electronic device, and can also enter online games through a browser, which is reasonable.
  • S102 Determine the game weapon in the game area to be cast and the obstacle area in the area to be cast;
  • the area to be cast includes but is not limited to: a fan ring to be cast area, a rectangular to be cast area or a ring to be cast area.
  • the area to be cast in the fan ring refers to the area to be cast in the shape of a fan ring.
  • the rectangular area to be cast refers to: a rectangular shape to be cast;
  • the circular area to be cast refers to: a circular shape to be cast.
  • the aiming area may be displayed in the area to be cast in the game scene.
  • the game player can be prompted with the effective area for casting the weapon of the game, so that the game player can accurately determine the actual attack area of the game weapon, thereby improving the hit rate of the game player to hit the enemy.
  • the aiming area can be displayed by displaying a layer or an animation in the aiming area, of course, it is not limited to this.
  • the electronic device can obtain the aiming instruction of the game weapon used by the game character, and then can determine the game weapon in the game scene to be cast area and the obstacle area in the game cast area. Then, the effective cast area of the game weapon in the area to be cast may be determined according to the position of the game character in the game scene and the determined area to be cast and the obstacle area. And take the effective area of the cast as the aiming area. Then, the aiming area can be displayed in the game scene. In this way, the game player can be prompted with the effective area of the game weapon casting spell, which can further improve the hit rate of the game player to hit the enemy and improve the game player's game experience.
  • the to-be-casted area of the game weapon is the fan ring cast area as shown in FIG. 3, and, in the game scene, the obstacle area in the fan ring cast area is the area where the rectangular EFGH is located. Then, the position of the game character in the game scene can be used as the pole position to construct a polar coordinate system as shown in FIG. 3.
  • an angle formed by one boundary line of the fan ring casting area and the polar axis is ⁇
  • an angle formed by another boundary line of the fan ring casting area and the polar axis is ⁇ .
  • the area to be cast and the obstacle area in the polar coordinate system can be mapped to the rectangular coordinate system to obtain the first area corresponding to the area to be cast and the second area efgh corresponding to the obstacle area as shown in FIG. 4.
  • the shape of the fan ring can be converted into a rectangle for processing.
  • the X axis represents a polar angle
  • the Y axis represents a polar diameter.
  • the area of the fan ring to be cast and the obstacle area in the polar coordinate system can be mapped to the rectangular coordinate system by homogeneous coordinate transformation. Specifically, each point on the boundary line between the area to be cast by the fan ring and the obstacle area can be mapped into a rectangular coordinate system through homogeneous coordinate transformation.
  • the obstacle area is a polygonal area before mapping the area to be cast and the obstacle area in the polar coordinate system to the rectangular coordinate system. If it is a polygonal area, the area to be cast and the obstacle area in the polar coordinate system can be directly mapped to the rectangular coordinate system, so that the first area corresponding to the area to be cast and the second area corresponding to the obstacle area can be obtained.
  • the area to be cast in the polar coordinate system and the obstacle area can also be marked to the pixel map of the rectangular coordinate system to obtain the first area corresponding to the area to be cast recorded in the marked picture and the second corresponding to the obstacle area area. That is, the obtained first area and second area are presented in the form of pictures, and the first area includes the second area.
  • the picture can be stored in the video memory, so that the speed of acquiring the picture can be increased, which is convenient for subsequent calculation or rendering of the picture.
  • S1032 The area starting from the boundary of the second area and along the positive direction of the Y axis is determined as the blocking area
  • the second area efgh is the area that the game weapon cannot attack, and the area blocked by the boundary lines ef, gh, fg, and eh of the second area is also the game weapon that cannot be attacked.
  • Area the area efmn starting from the boundary lines ef, gh, fg, and eh of the second area and along the positive direction of the Y axis can be determined as the blocking area. In this way, an accurate blocking area can be calculated.
  • the value range of each boundary line of the second area on the X axis may also be determined first. Then, based on the value range of each boundary line on the X axis, a region starting from the first type boundary line and along the positive direction of the Y axis is marked as a blocking region. Wherein, when the value range of one boundary line of the second area on the X axis is covered by the value range of another boundary line of the second area on the X axis, the other boundary line is the first type of boundary line.
  • the value range of one boundary line L1 on the X axis is [1,2]
  • the value range of the other boundary line L2 on the X axis is [1, 3]. Then, the value range of the boundary line L1 on the X axis is covered by the value range of another boundary line L2 on the X axis.
  • the boundary line ef of the second area efgh is the first type of boundary line, that is to say, in this way, only the area starting from the boundary line ef and along the positive direction of the Y axis needs to be marked in the first area
  • the blocking area efmn is obtained, which greatly reduces the amount of calculation.
  • S1033 Map the target area in the first area where the blocking area is removed to the polar coordinate system to obtain the effective casting area of the game weapon, and use the effective casting area as the aiming area.
  • the target area in the first area where the blocking area is removed can be mapped into a polar coordinate system, so as to obtain a cast effective area. Then, you can highlight the effective area of the cast to get the aiming area.
  • the target area in the first area where the blocking area is removed can be highlighted. Then, the target area after the highlight rendering is mapped into the polar coordinate system, thereby obtaining the cast effective area.
  • the rendering method is not limited to highlight rendering, but may also be gradient rendering, of course, it is not limited to this.
  • the calculated blocking area is accurate, the cast effective area determined after the coordinate system conversion is also accurate.
  • the content in the first quadrant of FIG. 4 can be represented on a picture (marked as a sticker).
  • the picture can also be superimposed with the art picture to obtain a superimposed picture.
  • the shape and size of the art picture are consistent with the shape and size of the texture picture, and the aiming display effect is rendered in the art picture.
  • the blocking area in the superimposed picture can be set to transparent through the mask technology. In this way, when the superimposed picture is mapped into the polar coordinate system, the effective casting area of the game weapon can be determined, that is, the aiming area can be determined.
  • the pixels in the area corresponding to the blocking area in the art picture may be directly cut out to obtain the processed picture. Then, when the processed picture is mapped into the polar coordinate system, the cast effective area of the game weapon may be determined, and the cast effective area may be used as the aiming area.
  • the target area After determining the target area, the target area can be displayed in the area to be cast in the game scene.
  • the aiming area shown in FIG. 5 can be obtained.
  • the aiming area is an area obtained by removing the invalid attack area shown in FIG. 6 in the area to be cast by the fan ring.
  • the two boundary lines of the boxes shown in Figure 5 of AB and CD are included.
  • the game player can be prompted with the effective area for casting the weapon of the game, so that the game player can accurately determine the actual attack area of the game weapon, thereby further improving the hit rate of the game player to hit the enemy and improving the game player's game experience.
  • the obtaining module 701 is used to obtain the aiming instruction of the game weapon used by the game character;
  • the first determining module 702 is used to determine the area of the game weapon to be cast in the game scene and the area of obstacles in the area to be cast;
  • the second determination module 703 is used to determine the effective casting area of the game weapon as the aiming area according to the position of the game character in the game scene, the area to be cast and the obstacle area;
  • the display module 704 is used to display the aiming area in the area to be cast in the game scene.
  • the electronic device can obtain the aiming instruction of the game weapon used by the game character, and then can determine the game weapon's to-be-casted area in the game scene and the obstacle-tolerated area in the to-be-casted area. Then, the effective cast area of the game weapon in the area to be cast may be determined according to the position of the game character in the game scene and the determined area to be cast and the obstacle area. And take the effective area of the cast as the aiming area. Then, the aiming area can be displayed in the game scene. In this way, the game player can be prompted with the effective area of the game weapon casting spell, which can further improve the hit rate of the game player to hit the enemy and improve the game player's game experience.
  • the second determination module 703 may include:
  • the second mapping unit is used to map the target area of the first area without the blocking area into the polar coordinate system to obtain the effective casting area of the game weapon, and use the effective casting area as the aiming area.
  • the first determining unit may specifically be used for:
  • the first mapping unit may include:
  • the judgment subunit is used to judge whether the obstacle area is a polygonal area
  • the processing subunit is used to process the obstacle area into a polygonal area when the obstacle area is not a polygonal area;
  • the second mapping subunit is used to map the area to be cast and the polygon area in the polar coordinate system to the rectangular coordinate system to obtain the first area corresponding to the area to be cast and the second area corresponding to the polygon area.
  • the first mapping unit may specifically be used for:
  • the area to be cast and the obstacle area in the polar coordinate system are mapped to the rectangular coordinate system to obtain the first area corresponding to the area to be cast and the second area corresponding to the obstacle area.
  • the first mapping unit is specifically used to:
  • the removal subunit is used to map the target area in the first area to remove the blocking area into the polar coordinate system to obtain the effective area for casting;
  • the first rendering subunit is used for highlight rendering of the effective casting area to obtain the aiming area.
  • a second rendering subunit used for highlight rendering of the target area in the first area where the blocking area is removed
  • the second determining unit is used to determine the area of the game weapon to be cast in the game scene according to the position of the game character in the game scene and the direction pointed by the aiming instruction;
  • the third determining unit is used to determine the obstacle area in the area to be cast according to the position of each obstacle in the game scene.
  • the area to be cast may include: a fan ring to be cast area, a rectangular to be cast area, or a ring to be cast area.
  • an embodiment of the present application further provides an electronic device, referring to FIG. 8, including a processor 801, a communication interface 802, a memory 803, and a communication bus 804, where the processor 801, the communication interface 802, and the memory 803 communicate with each other through the communication bus 804;
  • Memory 803 used to store computer programs
  • the processor 801 is used to implement the method steps of any one of the method for displaying the aiming area of the game weapon when executing the program stored in the memory 803.
  • the electronic device can obtain the aiming instruction of the game weapon used by the game character, and then can determine the game weapon in the game scene to be cast area and the obstacle area in the game cast area. Then, the effective cast area of the game weapon in the area to be cast may be determined according to the position of the game character in the game scene and the determined area to be cast and the obstacle area. And take the effective area of the cast as the aiming area. Then, the aiming area can be displayed in the game scene. In this way, the game player can be prompted with the effective area of the game weapon casting spell, which can further improve the hit rate of the game player to hit the enemy and improve the game player's game experience.
  • an embodiment of the present application further provides a readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the aiming area display method of any one of the above game weapons Method steps.
  • the readable storage medium is a computer-readable storage medium.
  • the electronic device can obtain the aiming instruction of the game weapon used by the game character, and then can determine the game weapon's pending in the game scene The obstacle area in the cast area and the area to be cast. Then, the effective cast area of the game weapon in the area to be cast may be determined according to the position of the game character in the game scene and the determined area to be cast and the obstacle area. And take the effective area of the cast as the aiming area. Then, the aiming area can be displayed in the game scene. In this way, the game player can be prompted with the effective area of the game weapon casting spell, which can further improve the hit rate of the game player to hit the enemy and improve the game player's game experience.
  • an embodiment of the present application further provides a computer program product that, when it runs on an electronic device, causes the electronic device to perform: the method steps of any of the above-mentioned aiming area display methods of game weapons.
  • the electronic device can obtain the aiming instruction of the game weapon used by the game character, and then can determine the area to be cast and the area to be cast in the game scene of the game weapon The obstacle area in the. Then, the effective cast area of the game weapon in the area to be cast may be determined according to the position of the game character in the game scene and the determined area to be cast and the obstacle area. And take the effective area of the cast as the aiming area. Then, the aiming area can be displayed in the game scene. In this way, the game player can be prompted with the effective area of the game weapon casting spell, which can further improve the hit rate of the game player to hit the enemy and improve the game player's game experience.
  • the communication interface is used for communication between the electronic device and other devices.
  • the aforementioned processor may be a general-purpose processor, including a central processor (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; it may also be a digital signal processor (Digital Signal Processing, DSP), dedicated integration Circuit (Application Specific Integrated Circuit, ASIC), field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
  • a central processor Central Processing Unit, CPU
  • NP Network Processor
  • DSP Digital Signal Processing
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a dedicated computer, a computer network, or other programmable devices.

Landscapes

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

Abstract

Provided is a method for displaying an aiming region of a game weapon. The method comprises: acquiring an aiming indication of the game weapon used by a game character (s101); determining a region affected by the game weapon in a game scene and a barrier region in the affected region (s102); on the basis of a location of the game character in the game scene, the affected region, and the barrier region, determining a valid region affected by the game weapon to be an aiming region (s103); and displaying the aiming region in the game scene (s104). Further provided are a display apparatus for a game weapon and an electronic device implementing the method. The method indicates to a player a valid region affected by a game weapon, such that the likelihood of the player hitting an enemy can be further increased.

Description

一种游戏武器的瞄准区域显示方法、装置及电子设备Method, device and electronic equipment for displaying aiming area of game weapon
本申请要求于2018年12月28日提交中国专利局、申请号为2018116239487、发明名称为“一种游戏武器的瞄准区域显示方法、装置及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application requires the priority of the Chinese patent application submitted to the China Patent Office on December 28, 2018, with the application number 2018116239487 and the invention titled "A method, device and electronic device for targeting area display of a game weapon", all of its content Incorporated by reference in this application.
技术领域Technical field
本申请涉及计算机技术技术领域,特别是涉及一种游戏武器的瞄准区域显示方法、装置及电子设备。The present application relates to the technical field of computer technology, and in particular to a method, device and electronic device for displaying an aiming area of a game weapon.
背景技术Background technique
目前,可以在游戏场景中显示游戏武器的瞄准区域,以向游戏玩家提示游戏武器的待施法区域,从而提高游戏玩家击中敌人的命中率。其中,在游戏中,每种游戏武器会有一个技能效果,将要显示该技能效果的全部区域叫做该游戏武器的待施法区域。Currently, the aiming area of the game weapon can be displayed in the game scene to remind the game player of the area of the game weapon to be cast, thereby improving the hit rate of the game player to hit the enemy. Among them, in the game, each game weapon will have a skill effect, and the entire area where the skill effect will be displayed is called the area of the game weapon to be cast.
发明人在实现本申请的过程中发现,当游戏武器向存在障碍物的方向瞄准时,所显示的瞄准区域仍然只能提示该游戏武器的待施法区域,而无法向游戏玩家提示:当该游戏武器的技能效果遇到障碍物时,该游戏武器的施法有效区域。这样,使得游戏玩家击中敌人的命中率受到影响,降低了游戏玩家的游戏体验。During the process of implementing the present application, the inventor found that when the game weapon is aimed in the direction where there is an obstacle, the displayed aiming area can still only prompt the area of the game weapon to be cast, but cannot prompt the game player: when the game When the skill effect of the weapon encounters an obstacle, the effective area of the game's weapon casting. In this way, the hit rate of the game player hitting the enemy is affected, which reduces the game player's game experience.
发明内容Summary of the invention
本申请实施例的目的在于提供一种游戏武器的瞄准区域显示方法、装置及电子设备,以可以向游戏玩家提示游戏武器的施法有效区域,从而可以进一步提高游戏玩家击中敌人的命中率,并提高游戏玩家的游戏体验。具体技术方案如下:The purpose of the embodiments of the present application is to provide a method, device and electronic device for displaying the aiming area of a game weapon, so as to be able to prompt the game player of the effective area of the game weapon's casting, so as to further improve the hit rate of the game player hitting the enemy, and Improve the gaming experience for gamers. The specific technical solutions are as follows:
第一方面,本申请实施例提供了一种游戏武器的瞄准区域显示方法,该方法可以包括:In a first aspect, an embodiment of the present application provides a method for displaying an aiming area of a game weapon. The method may include:
获取游戏角色使用的游戏武器的瞄准指示;Obtain the aiming instruction of the game weapon used by the game character;
确定游戏武器在游戏场景中的待施法区域和待施法区域中的障碍物区域;Determine the area of the game weapon to be cast in the game scene and the area of obstacles in the area to be cast;
根据游戏角色在游戏场景中的位置、待施法区域和障碍物区域,确定游戏武器的施法有效区域作为瞄准区域;According to the position of the game character in the game scene, the area to be cast and the area of obstacles, the effective casting area of the game weapon is determined as the aiming area;
在游戏场景中显示瞄准区域。Show the aiming area in the game scene.
可选地,在本申请实施例中,根据游戏角色在游戏场景中的位置、待施法区域和障碍物区域,确定游戏武器的施法有效区域作为瞄准区域的步骤,可以包括:Optionally, in the embodiment of the present application, the step of determining the effective casting area of the game weapon as the aiming area according to the position of the game character in the game scene, the area to be cast and the obstacle area may include:
将极坐标系中的待施法区域和障碍物区域映射至直角坐标系中,得到待施法区域对应的第一区域和障碍物区域对应的第二区域;其中,极坐标系的极点位置为:游戏角色在游戏场景中的位置;在直角坐标系中,X轴表示极角,Y轴表示极径;Map the area to be cast and the obstacle area in the polar coordinate system to the rectangular coordinate system to obtain the first area corresponding to the area to be cast and the second area corresponding to the obstacle area; where the pole position of the polar coordinate system is: game The position of the character in the game scene; in a rectangular coordinate system, the X axis represents the polar angle and the Y axis represents the polar diameter;
将从第二区域的边界线开始并沿着Y轴正方向的区域,确定为阻挡区域;The area starting from the boundary of the second area and along the positive direction of the Y axis is determined as the blocking area;
将第一区域中去除阻挡区域的目标区域映射到极坐标系中,得到游戏武器的施法有效区域,并将施法有效区域作为瞄准区域。The target area in the first area without the blocking area is mapped into the polar coordinate system to obtain the effective casting area of the game weapon, and the effective casting area is used as the aiming area.
可选地,在本申请实施例中,将从第二区域的边界线开始并沿着Y轴正方向的区域,确定为阻挡区域的步骤,可以包括:Optionally, in the embodiment of the present application, the step of determining the area starting from the boundary of the second area and along the positive direction of the Y axis as the blocking area may include:
确定第二区域的各条边界线在X轴上的取值范围;Determine the value range of each boundary line of the second area on the X axis;
基于各条边界线在X轴上的取值范围,标记从第一类边界线开始并沿着Y轴正方向的区域,作为阻挡区域;其中,当第二区域的一条边界线在X轴上取值范围被第二区域的另一条边界线在X轴上的取值范围覆盖时,另一条边界线为第一类边界线。Based on the value range of each boundary line on the X axis, mark the area starting from the first type of boundary line and along the positive direction of the Y axis as a blocking area; where, when a boundary line of the second area is on the X axis When the value range is covered by the value range of another boundary line in the second region on the X axis, the other boundary line is the first type boundary line.
可选地,在本申请的一个实施例中,将极坐标系中的待施法区域和障碍物区域映射至直角坐标系中,得到待施法区域对应的第一区域和障碍物区域对应的第二区域的步骤,可以包括:Optionally, in an embodiment of the present application, the area to be cast and the obstacle area in the polar coordinate system are mapped to the rectangular coordinate system to obtain the first area corresponding to the area to be cast and the second corresponding to the obstacle area The regional steps can include:
判断障碍物区域是否为多边形区域;Determine whether the obstacle area is a polygonal area;
若为多边形区域,将极坐标系中的待施法区域和障碍物区域映射至直角坐标系中,得到待施法区域对应的第一区域和障碍物区域对应的第二区域。If it is a polygonal area, map the area to be cast and the obstacle area in the polar coordinate system to the rectangular coordinate system to obtain the first area corresponding to the area to be cast and the second area corresponding to the obstacle area.
可选地,在本申请的另一个实施例中,将极坐标系中的待施法区域和障碍物区域映射至直角坐标系中,得到待施法区域对应的第一区域和障碍物区域对应的第二区域的步骤,包括:Optionally, in another embodiment of the present application, the area to be cast and the obstacle area in the polar coordinate system are mapped to the rectangular coordinate system to obtain the first area corresponding to the area to be cast and the corresponding The steps in the second area include:
判断障碍物区域是否为多边形区域;Determine whether the obstacle area is a polygonal area;
若不为多边形区域,将障碍物区域处理为多边形区域;If it is not a polygonal area, treat the obstacle area as a polygonal area;
将极坐标系中的待施法区域和多边形区域映射至直角坐标系中,得到待施法区域对应的第一区域和多边形区域对应的第二区域。The area to be cast and the polygon area in the polar coordinate system are mapped to the rectangular coordinate system to obtain the first area corresponding to the area to be cast and the second area corresponding to the polygon area.
可选地,在本申请的又一个实施例中,将极坐标系中的待施法区域和障碍物区域映射至直角坐标系中,得到待施法区域对应的第一区域和障碍物区域对应的第二区域的步骤,可以包括:Optionally, in yet another embodiment of the present application, the area to be cast and the obstacle area in the polar coordinate system are mapped to the rectangular coordinate system to obtain the first area corresponding to the area to be cast and the corresponding The steps in the second area may include:
通过齐次坐标变换,将极坐标系中的待施法区域和障碍物区域映射至直角坐标系中,得到待施法区域对应的第一区域和障碍物区域对应的第二区域。Through homogeneous coordinate transformation, the area to be cast and the obstacle area in the polar coordinate system are mapped to the rectangular coordinate system to obtain the first area corresponding to the area to be cast and the second area corresponding to the obstacle area.
可选地,在本申请的又一个实施例中,将极坐标系中的待施法区域和障碍物区域映射至直角坐标系中,得到待施法区域对应的第一区域和障碍物区域对应的第二区域的步骤,可以包括:Optionally, in yet another embodiment of the present application, the area to be cast and the obstacle area in the polar coordinate system are mapped to the rectangular coordinate system to obtain the first area corresponding to the area to be cast and the corresponding The steps in the second area may include:
将极坐标系中的待施法区域和障碍物区域标注到直角坐标系的像素图中,得到标注图片中记录的、待施法区域对应的第一区域和障碍物区域对应的第二区域。Mark the area to be cast in the polar coordinate system and the obstacle area to the pixel map of the rectangular coordinate system to obtain the first area corresponding to the area to be cast recorded in the marked picture and the second area corresponding to the obstacle area.
可选地,在本申请的一个实施例中,将第一区域中去除阻挡区域的目标区域映射到极坐标系中,得到游戏武器的施法有效区域,并将施法有效区域作为瞄准区域的步骤,可以包括:Optionally, in an embodiment of the present application, the target area of the first area where the blocking area is removed is mapped into a polar coordinate system to obtain a cast weapon effective area of the game weapon, and the cast effective area is used as a step of the aiming area, Can include:
将第一区域中去除阻挡区域的目标区域映射到极坐标系中,得到施法有效区域;Map the target area in the first area to remove the blocking area into the polar coordinate system to obtain the effective area of casting;
对施法有效区域进行高亮渲染,得到瞄准区域。Highlight the rendering effective area, get the aiming area.
可选地,在本申请的另一个实施例中,将第一区域中去除阻挡区域的目标区域映射到极坐标系中,得到游戏武器的施法有效区域,并将施法有效区域作为瞄准区域的步骤,可以包括:Optionally, in another embodiment of the present application, the target area in the first area where the blocking area is removed is mapped to a polar coordinate system to obtain a cast weapon effective area of the game weapon, and the cast effective area is used as the aiming area step , Which can include:
将第一区域中去除阻挡区域的目标区域进行高亮渲染;Highlight and render the target area in the first area without the blocking area;
将进行高亮渲染后的目标区域映射到极坐标系中,得到施法有效区域,并将施法有效区域作为瞄准区域。The target area after the highlight rendering is mapped into the polar coordinate system to obtain the cast effective area, and the cast effective area is used as the aiming area.
可选地,在本申请实施例中,确定游戏武器在游戏场景中的待施法区域和待施法区域中的障碍物区域的步骤,可以包括:Optionally, in the embodiment of the present application, the step of determining the to-be-casted area of the game weapon in the game scene and the obstacle area in the to-be-casted area may include:
根据游戏角色在游戏场景中的位置和瞄准指示所指向的方向,确定游戏武器在游戏场景中的待施法区域;According to the position of the game character in the game scene and the direction pointed by the aiming instruction, determine the area of the game weapon to be cast in the game scene;
根据游戏场景中各个障碍物的位置,确定待施法区域中的障碍物区域。According to the position of each obstacle in the game scene, determine the obstacle area in the area to be cast.
可选地,在本申请实施例中,待施法区域可以包括:扇环待施法区域、矩形待施法区域或圆环待施法区域。Optionally, in the embodiment of the present application, the area to be cast may include: a fan ring to be cast area, a rectangular to be cast area, or a ring to be cast area.
第二方面,本申请实施例还提供了一种游戏武器的瞄准区域显示装置,该装置可以包括:In a second aspect, an embodiment of the present application further provides an aiming area display device for game weapons, which may include:
获取模块,用于获取游戏角色使用的游戏武器的瞄准指示;The acquisition module is used to obtain the aiming instruction of the game weapon used by the game character;
第一确定模块,用于确定游戏武器在游戏场景中的待施法区域和待施法区域中的障碍物区域;The first determining module is used to determine the to-be-casted area and the obstacle area in the to-be-casted area of the game weapon in the game scene;
第二确定模块,用于根据游戏角色在游戏场景中的位置、待施法区域和障碍物区域,确定游戏武器的施法有效区域作为瞄准区域;The second determination module is used to determine the effective casting area of the game weapon as the aiming area according to the position of the game character in the game scene, the area to be cast and the obstacle area;
显示模块,用于在游戏场景中显示瞄准区域。The display module is used to display the aiming area in the game scene.
可选地,在本申请实施例中,第二确定模块可以包括:Optionally, in the embodiment of the present application, the second determination module may include:
第一映射单元,用于将极坐标系中的待施法区域和障碍物区域映射至直角坐标系中,得到待施法区域对应的第一区域和障碍物区域对应的第二区域;其中,极坐标系的极点位置为:游戏角色在游戏场景中的位置;在直角坐标系中,X轴表示极角,Y轴表示极径;The first mapping unit is used to map the area to be cast and the obstacle area in the polar coordinate system to the rectangular coordinate system to obtain the first area corresponding to the area to be cast and the second area corresponding to the obstacle area; wherein, the polar coordinates The pole position of the system is: the position of the game character in the game scene; in the rectangular coordinate system, the X axis represents the polar angle and the Y axis represents the polar diameter;
第一确定单元,用于将从第二区域的边界线开始并沿着Y轴正方向的区域,确定为阻挡区域;The first determining unit is used to determine an area starting from the boundary of the second area and along the positive direction of the Y axis as a blocking area;
第二映射单元,用于将第一区域中去除阻挡区域的目标区域映射到极坐标系中,得到游戏武器的施法有效区域,并将施法有效区域作为瞄准区域。The second mapping unit is used to map the target area of the first area without the blocking area into the polar coordinate system to obtain the effective casting area of the game weapon, and use the effective casting area as the aiming area.
可选地,在本申请实施例中,第一确定单元具体可以用于:Optionally, in the embodiment of the present application, the first determining unit may specifically be used for:
确定第二区域的各条边界线在X轴上的取值范围;Determine the value range of each boundary line of the second area on the X axis;
基于各条边界线在X轴上的取值范围,标记从第一类边界线开始并沿着Y轴正方向的区域,作为阻挡区域;其中,当第二区域的一条边界线在X轴上取值范围被第二区域的另一条边界线在X轴上的取值范围覆盖时,另一条边界线为第一类边界线。Based on the value range of each boundary line on the X axis, mark the area starting from the first type of boundary line and along the positive direction of the Y axis as a blocking area; where, when a boundary line of the second area is on the X axis When the value range is covered by the value range of another boundary line in the second region on the X axis, the other boundary line is the first type boundary line.
可选地,在本申请的一个实施例中,第一映射单元可以包括:Optionally, in an embodiment of the present application, the first mapping unit may include:
判断子单元,用于判断障碍物区域是否为多边形区域;The judgment subunit is used to judge whether the obstacle area is a polygonal area;
第一映射子单元,用于当障碍物区域为多边形区域,将极坐标系中的待 施法区域和障碍物区域映射至直角坐标系中,得到待施法区域对应的第一区域和障碍物区域对应的第二区域。The first mapping subunit is used to map the area to be cast and the obstacle area in the polar coordinate system to the rectangular coordinate system when the obstacle area is a polygonal area to obtain the correspondence between the first area corresponding to the area to be cast and the obstacle area The second area.
可选地,在本申请的另一个实施例中,第一映射单元可以包括:Optionally, in another embodiment of the present application, the first mapping unit may include:
判断子单元,用于判断障碍物区域是否为多边形区域;The judgment subunit is used to judge whether the obstacle area is a polygonal area;
处理子单元,用于当障碍物区域不为多边形区域,将障碍物区域处理为多边形区域;The processing subunit is used to process the obstacle area into a polygonal area when the obstacle area is not a polygonal area;
第二映射子单元,用于将极坐标系中的待施法区域和多边形区域映射至直角坐标系中,得到待施法区域对应的第一区域和多边形区域对应的第二区域。The second mapping subunit is used to map the area to be cast and the polygon area in the polar coordinate system to the rectangular coordinate system to obtain the first area corresponding to the area to be cast and the second area corresponding to the polygon area.
可选地,在本申请的又一个实施例中,第一映射单元具体可以用于:Optionally, in yet another embodiment of the present application, the first mapping unit may specifically be used for:
通过齐次坐标变换,将极坐标系中的待施法区域和障碍物区域映射至直角坐标系中,得到待施法区域对应的第一区域和障碍物区域对应的第二区域。Through homogeneous coordinate transformation, the area to be cast and the obstacle area in the polar coordinate system are mapped to the rectangular coordinate system to obtain the first area corresponding to the area to be cast and the second area corresponding to the obstacle area.
可选地,在本申请的又一个实施例中,第一映射单元具体可以用于:Optionally, in yet another embodiment of the present application, the first mapping unit may specifically be used for:
将极坐标系中的待施法区域和障碍物区域标注到直角坐标系的像素图中,得到标注图片中记录的、待施法区域对应的第一区域和障碍物区域对应的第二区域。Mark the area to be cast in the polar coordinate system and the obstacle area to the pixel map of the rectangular coordinate system to obtain the first area corresponding to the area to be cast recorded in the marked picture and the second area corresponding to the obstacle area.
可选地,在本申请的一个实施例中,第二映射单元可以包括:Optionally, in an embodiment of the present application, the second mapping unit may include:
去除子单元,用于将第一区域中去除阻挡区域的目标区域映射到极坐标系中,得到施法有效区域;The removal subunit is used to map the target area in the first area to remove the blocking area into the polar coordinate system to obtain the effective area for casting;
第一渲染子单元,用于对施法有效区域进行高亮渲染,得到瞄准区域。The first rendering subunit is used for highlight rendering of the effective casting area to obtain the aiming area.
可选地,在本申请的另一个实施例中,第二映射单元可以包括:Optionally, in another embodiment of the present application, the second mapping unit may include:
第二渲染子单元,用于将第一区域中去除阻挡区域的目标区域进行高亮渲染;A second rendering subunit, used for highlight rendering of the target area in the first area where the blocking area is removed;
第三映射子单元,用于将进行高亮渲染后的目标区域映射到极坐标系中,得到施法有效区域,并将施法有效区域作为瞄准区域。The third mapping subunit is used to map the target area after the highlight rendering to the polar coordinate system to obtain the cast effective area, and use the cast effective area as the aiming area.
可选地,在本申请实施例中,第一确定模块可以包括:Optionally, in the embodiment of the present application, the first determining module may include:
第二确定单元,用于根据游戏角色在游戏场景中的位置和瞄准指示所指向的方向,确定游戏武器在游戏场景中的待施法区域;The second determining unit is used to determine the area of the game weapon to be cast in the game scene according to the position of the game character in the game scene and the direction pointed by the aiming instruction;
第三确定单元,用于根据游戏场景中各个障碍物的位置,确定待施法区 域中的障碍物区域。The third determining unit is used to determine the obstacle area in the area to be cast according to the position of each obstacle in the game scene.
可选地,在本申请实施例中,待施法区域可以包括:扇环待施法区域、矩形待施法区域或圆环待施法区域。Optionally, in the embodiment of the present application, the area to be cast may include: a fan ring to be cast area, a rectangular to be cast area, or a ring to be cast area.
第三方面,本申请实施例提供了一种电子设备,包括处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
存储器,用于存放计算机程序;Memory, used to store computer programs;
处理器,用于执行存储器上所存放的程序时,实现上述任一项游戏武器的瞄准区域显示方法的方法步骤。The processor, when used to execute the program stored in the memory, implements the method steps of any of the above-mentioned aiming area display methods of the game weapon.
第四方面,本申请实施例提供了一种可读存储介质,可读存储介质内存储有计算机程序,计算机程序被处理器执行时实现上述任一项游戏武器的瞄准区域显示方法的方法步骤。According to a fourth aspect, an embodiment of the present application provides a readable storage medium in which a computer program is stored. When the computer program is executed by a processor, the method steps of any of the above-mentioned aiming area display methods for game weapons are implemented.
第五方面,本申请实施例还提供了一种计算机程序产品,当其在电子设备上运行时,使得电子设备执行:上述任一项游戏武器的瞄准区域显示方法的方法步骤。According to a fifth aspect, an embodiment of the present application further provides a computer program product which, when it runs on an electronic device, causes the electronic device to perform: the method steps of any one of the above-mentioned aiming area display methods of game weapons.
在本申请实施例中,电子设备可以获得游戏角色使用的游戏武器的瞄准指示,之后可以确定该游戏武器在游戏场景中的待施法区域和待施法区域中的障碍物区域。然后,可以根据游戏角色在游戏场景中的位置以及所确定得到的待施法区域和障碍物区域,来确定该游戏武器在待施法区域中的施法有效区域。并将该施法有效区域作为瞄准区域。然后,可以在游戏场景中显示该瞄准区域。这样,可以向游戏玩家提示游戏武器的施法有效区域,从而可以进一步提高游戏玩家击中敌人的命中率,并提高游戏玩家的游戏体验。In the embodiment of the present application, the electronic device can obtain the aiming instruction of the game weapon used by the game character, and then can determine the game weapon in the game scene to be cast area and the obstacle area in the game cast area. Then, the effective cast area of the game weapon in the area to be cast may be determined according to the position of the game character in the game scene and the determined area to be cast and the obstacle area. And take the effective area of the cast as the aiming area. Then, the aiming area can be displayed in the game scene. In this way, the game player can be prompted with the effective area of the game weapon casting spell, which can further improve the hit rate of the game player to hit the enemy and improve the game player's game experience.
附图说明BRIEF DESCRIPTION
为了更清楚地说明本申请实施例和现有技术的技术方案,下面对实施例和现有技术中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly explain the embodiments of the present application and the technical solutions of the prior art, the following briefly introduces the drawings required in the embodiments and the prior art. Obviously, the drawings in the following description are only For some embodiments of the application, for those of ordinary skill in the art, without paying any creative labor, other drawings may be obtained based on these drawings.
图1为本申请实施例提供的一种游戏武器的瞄准区域显示方法的流程图;FIG. 1 is a flowchart of a method for displaying an aiming area of a game weapon according to an embodiment of the present application;
图2为本申请实施例提供的另一种游戏武器的瞄准区域显示方法的流程 图;FIG. 2 is a flowchart of another method for displaying an aiming area of a game weapon provided by an embodiment of this application;
图3为本申请实施例提供的一种在极坐标系中的待施法区域和障碍物区域的示意图;3 is a schematic diagram of an area to be cast and an obstacle area in a polar coordinate system provided by an embodiment of the present application;
图4为图3所示的待施法区域和障碍物区域映射至直角坐标系后得到的第一区域和第二区域的示意图;4 is a schematic diagram of a first area and a second area obtained after mapping the area to be cast and the obstacle area shown in FIG. 3 to a rectangular coordinate system;
图5为本申请实施例提供的一种所显示的瞄准区域的示意图;5 is a schematic diagram of a displayed aiming area provided by an embodiment of the present application;
图6为图5所示的瞄准区域中所去除的施法无效区域的示意图;FIG. 6 is a schematic diagram of the cast-ineffective area removed from the aiming area shown in FIG. 5;
图7为本申请实施例提供的一种游戏武器的瞄准区域显示装置的结构示意图;7 is a schematic structural diagram of an aiming area display device for a game weapon provided by an embodiment of this application;
图8为本申请实施例提供的一种电子设备的结构示意图。FIG. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
具体实施方式detailed description
为使本申请的目的、技术方案、及优点更加清楚明白,以下参照附图并举实施例,对本申请进一步详细说明。显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solutions, and advantages of the present application more clear, the following describes the present application in further detail with reference to the accompanying drawings and examples. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
为了解决现有技术中所显示的瞄准区域只能向游戏玩家提示游戏武器的待施法区域,而无法向游戏玩家提示:当该游戏武器的技能效果遇到障碍物时,该游戏武器的施法有效区域的技术问题,本申请实施例提供了一种游戏武器的瞄准区域显示方法、装置及电子设备。In order to solve the aiming area shown in the prior art, the game player can only be prompted to the area where the game weapon is to be cast, but not to the game player: when the skill effect of the game weapon encounters an obstacle, the game weapon's cast is effective For the technical problem of the area, the embodiments of the present application provide a method, device and electronic device for displaying the aiming area of a game weapon.
其中,本申请实施例提供的游戏武器的瞄准区域显示方法可以应用于电子设备。该电子设备包括但并不局限于电脑、智能手机和智能手表。其中,游戏玩家可以通过该电子设备中安装的游戏客户端进行游戏,也可以通过浏览器进入在线游戏,这都是合理的。The method for displaying the aiming area of the game weapon provided by the embodiments of the present application can be applied to electronic devices. The electronic device includes but is not limited to computers, smart phones and smart watches. Among them, game players can play games through the game client installed in the electronic device, and can also enter online games through a browser, which is reasonable.
参见图1,本申请实施例提供的游戏武器的瞄准区域显示方法可以包括如下步骤:Referring to FIG. 1, the method for displaying an aiming area of a game weapon provided by an embodiment of the present application may include the following steps:
S101:获取游戏角色使用的游戏武器的瞄准指示;S101: Obtain the aiming instruction of the game weapon used by the game character;
举例而言,该游戏角色可以为弓箭手大作战游戏中的弓箭手,弓箭手所使用的游戏武器为弓箭。For example, the game character may be an archer in an archer battle game, and the game weapon used by the archer is a bow and arrow.
S102:确定游戏武器在游戏场景中的待施法区域和待施法区域中的障碍物区域;S102: Determine the game weapon in the game area to be cast and the obstacle area in the area to be cast;
该游戏武器在游戏场景中的待施法区域是指:在该游戏场景中的、该游戏武器将要显示技能效果的全部区域。延续上述示例,弓箭这一游戏武器在弓箭手大作战游戏场景中的待施法区域具体可以为扇环形的区域,即扇环待施法区域,当然并不局限于此。The to-be-casted area of the game weapon in the game scene refers to: all areas in the game scene where the game weapon will display skill effects. Continuing the above example, the area to be cast in the archer battle game scene of the game weapon of bow and arrow may specifically be a fan-shaped area, that is, a fan ring to be cast area, of course, it is not limited to this.
待施法区域中的障碍物区域是指:位于待施法区域中的障碍物所在的区域。其中,障碍物包括但并不局限于:箱子和墙壁等使技能效果无法穿透的物体。The obstacle area in the area to be cast refers to the area where the obstacle in the area to be cast is located. Among them, obstacles include, but are not limited to: objects such as boxes and walls that cannot penetrate skill effects.
该待施法区域包括但并不局限于:扇环待施法区域、矩形待施法区域或圆环待施法区域。其中,扇环待施法区域是指:扇环形状的待施法区域。同理,矩形待施法区域是指:矩形形状的待施法区域;圆环待施法区域是指:圆环形状的待施法区。The area to be cast includes but is not limited to: a fan ring to be cast area, a rectangular to be cast area or a ring to be cast area. The area to be cast in the fan ring refers to the area to be cast in the shape of a fan ring. Similarly, the rectangular area to be cast refers to: a rectangular shape to be cast; the circular area to be cast refers to: a circular shape to be cast.
具体地,可以根据游戏角色在游戏场景中的位置和瞄准指示所指向的方向,来确定游戏武器在游戏场景中的待施法区域。然后,根据游戏场景中各个障碍物的位置,确定待施法区域中的障碍物区域。Specifically, the area of the game weapon to be cast in the game scene can be determined according to the position of the game character in the game scene and the direction pointed by the aiming instruction. Then, according to the position of each obstacle in the game scene, determine the obstacle area in the area to be cast.
S103:根据游戏角色在游戏场景中的位置、待施法区域和障碍物区域,确定游戏武器的施法有效区域作为瞄准区域;S103: According to the position of the game character in the game scene, the area to be cast, and the obstacle area, determine the effective cast area of the game weapon as the aiming area;
在确定游戏武器在游戏场景中的待施法区域和待施法区域中的障碍物区域之后,可以基于游戏角色在游戏场景中的位置、该待施法区域和该障碍物区域来确定游戏武器的施法有效区域。这样,可以确定出游戏武器在该待施法区域中的、可以攻击到的区域。After determining the to-be-casted area of the game weapon in the game scene and the obstacle area in the to-be-casted area, the effective casting of the game weapon can be determined based on the position of the game character in the game scene, the to-be-casted area and the obstacle area area. In this way, the area where the game weapon can be attacked in the area to be cast can be determined.
然后,将该施法有效区域作为瞄准区域。这样,使得瞄准区域即为:游戏武器在该待施法区域中的、可以攻击到的区域。Then, use the cast effective area as the aiming area. In this way, the aiming area is the area where the game weapon can be attacked in the area to be cast.
S104:在游戏场景中显示瞄准区域。S104: Display the aiming area in the game scene.
在确定瞄准区域之后,可以在游戏场景中的待施法区域显示该瞄准区域。这样,可以向游戏玩家提示游戏武器的施法有效区域,使得游戏玩家可以准确地确定该游戏武器的实际攻击区域,从而提高游戏玩家击中敌人的命中率。After the aiming area is determined, the aiming area may be displayed in the area to be cast in the game scene. In this way, the game player can be prompted with the effective area for casting the weapon of the game, so that the game player can accurately determine the actual attack area of the game weapon, thereby improving the hit rate of the game player to hit the enemy.
其中,可以通过在该瞄准区域显示图层或者显示动画的方式来显示该瞄准区域,当然并不局限于。Wherein, the aiming area can be displayed by displaying a layer or an animation in the aiming area, of course, it is not limited to this.
在本申请实施例中,电子设备可以获得游戏角色使用的游戏武器的瞄准指示,之后可以确定该游戏武器在游戏场景中的待施法区域和待施法区域中的障碍物区域。然后,可以根据游戏角色在游戏场景中的位置以及所确定得到的待施法区域和障碍物区域,来确定该游戏武器在待施法区域中的施法有效区域。并将该施法有效区域作为瞄准区域。然后,可以在游戏场景中显示该瞄准区域。这样,可以向游戏玩家提示游戏武器的施法有效区域,从而可以进一步提高游戏玩家击中敌人的命中率,并提高游戏玩家的游戏体验。In the embodiment of the present application, the electronic device can obtain the aiming instruction of the game weapon used by the game character, and then can determine the game weapon in the game scene to be cast area and the obstacle area in the game cast area. Then, the effective cast area of the game weapon in the area to be cast may be determined according to the position of the game character in the game scene and the determined area to be cast and the obstacle area. And take the effective area of the cast as the aiming area. Then, the aiming area can be displayed in the game scene. In this way, the game player can be prompted with the effective area of the game weapon casting spell, which can further improve the hit rate of the game player to hit the enemy and improve the game player's game experience.
下面通过图2至图6,对本申请实施例提供的游戏武器的瞄准区域显示方法进行详细说明。The method for displaying the aiming area of the game weapon provided by the embodiment of the present application will be described in detail below through FIGS. 2 to 6.
其中,可以通过如图2所示的步骤S1031~S1033来确定瞄准区域。参见图2,步骤S1031~S1033为:Among them, the aiming area can be determined through steps S1031 to S1033 shown in FIG. 2. Referring to FIG. 2, steps S1031 to S1033 are:
S1031:将极坐标系中的待施法区域和障碍物区域映射至直角坐标系中,得到待施法区域对应的第一区域和障碍物区域对应的第二区域;其中,极坐标系的极点位置为:游戏角色在游戏场景中的位置;在直角坐标系中,X轴表示极角,Y轴表示极径;S1031: Map the area to be cast in the polar coordinate system and the obstacle area into the rectangular coordinate system to obtain the first area corresponding to the area to be cast and the second area corresponding to the obstacle area; where the pole position of the polar coordinate system is : The position of the game character in the game scene; in a rectangular coordinate system, the X axis represents the polar angle and the Y axis represents the polar diameter;
假设游戏武器的待施法区域为如图3所示的扇环施法区域,并且,在游戏场景中,该扇环施法区域中的障碍物区域为矩形EFGH所在的区域。那么,可以以游戏角色在游戏场景中的位置作为极点位置,构建如图3所示的极坐标系。Assume that the to-be-casted area of the game weapon is the fan ring cast area as shown in FIG. 3, and, in the game scene, the obstacle area in the fan ring cast area is the area where the rectangular EFGH is located. Then, the position of the game character in the game scene can be used as the pole position to construct a polar coordinate system as shown in FIG. 3.
这样,该扇环施法区域的一条边界线与极轴形成的角度为α,该扇环施法区域的另一条边界线与极轴形成的角度为θ。然后,可以将极坐标系中的待施法区域和障碍物区域映射至直角坐标系中,得到如图4所示的待施法区域对应的第一区域和障碍物区域对应的第二区域efgh。这样,可以将扇环形状转换为 矩形进行处理。其中,在该直角坐标系中,X轴表示极角,Y轴表示极径。In this way, an angle formed by one boundary line of the fan ring casting area and the polar axis is α, and an angle formed by another boundary line of the fan ring casting area and the polar axis is θ. Then, the area to be cast and the obstacle area in the polar coordinate system can be mapped to the rectangular coordinate system to obtain the first area corresponding to the area to be cast and the second area efgh corresponding to the obstacle area as shown in FIG. 4. In this way, the shape of the fan ring can be converted into a rectangle for processing. In this rectangular coordinate system, the X axis represents a polar angle, and the Y axis represents a polar diameter.
其中,可以通过齐次坐标变换将极坐标系中的扇环待施法区域和障碍物区域映射到直角坐标系中。具体地,可以通过齐次坐标变换,将扇环待施法区域和障碍物区域的边界线上的各个点映射到直角坐标系中。当然,也可以将扇环待施法区域和障碍物区域的边界线上的有限个点映射到直角坐标系中。然后,通过直角坐标系中映射得到的点确定待施法区域对应的第一区域和障碍物区域对应的第二区域。这都是合理的。Among them, the area of the fan ring to be cast and the obstacle area in the polar coordinate system can be mapped to the rectangular coordinate system by homogeneous coordinate transformation. Specifically, each point on the boundary line between the area to be cast by the fan ring and the obstacle area can be mapped into a rectangular coordinate system through homogeneous coordinate transformation. Of course, it is also possible to map a limited number of points on the boundary line between the area to be cast by the fan ring and the obstacle area into the rectangular coordinate system. Then, the first area corresponding to the area to be cast and the second area corresponding to the obstacle area are determined through the points mapped in the rectangular coordinate system. This is all reasonable.
其中,由于难以确定游戏角色在游戏场景中的位置所对应的极径值,因而会难以确认该位置的投影至直角坐标系中的位置。因此,在本申请实施例中,可以将待施法区域设置为扇环,而不是设置成扇形。Among them, since it is difficult to determine the extreme diameter value corresponding to the position of the game character in the game scene, it may be difficult to confirm the projection of the position to the position in the rectangular coordinate system. Therefore, in the embodiment of the present application, the area to be casted may be set as a fan ring instead of a fan shape.
另外,为了便于将障碍物区域映射到直角坐标系中,还可以在将极坐标系中的待施法区域和障碍物区域映射至直角坐标系之前,判断障碍物区域是否为多边形区域。若为多边形区域,可以直接将极坐标系中的待施法区域和障碍物区域映射至直角坐标系中,从而可以得到待施法区域对应的第一区域和障碍物区域对应的第二区域。In addition, to facilitate the mapping of the obstacle area into the rectangular coordinate system, it is also possible to determine whether the obstacle area is a polygonal area before mapping the area to be cast and the obstacle area in the polar coordinate system to the rectangular coordinate system. If it is a polygonal area, the area to be cast and the obstacle area in the polar coordinate system can be directly mapped to the rectangular coordinate system, so that the first area corresponding to the area to be cast and the second area corresponding to the obstacle area can be obtained.
若不为多边形区域,可以先将障碍物区域处理为多边形区域。然后,将极坐标系中的待施法区域和多边形区域映射至直角坐标系中,从而可以得到待施法区域对应的第一区域和多边形区域对应的第二区域。If it is not a polygonal area, you can first process the obstacle area as a polygonal area. Then, the area to be cast and the polygon area in the polar coordinate system are mapped to the rectangular coordinate system, so that the first area corresponding to the area to be cast and the second area corresponding to the polygon area can be obtained.
此外,也可以将极坐标系中的待施法区域和障碍物区域标注到直角坐标系的像素图中,得到标注图片中记录的、待施法区域对应的第一区域和障碍物区域对应的第二区域。也就是,所得到的第一区域和第二区域是通过图片形式呈现的,并且该第一区域中包含了第二区域。并且,可以将该图片存储至显存中,从而可以提高获取该图片的速度,便于后续对该图片进行计算或渲染。In addition, the area to be cast in the polar coordinate system and the obstacle area can also be marked to the pixel map of the rectangular coordinate system to obtain the first area corresponding to the area to be cast recorded in the marked picture and the second corresponding to the obstacle area area. That is, the obtained first area and second area are presented in the form of pictures, and the first area includes the second area. In addition, the picture can be stored in the video memory, so that the speed of acquiring the picture can be increased, which is convenient for subsequent calculation or rendering of the picture.
S1032:将从第二区域的边界线开始并沿着Y轴正方向的区域,确定为阻挡区域;S1032: The area starting from the boundary of the second area and along the positive direction of the Y axis is determined as the blocking area;
具体地,阻挡区域为:从第二区域的边界线开始并沿着Y轴正方向的、与第一区域的边界线所围成的区域。Specifically, the blocking area is an area surrounded by the boundary line of the first area starting from the boundary line of the second area and along the positive direction of the Y axis.
参见图4,由于当遇到障碍物时,第二区域efgh是游戏武器无法攻击到的区域,而且,第二区域的边界线ef、gh、fg和eh所阻挡的区域也是游戏武器无法攻击到的区域。因而,可以将从第二区域的边界线ef、gh、fg和eh开始并沿着Y轴正方向的区域efmn,确定为阻挡区域。这样,可以计算得到准确的阻挡区域。Referring to FIG. 4, when the obstacle is encountered, the second area efgh is the area that the game weapon cannot attack, and the area blocked by the boundary lines ef, gh, fg, and eh of the second area is also the game weapon that cannot be attacked. Area. Thus, the area efmn starting from the boundary lines ef, gh, fg, and eh of the second area and along the positive direction of the Y axis can be determined as the blocking area. In this way, an accurate blocking area can be calculated.
其中,为了减少确定阻挡区域所需的计算量,从而提高计算速度,还可以先确定第二区域的各条边界线在X轴上的取值范围。然后,基于各条边界线在X轴上的取值范围,标记从第一类边界线开始并沿着Y轴正方向的区域,作为阻挡区域。其中,当第二区域的一条边界线在X轴上取值范围被第二区域的另一条边界线在X轴上的取值范围覆盖时,另一条边界线为第一类边界线。In order to reduce the amount of calculation required to determine the blocking area and thereby increase the calculation speed, the value range of each boundary line of the second area on the X axis may also be determined first. Then, based on the value range of each boundary line on the X axis, a region starting from the first type boundary line and along the positive direction of the Y axis is marked as a blocking region. Wherein, when the value range of one boundary line of the second area on the X axis is covered by the value range of another boundary line of the second area on the X axis, the other boundary line is the first type of boundary line.
举例而言,若一条边界线L1在X轴上的取值范围为[1,2],另一条边界线L2在X轴上的取值范围为[1,3]。那么,边界线L1在X轴上取值范围被另一条边界线L2在X轴上的取值范围覆盖。For example, if the value range of one boundary line L1 on the X axis is [1,2], the value range of the other boundary line L2 on the X axis is [1, 3]. Then, the value range of the boundary line L1 on the X axis is covered by the value range of another boundary line L2 on the X axis.
其中,第二区域efgh的边界线ef为第一类边界线,也就是说,在该种方式中,只需要在第一区域中标记从边界线ef开始并沿着Y轴正方向的区域,从而得到阻挡区域efmn,极大的减少了计算量。Among them, the boundary line ef of the second area efgh is the first type of boundary line, that is to say, in this way, only the area starting from the boundary line ef and along the positive direction of the Y axis needs to be marked in the first area Thus, the blocking area efmn is obtained, which greatly reduces the amount of calculation.
S1033:将第一区域中去除阻挡区域的目标区域映射到极坐标系中,得到游戏武器的施法有效区域,并将施法有效区域作为瞄准区域。S1033: Map the target area in the first area where the blocking area is removed to the polar coordinate system to obtain the effective casting area of the game weapon, and use the effective casting area as the aiming area.
在一种实现方式中,可以将第一区域中去除阻挡区域的目标区域映射到极坐标系中,从而得到施法有效区域。然后,可以对施法有效区域进行高亮渲染,从而得到瞄准区域。In an implementation manner, the target area in the first area where the blocking area is removed can be mapped into a polar coordinate system, so as to obtain a cast effective area. Then, you can highlight the effective area of the cast to get the aiming area.
其中,可以将目标区域的边界线上的有限个点映射到极坐标系中。然后,通过极坐标系中映射得到的点确定施法有效区域,这也是合理的Among them, a limited number of points on the boundary line of the target area can be mapped into the polar coordinate system. Then, it is reasonable to determine the effective area of casting through the points mapped in the polar coordinate system
在另一种实现方式中,可以先将第一区域中去除阻挡区域的目标区域进行高亮渲染。然后,将进行高亮渲染后的目标区域映射到极坐标系中,从而得到施法有效区域。In another implementation manner, the target area in the first area where the blocking area is removed can be highlighted. Then, the target area after the highlight rendering is mapped into the polar coordinate system, thereby obtaining the cast effective area.
可以理解的是,渲染方式并不局限于高亮渲染,也可以为渐变色渲染,当然并不局限于此。另外,由于计算得到的阻挡区域是准确地,因而经过坐 标系转换后所确定得到的施法有效区域也是准确的。It can be understood that the rendering method is not limited to highlight rendering, but may also be gradient rendering, of course, it is not limited to this. In addition, because the calculated blocking area is accurate, the cast effective area determined after the coordinate system conversion is also accurate.
另外,当所得到的第一区域和第二区域是通过图片形式呈现的时,图4第一象限中的内容可以表现在一张图片(记为贴图)上。此时,还可以将该图片与美术图片进行叠加,得到叠加图片。其中,该美术图片的形状大小与该贴图图片的形状大小一致,且该美术图片中渲染有瞄准展示效果。然后,可以通过蒙版技术将该叠加图片中的阻挡区域设置为透明。这样,当将叠加图片映射到极坐标系中时,可以确定出游戏武器的施法有效区域,即可以确定瞄准区域。In addition, when the obtained first area and second area are presented in the form of pictures, the content in the first quadrant of FIG. 4 can be represented on a picture (marked as a sticker). At this time, the picture can also be superimposed with the art picture to obtain a superimposed picture. Wherein, the shape and size of the art picture are consistent with the shape and size of the texture picture, and the aiming display effect is rendered in the art picture. Then, the blocking area in the superimposed picture can be set to transparent through the mask technology. In this way, when the superimposed picture is mapped into the polar coordinate system, the effective casting area of the game weapon can be determined, that is, the aiming area can be determined.
当然,也可以直接将该美术图片中的、与该阻挡区域对应的区域的像素抠掉,得到处理后的图片。然后,将该处理后的图片映射到极坐标系中时,也可以确定出游戏武器的施法有效区域,并将该施法有效区域作为瞄准区域。Of course, the pixels in the area corresponding to the blocking area in the art picture may be directly cut out to obtain the processed picture. Then, when the processed picture is mapped into the polar coordinate system, the cast effective area of the game weapon may be determined, and the cast effective area may be used as the aiming area.
其中,在确定得到瞄准区域后,可以在游戏场景中的待施法区域显示该瞄准区域。After determining the target area, the target area can be displayed in the area to be cast in the game scene.
示例性的,对于图5中所显示的障碍物(箱子),可以得到如图5所示的瞄准区域。该瞄准区域是将扇环待施法区域中的、如图6所示的无效攻击区域去除后所得到的区域。其中,AB和CD图5所示的箱子的两条边界线。Exemplarily, for the obstacle (box) shown in FIG. 5, the aiming area shown in FIG. 5 can be obtained. The aiming area is an area obtained by removing the invalid attack area shown in FIG. 6 in the area to be cast by the fan ring. Among them, the two boundary lines of the boxes shown in Figure 5 of AB and CD.
这样,可以向游戏玩家提示游戏武器的施法有效区域,使得游戏玩家可以准确地确定该游戏武器的实际攻击区域,从而可以进一步提高游戏玩家击中敌人的命中率,提高了游戏玩家的游戏体验。In this way, the game player can be prompted with the effective area for casting the weapon of the game, so that the game player can accurately determine the actual attack area of the game weapon, thereby further improving the hit rate of the game player to hit the enemy and improving the game player's game experience.
相应于上述方法实施例,本申请实施例还提供了一种游戏武器的瞄准区域显示装置,参见图7,该装置可以包括:Corresponding to the above method embodiment, an embodiment of the present application also provides a device for displaying the aiming area of a game weapon. Referring to FIG. 7, the device may include:
获取模块701,用于获取游戏角色使用的游戏武器的瞄准指示;The obtaining module 701 is used to obtain the aiming instruction of the game weapon used by the game character;
第一确定模块702,用于确定游戏武器在游戏场景中的待施法区域和待施法区域中的障碍物区域;The first determining module 702 is used to determine the area of the game weapon to be cast in the game scene and the area of obstacles in the area to be cast;
第二确定模块703,用于根据游戏角色在游戏场景中的位置、待施法区域和障碍物区域,确定游戏武器的施法有效区域作为瞄准区域;The second determination module 703 is used to determine the effective casting area of the game weapon as the aiming area according to the position of the game character in the game scene, the area to be cast and the obstacle area;
显示模块704,用于在游戏场景中的待施法区域显示瞄准区域。The display module 704 is used to display the aiming area in the area to be cast in the game scene.
应用本申请实施例提供的装置,电子设备可以获得游戏角色使用的游戏武器的瞄准指示,之后可以确定该游戏武器在游戏场景中的待施法区域和待施法区域中的障碍物区域。然后,可以根据游戏角色在游戏场景中的位置以及所确定得到的待施法区域和障碍物区域,来确定该游戏武器在待施法区域中的施法有效区域。并将该施法有效区域作为瞄准区域。然后,可以在游戏场景中显示该瞄准区域。这样,可以向游戏玩家提示游戏武器的施法有效区域,从而可以进一步提高游戏玩家击中敌人的命中率,并提高游戏玩家的游戏体验。Using the device provided in the embodiment of the present application, the electronic device can obtain the aiming instruction of the game weapon used by the game character, and then can determine the game weapon's to-be-casted area in the game scene and the obstacle-tolerated area in the to-be-casted area. Then, the effective cast area of the game weapon in the area to be cast may be determined according to the position of the game character in the game scene and the determined area to be cast and the obstacle area. And take the effective area of the cast as the aiming area. Then, the aiming area can be displayed in the game scene. In this way, the game player can be prompted with the effective area of the game weapon casting spell, which can further improve the hit rate of the game player to hit the enemy and improve the game player's game experience.
可选地,在本申请实施例中,第二确定模块703可以包括:Optionally, in the embodiment of the present application, the second determination module 703 may include:
第一映射单元,用于将极坐标系中的待施法区域和障碍物区域映射至直角坐标系中,得到待施法区域对应的第一区域和障碍物区域对应的第二区域;其中,极坐标系的极点位置为:游戏角色在游戏场景中的位置;在直角坐标系中,X轴表示极角,Y轴表示极径;The first mapping unit is used to map the area to be cast and the obstacle area in the polar coordinate system to the rectangular coordinate system to obtain the first area corresponding to the area to be cast and the second area corresponding to the obstacle area; wherein, the polar coordinates The pole position of the system is: the position of the game character in the game scene; in the rectangular coordinate system, the X axis represents the polar angle and the Y axis represents the polar diameter;
第一确定单元,用于将从第二区域的边界线开始并沿着Y轴正方向的区域,确定为阻挡区域;The first determining unit is used to determine an area starting from the boundary of the second area and along the positive direction of the Y axis as a blocking area;
第二映射单元,用于将第一区域中去除阻挡区域的目标区域映射到极坐标系中,得到游戏武器的施法有效区域,并将施法有效区域作为瞄准区域。The second mapping unit is used to map the target area of the first area without the blocking area into the polar coordinate system to obtain the effective casting area of the game weapon, and use the effective casting area as the aiming area.
可选地,在本申请实施例中,第一确定单元具体可以用于:Optionally, in the embodiment of the present application, the first determining unit may specifically be used for:
确定第二区域的各条边界线在X轴上的取值范围;Determine the value range of each boundary line of the second area on the X axis;
基于各条边界线在X轴上的取值范围,标记从第一类边界线开始并沿着Y轴正方向的区域,作为阻挡区域;其中,当第二区域的一条边界线在X轴上取值范围被第二区域的另一条边界线在X轴上的取值范围覆盖时,另一条边界线为第一类边界线。Based on the value range of each boundary line on the X axis, mark the area starting from the first type of boundary line and along the positive direction of the Y axis as a blocking area; where, when a boundary line of the second area is on the X axis When the value range is covered by the value range of another boundary line in the second region on the X axis, the other boundary line is the first type boundary line.
可选地,在本申请实施例中,第一映射单元可以包括:Optionally, in the embodiment of the present application, the first mapping unit may include:
判断子单元,用于判断障碍物区域是否为多边形区域;The judgment subunit is used to judge whether the obstacle area is a polygonal area;
第一映射子单元,用于当障碍物区域为多边形区域,将极坐标系中的待 施法区域和障碍物区域映射至直角坐标系中,得到待施法区域对应的第一区域和障碍物区域对应的第二区域。The first mapping subunit is used to map the area to be cast and the obstacle area in the polar coordinate system to the rectangular coordinate system when the obstacle area is a polygonal area to obtain the correspondence between the first area corresponding to the area to be cast and the obstacle area The second area.
可选地,在本申请的一个实施例中,第一映射单元可以包括:Optionally, in an embodiment of the present application, the first mapping unit may include:
判断子单元,用于判断障碍物区域是否为多边形区域;The judgment subunit is used to judge whether the obstacle area is a polygonal area;
处理子单元,用于当障碍物区域不为多边形区域,将障碍物区域处理为多边形区域;The processing subunit is used to process the obstacle area into a polygonal area when the obstacle area is not a polygonal area;
第二映射子单元,用于将极坐标系中的待施法区域和多边形区域映射至直角坐标系中,得到待施法区域对应的第一区域和多边形区域对应的第二区域。The second mapping subunit is used to map the area to be cast and the polygon area in the polar coordinate system to the rectangular coordinate system to obtain the first area corresponding to the area to be cast and the second area corresponding to the polygon area.
可选地,在本申请的另一个实施例中,第一映射单元具体可以用于:Optionally, in another embodiment of the present application, the first mapping unit may specifically be used for:
通过齐次坐标变换,将极坐标系中的待施法区域和障碍物区域映射至直角坐标系中,得到待施法区域对应的第一区域和障碍物区域对应的第二区域。Through homogeneous coordinate transformation, the area to be cast and the obstacle area in the polar coordinate system are mapped to the rectangular coordinate system to obtain the first area corresponding to the area to be cast and the second area corresponding to the obstacle area.
可选地,在本申请的又一个实施例中,第一映射单元具体用于:Optionally, in yet another embodiment of the present application, the first mapping unit is specifically used to:
将极坐标系中的待施法区域和障碍物区域标注到直角坐标系的像素图中,得到标注图片中记录的、待施法区域对应的第一区域和障碍物区域对应的第二区域。Mark the area to be cast in the polar coordinate system and the obstacle area to the pixel map of the rectangular coordinate system to obtain the first area corresponding to the area to be cast recorded in the marked picture and the second area corresponding to the obstacle area.
可选地,在本申请的一个实施例中,第二映射单元可以包括:Optionally, in an embodiment of the present application, the second mapping unit may include:
去除子单元,用于将第一区域中去除阻挡区域的目标区域映射到极坐标系中,得到施法有效区域;The removal subunit is used to map the target area in the first area to remove the blocking area into the polar coordinate system to obtain the effective area for casting;
第一渲染子单元,用于对施法有效区域进行高亮渲染,得到瞄准区域。The first rendering subunit is used for highlight rendering of the effective casting area to obtain the aiming area.
可选地,在本申请的另一个实施例中,第二映射单元可以包括:Optionally, in another embodiment of the present application, the second mapping unit may include:
第二渲染子单元,用于将第一区域中去除阻挡区域的目标区域进行高亮渲染;A second rendering subunit, used for highlight rendering of the target area in the first area where the blocking area is removed;
第三映射子单元,用于将进行高亮渲染后的目标区域映射到极坐标系中,得到施法有效区域,并将施法有效区域作为瞄准区域。The third mapping subunit is used to map the target area after the highlight rendering to the polar coordinate system to obtain the cast effective area, and use the cast effective area as the aiming area.
可选地,在本申请实施例中,第一确定模块702可以包括:Optionally, in the embodiment of the present application, the first determining module 702 may include:
第二确定单元,用于根据游戏角色在游戏场景中的位置和瞄准指示所指向的方向,确定游戏武器在游戏场景中的待施法区域;The second determining unit is used to determine the area of the game weapon to be cast in the game scene according to the position of the game character in the game scene and the direction pointed by the aiming instruction;
第三确定单元,用于根据游戏场景中各个障碍物的位置,确定待施法区域中的障碍物区域。The third determining unit is used to determine the obstacle area in the area to be cast according to the position of each obstacle in the game scene.
可选地,在在本申请实施例中,待施法区域可以包括:扇环待施法区域、矩形待施法区域或圆环待施法区域。Optionally, in the embodiment of the present application, the area to be cast may include: a fan ring to be cast area, a rectangular to be cast area, or a ring to be cast area.
相应于上述方法实施例,本申请实施例还提供了一种电子设备,参见图8,包括处理器801、通信接口802、存储器803和通信总线804,其中,处理器801,通信接口802,存储器803通过通信总线804完成相互间的通信;Corresponding to the above method embodiment, an embodiment of the present application further provides an electronic device, referring to FIG. 8, including a processor 801, a communication interface 802, a memory 803, and a communication bus 804, where the processor 801, the communication interface 802, and the memory 803 communicate with each other through the communication bus 804;
存储器803,用于存放计算机程序; Memory 803, used to store computer programs;
处理器801,用于执行存储器803上所存放的程序时,实现上述任一项游戏武器的瞄准区域显示方法的方法步骤。The processor 801 is used to implement the method steps of any one of the method for displaying the aiming area of the game weapon when executing the program stored in the memory 803.
在本申请实施例中,电子设备可以获得游戏角色使用的游戏武器的瞄准指示,之后可以确定该游戏武器在游戏场景中的待施法区域和待施法区域中的障碍物区域。然后,可以根据游戏角色在游戏场景中的位置以及所确定得到的待施法区域和障碍物区域,来确定该游戏武器在待施法区域中的施法有效区域。并将该施法有效区域作为瞄准区域。然后,可以在游戏场景中显示该瞄准区域。这样,可以向游戏玩家提示游戏武器的施法有效区域,从而可以进一步提高游戏玩家击中敌人的命中率,并提高游戏玩家的游戏体验。In the embodiment of the present application, the electronic device can obtain the aiming instruction of the game weapon used by the game character, and then can determine the game weapon in the game scene to be cast area and the obstacle area in the game cast area. Then, the effective cast area of the game weapon in the area to be cast may be determined according to the position of the game character in the game scene and the determined area to be cast and the obstacle area. And take the effective area of the cast as the aiming area. Then, the aiming area can be displayed in the game scene. In this way, the game player can be prompted with the effective area of the game weapon casting spell, which can further improve the hit rate of the game player to hit the enemy and improve the game player's game experience.
相应于上述方法实施例,本申请实施例还提供了一种可读存储介质,可读存储介质内存储有计算机程序,计算机程序被处理器执行时实现上述任一项游戏武器的瞄准区域显示方法的方法步骤。其中,该可读存储介质为计算机可读存储介质。Corresponding to the above method embodiment, an embodiment of the present application further provides a readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the aiming area display method of any one of the above game weapons Method steps. Wherein, the readable storage medium is a computer-readable storage medium.
本申请实施例提供的可读存储介质中存储的计算机程序被电子设备的处 理器执行后,电子设备可以获得游戏角色使用的游戏武器的瞄准指示,之后可以确定该游戏武器在游戏场景中的待施法区域和待施法区域中的障碍物区域。然后,可以根据游戏角色在游戏场景中的位置以及所确定得到的待施法区域和障碍物区域,来确定该游戏武器在待施法区域中的施法有效区域。并将该施法有效区域作为瞄准区域。然后,可以在游戏场景中显示该瞄准区域。这样,可以向游戏玩家提示游戏武器的施法有效区域,从而可以进一步提高游戏玩家击中敌人的命中率,并提高游戏玩家的游戏体验。After the computer program stored in the readable storage medium provided by the embodiment of the present application is executed by the processor of the electronic device, the electronic device can obtain the aiming instruction of the game weapon used by the game character, and then can determine the game weapon's pending in the game scene The obstacle area in the cast area and the area to be cast. Then, the effective cast area of the game weapon in the area to be cast may be determined according to the position of the game character in the game scene and the determined area to be cast and the obstacle area. And take the effective area of the cast as the aiming area. Then, the aiming area can be displayed in the game scene. In this way, the game player can be prompted with the effective area of the game weapon casting spell, which can further improve the hit rate of the game player to hit the enemy and improve the game player's game experience.
相应于上述方法实施例,本申请实施例还提供了一种计算机程序产品,当其在电子设备上运行时,使得电子设备执行:上述任一项游戏武器的瞄准区域显示方法的方法步骤。Corresponding to the above method embodiment, an embodiment of the present application further provides a computer program product that, when it runs on an electronic device, causes the electronic device to perform: the method steps of any of the above-mentioned aiming area display methods of game weapons.
本申请实施例提供的计算机程序产品被电子设备的处理器执行后,电子设备可以获得游戏角色使用的游戏武器的瞄准指示,之后可以确定该游戏武器在游戏场景中的待施法区域和待施法区域中的障碍物区域。然后,可以根据游戏角色在游戏场景中的位置以及所确定得到的待施法区域和障碍物区域,来确定该游戏武器在待施法区域中的施法有效区域。并将该施法有效区域作为瞄准区域。然后,可以在游戏场景中显示该瞄准区域。这样,可以向游戏玩家提示游戏武器的施法有效区域,从而可以进一步提高游戏玩家击中敌人的命中率,并提高游戏玩家的游戏体验。After the computer program product provided by the embodiment of the present application is executed by the processor of the electronic device, the electronic device can obtain the aiming instruction of the game weapon used by the game character, and then can determine the area to be cast and the area to be cast in the game scene of the game weapon The obstacle area in the. Then, the effective cast area of the game weapon in the area to be cast may be determined according to the position of the game character in the game scene and the determined area to be cast and the obstacle area. And take the effective area of the cast as the aiming area. Then, the aiming area can be displayed in the game scene. In this way, the game player can be prompted with the effective area of the game weapon casting spell, which can further improve the hit rate of the game player to hit the enemy and improve the game player's game experience.
上述电子设备提到的通信总线可以是外设部件互连标准(Peripheral Component Interconnect,PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,EISA)总线等。该通信总线可以分为地址总线、数据总线、控制总线等。为便于表示,图中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The communication bus mentioned in the above electronic equipment may be a peripheral component interconnection standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard structure (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, and a control bus. For ease of representation, only a thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
通信接口用于上述电子设备与其他设备之间的通信。The communication interface is used for communication between the electronic device and other devices.
存储器可以包括随机存取存储器(Random Access Memory,RAM),也可以包括非易失性存储器(Non-Volatile Memory,NVM),例如至少一个磁盘存 储器。可选的,存储器还可以是至少一个位于远离前述处理器的存储装置。The memory may include random access memory (Random Access Memory, RAM), or non-volatile memory (Non-Volatile Memory, NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the foregoing processor.
上述的处理器可以是通用处理器,包括中央处理器(Central Processing Unit,CPU)、网络处理器(Network Processor,NP)等;还可以是数字信号处理器(Digital Signal Processing,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。The aforementioned processor may be a general-purpose processor, including a central processor (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; it may also be a digital signal processor (Digital Signal Processing, DSP), dedicated integration Circuit (Application Specific Integrated Circuit, ASIC), field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a dedicated computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be from a website site, computer, server or data center Transmission to another website, computer, server or data center via wired (eg coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (eg infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device including a server, a data center, and the like integrated with one or more available media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, Solid State Disk (SSD)), or the like.
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that these entities or operations There is any such actual relationship or order. Moreover, the terms "include", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also those not explicitly listed Or other elements that are inherent to this process, method, article, or equipment. Without more restrictions, the element defined by the sentence "include one..." does not exclude that there are other identical elements in the process, method, article or equipment that includes the element.
本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置、电子设备、可读存储介质和计算机程序产品实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。Each embodiment in this specification is described in a related manner. The same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the embodiments of the device, the electronic device, the readable storage medium, and the computer program product, since they are basically similar to the method embodiments, the description is relatively simple. For the related parts, refer to the description of the method embodiments.
以上所述仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。凡在本申请的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本申请的保护范围内。The above are only the preferred embodiments of the present application, and are not intended to limit the protection scope of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this application are included in the scope of protection of this application.

Claims (25)

  1. 一种游戏武器的瞄准区域显示方法,其特征在于,所述方法包括:A method for displaying an aiming area of a game weapon, characterized in that the method includes:
    获取游戏角色使用的游戏武器的瞄准指示;Obtain the aiming instruction of the game weapon used by the game character;
    确定所述游戏武器在游戏场景中的待施法区域和所述待施法区域中的障碍物区域;Determine the area of the game weapon to be cast in the game scene and the area of obstacles in the area to be cast;
    根据所述游戏角色在所述游戏场景中的位置、所述待施法区域和所述障碍物区域,确定所述游戏武器的施法有效区域作为瞄准区域;According to the position of the game character in the game scene, the area to be cast and the obstacle area, determine the effective casting area of the game weapon as the aiming area;
    在所述游戏场景中显示所述瞄准区域。The aiming area is displayed in the game scene.
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述游戏角色在所述游戏场景中的位置、所述待施法区域和所述障碍物区域,确定所述游戏武器的施法有效区域作为瞄准区域的步骤,包括:The method according to claim 1, characterized in that the effective casting area of the game weapon is determined according to the position of the game character in the game scene, the area to be cast and the obstacle area As a step to target the area, include:
    将极坐标系中的所述待施法区域和所述障碍物区域映射至直角坐标系中,得到所述待施法区域对应的第一区域和所述障碍物区域对应的第二区域;其中,所述极坐标系的极点位置为:所述游戏角色在所述游戏场景中的位置;在所述直角坐标系中,X轴表示极角,Y轴表示极径;Mapping the area to be cast and the obstacle area in the polar coordinate system to a rectangular coordinate system to obtain a first area corresponding to the area to be cast and a second area corresponding to the obstacle area; wherein, The pole position of the polar coordinate system is: the position of the game character in the game scene; in the rectangular coordinate system, the X axis represents a polar angle and the Y axis represents a polar diameter;
    将从所述第二区域的边界线开始并沿着所述Y轴正方向的区域,确定为阻挡区域;The area starting from the boundary line of the second area and along the positive direction of the Y axis is determined as the blocking area;
    将所述第一区域中去除所述阻挡区域的目标区域映射到所述极坐标系中,得到所述游戏武器的施法有效区域,并将所述施法有效区域作为瞄准区域。The target area in the first area where the blocking area is removed is mapped into the polar coordinate system to obtain a cast effective area of the game weapon, and the cast effective area is used as an aiming area.
  3. 根据权利要求2所述的方法,其特征在于,所述将从所述第二区域的边界线开始并沿着所述Y轴正方向的区域,确定为阻挡区域的步骤,包括:The method according to claim 2, wherein the step of determining the area starting from the boundary line of the second area and along the positive direction of the Y axis as the blocking area includes:
    确定所述第二区域的各条边界线在X轴上的取值范围;Determine the value range of each boundary line of the second area on the X axis;
    基于所述各条边界线在X轴上的取值范围,标记从第一类边界线开始并沿着Y轴正方向的区域,作为阻挡区域;其中,当所述第二区域的一条边界线在X轴上取值范围被所述第二区域的另一条边界线在X轴上的取值范围覆盖时,所述另一条边界线为第一类边界线。Based on the value range of each boundary line on the X axis, mark the area starting from the first type boundary line and along the positive direction of the Y axis as a blocking area; wherein, when a boundary line of the second area When the value range on the X axis is covered by the value range on the X axis of another boundary line of the second area, the other boundary line is a first type boundary line.
  4. 根据权利要求2所述的方法,其特征在于,所述将极坐标系中的所述待施法区域和所述障碍物区域映射至直角坐标系中,得到所述待施法区域对应的第一区域和所述障碍物区域对应的第二区域的步骤,包括:The method according to claim 2, wherein the mapping the area to be cast in the polar coordinate system and the obstacle area into a rectangular coordinate system to obtain the first area corresponding to the area to be cast The step of the second area corresponding to the obstacle area includes:
    判断所述障碍物区域是否为多边形区域;Determine whether the obstacle area is a polygonal area;
    若为多边形区域,将极坐标系中的所述待施法区域和所述障碍物区域映射至直角坐标系中,得到所述待施法区域对应的第一区域和所述障碍物区域对应的第二区域。If it is a polygonal area, map the area to be cast and the obstacle area in the polar coordinate system to a rectangular coordinate system to obtain the first area corresponding to the area to be cast and the second corresponding to the obstacle area area.
  5. 根据权利要求2所述的方法,其特征在于,所述将极坐标系中的所述待施法区域和所述障碍物区域映射至直角坐标系中,得到所述待施法区域对应的第一区域和所述障碍物区域对应的第二区域的步骤,包括:The method according to claim 2, wherein the mapping the area to be cast in the polar coordinate system and the obstacle area into a rectangular coordinate system to obtain the first area corresponding to the area to be cast The step of the second area corresponding to the obstacle area includes:
    判断所述障碍物区域是否为多边形区域;Determine whether the obstacle area is a polygonal area;
    若不为多边形区域,将所述障碍物区域处理为多边形区域;If it is not a polygonal area, process the obstacle area as a polygonal area;
    将极坐标系中的所述待施法区域和所述多边形区域映射至直角坐标系中,得到所述待施法区域对应的第一区域和所述多边形区域对应的第二区域。Mapping the area to be cast and the polygonal area in the polar coordinate system to a rectangular coordinate system to obtain a first area corresponding to the area to be cast and a second area corresponding to the polygonal area.
  6. 根据权利要求2所述的方法,其特征在于,所述将极坐标系中的所述待施法区域和所述障碍物区域映射至直角坐标系中,得到所述待施法区域对应的第一区域和所述障碍物区域对应的第二区域的步骤,包括:The method according to claim 2, wherein the mapping the area to be cast in the polar coordinate system and the obstacle area into a rectangular coordinate system to obtain the first area corresponding to the area to be cast The step of the second area corresponding to the obstacle area includes:
    通过齐次坐标变换,将极坐标系中的所述待施法区域和所述障碍物区域映射至直角坐标系中,得到所述待施法区域对应的第一区域和所述障碍物区域对应的第二区域。Through homogeneous coordinate transformation, the area to be cast and the obstacle area in the polar coordinate system are mapped to a rectangular coordinate system to obtain the first area corresponding to the area to be cast and the first corresponding area of the obstacle area Second area.
  7. 根据权利要求2所述的方法,其特征在于,所述将极坐标系中的所述待施法区域和所述障碍物区域映射至直角坐标系中,得到所述待施法区域对应的第一区域和所述障碍物区域对应的第二区域的步骤,包括:The method according to claim 2, wherein the mapping the area to be cast in the polar coordinate system and the obstacle area into a rectangular coordinate system to obtain the first area corresponding to the area to be cast The step of the second area corresponding to the obstacle area includes:
    将极坐标系中的所述待施法区域和所述障碍物区域标注到直角坐标系的像素图中,得到标注图片中记录的、所述待施法区域对应的第一区域和所述障碍物区域对应的第二区域。Mark the area to be cast and the obstacle area in the polar coordinate system to the pixel map of the rectangular coordinate system to obtain the first area and the obstacle area corresponding to the area to be cast recorded in the marked picture Corresponding second area.
  8. 根据权利要求2所述的方法,其特征在于,所述将所述第一区域中去 除所述阻挡区域的目标区域映射到所述极坐标系中,得到所述游戏武器的施法有效区域,并将所述施法有效区域作为瞄准区域的步骤,包括:The method according to claim 2, wherein the mapping of the target area in the first area from which the blocking area is removed is mapped into the polar coordinate system to obtain a casting weapon effective area of the game weapon, and The step of using the casting effective area as the aiming area includes:
    将所述第一区域中去除所述阻挡区域的目标区域映射到所述极坐标系中,得到施法有效区域;Mapping the target area in the first area from which the blocking area is removed into the polar coordinate system to obtain a cast effective area;
    对所述施法有效区域进行高亮渲染,得到瞄准区域。Highlight the rendering effective area to obtain the aiming area.
  9. 根据权利要求2所述的方法,其特征在于,所述将所述第一区域中去除所述阻挡区域的目标区域映射到所述极坐标系中,得到所述游戏武器的施法有效区域,并将所述施法有效区域作为瞄准区域的步骤,包括:The method according to claim 2, wherein the mapping of the target area in the first area from which the blocking area is removed is mapped into the polar coordinate system to obtain a casting weapon effective area of the game weapon, and The step of using the casting effective area as the aiming area includes:
    将所述第一区域中去除所述阻挡区域的目标区域进行高亮渲染;Highlight rendering the target area in the first area where the blocking area is removed;
    将进行高亮渲染后的目标区域映射到所述极坐标系中,得到施法有效区域,并将所述施法有效区域作为瞄准区域。The target area after the highlight rendering is mapped into the polar coordinate system to obtain a cast effective area, and the cast effective area is used as the aiming area.
  10. 根据权利要求1所述的方法,其特征在于,所述确定所述游戏武器在游戏场景中的待施法区域和所述待施法区域中的障碍物区域的步骤,包括:The method according to claim 1, wherein the step of determining the to-be-casted area of the game weapon in the game scene and the obstacle area in the to-be-casted area includes:
    根据所述游戏角色在所述游戏场景中的位置和所述瞄准指示所指向的方向,确定所述游戏武器在所述游戏场景中的待施法区域;Determine the area of the game weapon to be cast in the game scene according to the position of the game character in the game scene and the direction pointed by the aiming instruction;
    根据所述游戏场景中各个障碍物的位置,确定所述待施法区域中的障碍物区域。According to the position of each obstacle in the game scene, determine the obstacle area in the area to be cast.
  11. 根据权利要求1-10中任一项所述的方法,其特征在于,所述待施法区域包括:扇环待施法区域、矩形待施法区域或圆环待施法区域。The method according to any one of claims 1-10, wherein the area to be cast comprises: a fan ring to be cast area, a rectangular to be cast area or a ring to be cast area.
  12. 一种游戏武器的瞄准区域显示装置,其特征在于,所述装置包括:A targeting area display device for game weapons, characterized in that the device includes:
    获取模块,用于获取游戏角色使用的游戏武器的瞄准指示;The acquisition module is used to obtain the aiming instruction of the game weapon used by the game character;
    第一确定模块,用于确定所述游戏武器在游戏场景中的待施法区域和所述待施法区域中的障碍物区域;A first determining module, configured to determine the area of the game weapon to be cast in the game scene and the area of obstacles in the area to be cast;
    第二确定模块,用于根据所述游戏角色在所述游戏场景中的位置、所述待施法区域和所述障碍物区域,确定所述游戏武器的施法有效区域作为瞄准区域;A second determination module, configured to determine the effective casting area of the game weapon as the aiming area according to the position of the game character in the game scene, the area to be cast and the obstacle area;
    显示模块,用于在所述游戏场景中显示所述瞄准区域。The display module is used for displaying the aiming area in the game scene.
  13. 根据权利要求12所述的装置,其特征在于,所述第二确定模块包括:The apparatus according to claim 12, wherein the second determining module comprises:
    第一映射单元,用于将极坐标系中的所述待施法区域和所述障碍物区域映射至直角坐标系中,得到所述待施法区域对应的第一区域和所述障碍物区域对应的第二区域;其中,所述极坐标系的极点位置为:所述游戏角色在所述游戏场景中的位置;在所述直角坐标系中,X轴表示极角,Y轴表示极径;The first mapping unit is used to map the area to be cast and the obstacle area in the polar coordinate system to a rectangular coordinate system to obtain the first area corresponding to the area to be cast and the obstacle area The second area; wherein, the polar position of the polar coordinate system is: the position of the game character in the game scene; in the rectangular coordinate system, the X axis represents a polar angle, and the Y axis represents a polar diameter;
    第一确定单元,用于将从所述第二区域的边界线开始并沿着所述Y轴正方向的区域,确定为阻挡区域;A first determining unit, configured to determine an area starting from the boundary line of the second area and along the positive direction of the Y axis as a blocking area;
    第二映射单元,用于将所述第一区域中去除所述阻挡区域的目标区域映射到所述极坐标系中,得到所述游戏武器的施法有效区域,并将所述施法有效区域作为瞄准区域。The second mapping unit is used to map the target area in the first area from which the blocking area is removed into the polar coordinate system, to obtain a cast effective area of the game weapon, and use the cast effective area as an aim area.
  14. 根据权利要求13所述的装置,其特征在于,所述第一确定单元具体用于:The apparatus according to claim 13, wherein the first determining unit is specifically configured to:
    确定所述第二区域的各条边界线在X轴上的取值范围;Determine the value range of each boundary line of the second area on the X axis;
    基于所述各条边界线在X轴上的取值范围,标记从第一类边界线开始并沿着Y轴正方向的区域,作为阻挡区域;其中,当所述第二区域的一条边界线在X轴上取值范围被所述第二区域的另一条边界线在X轴上的取值范围覆盖时,所述另一条边界线为第一类边界线。Based on the value range of each boundary line on the X axis, mark the area starting from the first type boundary line and along the positive direction of the Y axis as a blocking area; wherein, when a boundary line of the second area When the value range on the X axis is covered by the value range on the X axis of another boundary line of the second area, the other boundary line is the first type boundary line.
  15. 根据权利要求13所述的装置,其特征在于,所述第一映射单元包括:The apparatus according to claim 13, wherein the first mapping unit comprises:
    判断子单元,用于判断所述障碍物区域是否为多边形区域;The judgment subunit is used to judge whether the obstacle area is a polygonal area;
    第一映射子单元,用于当所述障碍物区域为多边形区域,将极坐标系中的所述待施法区域和所述障碍物区域映射至直角坐标系中,得到所述待施法区域对应的第一区域和所述障碍物区域对应的第二区域。The first mapping subunit is used to map the area to be cast and the obstacle area in the polar coordinate system to a rectangular coordinate system when the obstacle area is a polygonal area to obtain the corresponding area of the area to be cast A second area corresponding to the first area and the obstacle area.
  16. 根据权利要求13所述的装置,其特征在于,所述第一映射单元包括:The apparatus according to claim 13, wherein the first mapping unit comprises:
    判断子单元,用于判断所述障碍物区域是否为多边形区域;The judgment subunit is used to judge whether the obstacle area is a polygonal area;
    处理子单元,用于当所述障碍物区域不为多边形区域,将所述障碍物区 域处理为多边形区域;A processing subunit, configured to process the obstacle area into a polygonal area when the obstacle area is not a polygonal area;
    第二映射子单元,用于将极坐标系中的所述待施法区域和所述多边形区域映射至直角坐标系中,得到所述待施法区域对应的第一区域和所述多边形区域对应的第二区域。A second mapping subunit, configured to map the area to be cast and the polygonal area in the polar coordinate system to a rectangular coordinate system, to obtain the first area corresponding to the area to be casted and the third corresponding to the polygonal area Second area.
  17. 根据权利要求13所述的装置,其特征在于,所述第一映射单元具体用于:The apparatus according to claim 13, wherein the first mapping unit is specifically configured to:
    通过齐次坐标变换,将极坐标系中的所述待施法区域和所述障碍物区域映射至直角坐标系中,得到所述待施法区域对应的第一区域和所述障碍物区域对应的第二区域。Through homogeneous coordinate transformation, the area to be cast and the obstacle area in the polar coordinate system are mapped to a rectangular coordinate system to obtain the first area corresponding to the area to be cast and the first corresponding area of the obstacle area Second area.
  18. 根据权利要求13所述的装置,其特征在于,所述第一映射单元具体用于:The apparatus according to claim 13, wherein the first mapping unit is specifically configured to:
    将极坐标系中的所述待施法区域和所述障碍物区域标注到直角坐标系的像素图中,得到标注图片中记录的、所述待施法区域对应的第一区域和所述障碍物区域对应的第二区域。Mark the area to be cast and the obstacle area in the polar coordinate system to the pixel map of the rectangular coordinate system to obtain the first area and the obstacle area corresponding to the area to be cast recorded in the marked picture Corresponding second area.
  19. 根据权利要求13所述的装置,其特征在于,所述第二映射单元包括:The apparatus according to claim 13, wherein the second mapping unit comprises:
    去除子单元,用于将所述第一区域中去除所述阻挡区域的目标区域映射到所述极坐标系中,得到施法有效区域;A removing subunit, configured to map the target area in the first area from which the blocking area is removed into the polar coordinate system to obtain a cast effective area;
    第一渲染子单元,用于对所述施法有效区域进行高亮渲染,得到瞄准区域。The first rendering subunit is used for highlight rendering the effective casting area to obtain the aiming area.
  20. 根据权利要求13所述的装置,其特征在于,所述第二映射单元包括:The apparatus according to claim 13, wherein the second mapping unit comprises:
    第二渲染子单元,用于将所述第一区域中去除所述阻挡区域的目标区域进行高亮渲染;A second rendering subunit, configured to highlight the target area in the first area from which the blocking area is removed;
    第三映射子单元,用于将进行高亮渲染后的目标区域映射到所述极坐标系中,得到施法有效区域,并将所述施法有效区域作为瞄准区域。The third mapping subunit is used to map the target area after the highlight rendering into the polar coordinate system to obtain a cast effective area, and use the cast effective area as the aiming area.
  21. 根据权利要求12所述的装置,其特征在于,所述第一确定模块包括:The apparatus according to claim 12, wherein the first determining module comprises:
    第二确定单元,用于根据所述游戏角色在所述游戏场景中的位置和所述 瞄准指示所指向的方向,确定所述游戏武器在所述游戏场景中的待施法区域;A second determining unit, configured to determine the area of the game weapon to be cast in the game scene according to the position of the game character in the game scene and the direction pointed by the aiming instruction;
    第三确定单元,用于根据所述游戏场景中各个障碍物的位置,确定所述待施法区域中的障碍物区域。The third determining unit is configured to determine the obstacle area in the area to be cast according to the position of each obstacle in the game scene.
  22. 根据权利要求12-21中任一项所述的装置,其特征在于,所述待施法区域包括:扇环待施法区域、矩形待施法区域或圆环待施法区域。The device according to any one of claims 12-21, wherein the area to be cast comprises: a fan ring to be cast area, a rectangular to be cast area or a ring to be cast area.
  23. 一种电子设备,其特征在于,包括处理器、通信接口、存储器和通信总线,其中,处理器,通信接口,存储器通过通信总线完成相互间的通信;An electronic device characterized by comprising a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory complete communication with each other through the communication bus;
    存储器,用于存放计算机程序;Memory, used to store computer programs;
    处理器,用于执行存储器上所存放的程序时,实现权利要求1-11中任一所述的方法步骤。The processor, when used to execute the program stored on the memory, implements the method steps of any one of claims 1-11.
  24. 一种可读存储介质,其特征在于,所述可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1-11中任一所述的方法步骤。A readable storage medium, characterized in that a computer program is stored in the readable storage medium, and when the computer program is executed by a processor, the method steps of any one of claims 1-11 are realized.
  25. 一种计算机程序产品,所述计算机程序产品用于在运行时执行权利要求1-11中任一项所述的方法步骤。A computer program product for performing the method steps of any one of claims 1-11 during runtime.
PCT/CN2019/088140 2018-12-28 2019-05-23 Method and apparatus for displaying aiming region of game weapon, and electronic device WO2020133894A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811623948.7A CN109731326B (en) 2018-12-28 2018-12-28 Aiming area display method and device of game weapon and electronic equipment
CN201811623948.7 2018-12-28

Publications (1)

Publication Number Publication Date
WO2020133894A1 true WO2020133894A1 (en) 2020-07-02

Family

ID=66361831

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/088140 WO2020133894A1 (en) 2018-12-28 2019-05-23 Method and apparatus for displaying aiming region of game weapon, and electronic device

Country Status (2)

Country Link
CN (1) CN109731326B (en)
WO (1) WO2020133894A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109731326B (en) * 2018-12-28 2020-05-22 北京金山安全软件有限公司 Aiming area display method and device of game weapon and electronic equipment
CN111330271A (en) * 2020-02-24 2020-06-26 竞技世界(北京)网络技术有限公司 Display method and device of prompt area

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001009154A (en) * 1999-06-30 2001-01-16 Namco Ltd Shooting game device
KR20120085479A (en) * 2011-01-24 2012-08-01 김형준 Device for generating color signal and system for expressing color using the same
JP5554010B2 (en) * 2009-05-01 2014-07-23 株式会社タイトー Shooting game equipment
CN107875630A (en) * 2017-11-17 2018-04-06 杭州电魂网络科技股份有限公司 Render area determination method and device
CN108635838A (en) * 2018-05-04 2018-10-12 网易(杭州)网络有限公司 Direction-controlling method and device, storage medium, processor and terminal
CN108854070A (en) * 2018-06-15 2018-11-23 网易(杭州)网络有限公司 Information cuing method, device and storage medium in game
CN108939540A (en) * 2018-07-04 2018-12-07 网易(杭州)网络有限公司 Shooting game assists method of sight, device, storage medium, processor and terminal
CN109731326A (en) * 2018-12-28 2019-05-10 北京金山安全软件有限公司 Aiming area display method and device of game weapon and electronic equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001009154A (en) * 1999-06-30 2001-01-16 Namco Ltd Shooting game device
JP5554010B2 (en) * 2009-05-01 2014-07-23 株式会社タイトー Shooting game equipment
KR20120085479A (en) * 2011-01-24 2012-08-01 김형준 Device for generating color signal and system for expressing color using the same
CN107875630A (en) * 2017-11-17 2018-04-06 杭州电魂网络科技股份有限公司 Render area determination method and device
CN108635838A (en) * 2018-05-04 2018-10-12 网易(杭州)网络有限公司 Direction-controlling method and device, storage medium, processor and terminal
CN108854070A (en) * 2018-06-15 2018-11-23 网易(杭州)网络有限公司 Information cuing method, device and storage medium in game
CN108939540A (en) * 2018-07-04 2018-12-07 网易(杭州)网络有限公司 Shooting game assists method of sight, device, storage medium, processor and terminal
CN109731326A (en) * 2018-12-28 2019-05-10 北京金山安全软件有限公司 Aiming area display method and device of game weapon and electronic equipment

Also Published As

Publication number Publication date
CN109731326A (en) 2019-05-10
CN109731326B (en) 2020-05-22

Similar Documents

Publication Publication Date Title
US10702776B2 (en) Information processing method, storage medium and electronic device
AU2016336604B2 (en) Information processing method and terminal, and computer storage medium
US9272219B2 (en) Three dimensional operations in an isometric projection
WO2017059684A1 (en) Information processing method, terminal, and computer storage medium
WO2020133894A1 (en) Method and apparatus for displaying aiming region of game weapon, and electronic device
WO2020098465A1 (en) Method and device for image display, storage medium and electronic device
WO2022017094A1 (en) Interface display method and apparatus, and terminal and storage medium
JP6438198B2 (en) Program and game device
US20130225260A1 (en) Adaptive difficulty in a multiplayer gaming environment
CN111135561B (en) Game character display method, game character display device, storage medium and electronic equipment
JP6050884B1 (en) Control method and program for competitive game
WO2017133567A1 (en) Batch rendering method, device, and apparatus
TW202228824A (en) Mark processing method, apparatus, computing device, storage medium and program product
EP4192593A1 (en) Improved targeting of a long-range object in a multiplayer game
CN112535866A (en) Method and device for processing virtual object in game and electronic equipment
JP5565591B2 (en) GAME DEVICE AND PROGRAM
WO2023165314A1 (en) Skill damage range determining method and apparatus, electronic device, and storage medium
CN113413588B (en) Game task processing method and device, electronic equipment and storage medium
US20210383101A1 (en) Transforming sports implement motion sensor data to two-dimensional image for analysis
CN110750227B (en) Processing method and device of projection picture, terminal equipment and storage medium
JP7125389B2 (en) Remastering by emulation
US20130172084A1 (en) Dynamic peer-to-peer map reconciliation in a multiplayer gaming environment
CN112446968B (en) Splicing method and device of model components in game and electronic equipment
CN112807698B (en) Shooting position determining method and device, electronic equipment and storage medium
CN112843713A (en) Method, device, equipment and medium for determining center point of visual field

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19902776

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19902776

Country of ref document: EP

Kind code of ref document: A1