Regional action method, device, equipment and medium in virtual environment
By displaying virtual objects in a horizontal perspective in a 3D horizontal game and controlling their movements within the target area, the problem that virtual objects cannot move to non-walking areas is solved, improving user experience and visual effects.
Patent Information
- Application Number
- CN202111643224.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-02-04
- Filing Date
- 2021-12-29
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2041-12-29
AI Technical Summary
In the 3D horizontal version of the game, the virtual object cannot be moved to the non-walking area, resulting in poor user experience and the settings of the walkable area are not intuitive enough.
By displaying the virtual object in a horizontal perspective in a virtual environment and receiving action control operations, the virtual object is controlled to act within the target area. The target area range has a first shape at the horizontal viewing angle, the sides are parallel to the sides of the virtual environment screen, and the second shape is in the front viewing angle.
Improve the visual effect of the target area range in the virtual environment, allowing users to understand the walkable area more intuitively, and improve user experience.
Smart Images

Figure CN114288661B_ABST
Abstract
Description
[0001] This application claims priority to Chinese patent application No. 202110155519.7 filed on February 4, 2021, with invention name “Regional action method, device, equipment and medium in a virtual environment”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of virtual environments, and in particular to a method, device, equipment and medium for regional actions in a virtual environment. Background Art
[0003] Side-Scrolling Platformer refers to a game that fixes the screen on a horizontal plane. It is mainly a scroll map setting of "from left to right" or "from right to left". The cost of making the game is low. The side-scrolling games on the market currently include 2D side-scrolling games, 2.5D side-scrolling games, and 3D side-scrolling games. 2D side-scrolling games use 2D graphics technology. The virtual objects and virtual scenes in the game are all flat graphics. The virtual objects in the game can only move left and right, and the corresponding camera cannot be rotated. In 3D side-scrolling games, 3D graphics technology is used, that is, the virtual objects and virtual scenes in the game are all 3D models. Therefore, the camera is allowed to rotate to see different game perspectives. And compared with 2D side-scrolling games, the virtual objects in 3D side-scrolling games can not only move left and right, but also move forward and backward in a small range.
[0004] The walkable area in the 3D horizontal game is projected on the screen, and players can control virtual objects to move in the walkable area. When the virtual object moves to the boundary of the walkable area, even if the player issues a control command to move outside the boundary, the virtual object cannot move to the non-walkable area.
[0005] Since the walkable area is projected onto the screen based on the scene effects in the virtual environment, there is a perspective effect. Therefore, the walkable area seen by the player is different from the actual walkable area, which will cause misunderstandings due to the perspective effect. That is, there is a situation where the virtual ground is displayed in the game screen, but the virtual object cannot be moved to that position. The user experience is poor and the setting of the walkable area is not intuitive enough. Summary of the invention
[0006] The embodiment of the present application provides a method, device, equipment and medium for regional actions in a virtual environment, which can increase the diversity of methods for using virtual throwing props. The technical solution is as follows:
[0007] On the one hand, a method for regional action in a virtual environment is provided, the method comprising:
[0008] Displaying a virtual object in the virtual environment in a horizontal perspective in a virtual environment screen, wherein the horizontal perspective is used to indicate a side observation angle of the virtual object in a third-person perspective;
[0009] receiving an action control operation on the virtual object, wherein the action control operation is used to control the virtual object to act in the virtual environment;
[0010] Based on the action control operation, the virtual object is controlled to move within the target area of the virtual environment, wherein the target area presents a first shape under the horizontal perspective, and the side of the target area is parallel to the side of the virtual environment screen under the horizontal perspective, and the target area presents a second shape under the front view of the virtual environment, and the direction of the front view is a viewing direction perpendicular to the surface where the target area is located.
[0011] In another aspect, a regional action device in a virtual environment is provided, the device comprising:
[0012] A display module, used for displaying a virtual object in the virtual environment in a horizontal perspective in a virtual environment screen, wherein the horizontal perspective is used to indicate a side observation angle of the virtual object in a third-person perspective;
[0013] A receiving module, used for receiving an action control operation on the virtual object, wherein the action control operation is used for controlling the virtual object to act in the virtual environment;
[0014] A control module is used to control the virtual object to move within a target area in the virtual environment based on the action control operation, wherein the target area is in a first shape under the horizontal perspective, and the side of the target area is parallel to the side of the virtual environment screen under the horizontal perspective, and the target area is in a second shape under the front view of the virtual environment, and the direction of the front view is a viewing direction perpendicular to the surface where the target area is located.
[0015] On the other hand, a computer device is provided, wherein the terminal includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the regional action method in a virtual environment described in any of the embodiments of the present application.
[0016] On the other hand, a computer-readable storage medium is provided, wherein at least one program code is stored in the computer-readable storage medium, and the program code is loaded and executed by a processor to implement the regional action method in a virtual environment described in any of the embodiments of the present application.
[0017] On the other hand, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the regional action method in a virtual environment described in any of the above embodiments.
[0018] The technical solution provided by this application includes at least the following beneficial effects:
[0019] A virtual object is displayed in a horizontal perspective in a virtual environment screen. When an action control operation of the virtual object is received, the virtual object can act within a target area, wherein the target area is in a first shape in the horizontal perspective, and in the horizontal perspective, the side of the target area is parallel to the side of the virtual environment screen, and the target area is in a second shape in the front view of the virtual environment, and the direction of the front view is a viewing direction perpendicular to the target area. That is, a target area in a first shape is set in the horizontal perspective to provide the virtual object with an action, and since the first shape matches the shape of the virtual environment screen, the visual effect of the target area in the virtual environment can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 is a schematic diagram of a two-dimensional virtual environment interface provided by an exemplary embodiment of the present application;
[0022] Figure 2 is a schematic diagram of a two-dimensional virtual environment lens rotation provided by an exemplary embodiment of the present application;
[0023] Figure 3 is a schematic diagram of a three-dimensional virtual environment interface provided by an exemplary embodiment of the present application;
[0024] Figure 4 is a schematic diagram of a three-dimensional virtual environment lens rotation provided by an exemplary embodiment of the present application;
[0025] Figure 5 It is a schematic diagram of a virtual object using skills in a three-dimensional virtual environment screen provided by an exemplary embodiment of the present application;
[0026] Figure 6 is a structural block diagram of a terminal provided by an exemplary embodiment of the present application;
[0027] Figure 7 It is a schematic diagram of a walkable area provided in the related art;
[0028] Figure 8 It is a schematic diagram of the walkable area and the non-walkable area provided in the related art;
[0029] Fig. 9 It is a schematic diagram of a light wall provided in the related art;
[0030] Fig.10 is a structural block diagram of a computer system provided by an exemplary embodiment of the present application;
[0031] Fig.11 is a flow chart of a regional action method in a virtual environment provided by an exemplary embodiment of the present application;
[0032] Fig.12 is a schematic diagram of a perspective effect of a target area range provided by an exemplary embodiment of the present application;
[0033] Fig.13 is a flow chart of a regional action method in a virtual environment provided by an exemplary embodiment of the present application;
[0034] Fig.14 is a flow chart of a method for setting a target area range provided by another exemplary embodiment of the present application;
[0035] Fig.15 is a schematic diagram of a moving boundary of a virtual camera model provided by an exemplary embodiment of the present application;
[0036] Fig.16 is a schematic diagram of a correction angle provided by an exemplary embodiment of the present application;
[0037] Fig.17 This is a schematic diagram of the target area range obtained when the boundary extension distance is 0 provided by an exemplary embodiment of the present application;
[0038] Fig.18 It is the target area range obtained when the boundary extension distance is -2 provided by an exemplary embodiment of the present application;
[0039] Fig.19 is a structural block diagram of a regional action device in a virtual environment provided by an exemplary embodiment of the present application;
[0040] Fig. 20 is a structural block diagram of a regional action device in a virtual environment provided by another exemplary embodiment of the present application;
[0041] Fig.21 It is a structural block diagram of a terminal provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0042] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0043] First, the nouns involved in the embodiments of the present application are briefly introduced:
[0044] Virtual environment: is a virtual environment displayed (or provided) when an application is running on a terminal. The virtual environment can be a simulation of the real world, a semi-simulation and semi-fictitious environment, or a purely fictitious environment. The virtual environment can be any one of a two-dimensional virtual environment, a 2.5-dimensional virtual environment, and a three-dimensional virtual environment, and this application does not limit this. The following embodiments are illustrated by taking the virtual environment as a three-dimensional virtual environment.
[0045] Virtual object: refers to an active object in a virtual environment. The active object may be a virtual person, a virtual animal, an animated character, etc., such as a person, an animal, a plant, an oil drum, a wall, a stone, etc. displayed in a three-dimensional virtual environment. Optionally, the virtual object is a three-dimensional model created based on animation skeleton technology. Each virtual object has its own shape and volume in a three-dimensional virtual environment and occupies a part of the space in the three-dimensional virtual environment.
[0046] View direction: the viewing direction when observing the virtual object in the virtual environment from the first-person perspective or the third-person perspective. Optionally, in the embodiment of the present application, the view direction is the direction when observing the virtual object through the camera model in the virtual environment.
[0047] Optionally, the camera model automatically follows the virtual object in the virtual environment, that is, when the position of the virtual object in the virtual environment changes, the camera model follows the position of the virtual object in the virtual environment and changes simultaneously, and the camera model is always within a preset distance range of the virtual object in the virtual environment. Optionally, during the automatic following process, the relative position of the camera model and the virtual object does not change.
[0048] Camera model: A camera model is a three-dimensional model located around a virtual object in a three-dimensional virtual environment. In an embodiment of the present application, the camera model is located on a horizontal plane at a preset distance in front of the virtual environment. Schematically, the camera model can be bound to the virtual object. The camera model moves with the left and right movement of the virtual object, moves with the up and down movement of the virtual object, moves with the forward and backward movement of the virtual object, or the camera model is fixed for the forward and backward movement of the virtual object. Schematically, the camera model can also observe the virtual environment independently of the virtual object, that is, only the observation position of the camera model is adjusted without adjusting the position of the virtual object in the virtual environment. In an embodiment of the present application, the camera model is described in a manner that it can be bound to a virtual object. Schematically, the camera model will not be actually displayed in the three-dimensional virtual environment, that is, the camera model cannot be recognized in the three-dimensional virtual environment displayed by the user interface.
[0049] Illustratively, the camera model can also observe the virtual object at preset angles in different directions of the virtual object. In one example, when the virtual object uses a preset skill in a virtual environment, its camera model moves according to a preset motion trajectory, showing the skill performance of the virtual object from different angles.
[0050] Horizontal scrolling game: refers to a game in which the screen is fixed on a horizontal plane. Horizontal scrolling games include virtual environments and virtual objects. Horizontal scrolling games include 2D horizontal scrolling games, 2.5D horizontal scrolling games, and 3D horizontal scrolling games.
[0051] Schematically, a 2D horizontal version game uses 2D graphics technology, that is, the virtual environment and virtual characters are 2D graphics, such as Figure 1 As shown in FIG. 1 , it shows the normal display effect of the 2D virtual environment interface 100. The 2D virtual environment interface 100 includes a virtual object 110 and a virtual environment (not shown) displayed in 2D graphics. Operation controls, such as a movement control 131 and a skill control 132, are also superimposed on the 2D virtual environment interface 100. That is, since the virtual environment and the virtual characters are both in the form of 2D graphics, the virtual objects in the game can only move left and right, and the corresponding lens cannot be rotated. If they are rotated, the picture will be distorted, such as Figure 2 As shown, it shows the deformation of the virtual object 210 and the virtual environment 220 after the 2D virtual environment screen is rotated.
[0052] Schematically, 2.5D horizontal scrolling games are a form of horizontal scrolling games between 2D horizontal scrolling games and 3D horizontal scrolling games. 2.5D is essentially a kind of "fake 3D", that is, a 2D picture in the form of 3D graphics, which has a 3D visual experience, but its game engine is still the same as the game engine of 2D horizontal scrolling games, and its representation form is that the virtual object is 2D graphics, the virtual environment is 3D graphics, or, the virtual object is 3D graphics, and the virtual environment is in 2D form. Because 2.5D horizontal scrolling games use 2D game engines, their resource consumption is less than that of 3D horizontal scrolling games, and the visual effect is better than that of 2D horizontal scrolling games.
[0053] Schematically, 3D horizontal version games use 3D graphics technology, that is, the virtual environment and virtual characters are 3D graphics (models), such as Figure 3 As shown in FIG. 1 , it shows the normal display effect of the 3D virtual environment interface 300. The 3D virtual environment interface 300 includes a virtual object 310 and a virtual environment (not shown) displayed in 3D graphics. Operation controls, such as a movement control 331 and a skill control 332, are also superimposed on the 3D virtual environment interface 300. In a 3D horizontal version game, the virtual environment and virtual characters are both in the form of 2D graphics (models). Therefore, the virtual objects in the game can not only move left and right, but also move forward and backward on the same virtual ground layer in the virtual environment, and the camera can be rotated, so that players can observe different game perspectives, such as Figure 4 As shown in FIG. 4 , the virtual object 410 and the virtual environment (not shown) after the 3D virtual environment screen 400 is rotated are shown. The virtual environment and the virtual object 410 in the virtual environment screen 400 are not deformed and can still be displayed normally. Schematically, since the 3D horizontal version game has the advantage of a rotatable camera, the 3D horizontal version game has a richer camera image performance. In one example, Figure 5 As shown, it shows that in a 3D horizontal version game, when a virtual object 510 in a 3D virtual environment screen 500 uses a preset skill, its skill screen and its skill effect are displayed by changing the camera direction, making the camera screen more expressive. Optionally, the preset skill can be a big move skill or a combination skill. Indicatively, the player can also trigger the view rotation control on the virtual environment interface to achieve the view rotation effect. Optionally, the trigger operation can be a drag operation, a press operation, or a touch operation, which is not limited here.
[0054] In the embodiment of the present application, the method for setting the mobile area in the virtual environment is applied to a 3D horizontal game for illustration.
[0055] Next, in conjunction with the above terms, the terminal structure of the embodiment of the present application is schematically described. Figure 6, which shows a structural block diagram of a terminal provided by an exemplary embodiment of the present application. The terminal 600 includes: an operating system 610 and an application 620.
[0056] The terminal 600 in the present application can be a desktop computer, a laptop computer, a mobile phone, a tablet computer, an e-book reader, an MP3 (Moving Picture Experts Group Audio Layer III) player, an MP4 (Moving Picture Experts Group Audio Layer IV) player, etc.
[0057] Operating system 610 is the basic software that provides application programs 620 with secure access to computer hardware.
[0058] An application 620 supporting a virtual environment is installed and run in the terminal 600, such as an application supporting a three-dimensional virtual environment. The application 620 may be any one of a virtual reality application, a three-dimensional map program, a TPS game, an FPS game, and a MOBA game. In an embodiment of the present application, the application 620 is an application corresponding to a 3D horizontal version game. Schematically, the 3D horizontal version game may be a shooting game, a fighting game, an adventure game, an action game, a puzzle game, and other different types of games, which are not limited here. Optionally, the application may be a stand-alone application, such as a stand-alone 3D horizontal version game program, or a networked application. The user uses the terminal to control a virtual object in a virtual environment to perform an activity, which includes but is not limited to: adjusting body posture, crawling, walking, running, riding, jumping, driving, using skills, and attacking at least one of them. Schematically, the virtual object may be a simulated character or an anime character.
[0059] In combination with the above-mentioned explanations of terms and terminal structures, the application scenarios of the embodiments of the present application are schematically described.
[0060] In the embodiment of the present application, the 3D horizontal version game is taken as a fighting game as an example for explanation. In the virtual environment provided by the application, the player can manipulate the virtual object to carry out activities in the virtual environment. Schematically, the virtual environment includes a walkable area and a non-walkable area. The player can manipulate the virtual object to move in the walkable area, and can also carry out activities such as attacking and using skills in the walkable area. The walkable area can be a virtual ground, a virtual ladder, the surface of a virtual object, etc. displayed in the virtual environment. For the non-walking area, the player cannot manipulate the virtual object to move to the non-walking area. The non-walking area can be a virtual ground displayed in the virtual environment, or it can be a virtual scene of an immovable area displayed in the virtual environment.
[0061] Generally, the virtual ground in the virtual environment is set as the walkable area, that is, the target shape area is determined according to the virtual ground, and the area is set as the walkable area. Schematically, the target shape is a rectangle. In a 3D horizontal game, the virtual environment displayed follows the rule that objects are larger when near and smaller when far, that is, it has a perspective effect. After the determined walkable area is projected, the shape displayed on the screen will become a rectangle. For a schematic, please refer to Figure 7 , a rectangular ground is selected from the virtual ground 710 as the walkable area 711. When the walkable area is projected into the virtual environment picture 720 on the terminal screen, the walkable area 721, that is, the walkable area 721 is a trapezoid in visual effect, while the walkable area of the actual virtual object is a rectangle.
[0062] The virtual ground displayed in the virtual environment screen of the walkable area set by the above scheme includes the walkable area and the non-walkable area, such as Figure 8 As shown, it shows that the virtual environment screen 800 includes a virtual object 810 and a virtual ground, and the virtual ground includes a walkable area 820 and a non-walkable area. In the picture displayed by the virtual environment screen 800, the walkable area intuitively felt by the player is the "visual walkable area" 830, and the "visual walkable area" 830 includes the walkable area 820 and the non-walkable area, which can easily cause misunderstanding to the player.
[0063] In the related art, a light wall is set at the boundary between the walkable area and the non-walkable area to inform the player of the actual walkable range of the virtual object in the virtual environment. Fig. 9 , which shows that the virtual environment 900 includes a virtual object 910 and a walkable area 920, and light walls 930 are displayed on both sides of the walkable area 920. The light walls 930 are displayed in a semi-transparent form, that is, the light walls 930 are used to mark the inaccessible range in the virtual environment to alleviate the misunderstanding caused by perspective.
[0064] However, using light walls to mark the difference between walkable areas and non-walkable areas will visually have a negative impact on the player's gaming experience, that is, the setting of the light wall is abrupt, reducing the player's sense of immersion.
[0065] In an embodiment of the present application, by correcting the selected walkable area in the virtual environment, a corrected walkable area is obtained, so that the walkable area displayed on the screen is closer to the "visual walkable area" observed by the player, giving the player a better visual experience.
[0066] Please refer to Fig.10 , which shows a block diagram of a computer system provided by an exemplary embodiment of the present application. The computer system 1000 includes: a terminal 1010 , a server 1020 and a communication network 1030 .
[0067] Terminal 1010 can be a desktop computer, a laptop, a mobile phone, a tablet computer, an e-book reader, an MP3 (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Group Audio Layer 3) player, an MP4 (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Group Audio Layer 4) player, etc. The terminal 1010 has installed and runs an application that supports a virtual environment, such as an application that supports a three-dimensional virtual environment. The application can be any one of a virtual reality application, a three-dimensional map program, a TPS (Third-Person Shooting) game, an FPS (First-Person Shooting) game, and a MOBA (Multiplayer Online Battle Arena) game. In an embodiment of the present application, the application is a 3D horizontal version game. Optionally, the application can be a stand-alone version application or a networked version application.
[0068] The server 1020 includes at least one of a single server, multiple servers, a cloud computing platform, and a virtualization center. The server 1020 is used to provide background services for applications that support a three-dimensional virtual environment. Optionally, the server 1020 undertakes the main computing work, and the terminal 1010 undertakes the secondary computing work; or, the server 1020 undertakes the secondary computing work, and the terminal 1010 undertakes the main computing work; or, the server 1020 and the terminal 1010 adopt a distributed computing architecture for collaborative computing.
[0069] The user can control the virtual objects in the application supporting the virtual environment through the terminal 1010. Schematically, the application is a 3D horizontal version fighting game program, that is, the user can control the virtual object to join the virtual battle game, and participate in the fighting competition in the virtual environment corresponding to the virtual game, and defeat the local virtual object by controlling the virtual object to attack or use skills. The terminal 1010 transmits the signal corresponding to the user operation to the server 1020 through the communication network 1030, and the server 1020 performs the corresponding logical processing and returns the processing result to the terminal 1020. Those skilled in the art can know that the number of the above-mentioned terminals 1010 can be more. For example, the above-mentioned terminal 1010 can be only one, or the above-mentioned terminal 1010 can be dozens or hundreds, or more. The embodiment of the present application does not limit the number of terminals 1010 and the type of terminals 1010.
[0070] In an embodiment of the present application, the terminal 1010 displays a virtual environment screen through the above-mentioned application, and the virtual environment screen includes a virtual object displayed in a 3D horizontal version perspective. The user sends an action control operation to the virtual object through the terminal 1010, and the terminal 1010 generates a control signal corresponding to the action control operation and sends it to the server 1020. The server 1020 performs logical processing on the control signal and returns the result to the terminal 1010, and the terminal 1010 displays the screen according to the result. Among them, the target area range (walkable area) in the virtual environment screen is set by the server 1020. When the control signal sent by the terminal 1010 corresponds to moving the virtual object in the virtual environment, the server 1020 determines whether the control signal indicates that the virtual object moves to the non-walking area according to the target area range. If so, a signal that cannot continue to move in this direction is returned to the terminal 1010, and the virtual object displayed in the terminal 1010 stops or repeats the walking action at the boundary of the target area range, but its corresponding position does not change.
[0071] Please refer to Fig.11 , which shows a flowchart of a regional action method in a virtual environment provided by an exemplary embodiment of the present application, combined with Fig.11 The above application scenarios illustrate the regional action method in the virtual environment provided by the embodiment of the present application. In this embodiment, the method is applied to a terminal for illustration. The method includes:
[0072] Step 1101: Display virtual objects in a virtual environment in a horizontal perspective in a virtual environment screen.
[0073] In the embodiment of the present application, a three-dimensional horizontal version game is run in the terminal as an example for explanation. Schematically, the three-dimensional horizontal version game includes but is not limited to at least one of shooting games, fighting games, adventure games, action games, and puzzle games. A virtual environment interface corresponding to the three-dimensional horizontal version game is displayed in the terminal, and the virtual environment interface includes a virtual environment screen, and a virtual object is displayed in the virtual environment screen. The virtual environment interface is an interface obtained by superimposing interface elements such as instruments and controls on the virtual environment screen, wherein the virtual environment screen is a screen acquired by a camera model in a three-dimensional virtual environment, that is, the virtual environment interface includes a virtual environment screen. Among them, the virtual object is displayed in a horizontal version perspective, and the horizontal version perspective is used to indicate the side observation angle of observing the virtual object from a third-person perspective. Since the three-dimensional horizontal version game is used as an example for explanation in the embodiment of the present application, the horizontal version perspective is the side observation angle of observing the virtual object in the three-dimensional virtual environment.
[0074] Illustratively, a user may control a virtual object in a virtual environment through a terminal to implement various activities in the virtual environment through the virtual object, including but not limited to: adjusting body posture, crawling, walking, running, riding, jumping, driving, using skills, and attacking. The virtual object may be a simulated character or an animated character.
[0075] In this 3D horizontal game, the user can also rotate the viewing direction of the horizontal perspective through the terminal, that is, by changing the lens direction of the virtual camera model, to observe the virtual environment and the state of the virtual object from different perspectives. Schematically, when the user controls the virtual object to perform a preset skill, the direction of the horizontal perspective will change, that is, the skill screen and its skill effect will be displayed by changing the lens direction; or the user can control the change of the above perspective through the perspective rotation control superimposed in the virtual environment interface.
[0076] Step 1102: Receive an action control operation on a virtual object.
[0077] The action control operation is used to control the action of the virtual object in the virtual environment, wherein the above-mentioned actions include but are not limited to adjusting body posture, crawling, walking, running, riding, jumping, driving, skill use, and at least one of attacking. In the embodiment of the present application, the action is taken as an example for explanation. Since the three-dimensional horizontal version game is targeted in the embodiment of the present application, the movement range of the virtual object in the above-mentioned virtual environment is different from that of the ordinary three-dimensional game. Since the "map" in the virtual environment is in the shape of a scroll, that is, the horizontal movement range of the virtual object is much larger than the front and back movement range, the movement operation of the virtual object in the virtual environment has obvious limitations. Schematically, the "map" in the virtual environment not only provides a horizontal movement range and a front and back movement range, but also includes an up and down movement range, that is, the virtual environment includes at least one layer of virtual ground (or other virtual objects provided for the virtual object to move). When the number of layers of the virtual ground is greater than one layer, the user can also operate the virtual object to move up and down. In one example, the virtual object moves up and down by connecting the virtual ladder or virtual vines between the upper and lower virtual surfaces, or the virtual object jumps from the low virtual ground to the high virtual ground by triggering a jump operation.
[0078] Step 1103, based on the action control operation, control the virtual object to move within the target area of the virtual environment, wherein the target area is in a first shape in the horizontal perspective, and the side of the target area is parallel to the side of the virtual environment screen in the horizontal perspective.
[0079] In an embodiment of the present application, the virtual environment includes a walkable area and a non-walkable area. The user can manipulate the virtual object to move in the walkable area, and can also perform activities such as attacking and using skills in the walkable area. The walkable area can be a part of the virtual ground, a virtual ladder, the surface of a virtual object, etc. displayed in the virtual environment. As for the non-walkable area, the user cannot manipulate the virtual object to move to the non-walkable area. The above-mentioned non-walking area is an area in which the virtual object cannot enter the virtual environment. The non-walking area includes background areas, such as virtual houses and virtual sea surfaces displayed as backgrounds in the virtual environment. The non-walking area also includes virtual ground other than the above-mentioned walkable part of the virtual ground. Although the virtual ground is visually a "walkable area", due to the perspective relationship of the three-dimensional virtual environment, it is actually an area where the virtual object cannot walk.
[0080] In the embodiment of the present application, the walkable area is displayed as a virtual ground for example. The terminal determines the walkable area in the virtual environment as the target area range, and controls the virtual object to move within the target area range in the virtual environment based on the action control operation.
[0081] Schematically, the target area range has a first shape in a horizontal perspective, and the first shape is a shape obtained by mapping the target area range in a horizontal perspective, and has a second shape in a frontal perspective of the virtual environment, wherein the horizontal perspective is a side observation angle for observing a virtual object in a third-person perspective, that is, the viewing direction of the virtual environment observed in the virtual environment screen displayed by the terminal, and the direction of the frontal perspective is a viewing direction perpendicular to the surface where the target area range is located. The first shape matches the shape of the virtual environment screen in the horizontal perspective, that is, in the horizontal perspective, the side of the displayed target area range is parallel to the side of the virtual environment screen. Schematically, the side of the target area range includes a first side and a second side, the first side is opposite to the second side, and the side of the virtual environment screen includes a third side and a fourth side, the third side is opposite to the fourth side, wherein the first side is parallel to the third side, and the second side is parallel to the fourth side. In one example, the display screen of the terminal is a rectangle, and the virtual environment screen displayed by it corresponds to a rectangle. Based on the display direction of the virtual environment screen, the first side of the virtual environment screen corresponds to the left side, and the second side corresponds to the right side. Therefore, the third side of the target area range in the horizontal version is also the left side, and the fourth side corresponds to the right side. The display direction is the display direction when the user controls the virtual object in the virtual environment to move left and right through the terminal. When the virtual object moves to the left, the display direction corresponds to the left, and when the virtual object moves to the right, the display direction corresponds to the right, that is, the first side is the left side of the target area range, and the second side is the right side of the target area range; the third side is the left side of the virtual environment screen, and the fourth side is the right side of the virtual environment screen. In the horizontal version, the first shape corresponding to the target area range is a rectangle whose two opposite sides are parallel to the left and right sides of the virtual environment screen.
[0082] In one example, the first shape is a rectangle and the second shape is a trapezoid. Fig.12 , after the perspective effect, the target area range 1211 displayed as a trapezoid in the virtual environment 1210 is projected into the virtual environment 1220 under the horizontal perspective, and is displayed as a rectangular target area range 1221. The rectangular target area range is more closely aligned with the edge of the virtual environment screen displayed by the terminal. In the embodiment of the present application, the first shape and the second shape may also be other shapes with a perspective relationship, which are not limited here.
[0083] In an embodiment of the present application, the method for determining the target area range may be to determine the target area range based on the perspective angle between the horizontal perspective and the frontal perspective, that is, by calculating the perspective angle formed by the perspective relationship between the horizontal perspective and the frontal perspective. In one example, an initial area range of a first shape is selected in a virtual environment under a frontal perspective, and the initial area range of the first shape is corrected to a target area range of a second shape according to the perspective angle. After projection, the target area range obtained by the above process is displayed as a first shape matching the virtual environment screen under the horizontal perspective.
[0084] The method for determining the target area range can also be to set a virtual camera model that can observe the three-dimensional virtual environment in all directions, adjust the virtual camera model to the front view angle where the walkable area position needs to be set, select an initial area range of a second shape, and then adjust the virtual camera model to the horizontal view angle, and determine whether the shape displayed by the initial area range in the horizontal view angle is a first shape that matches the virtual environment picture. If so, determine that the initial area range is the target area range. If not, readjust the camera model to the front view angle, and correct the initial area range according to the display of the initial area range in the horizontal view angle until the initial area range is displayed as the first shape that matches the virtual environment picture in the horizontal view angle.
[0085] In the embodiment of the present application, the terminal needs to determine whether the action performed by the virtual object controlled by the action control operation exceeds the target area range. If it exceeds the target area range, the virtual object cannot perform the corresponding action operation. If it does not exceed the target area range, the terminal controls the virtual object to act within the target area range. That is, in response to the action control operation indicating that the action range of the virtual object in the virtual environment does not exceed the target area range, the virtual object is controlled to act; or, in response to the action control operation indicating that the action range of the virtual object in the virtual environment exceeds the target area range, it is determined that the action control operation fails to execute.
[0086] In summary, the regional action method in the virtual environment provided by the embodiment of the present application controls the virtual object in the virtual environment displayed in a horizontal perspective to perform actions within the target area by receiving an action control operation, wherein the target area is in a first shape in the horizontal perspective and the side of the target area in the horizontal perspective is parallel to the side of the virtual environment screen, and the target area is in a second shape in the front view of the virtual environment. That is, a target area in a first shape is set in the horizontal perspective to provide the virtual object with actions, and the target area in the horizontal perspective fits the display effect of the virtual environment screen, so the visual effect of the target area in the virtual environment can be improved.
[0087] Please refer to Fig.13, which shows a flow chart of a regional action method in a virtual environment provided by an exemplary embodiment of the present application. In the embodiment of the present application, the target area range in the virtual environment is determined by the terminal. Schematically, the application program for providing the virtual environment running in the terminal is a stand-alone game program or a network-connected game program, but the process of determining the target area range is implemented by the terminal. The method includes:
[0088] Step 1301: Display virtual objects in a virtual environment in a horizontal perspective in a virtual environment screen.
[0089] In an embodiment of the present application, a virtual environment interface corresponding to a three-dimensional horizontal game is displayed in the terminal, and the virtual environment interface includes a virtual environment screen, and a virtual object is displayed in the virtual environment screen, wherein the virtual object is displayed in a horizontal perspective, and the horizontal perspective is used to indicate a side observation angle of the virtual object from a third-person perspective.
[0090] Step 1302: Receive an action control operation on a virtual object.
[0091] The action control operation is used to control the action of the virtual object in the virtual environment, wherein the above-mentioned action includes but is not limited to at least one of adjusting body posture, crawling, walking, running, riding, jumping, driving, using skills, and attacking.
[0092] In an embodiment of the present application, the virtual environment includes a walkable area and a non-walkable area. The user can only control the virtual object to move in the walkable area, but not in the non-walkable area. That is, all actions performed by the user to control the virtual object can only be performed in the walkable area.
[0093] Step 1303, determining the perspective angle based on the horizontal perspective and the frontal perspective.
[0094] After the terminal receives the action control operation of the virtual object, it needs to determine whether the control operation is valid. In one example, if the action control operation is used to instruct the virtual object to walk to the non-walking area, the terminal determines that the action control operation is invalid. Therefore, the terminal needs to determine the target area range corresponding to the walkable area in the virtual environment. Schematically, the target area range can be the area range stored in the memory of the terminal, and the terminal obtains the corresponding target area range according to the virtual environment in which the current virtual object exists. In one example, the virtual environment corresponds to map information, that is, different virtual environments correspond to different virtual maps, and the map information corresponds to a map identifier. The terminal reads the target area range stored in the memory according to the map identifier; the target area range can also be the target area range calculated by the terminal according to the current virtual environment.
[0095] In the embodiment of the present application, a perspective effect is formed because there is a perspective angle between the horizontal viewing angle and the frontal viewing angle. The perspective angle is used to describe the change in the viewing angle between the horizontal viewing angle and the frontal viewing angle.
[0096] In an illustrative manner, the perspective angle is determined by a perspective camera model in a virtual environment, and the perspective camera model is used to rotate around a target point in the virtual environment. In one example, a point on the surface of a virtual plane used to determine the range of the target area is selected as the target point; the perspective camera model is rotated from a frontal perspective to a horizontal perspective based on the target point; and the rotation angle of the perspective camera model is determined as the perspective angle.
[0097] Step 1304: Determine the range of the target area in the second shape under the normal viewing angle based on the perspective angle.
[0098] In the embodiment of the present application, the terminal determines the scope of the target area by the perspective angle between the horizontal view angle and the front view angle. That is, based on the horizontal view angle and the front view angle, the perspective angle is determined; based on the perspective angle, the scope of the target area in the second shape under the front view angle is determined. The above-mentioned target area in the second shape under the front view angle is in the first shape under the horizontal view angle.
[0099] Illustratively, determining the target area range also includes selecting an initial area range of a first shape in a virtual environment under a frontal perspective, and modifying the initial area range according to the perspective perspective to obtain a target area range that can be in the first shape under a horizontal perspective.
[0100] In an embodiment of the present application, the boundary of the target area range is also determined by the boundary of the virtual environment screen displayed in the terminal. Schematically, the virtual environment also includes a virtual camera model, which moves with the movement of the virtual object in the virtual environment. After determining the initial area range, the moving boundary of the camera model when moving in the virtual environment is obtained, and the boundary of the initial area range and the moving boundary are compared to determine the boundary extension distance, and then the boundary extension distance and the perspective angle are used to determine the target area range that is in the second shape under the front view angle. The above-mentioned target area range that is in the second shape under the front view angle is in the first shape under the horizontal view angle.
[0101] Step 1305 , based on the action control operation, controlling the virtual object to move within a target area in the virtual environment.
[0102] The terminal controls the virtual object to act within the target area according to the action control operation and the determined target area.
[0103] In summary, the regional action method in the virtual environment provided by the embodiment of the present application controls the virtual object in the virtual environment displayed in a horizontal perspective to act within the target area by receiving an action control operation and determining the target area range corresponding to the virtual environment, wherein the target area range is in a first shape in the horizontal perspective, and the first shape matches the shape of the virtual environment screen, and the target area range is in a second shape in the front view of the virtual environment. That is, a target area range in a first shape is set in the horizontal perspective to provide the virtual object with an action, and since the first shape matches the shape of the virtual environment screen, the visual effect of the target area range in the virtual environment can be improved.
[0104] Please refer to Fig.14 , which shows a flow chart of a method for setting a target area range provided by an exemplary embodiment of the present application. The method can be applied to a terminal or a server. In the embodiment of the present application, the method is applied to a server for explanation. The method for setting a target area range includes:
[0105] Step 1401, determining the perspective angle based on the horizontal perspective and the frontal perspective.
[0106] The virtual environment corresponding to the virtual environment screen includes a walkable area and a non-walkable area. Users can manipulate virtual objects to move in the walkable area, and can also perform activities such as attacking and using skills in the walkable area. The walkable area can be a virtual ground, a virtual ladder, the surface of a virtual object, etc. displayed in the virtual environment. For the non-walking area, the user cannot manipulate the virtual object to move to the non-walking area. The non-walking area can be a virtual ground displayed in the virtual environment, or it can be a virtual scene of an immovable area displayed in the virtual environment. In an embodiment of the present application, the above-mentioned walkable area is the target area range determined by the server.
[0107] In an embodiment of the present application, the server determines the target area range and sends the target area range to the terminal, or after determining the target area range, the server makes a judgment based on the action control signal sent by the terminal and the target area range, and returns to the terminal whether the action control signal is valid. Schematically, if the action control signal corresponds to moving the virtual object to a non-walking area, that is, moving it outside the target area range, the action control signal is determined to be invalid and a corresponding feedback signal is returned; otherwise, the action control signal is determined to be valid and a corresponding feedback signal is returned.
[0108] The server determines the target area based on the change of the viewing angle between the horizontal view and the front view in the virtual environment, that is, the perspective angle, which is used to describe the change of the virtual environment under the horizontal view. Schematically, the perspective angle is determined based on the horizontal view and the front view, that is, by calculating the perspective angle formed by the perspective relationship between the horizontal view and the front view.
[0109] Step 1402: Select an initial area range of a first shape in a virtual environment under a normal viewing angle.
[0110] In an embodiment of the present application, an initial area range of a first shape is selected in a virtual environment under a frontal perspective, and the initial area range of the first shape is corrected to a target area range of a second shape according to a perspective angle. After projection, the target area range obtained by the above process is displayed as a first shape matching the virtual environment screen under a horizontal perspective, that is, an initial area range of a first shape is selected in a virtual environment under a frontal perspective; based on the initial area range and the perspective angle, a target area range of a second shape under a frontal perspective is determined. In one example, the first shape is a rectangle, and the second shape is a trapezoid, that is, the determined target area range is a rectangle under a horizontal perspective, and its boundary coincides with the boundary of the virtual environment screen displayed by the terminal, and the target area range is a trapezoid under a frontal perspective. Before determining the target area range, an initial area range of a first shape is first selected in a virtual environment under a frontal perspective, and then the initial area range is corrected to obtain the target area range.
[0111] Step 1403, obtaining the moving boundary of the virtual camera model in the virtual environment.
[0112] In an embodiment of the present application, the virtual environment also includes a virtual camera model, which moves with the movement of the virtual object in the virtual environment. Schematically, the virtual camera model is located on a horizontal plane at a preset distance in front of the virtual environment. Schematically, the virtual camera model can be bound to the virtual object, and the virtual camera model moves with the left and right movement of the virtual object, moves with the up and down movement of the virtual object, moves with the forward and backward movement of the virtual object, or, for the forward and backward movement of the virtual object, the virtual camera model is fixed. In one example, the virtual camera model can also observe the virtual environment independently of the virtual object, that is, only the observation position of the virtual camera model is adjusted without adjusting the position of the virtual object in the virtual environment. In an embodiment of the present application, the virtual camera model is described in a manner that it can be bound to the virtual object. Schematically, the virtual camera model will not be actually displayed in the three-dimensional virtual environment, that is, the virtual camera model cannot be recognized in the three-dimensional virtual environment displayed by the user interface.
[0113] When the virtual object moves to the boundary of the walkable area set in the virtual environment, the virtual camera model will also move to its corresponding boundary. Schematically, the moving boundary of the virtual camera model is the same as the boundary of the walkable area, or the moving boundary of the virtual camera model is different from the boundary of the walkable area. In an example, the moving boundary of the virtual camera model is the same as the boundary of the initial area range. Fig.15 As shown, the left boundary of the initial area range 1510 coincides with the moving boundary of the virtual camera model 1520 when it moves to the left boundary. Fig.15 The middle area between the first arrow 1521 and the second arrow 1522 corresponding to the virtual camera model 1520 is the field of view of the virtual camera model 1520, that is, when the virtual camera model 1520 moves to the moving boundary, the virtual scene that the user can observe through the terminal screen includes virtual scenes in other areas in addition to the virtual scenes within the initial area.
[0114] Step 1404 , comparing the boundary of the initial area range with the moving boundary to determine the boundary expansion distance.
[0115] Because when the virtual camera model moves to the moving boundary, the virtual scene that the user can observe through the terminal screen includes virtual scenes in other areas in addition to the virtual scene within the initial area, it is necessary to determine the boundary extension distance, which is used to represent the difference between the boundary of the initial area and the visual boundary corresponding to the moving boundary. Schematically, the boundary extension range can be a positive value or a negative value. In one example, when it is desired that the boundary of the walkable area is farther from the moving boundary of the virtual camera, it is necessary to reduce the value of the boundary extension distance. That is, based on the boundary extension distance and the perspective angle, the target area range that is in the second shape under the normal viewing angle is determined.
[0116] Step 1405, based on the boundary extension distance and the perspective angle, calculate the correction angle of the initial area range.
[0117] The correction angle is used to correct the boundary of the initial area range. In an embodiment of the present application, by establishing a target coordinate system in the initial area range, and moving the virtual camera model to its corresponding moving boundary, the corresponding correction angle is obtained by calculation according to the positional relationship between the field of view corresponding to the virtual camera model and the initial area range. That is, a target coordinate system is established based on the initial area range; the virtual camera model is moved to the moving boundary; the boundary coordinates, front vector, direction vector and upper vector of the virtual camera model in the target coordinate system relative to the initial area range are determined, wherein the front vector is used to represent the distance between the virtual camera model and the target coordinate system, the direction vector is used to represent the distance between the virtual camera model and the target coordinate system in the boundary direction, and the upper vector is used to represent the vertical height of the virtual camera model; based on the boundary coordinates, the front vector, the direction vector and the upper vector, the unit vector between the position of the virtual camera model and the vertex of the initial area range is determined; based on the upper vector and the unit vector, the correction angle of the initial area range is determined.
[0118] For an example, see Fig.16 , a target coordinate system 1610 is established in the initial area range 1600, the virtual camera model 1620 is moved to the moving boundary, and the boundary extension distance 1621 can be determined according to its corresponding field of view, and the correction angle 1630 is determined according to the boundary coordinates, front vector, direction vector and up vector of the virtual camera model in the target coordinate system relative to the initial area range.
[0119] Schematically, the field of view of the virtual camera model can be set by the system or manually input. Different field of view ranges correspond to different boundary extension distances, and the target area ranges obtained are different. Fig.17 As shown, it shows the target area range 1710 corresponding to the boundary extension distance of 0 in the virtual environment screen 1700. The target area range 1710 coincides with the "visually walkable range" observed by the user through the terminal, realizing the unification of the actual walkable range and the visual walkable range; and as shown Fig.18 As shown, it shows that when the boundary extension distance in the virtual environment screen 1800 is -2, the corresponding target area range 1810 and the "visually walkable range" 1820 are obtained, that is, the "visually walkable range" 1820 is larger than the actual walkable target area range 1810.
[0120] Schematically, based on the up vector and the unit vector, the correction angle of the initial area range can be determined by determining the plane normal vector of the initial area range, and calculating the cross product of the plane normal vector and the up vector to obtain the correction direction of the initial area range, and determining the correction angle based on the correction direction.
[0121] Step 1406, correcting the initial area range based on the correction angle to obtain a target area range in a second shape under a normal viewing angle.
[0122] After determining the correction angle, the initial area range is corrected, that is, in the front view angle, the initial area range is corrected from the first shape to the second shape, and in the corresponding horizontal view angle, the initial area range is corrected from the second shape to the first shape, thereby obtaining the target area range in the second shape in the front view angle.
[0123] Step 1407: Project the target area in the second shape in a horizontal perspective.
[0124] The above target area range is projected onto the virtual environment screen under the horizontal perspective, that is, the target area range observed by the user through the terminal screen.
[0125] Step 14081, in response to the target area after projection being in a first shape, applying the target area to the virtual environment screen.
[0126] In an embodiment of the present application, the target area range obtained by correcting the initial area range is projected onto the virtual environment screen under the horizontal perspective, and whether the current correction is reasonable is determined by determining whether the corresponding display effect meets the target effect.
[0127] Illustratively, when it is determined that the projected target area range is in the first shape, the target area range is applied to the virtual environment screen.
[0128] The target area range that is finally reasonably corrected is applied to the virtual environment screen and displayed as a first shape in a horizontal perspective. The target area range of the first shape has a corresponding relationship with the virtual environment screen displayed on the terminal. The corresponding relationship is that in the horizontal perspective, the side of the target area range is parallel to the side of the virtual environment screen. For example, when the virtual environment screen displayed in the terminal corresponds to a rectangle, the first shape presented by the target area range projected in the horizontal perspective corresponds to a rectangle, and the left and right sides of the rectangle are parallel to the left and right sides of the virtual environment screen. Schematically, to ensure that the corresponding visual effect is the best effect, when the left and right sides of the virtual environment screen are displayed as virtual ground, the left and right sides of the target area range coincide with the left and right sides of the virtual environment screen.
[0129] Step 14082: In response to the target area range after projection not being in the first shape, resetting the target area range.
[0130] If the target area after projection does not achieve the target effect, it needs to be corrected again. Schematically, if the target area after projection does not present the first shape, the target area is reset.
[0131] In summary, the method for regional movement in a virtual environment provided by the embodiment of the present application allows a virtual object to move within a target region in the virtual environment through a movement control operation, wherein the target region is obtained by correcting the initial region through a perspective angle, and the corrected target region is in a first shape under a horizontal perspective, and the first shape matches the shape of the virtual environment screen, and the target region is in a second shape under a frontal perspective of the virtual environment. Since the target region in the first shape matches the virtual environment screen observed by the user, the visual effect of the target region in the virtual environment can be improved.
[0132] Please refer to Fig.19 , which shows a structural block diagram of a regional action device in a virtual environment provided by an exemplary embodiment of the present application, the device includes:
[0133] A display module 1910 is used to display a virtual object in the virtual environment in a horizontal perspective in a virtual environment screen, where the horizontal perspective is used to indicate a side observation angle of the virtual object in a third-person perspective;
[0134] A receiving module 1920, configured to receive a motion control operation on the virtual object, wherein the motion control operation is used to control the virtual object to move in the virtual environment;
[0135] The control module 1930 is used to control the virtual object to move within the target area of the virtual environment based on the action control operation, wherein the target area is in a first shape under the horizontal perspective, and the side of the target area is parallel to the side of the virtual environment screen under the horizontal perspective, and the target area is in a second shape under the front view of the virtual environment, and the direction of the front view is a viewing direction perpendicular to the surface where the target area is located.
[0136] In an alternative embodiment, please refer to Fig. 20 , the device further comprises:
[0137] A determination module 1940, configured to determine a perspective angle based on the horizontal perspective and the frontal perspective, wherein the perspective angle is used to describe a change in the virtual environment under the horizontal perspective;
[0138] The determination module 1940 is further configured to determine, based on the perspective angle, a range of the target area that is in the second shape under the normal viewing angle.
[0139] In an optional embodiment, the virtual environment further includes a perspective camera model, and the perspective camera model can rotate around a target point in the virtual environment;
[0140] The determining module 1940 further includes:
[0141] A selection unit 1941 is used to select a point in a virtual plane used to determine the range of the target area as the target point;
[0142] A rotation unit 1942, configured to rotate the perspective camera model from the frontal perspective to the horizontal perspective based on the target point;
[0143] The determination module 1940 is further configured to determine the rotation angle of the viewing angle camera model as the perspective angle.
[0144] In an optional embodiment, the selection unit 1941 is further configured to select an initial area range of the first shape in the virtual environment under the front view angle;
[0145] The determination module 1940 is further configured to determine the target area range in the second shape under the normal viewing angle based on the initial area range and the perspective angle.
[0146] In an optional embodiment, the virtual environment further includes a virtual camera model, and the virtual camera model moves with the movement of the virtual object in the virtual environment;
[0147] The determining module 1940 further includes:
[0148] An acquiring unit 1943 is used to acquire a moving boundary of the virtual camera model in the virtual environment;
[0149] A comparing unit 1944 is used to compare the boundary of the initial area range with the moving boundary to determine a boundary extension distance, where the boundary extension distance is used to represent the difference between the boundary of the initial area range and the visual boundary corresponding to the moving boundary;
[0150] The determination module 1940 is further configured to determine, based on the boundary extension distance and the perspective angle, a range of the target area in the second shape under the normal viewing angle.
[0151] In an optional embodiment, the determining module 1940 further includes:
[0152] A calculation unit 1945 is used to calculate a correction angle of the initial area range based on the boundary extension distance and the perspective angle, wherein the correction angle is used to correct the boundary of the initial area range;
[0153] The acquisition unit 1943 is further configured to correct the initial area range based on the correction angle to obtain the target area range in the second shape under the normal viewing angle.
[0154] In an optional embodiment, the determining module 1940 further includes:
[0155] A coordinate establishing unit 1946, configured to establish a target coordinate system based on the initial area range;
[0156] A moving unit 1947, used to move the virtual camera model to the moving boundary;
[0157] The determination module 1940 is further configured to determine the boundary coordinates, the front vector, the direction vector and the upper vector of the virtual camera model relative to the initial area in the target coordinate system, wherein the front vector is used to represent the distance between the virtual camera model and the target coordinate system, the direction vector is used to represent the distance between the virtual camera model and the target coordinate system in the boundary direction, and the upper vector is used to represent the vertical height of the virtual camera model;
[0158] The determination module 1940 is further configured to determine a unit vector between the position of the virtual camera model and a vertex of the initial area range based on the boundary coordinates, the front vector, the direction vector and the up vector;
[0159] The determination module 1940 is further configured to determine a correction angle of the initial area range based on the up vector and the unit vector.
[0160] In an optional embodiment, the determination module 1940 is further configured to determine a plane normal vector of the initial area range based on the up vector and the unit vector;
[0161] The calculation unit 1945 is further used to calculate the cross product of the plane normal vector and the upper vector to obtain the correction direction of the initial area range;
[0162] The determination module 1940 is further configured to determine a correction angle based on the correction direction.
[0163] In an optional embodiment, the determining module 1940 further includes:
[0164] A projection unit 1948 is used to project the target area in the second shape at the horizontal viewing angle;
[0165] The setting unit 1949 is used for applying the target area range to the virtual environment screen in response to the target area range after the projection being in the first shape, or resetting the target area range in response to the target area range after the projection not being in the first shape.
[0166] In an optional embodiment, the side of the target area range includes a first side and a second side, the first side is opposite to the second side, and the side of the virtual environment screen includes a third side and a fourth side, the third side is opposite to the fourth side;
[0167] The first side is parallel to the third side, and the second side is parallel to the fourth side.
[0168] In an optional embodiment, based on the display direction of the virtual environment screen, the first side is the left side of the target area range, and the second side is the right side of the target area range; the third side is the left side of the virtual environment screen, and the fourth side is the right side of the virtual environment screen.
[0169] In an optional embodiment, the control module 1930 is further used to control the virtual object to take action in response to the action control operation indicating that the action range of the virtual object in the virtual environment does not exceed the target area; or, in response to the action control operation indicating that the action range of the virtual object in the virtual environment exceeds the target area, determine that the action control operation has failed to execute.
[0170] In summary, the regional action device in the virtual environment provided by the embodiment of the present application controls the virtual object in the virtual environment displayed in a horizontal perspective to perform actions within the target area by receiving an action control operation, wherein the target area is in a first shape in the horizontal perspective, and the first shape matches the shape of the virtual environment screen, and the target area is in a second shape in the front view of the virtual environment. That is, a target area in a first shape is set in the horizontal perspective to provide the virtual object with an action, and since the first shape matches the shape of the virtual environment screen, the visual effect of the target area in the virtual environment can be improved.
[0171] It should be noted that the regional action device in the virtual environment provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the regional action device in the virtual environment provided in the above embodiment and the regional action method embodiment in the virtual environment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0172] Fig.21 The structure block diagram of a terminal 2100 provided by an exemplary embodiment of the present application is shown. The terminal 2100 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Group Audio Layer 3), an MP4 (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Group Audio Layer 4) player, a laptop computer or a desktop computer. The terminal 2100 may also be called a user device, a portable terminal, a laptop terminal, a desktop terminal or other names.
[0173] Typically, the terminal 2100 includes: a processor 2101 and a memory 2102 .
[0174] The processor 2101 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 2101 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 2101 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 2101 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 2101 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0175] The memory 2102 may include one or more computer-readable storage media, which may be non-transitory. The memory 2102 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 2102 is used to store at least one instruction, which is used to be executed by the processor 2101 to implement the regional action method in the virtual environment provided by the method embodiment of the present application.
[0176] In some embodiments, the terminal 2100 may further optionally include: a peripheral device interface 2103. The processor 2101, the memory 2102 and the peripheral device interface 2103 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 2103 via a bus, a signal line or a circuit board. The peripheral device interface 2103 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 2101 and the memory 2102. In some embodiments, the processor 2101, the memory 2102 and the peripheral device interface 2103 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 2101, the memory 2102 and the peripheral device interface 2103 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
[0177] Those skilled in the art will understand that Fig.21 The structure shown in the figure does not constitute a limitation on the terminal 2100, and the terminal 2100 may include more or fewer components than those shown in the figure, or combine certain components, or adopt a different component arrangement.
[0178] A person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the relevant hardware through a program, and the program can be stored in a computer-readable storage medium, which can be a computer-readable storage medium contained in the memory in the above embodiments; or a computer-readable storage medium that exists independently and is not assembled in the terminal. The computer-readable storage medium stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, the at least one program, the code set or instruction set is loaded and executed by the processor to implement the regional action method in the virtual environment described in any of the above embodiments.
[0179] Optionally, the computer readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a solid state drive (SSD), or an optical disk. Among them, the random access memory may include a resistance random access memory (ReRAM) and a dynamic random access memory (DRAM). The serial numbers of the above embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.
[0180] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0181] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A regional action method in a virtual environment, characterized in that: The method comprises: Displaying a virtual object in the virtual environment in a horizontal perspective in a virtual environment screen, wherein the horizontal perspective is used to indicate a side observation angle of the virtual object in a third-person perspective; receiving an action control operation on the virtual object, wherein the action control operation is used to control the virtual object to act in the virtual environment; Determine a perspective angle based on the horizontal viewing angle and the frontal viewing angle, wherein the perspective angle is used to describe a change in the viewing angle between the horizontal viewing angle and the frontal viewing angle; Based on the perspective angle, determining a target area range that is in a second shape under the frontal viewing angle, wherein the target area range is in a first shape under the horizontal viewing angle, and a side of the target area range under the horizontal viewing angle is parallel to a side of the virtual environment screen, and a direction of the frontal viewing angle is perpendicular to a surface where the target area range is located; Projecting the target area in the second shape at the horizontal viewing angle; In response to the target area being in a first shape after projection, applying the target area to the virtual environment screen, or, in response to the target area not being in the first shape after projection, resetting the target area; Based on the action control operation, the virtual object is controlled to move within the target area in the virtual environment.
2. The method according to claim 1, characterized in that The virtual environment also includes a perspective camera model, and the perspective camera model is used to rotate around a target point in the virtual environment; The determining of the perspective angle based on the horizontal perspective and the frontal perspective includes: Selecting a point in the surface for determining the range of the target area as the target point; Rotating the perspective camera model from the frontal perspective to the horizontal perspective based on the target point; The rotation angle of the view camera model is determined as the perspective angle.
3. The method according to claim 1, characterized in that The determining, based on the perspective angle, a range of a target area in a second shape at the front view angle includes: Selecting an initial area range of the first shape in the virtual environment under the front view angle; Based on the initial area range and the perspective angle, the target area range in the second shape under the front view angle is determined.
4. The method according to claim 3, characterized in that The virtual environment also includes a virtual camera model, and the virtual camera model moves with the movement of the virtual object in the virtual environment; After selecting the initial area range of the first shape in the virtual environment under the front view angle, the method further includes: Acquire a moving boundary of the virtual camera model in the virtual environment; Comparing the boundary of the initial area range with the moving boundary to determine a boundary extension distance, where the boundary extension distance is used to represent the difference between the boundary of the initial area range and the visual boundary corresponding to the moving boundary; The determining, based on the initial area range and the perspective angle, the target area range in the second shape at the front view angle comprises: Based on the boundary extension distance and the perspective angle, a range of the target area in the second shape under the front view angle is determined.
5. The method according to claim 4, characterized in that The determining, based on the boundary extension distance and the perspective angle, the range of the target area in the second shape at the frontal viewing angle includes: Calculating a correction angle of the initial area range based on the boundary extension distance and the perspective angle, wherein the correction angle is used to correct the boundary of the initial area range; The initial area range is corrected based on the correction angle to obtain the target area range in the second shape under the front view angle.
6. The method according to claim 5, characterized in that The calculating the correction angle of the initial area range based on the boundary extension distance and the perspective angle includes: Establishing a target coordinate system based on the initial area range; Moving the virtual camera model to the moving boundary; Determine the boundary coordinates, front vector, direction vector and up vector of the virtual camera model relative to the initial area range in the target coordinate system, the front vector is used to represent the distance between the virtual camera model and the target coordinate system, the direction vector is used to represent the distance between the virtual camera model and the target coordinate system in the boundary direction, and the up vector is used to represent the vertical height of the virtual camera model; Determine a unit vector between the position of the virtual camera model and a vertex of the initial area range based on the boundary coordinates, the front vector, the direction vector and the up vector; Based on the up vector and the unit vector, a correction angle of the initial area range is determined.
7. The method according to claim 6, characterized in that The step of determining a correction angle of the initial area range based on the up vector and the unit vector includes: Determine a plane normal vector of the initial region based on the up vector and the unit vector; Calculate the cross product of the plane normal vector and the up vector to obtain a correction direction of the initial area range; A correction angle is determined based on the correction direction.
8. The method according to any one of claims 1 to 7, characterized in that: The sides of the target area range include a first side and a second side, the first side is opposite to the second side, and the sides of the virtual environment screen include a third side and a fourth side, the third side is opposite to the fourth side; The first side is parallel to the third side, and the second side is parallel to the fourth side.
9. The method according to claim 8, characterized in that Based on the display direction of the virtual environment screen, the first side is the left side of the target area range, and the second side is the right side of the target area range; the third side is the left side of the virtual environment screen, and the fourth side is the right side of the virtual environment screen.
10. The method according to any one of claims 1 to 7, characterized in that: The controlling the virtual object to move within the target area in the virtual environment based on the action control operation includes: In response to the action control operation indicating that the action range of the virtual object in the virtual environment does not exceed the target area range, controlling the virtual object to take action; Or, in response to the action control operation indicating that the action range of the virtual object in the virtual environment exceeds the target area range, it is determined that the action control operation fails to be executed.
11. A regional motion device in a virtual environment, characterized in that: The device comprises: A display module, used for displaying a virtual object in the virtual environment in a horizontal perspective in a virtual environment screen, wherein the horizontal perspective is used to indicate a side observation angle of the virtual object in a third-person perspective; A receiving module, used for receiving an action control operation on the virtual object, wherein the action control operation is used for controlling the virtual object to act in the virtual environment; A determination module, used to determine a perspective angle based on the horizontal viewing angle and the frontal viewing angle, wherein the perspective angle is used to describe a change in the viewing angle between the horizontal viewing angle and the frontal viewing angle; The determination module is further configured to determine, based on the perspective angle, a target area range that is in a second shape under the frontal viewing angle, wherein the target area range is in a first shape under the horizontal viewing angle, and a side edge of the target area range under the horizontal viewing angle is parallel to a side edge of the virtual environment screen, and a direction of the frontal viewing angle is perpendicular to a surface where the target area range is located; The determining module is further configured to project the target area in the second shape at the horizontal viewing angle; The determination module is further configured to apply the target area range to the virtual environment screen in response to the target area range after projection being in the first shape, or to re-set the target area range in response to the target area range after projection not being in the first shape; The control module is used to control the virtual object to move within the target area in the virtual environment based on the action control operation.
12. The device according to claim 11, characterized in that The virtual environment also includes a perspective camera model, and the perspective camera model can rotate around a target point in the virtual environment; The determining module further includes: A selection unit, used for selecting a point in a virtual plane used to determine the range of the target area as the target point; A rotation unit, configured to rotate the perspective camera model from the frontal perspective to the horizontal perspective based on the target point; The determination module is further used to determine the rotation angle of the viewing angle camera model as the perspective angle.
13. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the regional action method in the virtual environment as described in any one of claims 1 to 10.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one program code, and the program code is loaded and executed by a processor to implement the regional action method in a virtual environment as described in any one of claims 1 to 10.
15. A computer program product, characterized in that The computer program product comprises computer instructions, and when the computer instructions are executed by a processor, the method for regional action in a virtual environment according to any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
System and method for augmented reality gaming
CN109003398A
Method and device for controlling virtual shot in game
CN109675310A