Interaction processing method and apparatus for virtual scene, and electronic device, computer-readable storage medium and computer program product
By switching between different perspectives of the virtual scene in shooting games by only rotating the virtual object's head without rotating its body, the problem of players' location being revealed by sound when turning around is solved, thus improving the game's tactical choices and experience.
Patent Information
- Application Number
- PCT/CN2025/107702
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-08-13
- Filing Date
- 2025-07-09
- Publication Date
- 2026-02-19
AI Technical Summary
In existing technologies, when players turn around to observe their surroundings in shooting games, the body rotation causes sound to reveal their location, affecting tactical choices and the gaming experience.
By rotating only the head of the virtual object without rotating its body, different perspectives of the virtual scene can be switched using the viewpoint rotation operation, enabling silent observation of surrounding information.
The ability to gather information about the surroundings without making a sound enriches the strategic depth of the game and enhances the player's gaming experience.
Smart Images

Figure CN2025107702_19022026_PF_FP_ABST
Abstract
Description
Method and device for processing interaction of virtual scene, electronic device, computer readable storage medium and computer program product
[0001] Cross-reference to related applications
[0002] The present application is based on and claims priority to Chinese patent application No. 2024111102996, filed on August 13, 2024, the entire contents of which are incorporated herein by reference. TECHNICAL FIELD
[0003] The present application relates to the technical field of Internet, and in particular to a method and device for processing interaction of virtual scene, an electronic device, a computer readable storage medium and a computer program product. BACKGROUND
[0004] Based on the display technology of graphics processing hardware, the channel for perceiving the environment and obtaining information is expanded, especially the display technology of virtual scene, which can realize diversified interaction between virtual objects controlled by users (or players) or artificial intelligence according to actual application requirements, has various typical application scenarios, for example, in the virtual scene of games, the real battle process between virtual objects can be simulated. Taking a shooting game as an example, the player can view the surrounding situation by controlling the game character to turn around. SUMMARY
[0005] The embodiments of the present application provide a method and device for processing interaction of virtual scene, an electronic device, a computer readable storage medium and a computer program product, which can enable the player to obtain the information of the surrounding without making a sound, enrich the strategy depth of the game, and further improve the game experience of the player.
[0006] The technical solutions of the embodiments of the present application are implemented as follows:
[0007] The embodiments of the present application provide a method for processing interaction of virtual scene, applied to an electronic device, comprising:
[0008] displaying a first virtual scene picture, wherein the first virtual scene picture is obtained by a virtual object observing the virtual scene at a first view angle;
[0009] in response to a view angle turning operation, keeping the body of the virtual object from turning, and controlling the head of the virtual object to turn at a corresponding angle in a direction indicated by the view angle turning operation, and
[0010] switching to display a second virtual scene picture, wherein the second virtual scene picture is obtained by the virtual object observing the virtual scene at a second view angle, and the second view angle is a view angle corresponding to the head of the virtual object after turning.
[0011] An embodiment of the present application provides a virtual scene interaction processing device, comprising:
[0012] a display module configured to display a first virtual scene picture, wherein the first virtual scene picture is obtained by a virtual object observing the virtual scene at a first visual angle;
[0013] a control module configured to, in response to a visual angle rotation operation, keep a body of the virtual object from rotating and control a head of the virtual object to rotate by a corresponding angle in a direction indicated by the visual angle rotation operation;
[0014] the display module is further configured to switch to display a second virtual scene picture, wherein the second virtual scene picture is obtained by the virtual object observing the virtual scene at a second visual angle, and the second visual angle is a visual angle corresponding to the head of the virtual object after rotation.
[0015] An embodiment of the present application provides an electronic device, comprising:
[0016] a memory configured to store executable instructions;
[0017] a processor configured to execute the executable instructions stored in the memory to implement a virtual scene interaction processing method provided by an embodiment of the present application.
[0018] An embodiment of the present application provides a computer readable storage medium storing computer executable instructions for being executed by a processor to implement a virtual scene interaction processing method provided by an embodiment of the present application.
[0019] An embodiment of the present application provides a computer program product comprising a computer program or computer executable instructions for being executed by a processor to implement a virtual scene interaction processing method provided by an embodiment of the present application.
[0020] An embodiment of the present application has the following beneficial effects:
[0021] When receiving a visual angle rotation operation triggered by a player, the surrounding information is obtained by rotating only the head of the virtual object without rotating the body. Since the motion amplitude of the head rotation is small, no sound is generated, and the sound effect generated by the body rotation does not expose the position of the player. In this way, the player can be provided with an observation method without making sound, so that the player can choose to obtain the surrounding information without exposing himself by making sound, thereby enriching the tactical choices in the virtual scene and improving the game experience of the player. BRIEF DESCRIPTION OF DRAWINGS
[0022] FIG. 1 is an architecture schematic diagram of a virtual scene interaction processing system 100 provided by an embodiment of the present application.
[0023] FIG. 2 is a structural schematic diagram of an electronic device 500 according to an embodiment of the present application;
[0024] FIG. 3 is a first flowchart of an interaction processing method of a virtual scene according to an embodiment of the present application;
[0025] FIG. 4 is a second flowchart of an interaction processing method of a virtual scene according to an embodiment of the present application;
[0026] FIG. 5 is a first application scenario diagram of an interaction processing method of a virtual scene according to an embodiment of the present application;
[0027] FIG. 6 is a second application scenario diagram of an interaction processing method of a virtual scene according to an embodiment of the present application;
[0028] FIG. 7A is a third application scenario diagram of an interaction processing method of a virtual scene according to an embodiment of the present application;
[0029] FIG. 7B is a fourth application scenario diagram of an interaction processing method of a virtual scene according to an embodiment of the present application;
[0030] FIG. 8A is a fifth application scenario diagram of an interaction processing method of a virtual scene according to an embodiment of the present application;
[0031] FIG. 8B is a sixth application scenario diagram of an interaction processing method of a virtual scene according to an embodiment of the present application;
[0032] FIG. 9 is a comparison diagram between turning around to observe and turning head to observe according to an embodiment of the present application;
[0033] FIG. 10 is a seventh application scenario diagram of an interaction processing method of a virtual scene according to an embodiment of the present application;
[0034] FIG. 11 is a third flowchart of an interaction processing method of a virtual scene according to an embodiment of the present application;
[0035] FIG. 12 is a first diagram of a setting interface according to an embodiment of the present application;
[0036] FIG. 13 is a diagram of an angle restriction interface according to an embodiment of the present application;
[0037] FIG. 14 is a second diagram of a setting interface according to an embodiment of the present application;
[0038] FIG. 15 is a diagram of a direction control according to an embodiment of the present application;
[0039] FIG. 16 is a diagram of a partial Euler angle according to an embodiment of the present application.
[0040] It should be noted that the above-mentioned "first", "second" are only used to distinguish different schemes, and do not represent the advantages or disadvantages of the schemes or the priority in the implementation process. DETAILED DESCRIPTION
[0041] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings. The described embodiments should not be regarded as limitations of the present application. All other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0042] In the following description, "some embodiments" are related to a subset of all possible embodiments, but it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.
[0043] It can be understood that in the embodiments of the present application, the data related to user information and the like (such as the data of the game character controlled by the player) need to obtain the permission or consent of the user when the embodiments of the present application are applied to specific products or technologies, and the collection, use and processing of the related data need to comply with relevant laws, regulations and standards.
[0044] In the following description, the terms "first", "second", and the like are only used to distinguish similar objects, and do not represent a specific order of the objects. It can be understood that "first", "second", and the like can be interchanged in a specific order or sequence as allowed, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0045] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0046] Before the embodiments of the present application are further described in detail, the terms and phrases related to the embodiments of the present application are explained, and the terms and phrases related to the embodiments of the present application are applicable to the following explanations.
[0047] 1) In response to: used to represent the conditions or states on which the operations performed depend, when the dependent conditions or states are met, one or more operations performed can be real-time or have a set delay; in the absence of special instructions, there is no restriction on the execution order of multiple operations performed.
[0048] 2) Virtual scene: a scene displayed (or provided) by an application when running on a terminal device. The scene can be a simulated environment of the real world, a virtual environment that is half simulated and half fictional, or a purely fictional virtual environment. The virtual scene can be any of a two-dimensional virtual scene, a 2.5-dimensional virtual scene, or a three-dimensional virtual scene, and the embodiments of the present application do not limit the dimension of the virtual scene. For example, the virtual scene can include a sky, a land, an ocean, and the like, and the land can include desert, city, and the like, and a user can control a virtual object to move in the virtual scene.
[0049] 3) Virtual object: an image of various people and things that can interact in a virtual scene, or a movable object in a virtual scene. The movable object can be a virtual person, a virtual animal, an animation character, and the like, such as a person, an animal, and the like displayed in a virtual scene. For example, the virtual object can be a virtual image in a virtual scene representing a user. The virtual scene can include multiple virtual objects, each virtual object having its own shape and volume in the virtual scene and occupying a part of the space in the virtual scene.
[0050] 4) Cloud gaming: also known as gaming on demand, which means deploying a game program in a server, running an instance of the game program (referred to as a game instance), and sending game data output during running to a browser page of a user terminal. The page calls a media component of the browser to decode the game data, and renders a real-time game screen in the game process according to the decoding result. When the page detects an operation implemented by the user in the game screen, it will be reported to the game instance running in the server. When receiving the game data generated by the game instance in response to the operation, the decoding and rendering process will be repeated, so as to present the change of the game screen according to the operation of the user in the page.
[0051] That is, cloud gaming is an online gaming technology based on cloud computing technology. Cloud gaming technology enables a thin client with relatively limited graphics processing and data processing capabilities to run high-quality games. In the cloud gaming scenario, the game is not run on the user terminal (such as a player's game terminal), but is run in the cloud server, and the cloud server renders the game scene into an audio and video stream and transmits it to the user terminal through the network. In this way, the user terminal does not need to have strong graphics processing and data processing capabilities, but only needs to have basic streaming media playback capabilities and the ability to obtain player input instructions and send them to the cloud server.
[0052] 5) Machine learning model: a data-driven algorithm model, whose core mechanism is to learn from a large number of sample data, mine the patterns, rules or relationships implied in the data, and make predictions, classifications or decisions on new input data accordingly. Machine learning models can use convolutional neural network (CNN), recurrent neural network (RNN) or support vector machine (SVM) algorithm architecture, optimize parameters through data learning, and adapt to the dynamic changes of interaction in virtual scenarios.
[0053] Taking a shooting game as an example, in a realistic shooting game, the player can determine the information (such as the position) of the enemy through sound. In related technologies, when the player controls the game character to turn around and observe the surroundings, the game character will inevitably make a sound when turning around due to the large amplitude of the turning motion, thereby exposing himself.
[0054] In view of this, the embodiments of the present application provide a virtual scene interaction processing method and device, electronic equipment, computer readable storage medium and computer program product, which can enable the player to obtain the information around without making a sound to expose himself. The electronic equipment provided by the embodiments of the present application will be described below. The electronic equipment provided by the embodiments of the present application can be implemented as a terminal device (corresponding to a standalone game), or cooperatively implemented by a terminal device and a server (corresponding to an online game). The virtual scene interaction processing method provided by the embodiments of the present application will be described below.
[0055] Before introducing the architecture of the virtual scene interaction processing system provided by the embodiments of the present application, the game mode related to the embodiments of the present application will be introduced first. For the scheme of cooperative implementation of terminal device and server, two game modes are mainly involved, which are local game mode and cloud game mode. The local game mode refers to that the terminal device and the server cooperatively run the game processing logic, and the operation instruction input by the player in the terminal device is partly processed by the terminal device running the game logic, and partly processed by the server running the game logic. Moreover, the game logic processing run by the server is often more complex and needs to consume more computing power. The cloud game mode refers to that the game logic processing is completely run by the server (such as a cloud server), and the game scene data is rendered into an audio and video stream by the cloud server, and then transmitted to the terminal device for display through the network. That is to say, the terminal device only needs to have the basic stream media playing ability and the ability to obtain the operation instruction of the player and send it to the server.
[0056] The architecture of the virtual scene interaction processing system provided by the embodiments of the present application is described below.
[0057] For example, referring to FIG. 1, which is an architecture schematic diagram of a virtual scene interaction processing system 100 provided by the embodiments of the present application, as shown in FIG. 1, the virtual scene interaction processing system 100 includes a server 200, a network 300 and a terminal device 400, wherein the server 200 is a background server of a client 410 running on the terminal device 400, the network 300 can be a local area network or a wide area network, or a combination of the two, and the terminal device 400 is a terminal device associated with a user (or player), and the client 410 runs on the terminal device 400. The client 410 can be various types of clients, such as a shooting game client, a role-playing game client, a browser, etc.
[0058] In some embodiments, taking a shooting game as an example, a first virtual scene picture can be displayed in the human-computer interaction interface of the client 410, wherein the first virtual scene picture is obtained by a virtual object (for example, a game character A) controlled by the user observing the virtual scene in a first view (for example, a current view). Then, when a view turning operation triggered by the user is received, the client 410 can respond to the view turning operation by keeping the body (i.e., the torso and limbs) of the virtual object from turning, controlling the head of the virtual object to turn in a direction indicated by the view turning operation by a corresponding angle, and switching from the first virtual scene picture to a second virtual scene picture, wherein the second virtual scene picture is obtained by the virtual object observing the virtual scene in a second view, and the second view is a view corresponding to the head of the virtual object after turning. In this way, the player can obtain information around without exposing himself by making a sound, enriching the strategy depth in the game, and thus improving the game experience of the player.
[0059] It should be noted that the virtual scene in the virtual scene interaction processing method provided by the embodiments of the present application can be completely based on the terminal device output, or based on the terminal device and server cooperative output, for example, the related data calculation and output of the virtual scene can be completely completed by relying on the graphic processing hardware computing capability of the terminal device 400, wherein the types of graphic processing hardware include a central processing unit (CPU) and a graphics processing unit (GPU). For example, when forming a visual perception of a virtual scene, the terminal device 400 calculates the required data by graphic computing hardware, and completes loading, parsing and rendering of display data, and outputs a video frame capable of forming a visual perception of a virtual scene by graphic output hardware, for example, a two-dimensional video frame is presented on the display screen of a smart phone, or a video frame achieving a three-dimensional display effect is projected on the lens of an augmented reality / virtual reality glasses; in addition, in order to enrich the perception effect, the terminal device 400 can also form one or more of auditory perception, tactile perception, motion perception and taste perception by means of different hardware.
[0060] Of course, the virtual scene calculation can also be completed by relying on the computing capability of the server 200, and the virtual scene is output by the terminal device 400, for example, taking forming a visual perception of a virtual scene as an example, the server 200 calculates the virtual scene related display data (such as scene data) and sends it to the terminal device 400 through the network 300, the terminal device 400 relies on graphic computing hardware to complete loading, parsing and rendering of the calculated display data, and relies on graphic output hardware to output the virtual scene to form a visual perception, for example, a two-dimensional video frame can be presented on the display screen of a smart phone, or a video frame achieving a three-dimensional display effect is projected on the lens of an augmented reality / virtual reality glasses; for the form of perception of the virtual scene, it can be understood that the corresponding hardware output of the terminal device 400 can be used, for example, a microphone is used to form auditory perception, a vibrator is used to form tactile perception, and the like.
[0061] It should also be noted that the server 200 in FIG. 1 can be a stand-alone physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and basic cloud computing services such as big data and artificial intelligence platforms. The terminal device 400 can be a smartphone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, a vehicle-mounted terminal, and the like, but is not limited thereto. The terminal device 400 and the server 200 can be connected directly or indirectly through wired or wireless communication, which is not limited in the embodiments of the present application.
[0062] In some other embodiments, the terminal device or the server can also implement the interaction processing method of the virtual scene provided in the embodiments of the present application by running various computer executable instructions or computer programs. For example, the computer executable instructions can be microprogram level commands, machine instructions or software instructions. The computer program can be a native program or a software module in the operating system; can be a native application program (APP), that is, a program that needs to be installed in the operating system to run, such as a shooting game APP; or can be a small program that can be embedded into any APP, that is, a program that only needs to be downloaded into a browser environment to run. In summary, the above computer executable instructions can be any form of instructions, and the above computer programs can be any form of application programs, modules or plug-ins.
[0063] The structure of the electronic device provided in the embodiments of the present application will be described below. Taking the electronic device as a terminal device as an example, referring to FIG. 2, FIG. 2 is a structural schematic diagram of an electronic device 500 provided in the embodiments of the present application. The electronic device 500 shown in FIG. 2 includes at least one processor 510, a memory 550, at least one network interface 520 and a user interface 530. The various components in the electronic device 500 are coupled together through a bus system 540. It can be understood that the bus system 540 is used to realize the connection and communication between the components. In addition to including a data bus, the bus system 540 also includes a power bus, a control bus and a status signal bus. However, for the purpose of clear illustration, all kinds of buses are marked as the bus system 540 in FIG. 2.
[0064] The processor 510 can be an integrated circuit chip that has a processing capability of signals, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, etc., wherein the general-purpose processor can be a microprocessor or any conventional processor.
[0065] The user interface 530 includes one or more output devices 531 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 530 also includes one or more input devices 532 that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
[0066] The memory 550 can be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard drives, optical drives, etc. The memory 550 optionally includes one or more storage devices physically located in proximity to the processor 510.
[0067] The memory 550 includes volatile memory or non-volatile memory, and can also include both volatile and non-volatile memory. Non-volatile memory can be read only memory (ROM), and volatile memory can be random access memory (RAM). The memory 550 described in embodiments of the present application is intended to include any suitable type of memory.
[0068] In some embodiments, the memory 550 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or a subset or superset thereof, which are exemplarily illustrated below.
[0069] The operating system 551 includes system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
[0070] The network communication module 552 is used to reach other computing devices via one or more (wired or wireless) network interfaces 520, exemplary network interfaces 520 including Bluetooth, wireless compatibility certification (WiFi), and universal serial bus (USB), etc.
[0071] a presentation module 553 for enabling presentation of information (e.g., a user interface for operating a peripheral device and displaying content and information) via one or more output devices 531 (e.g., a display screen, a speaker, etc.) associated with the user interface 530;
[0072] an input processing module 554 for detecting and translating one or more user inputs or interactions from one or more input devices 532.
[0073] In some embodiments, the apparatus provided by the embodiments of the present application can be implemented in software. FIG. 2 shows an interaction processing apparatus 555 of a virtual scene stored in a memory 550, which can be software in the form of programs and plug-ins, etc., including the following software modules: a display module 5551, a control module 5552, an acquisition module 5553, a determination module 5554, a prediction module 5555, and a training module 5556. These modules are logical, and thus can be combined or further split according to the implemented functions. It should be noted that all the above modules are shown at one time in FIG. 2 for the convenience of expression, but should not be regarded as excluding the implementation that the virtual scene interaction processing apparatus 555 can only include the display module 5551 and the control module 5552. The functions of the various modules will be described below.
[0074] The interaction processing method of a virtual scene provided by the embodiments of the present application will be described in detail below in combination with exemplary applications and implementations of a terminal device provided by the embodiments of the present application.
[0075] Referring to FIG. 3, FIG. 3 is a first flowchart of an interaction processing method of a virtual scene provided by the embodiments of the present application, which will be described in combination with the steps shown in FIG. 3.
[0076] It should be noted that the method shown in FIG. 3 can be executed by various forms of computer programs run by a terminal device, and is not limited to a client, for example, can also be the operating system, software modules, scripts, and applets described above, and thus the following description with the example of a client should not be regarded as limiting the embodiments of the present application. In addition, for the convenience of description, the terminal device and the client run by the terminal device will not be specifically distinguished in the following description.
[0077] In step 101, a first virtual scene picture is displayed.
[0078] Here, the first virtual scene picture can be obtained by a virtual object (for example, a game character A controlled by a current player in a game scene) observing a virtual scene in a first view (for example, a current view). For example, a virtual camera corresponding to the virtual object can be set in the virtual scene, and the virtual camera is controlled to shoot the virtual scene in the first view, thereby obtaining the first virtual scene picture.
[0079] For example, taking the game character A controlled by the current player as an example, a virtual camera corresponding to the game character A can be set in the game scene (i.e., the virtual scene) in which the game character A is located. For example, when a first-person perspective is adopted, the virtual camera can be set near the head of the game character A (e.g., the position at which the eyes of the game character A are located), and the game scene is photographed through the virtual camera to obtain a corresponding game scene picture (i.e., a first virtual scene picture), wherein the perspective of the virtual camera is the same as the perspective of the game character A. That is, the virtual camera can be used as the eyes of the game character A to photograph the game scene, thereby obtaining the corresponding game scene picture. In addition, when a third-person perspective is adopted, the virtual camera can be set behind the game character A and bound to the game character A. That is, when the game character A moves in the game scene, the virtual camera moves following the game character A, and in addition, the virtual camera is not actually displayed in the game scene, i.e., the player cannot identify the virtual camera bound to the game character A from the game scene.
[0080] It should be noted that the player can control the virtual object in the virtual scene to perform an activity, which includes but is not limited to at least one of adjusting a body posture, crawling, walking, running, riding, jumping, driving, picking up, shooting, attacking, and throwing, and the virtual object can be a simulated character or an animation character. In addition, in addition to the virtual object (e.g., the game character A) controlled by the current player, the virtual scene can also display a virtual object (e.g., the game character B) controlled by another player or artificial intelligence, wherein the game character A and the game character B can belong to the same camp, i.e., they are in a cooperative relationship and jointly perform a task. Of course, the game character A and the game character B can also belong to different camps, i.e., they are in a hostile relationship of mutual confrontation.
[0081] In some embodiments, taking a shooting game as an example, a virtual object controlled by a current player can be displayed in a virtual scene, wherein the virtual object can hold a virtual shooting prop (e.g., a virtual gun), a first virtual scene picture is obtained by the virtual object observing the virtual scene in a first perspective, for example, can be a picture displayed in a first person perspective of the virtual object (i.e., a picture obtained by a virtual camera arranged near the head of the virtual object shooting the virtual scene), or can be a picture displayed in a third person perspective of the virtual object (i.e., a picture obtained by a virtual camera arranged behind the virtual object shooting the virtual scene). Various controls can also be superimposed in the first virtual scene picture, for example, at least one of a movement control, a shooting control, a throwing control, a small map control, and a map direction guide control, and the player can control the virtual object to perform corresponding actions by clicking the corresponding control.
[0082] In step 102, in response to the perspective turning operation, the body of the virtual object is kept from turning, and the head of the virtual object is controlled to turn in a direction indicated by the perspective turning operation by a corresponding angle.
[0083] Here, the body of the virtual object specifically refers to the torso and limbs of the virtual object, and in addition, the angle of the head of the virtual object turning can be related to the perspective turning operation, for example, when the perspective turning operation is a movement operation (including a sliding operation for a touch screen and a dragging operation for a mouse, etc.), the angle of the head of the virtual object to be turned can be determined based on the movement distance of the movement operation; when the perspective turning operation is a pressing operation for a certain direction control, the angle of the head of the virtual object to be turned can be determined based on the pressing degree of the pressing operation. Of course, the perspective turning operation can also be used only to determine the direction of the head of the virtual object turning, and the angle of the head of the virtual object to be turned can be automatically determined in an artificial intelligence manner, which will be described in detail below.
[0084] For example, when the player triggers the perspective turning operation (such as dragging the mouse, sliding the screen, or pressing the direction control) in the virtual scene, the direction pointed by the perspective turning operation (such as left, right, up, and down) is identified, and the angle of the head to be turned is calculated according to the operation parameters (such as the movement distance, the pressing degree, etc.), and finally only the head of the virtual object is controlled to turn in the direction by the corresponding angle, while the torso and limbs and other body parts are kept still.
[0085] For example, in a virtual scene, the calculation of the angle by which the head is to be rotated, and the control of the head of the virtual object to rotate by the corresponding angle in the direction indicated by the view rotation operation, can be achieved through the coordinated conversion of the world coordinate system and the local coordinate system. For example, when the view rotation operation is a movement operation (the player drags the mouse), first, the mouse drag distance is mapped to an angle increment, where the angle direction is based on the world coordinate system, and horizontal dragging corresponds to the Z-axis yaw angle (Yaw) of the world coordinate system, and vertical sliding corresponds to the Y-axis pitch angle (Pitch) of the world coordinate system. When the player drags the mouse 1 cm upwards, assuming that 1 cm corresponds to a 10-degree rotation, a 10-degree pitch angle increment is generated (correspondingly, when the player drags the mouse 1 cm downwards, a -10-degree pitch angle increment is generated). Next, the rotation state of the head relative to the torso (such as the center point of the chest) is represented by the local Euler angle of the head. Assuming that the current local Euler angle of the head is (20°, 10°, 0°), the new 10° horizontal increment will be added to the pitch angle corresponding to the Y-axis of the local coordinate system to obtain a new angle (20°, 20°, 0°). Assuming that the torso is facing the positive direction of the X-axis of the world coordinate system, since the torso has not rotated relative to the world coordinate system (i.e., the axis direction of the local coordinate system has not deviated relative to the world coordinate system), the axis direction of the local coordinate system is the same as that of the world coordinate system. At this time, the new angle (20°, 20°, 0°) corresponds to a compound rotation of 20° yaw around the Z-axis and 20° pitch around the Y-axis in the world coordinate system, which is visually represented as the head facing a direction that is 20° right and 20° upward.
[0086] The world coordinate system refers to the global reference frame of the virtual scene, with a fixed origin as the reference (such as the (0, 0, 0) point at the center of the virtual scene), and the coordinate axis direction can be fixed as the X-axis pointing forward (i.e., from the inside of the screen to the outside), the Z-axis vertically upward, and the Y-axis horizontally to the right. The absolute position and global direction of all objects in the virtual scene are calculated based on this.
[0087] The local coordinate system refers to the reference frame attached to the torso of the virtual object. The center point of the chest of the torso can be taken as the origin, and the coordinate axis direction is determined by the orientation of the torso, for example, the X-axis points forward, the Z-axis vertically upward (consistent with the Z-axis direction of the world coordinate system), and the Y-axis points to the right side of the torso. When the torso moves or rotates in the world space, the local coordinate system will change synchronously with the torso, but the rotation of the head is only based on the local coordinate system to calculate the relative rotation.
[0088] The local Euler angle refers to a rotation angle of the head relative to a local coordinate system of the torso. Referring to FIG. 16, which is a schematic diagram of the local Euler angle according to an embodiment of the present application, the local Euler angle is represented in three dimensions of (Yaw, Pitch, Roll). Yaw refers to a yaw angle (controlling left and right turning of the head) around the Z axis of the local coordinate system, Pitch refers to a pitch angle (controlling tilting of the head) around the Y axis of the local coordinate system, and Roll refers to a roll angle (usually 0) around the X axis of the local coordinate system. In the above example, the local Euler angle of the head (20°, 20°, 0°) indicates that the head is in a state of “turning right by 20°, tilting up by 20°, and no roll (Roll is 0°)” relative to the torso.
[0089] For example, when the terminal device is a desktop computer or a laptop computer, the view angle turning operation can be an input operation based on an external input device. For example, the operation of pressing and dragging the middle mouse button can be recognized as the view angle turning operation, or the pressing operation of a specific key on the keyboard can be recognized as the view angle turning operation, or the shaking operation of a handle can be recognized as the view angle turning operation. When the terminal device is a mobile terminal such as a mobile phone or a tablet computer, the triggering operation of a specific virtual control displayed on the touch screen can be recognized as the view angle turning operation, or the sliding operation of the touch screen can be recognized as the view angle turning operation. The embodiments of the present application do not make a specific limitation in this regard.
[0090] In some embodiments, the view angle turning operation can be a moving operation (for example, the operation of pressing and dragging the middle mouse button). The above-mentioned control of the head of the virtual object to turn by a corresponding angle in the direction indicated by the view angle turning operation can be implemented in the following manner: obtaining a moving distance of the moving operation; determining an angle to be turned by the head of the virtual object based on the moving distance, wherein the angle to be turned by the head of the virtual object is positively correlated with the moving distance (that is, the farther the moving distance, the greater the angle to be turned by the head of the virtual object); and controlling the head of the virtual object to turn by the determined angle in the moving direction of the moving operation (that is, the direction indicated by the view angle turning operation).
[0091] For example, the above-mentioned determination of the angle to be turned by the head of the virtual object based on the moving distance can be implemented in the following manner: when the moving distance is less than a distance threshold (for example, 3 cm), querying a pre-created mapping table based on the moving distance to obtain an angle corresponding to the moving distance as the angle to be turned by the head of the virtual object, wherein the mapping table includes a mapping relationship between different moving distances and different angles; and when the moving distance is greater than the distance threshold, setting a pre-set maximum turnable angle (for example, 80 degrees) as the angle to be turned by the head of the virtual object. In this way, the situation of “breaking the mold” due to the head of the virtual object turning too large an angle can be avoided.
[0092] For example, taking a desktop computer as an example, when it is detected that the player holds the middle key of the mouse (i.e., the mouse wheel) and drags the mouse to the right, the distance of the mouse dragged by the player can be obtained, and an angle corresponding to the distance can be obtained by querying a mapping table created in advance according to the distance. For example, assuming that the distance of the mouse dragged by the player is 1 cm, and it is learned from the mapping table that the angle corresponding to 1 cm is 15 degrees, 15 degrees can be taken as the angle to be rotated by the head of the virtual object, and finally the head of the virtual object can be controlled to rotate 15 degrees to the right. In addition, when it is detected that the distance of the mouse dragged by the player (for example, assuming 5 cm) exceeds the distance threshold, that is, the angle corresponding to the distance cannot be queried from the mapping table, the maximum rotatable angle (for example, assuming 90 degrees) corresponding to the right direction set in advance can be taken as the angle to be rotated by the head of the virtual object, that is, the rotation angle of the head of the virtual object is limited, and even if the distance of the mouse dragged by the player to the right is greater than the distance threshold, the head of the virtual object is only controlled to rotate 90 degrees to the right, so that the occurrence of the penetration problem due to the too large rotation angle of the head of the virtual object can be avoided.
[0093] For example, taking a desktop computer as an example, when it is detected that the player holds the middle key of the mouse (i.e., the mouse wheel) and drags the mouse to the right, the distance of the mouse dragged by the player can be obtained, and an angle corresponding to the distance can be obtained by querying a mapping table created in advance according to the distance. For example, assuming that the distance of the mouse dragged by the player is 1 cm, and it is learned from the mapping table that the angle corresponding to 1 cm is 15 degrees, 15 degrees can be taken as the angle to be rotated by the head of the virtual object, and finally the head of the virtual object can be controlled to rotate 15 degrees to the right. In addition, when it is detected that the distance of the mouse dragged by the player (for example, assuming 5 cm) exceeds the distance threshold, that is, the angle corresponding to the distance cannot be queried from the mapping table, the maximum rotatable angle (for example, assuming 90 degrees) corresponding to the right direction set in advance can be taken as the angle to be rotated by the head of the virtual object, that is, the rotation angle of the head of the virtual object is limited, and even if the distance of the mouse dragged by the player to the right is greater than the distance threshold, the head of the virtual object is only controlled to rotate 90 degrees to the right, so that the occurrence of the penetration problem due to the too large rotation angle of the head of the virtual object can be avoided.
[0094] The embodiment of the present application dynamically controls the rotation angle of the head of the virtual object based on the movement distance, not only realizes the positive correlation adaptation of the operation precision and the movement distance (for example, 1 cm movement corresponds to 15 degrees rotation), so that the player can realize the visual angle fine adjustment through delicate mouse dragging or screen sliding, but also effectively avoids the penetration problem caused by excessive dragging through the double limitation of the distance threshold (for example, 5 cm) and the maximum rotation angle (for example, 90 degrees), and improves the visual reality of the virtual scene.
[0095] In some embodiments, the virtual scene can display at least one direction control, and the view rotation operation can be a press operation on any direction control. The control of the head of the virtual object to rotate a corresponding angle in a direction indicated by the view rotation operation can be implemented by: obtaining a press parameter of the press operation; determining an angle to be rotated by the head of the virtual object based on the press parameter; and controlling the head of the virtual object to rotate the determined angle in the direction indicated by the pressed direction control.
[0096] It should be noted that the direction control for controlling the rotation direction of the head of the virtual object and the direction control for controlling the movement direction of the virtual object can be the same set of direction controls, that is, the direction control can have two different modes, for example, in a first mode, the direction control is used to control the movement direction of the virtual object, and in a second mode, the direction control is used to control the rotation direction of the head of the virtual object. In addition, in order to facilitate the player to distinguish, the direction control can have different display styles in different modes, for example, in the first mode, the direction control can be red, and in the second mode, the direction control can be green. Alternatively, when the direction control is in the first mode, first prompt information can be displayed near the direction control, wherein the first prompt information is used to prompt that the direction control is used to control the movement direction of the virtual object; when the direction control is in the second mode, second prompt information can be displayed near the direction control, wherein the second prompt information is used to prompt that the direction control is used to control the rotation direction of the head of the virtual object, and the embodiments of the present application do not make specific limitations.
[0097] In addition, the switching of the mode of the direction control can be achieved by triggering a mode switching control. For example, a mode switching control can be displayed near the direction control, and the player can switch the mode by clicking the mode switching control. For example, assuming that the direction control is currently in the first mode, and the player wants to turn the head of the virtual object to view the surroundings, the player can click the mode switching control. After receiving the click operation of the player on the mode switching control, the mode of the direction control can be switched from the first mode to the second mode, that is, the direction control is currently used to control the turning direction of the head of the virtual object. That is, the player can control the head of the virtual object to turn in the corresponding direction by clicking the direction control. If the click operation of the player on the mode switching control is received again subsequently, the mode of the direction control can be switched from the second mode to the first mode again, that is, the direction control is currently used to control the moving direction of the virtual object. When the click operation of the player on the direction control is received, the body of the virtual object can be controlled to turn in the direction indicated by the clicked direction control, that is, the moving direction of the virtual object can be controlled to turn in the direction indicated by the clicked direction control. In this way, by reusing the same set of direction controls, the player can be prevented from being disturbed by too many controls in the virtual scene picture.
[0098] For example, referring to FIG. 15, which is a schematic diagram of a direction control provided by an embodiment of the present application, the layout of the direction control is shown in FIG. 15. The mode switching control 1500 includes a mode control 1501 and a mode control 1502. The mode of the direction control is set to the first mode in response to the triggering operation on the mode control 1501, and the mode of the direction control is set to the second mode in response to the triggering operation on the mode control 1502. The mode control 1501 and the mode control 1502 can only be triggered one at a time, that is, the mode of the direction control is either the first mode or the second mode. The direction control 1503 (up), the direction control 1504 (left), the direction control 1505 (right), and the direction control 1506 (down) are direction indication controls, which are used to control the moving direction of the virtual object. For example, in the first mode, the body of the virtual object is controlled to turn in the direction (right) indicated by the clicked direction control 1505 in response to the triggering operation on the direction control 1505. In the second mode, the head of the virtual object is controlled to turn in the direction (right) indicated by the clicked direction control 1505 in response to the triggering operation on the direction control 1505.
[0099] In some embodiments, the direction control for controlling the rotation direction of the head of the virtual object and the direction control for controlling the movement direction of the virtual object can also be two different sets of direction controls, that is, two sets of direction controls can be displayed in the virtual scene, one set of direction controls is used to control the rotation direction of the head of the virtual object, and the other set of direction controls is used to control the movement direction of the virtual object. For example, the direction controls located on the left side of the virtual scene can be used to control the movement direction of the virtual object, and the direction controls located on the right side of the virtual scene can be used to control the rotation direction of the head of the virtual object. Of course, the player can also set according to his own habits, for example, the player can also set the direction controls located on the left side of the virtual scene to control the rotation direction of the head of the virtual object, and set the direction controls located on the right side of the virtual scene to control the movement direction of the virtual object. The embodiments of the present application do not make specific limitations on this.
[0100] It should be noted that the display style of the direction control (for example, direction control 1) for controlling the rotation direction of the head of the virtual object and the display style of the direction control (for example, direction control 2) for controlling the movement direction of the virtual object can be different, for example, direction control 1 can be displayed in red, and direction control 2 can be displayed in green, to facilitate the user to distinguish. Of course, the display style of direction control 1 and the display style of direction control 2 can also be the same, for example, the corresponding prompt information can be displayed near direction control 1 and direction control 2 respectively to prompt the functions of each direction control, for example, the first prompt information that the direction control is used to control the rotation direction of the head of the virtual object can be displayed near direction control 1, and the second prompt information that the direction control is used to control the movement direction of the virtual object can be displayed near direction control 2. The embodiments of the present application do not make specific limitations on this.
[0101] In other embodiments, the pressing parameter can include the pressing duration and the pressing force, and the angle at which the head of the virtual object is to be rotated can be determined based on the pressing parameter in the following manner: when the pressing duration is greater than a duration threshold (for example, 2 seconds), the pressure interval in which the pressing force is located is determined; the angle corresponding to the determined pressure interval is taken as the angle at which the head of the virtual object is to be rotated, wherein different pressure intervals correspond to different angles.
[0102] For example, in a mobile device or other interactive terminal device, the detection of the pressing force in the pressure parameter can be achieved in the following manner: if the device is equipped with a pressure sensor, the physical pressure value of the user's pressing is directly obtained, which is proportional to the actual force applied by the finger; if the device is not equipped with a pressure sensor, the pressing force can be obtained by the contact area of the player with the screen of the device, for example, by detecting the number of pixels of the contact area of the user's finger with the screen through a capacitive screen, converting the number of pixels into the contact area, and obtaining the pressing force through a preset mapping relationship between the pressure and the area, wherein the contact area is proportional to the pressing force.
[0103] It should be noted that the detection of the pressing duration is to avoid identifying the player's accidental touch as a view angle rotation operation, that is, only when the player presses the direction control for a duration greater than the duration threshold, it will be identified as a view angle rotation operation, so as to avoid identifying the operation of the player accidentally pressing the direction control as a view angle rotation operation.
[0104] In other embodiments, as in the above example, when it is detected that the pressing force exceeds the preset maximum pressure interval, the following processing can be performed: the angle corresponding to the maximum pressure interval is taken as the angle to be rotated by the head of the virtual object.
[0105] For example, in a virtual scene, four direction controls of up, down, left and right can be displayed, when a pressing operation of the player on the up direction control is received, and the pressing duration of the pressing operation exceeds the duration threshold, the pressing force of the pressing operation can be obtained, then the target pressure interval in which the pressing force is located among the preset multiple pressure intervals can be determined, wherein each pressure interval corresponds to an angle, then the angle (for example, 30 degrees) corresponding to the target pressure interval is taken as the angle to be rotated by the head of the virtual object, finally the head of the virtual object can be controlled to rotate upward by 30 degrees. In addition, if it is detected that the pressing force of the player pressing the direction control exceeds the maximum pressure interval, the angle corresponding to the maximum pressure interval is taken as the angle to be rotated by the head of the virtual object, so that the case of wearing a model due to the angle of the head of the virtual object being too large can be avoided.
[0106] Taking the pressing operation on the left and right direction controls (controlling the left and right head) as an example, when the pressing force is in the 0-50 gf (here, gf (gram-force) represents gram-force) interval, the corresponding angle is 10°; when the pressing force is in the 51-100 gf interval, the corresponding angle is 20°; when the pressing force is in the 101-150 gf interval, the corresponding angle is 30°; if the pressing force exceeds 150 gf, that is, in the maximum pressure interval, the corresponding angle is 35°.
[0107] The embodiment of the application establishes a mapping relationship between the pressing duration and the pressing strength and the head rotation angle of the virtual object, avoids insufficient control accuracy caused by a fixed rotation angle, prevents abnormal conditions such as scene penetration caused by extreme operation through pressure interval threshold control, enhances the operation immersion, ensures the physical reality of the virtual scene, and provides a more delicate visual angle control experience for the player.
[0108] In some embodiments, the angle at which the head of the virtual object is to be rotated can also be determined according to the duration for which the player presses the direction control, wherein the angle at which the head of the virtual object is to be rotated can be positively correlated with the duration for which the player presses the direction control, that is, the longer the duration for which the player presses the direction control, the greater the angle at which the head of the virtual object is to be rotated. For example, assuming that it is detected that the player presses the upward direction control for 3 seconds, the angle corresponding to 3 seconds (for example, 30 degrees) can be queried from a pre-created mapping table, wherein the mapping table can include a mapping relationship between different pressing durations and different angles, and then the head of the virtual object can be controlled to rotate upward by 30 degrees while keeping the body of the virtual object from rotating. In addition, if it is detected that the player presses the upward direction control for a duration exceeding a duration threshold, the maximum rotatable angle (for example, 80 degrees) corresponding to the upward direction that is pre-set can be used as the angle at which the head of the virtual object is to be rotated, that is, even if the player presses the upward direction control for a duration exceeding the duration threshold, the head of the virtual object is only controlled to rotate upward by 80 degrees, so that the scene penetration caused by the head of the virtual object rotating too much can be avoided.
[0109] That is, in order to avoid the scene penetration caused by the head of the virtual object rotating too much, the player can also set the maximum rotatable angle of the head of the virtual object in different directions before controlling the head of the virtual object to rotate in the direction indicated by the visual angle rotation operation, for example, the player can set the maximum angle at which the head of the virtual object can rotate in the horizontal direction and the vertical direction in the setting interface, that is, the rotation angle of the head of the virtual object can be limited to avoid the occurrence of the scene penetration.
[0110] The embodiment of the application establishes a positive correlation mapping relationship between the pressing duration and the rotation angle of the head of the virtual object, and combines the pre-set maximum rotatable angle limit, realizes dynamic matching of the pressing time and the rotation amplitude, enables the player to accurately control the delicacy of the visual angle rotation through the pressing duration, prevents the scene penetration caused by excessive rotation through the angle threshold, ensures the operation flexibility while maintaining the physical rationality of the virtual scene, and provides the player with a visual angle adjustment experience that has controllability and reality.
[0111] In some embodiments, the angle at which the head of the virtual object is to be turned can also be determined in an artificial intelligence-based manner, and the control of the head of the virtual object to turn the corresponding angle in the direction indicated by the view turning operation can also be achieved in the following manner: based on the feature data of the virtual scene (for example, the position distribution of other virtual objects in the virtual scene, the type of the virtual scene, etc.) and the feature data of the virtual object (for example, whether the virtual object is in a moving state, whether the virtual object holds a virtual shooting prop, etc.), a machine learning model is called to perform prediction processing to obtain the angle at which the head of the virtual object is to be turned; and the head of the virtual object is controlled to turn the determined angle in the direction indicated by the view turning operation.
[0112] For example, taking a game character A controlled by a current player as a virtual object, when receiving a view turning operation triggered by the player, the feature data of the game character A and the feature data of the game scene in which the game character A is located can be obtained, and then the feature data of the game character A and the feature data of the game scene can be encoded respectively, and then the encoded feature data (including the feature data of the game character A and the feature data of the game scene) can be input into a trained machine learning model to perform prediction processing to obtain the angle at which the head of the game character A is to be turned (for example, 20 degrees), and then the head of the game character A can be controlled to turn 20 degrees in the direction indicated by the view turning operation while keeping the body of the game character A from turning. In this way, the player only needs to determine the turning direction of the head of the game character, and the angle at which the head of the game character needs to be turned can be automatically determined based on the feature data of the game character and the feature data of the game scene in an artificial intelligence manner, thereby reducing the operation burden of the player and further improving the game experience of the player.
[0113] For example, the machine learning model adopts a multi-modal fusion architecture, first processes the role features (such as posture, equipment) and scene features (such as terrain, obstacles) through parallel feature extractors, automatically allocates feature weights using an attention mechanism, captures the interaction between the role features and the scene features, and obtains fused features. Then, the fused features are subjected to multi-layer nonlinear transformation; and finally, the head turning angle prediction value is output through a fully connected layer. The training phase of the machine learning model can adopt supervised learning, for example, the operation data of professional players is used as a label to optimize the prediction ability of the machine learning model, and the specific training manner of the machine learning model is not limited in the embodiments of the present application.
[0114] The embodiments of the application introduce artificial intelligence technology, construct a machine learning model based on virtual scene feature data and virtual object state data, realize intelligent prediction and dynamic adaptation of head rotation angle, can automatically generate reasonable rotation amplitude according to real-time information such as distribution of other objects in the scene and action state of the virtual object (such as intelligently adjusting the view angle to lock the enemy in the battle scene, keeping the field of view balanced when moving), and can make the angle control more in line with the player's operation habits and scene logic through model training, so that the player can obtain accurate view angle feedback without manually adjusting the angle, greatly reducing the operation complexity, and enhancing the immersion and reality of the virtual scene through intelligent interaction logic.
[0115] In some other embodiments, based on the above examples, before calling the machine learning model for prediction processing, the following processing can also be performed: obtaining feature data of a sample virtual scene and feature data of a sample virtual object; calling the initialized machine learning model for prediction processing based on the feature data of the sample virtual scene and the feature data of the sample virtual object, to obtain an angle at which the head of the sample virtual object is to be rotated; determining a difference between the angle at which the head of the sample virtual object is to be rotated and a pre-labeled rotation angle; performing back propagation based on the difference, and updating parameters of the machine learning model layer by layer in the process of back propagation.
[0116] It should be noted that the principle of the back propagation (BP) algorithm is mainly based on the gradient descent method, which adjusts the weights and parameters of the machine learning model (such as a neural network model) by calculating the gradient of the loss function with respect to the weights and parameters to improve the accuracy of the neural network model training. The working principle of the algorithm mainly includes the following steps: 1, forward propagation: the input data passes through the hierarchical structure and parameters of the neural network model, and is gradually converted into a prediction result, realizing the complex mapping between input and output. This includes the input layer receiving sample data, the hidden layer receiving the signals of the input layer neurons and performing weighted summation and bias operation, and finally the output layer receiving signals from the hidden layer and performing similar weighted summation and bias operation to obtain the prediction result. 2, calculate the loss: compare the prediction result with the actual result, calculate the deviation between the prediction result and the actual result, which is called loss function or error function, which represents the fitting quality of the model. The smaller the value of the loss function, the higher the fitting quality of the model. 3, back propagation: use the chain rule to calculate the error gradient from the output layer to the input layer, efficiently solve the partial derivative of the neural network model parameters, to realize the optimization of network parameters and the minimization of loss function. This includes calculating the gradient of the loss function from the output layer, then propagating the error information back to the hidden layer, and calculating the error gradient of each neuron layer by layer. 4, parameter update: according to the gradient information calculated, use gradient descent or other optimization algorithms to update the weights and bias parameters in the network to minimize the loss function. This process is iterated until the value of the loss function reaches the minimum or reaches the preset training round, and the training of the neural network model ends.
[0117] For example, an exemplary structure of a machine learning model can include an input layer (i.e., an embedding layer), an encoding layer (which can be composed of multiple cascaded convolutional layers), a fully connected layer, and an output layer (including an activation function, such as a Softmax function). After obtaining the feature data of the sample virtual scene and the feature data of the sample virtual object, the feature data can first be input into the input layer for embedding processing, then the embedding feature vector output by the input layer can be encoded by the encoding layer to obtain the hidden layer feature vector, then the hidden layer feature vector can be fully connected by the fully connected layer, and finally the fully connected result output by the fully connected layer can be input into the output layer for activation processing by the activation function, thereby obtaining the prediction result (i.e., the angle at which the head of the sample virtual object is to be rotated). After obtaining the angle at which the head of the sample virtual object is to be rotated output by the initialized machine learning model, the angle at which the head of the sample virtual object is to be rotated and the pre-labeled rotation angle can be substituted into the loss function to obtain the corresponding difference, and the difference can be used for back propagation, so that the parameters of the machine learning model can be updated layer by layer during back propagation, and a trained machine learning model can be obtained.
[0118] It should be noted that the machine learning model described above can be various types of neural network models, such as including a convolutional neural network model, a deep learning neural network model, and a support vector machine, etc., and the type of the machine learning model is not specifically limited in the embodiments of the present application.
[0119] That is, in the embodiments of the present application, the player only needs to determine the rotation direction of the head of the virtual object, and the angle to be rotated of the head of the virtual object can be automatically determined based on the artificial intelligence mode. In this way, the operation burden of the player can be reduced, and the game experience of the player is further improved.
[0120] In some embodiments, taking a shooting game as an example, the rotation speed of the head of the game character when rotating can be determined according to the design intention of the game and the operation habit of the player. For example, in the game, a sensitivity coefficient is usually set, and the multiplication result of the coefficient and the operation parameter of the view rotation operation (such as the moving distance of the moving operation, such as including the sliding distance or the dragging distance, or the pressing degree of the pressing operation) is taken as the rotation speed of the head of the game character when rotating. In addition, the player can adjust the sensitivity coefficient according to his own preference to meet the individualized needs of different players.
[0121] Taking a shooting game as an example, the basic sensitivity coefficient is automatically adjusted according to the current game scene type (such as close-range street fighting, aiming state), and the speed curve is dynamically optimized by analyzing the historical operation data of the player and identifying the operation intention such as target tracking, rapid scanning, and accurate aiming. For example, when it is detected that the virtual object (game character) controlled by the player moves continuously in a small range, the operation intention is predicted to be tracking the target, the speed curve is smoothed, and the maximum value is reduced according to the preset parameter; when it is detected that the virtual object controlled by the player slides rapidly, the maximum rotation speed is increased. In addition, the rotation speed can also be determined according to the state of the virtual object controlled by the player, such as increasing the rotation speed when the virtual object has low blood volume.
[0122] In other embodiments, based on the above example, since the frame rate of the game can be different, the operation parameter can also be multiplied by a time parameter before being multiplied by the sensitivity coefficient, so as to ensure that the rotation speed of the head of the game character is independent of the frame rate, and the rotation speed of the head of the game character remains consistent on different devices. In addition, in order to prevent the discomfort or game experience problem caused by the too fast rotation speed of the head of the game character, the maximum rotatable speed of the head of the game character can also be limited, for example, when the rotation speed set by the player is greater than the maximum rotatable speed, a prompt information can be output to remind the player to modify.
[0123] In some embodiments, in order to make the rotation of the head of the virtual object more smooth, the rotation of the head of the virtual object can also be controlled according to a gradual change in speed, for example, in Unity, the "Mathf.Lerp" function can be used to smoothly transition from one rotation speed to another. In addition, in some games, the rotation speed of the head of the game character can also be dynamically adjusted according to the game state or the character state, for example, when the game character is in a certain special state, the rotation speed of the head of the game character can become slower or faster.
[0124] For example, by linear interpolation, from one rotation speed to another, the transition intermediate value result can be calculated by the formula result = start + t * (end - start), where the value of t is updated with the frame number, so that t gradually increases from 0 to 1, driving the rotation speed to smoothly transition from the starting value to the target value, forming a linear gradient.
[0125] Of course, the rotation speed of the head of the virtual object can also be set by the player, for example, in the settings interface of the game, the corresponding options can be provided to allow the player to set the rotation speed of the head of the virtual object according to their own habits and preferences. The following will be described in detail.
[0126] In some embodiments, a rotation speed setting control can also be displayed in the virtual scene, and the following processing can be performed before controlling the head of the virtual object to rotate by a corresponding angle in the direction indicated by the view rotation operation: in response to a setting operation on the rotation speed setting control, the set rotation speed is obtained, and the above-mentioned control of the head of the virtual object to rotate by a corresponding angle in the direction indicated by the view rotation operation can be achieved by the following method: controlling the head of the virtual object to rotate by a corresponding angle in the direction indicated by the view rotation operation according to the set rotation speed.
[0127] For example, the virtual object is a game character A controlled by the current player, the player can set the rotation speed of the game character A, for example, a rotation speed setting control can be displayed in the game scene, the player can set the rotation speed of the game character A through the rotation speed setting control, for example, assuming that the player sets the rotation speed to 1 degree per second, when receiving the view rotation operation triggered by the player, the head of the game character A can be controlled to rotate by a corresponding angle in the direction indicated by the view rotation operation according to the rotation speed of 1 degree per second, that is, the player can customize the rotation speed of the head of the game character, further improving the game experience of the player.
[0128] It should be noted that if the player does not set the rotation speed of the head of the virtual object, the head of the virtual object can be controlled to rotate at a default rotation speed, or the head of the virtual object can be controlled to rotate at a rotation speed set by the player last time, and the embodiments of the application do not make specific limitations.
[0129] The embodiments of the application give the player the right to customize the rotation speed of the head of the virtual object by setting the rotation speed adjustment control, so that the player can flexibly adjust the rotation speed of the view angle according to the operation habit (for example, high rotation speed is selected for fast-paced battle scenes, and low rotation speed is selected for detailed exploration scenes). This adjustable speed control mode not only adapts to different player operation preferences, but also avoids the problem of stiff view angle switching caused by fixed rotation speed, so that the rotation of the head of the virtual object is more in line with the player's control expectation, and the comfort and freedom of scene exploration in the interaction process are effectively improved.
[0130] In other embodiments, the rotation speed of the head of the virtual object can be variable during the control of the rotation of the head of the virtual object, for example, the rotation speed of the head of the virtual object can be fast first and then slow, or slow first and then fast, and the embodiments of the application do not make specific limitations.
[0131] For example, taking the virtual object as a game character A controlled by the current player, when receiving the view angle rotation operation triggered by the player, for example, detecting that the player presses and drags the mouse to the left, the body of the game character A can be kept from rotating, and the head of the game character A can be controlled to rotate slowly (for example, 1 degree per second) to the left. When it is detected that the head of the game character A rotates by 50% of the corresponding angle, the head of the game character A can be controlled to rotate rapidly (for example, 3 degrees per second) to the left. That is, the rotation speed of the head of the game character A can be variable during the control of the rotation of the head of the game character A, so that the situation of a person in the real world when turning his head can be more realistically simulated. That is, the rotation process of the head of the virtual object can be divided into multiple stages, and the rotation speed of the head of the virtual object can be different in different stages. For example, the player can set a corresponding rotation speed for each stage, so that the turning action can be more realistically simulated.
[0132] In some embodiments, the virtual scene can further include a virtual camera corresponding to the virtual object (e.g., a virtual camera located at the eye of the virtual object, corresponding to a first-person perspective), wherein the first virtual scene picture is obtained by the virtual camera shooting the virtual scene at a first perspective, and when the head of the virtual object is controlled to rotate by an angle in a direction indicated by the perspective rotation operation, the following processing can be further performed: controlling the virtual camera to rotate by the angle in the direction indicated by the perspective rotation operation, and obtaining a second virtual scene picture by shooting the virtual scene through the rotated virtual camera, that is, the second virtual scene picture is obtained by the virtual camera shooting the virtual scene at a second perspective.
[0133] For example, taking a game character A controlled by a current player as the virtual object, a virtual camera corresponding to the game character A can be set in a game scene in which the game character A is located, for example, the virtual camera can be set at the eye of the game character A, and when the head of the game character A is controlled to rotate in a direction indicated by a perspective rotation operation, the virtual camera can be further controlled to rotate in the direction indicated by the perspective rotation operation, and then a second game scene picture (i.e., a second virtual scene picture) can be obtained by shooting the game scene through the rotated virtual camera.
[0134] The specific implementation process of controlling the head of the virtual object to rotate in the direction indicated by the perspective rotation operation will be described below.
[0135] In some embodiments, the specific implementation process of controlling the head of the virtual object to rotate can involve multiple aspects such as input processing, physical simulation, animation system, and graphics rendering pipeline, which will be described in detail below.
[0136] 1. Input Management: The game engine can capture the input actions of the player through the application programming interface (API) of the underlying input, such as pressing operations for the keyboard or dragging operations for the mouse, etc. The game engine can convert these physical signals into logical signals inside the game through the input management system, such as converting the player's dragging operation for the mouse into the rotation direction and rotation angle of the head of the virtual object.
[0137] 2. Game Logic: The game logic layer receives the signals sent by the input management system and decides how to respond to these signals according to the game design. In this layer, the rotation direction of the head of the virtual object (e.g., a game character) can be calculated, which can usually be determined in combination with the current perspective of the virtual object, the state of the virtual object, and other logic of the game.
[0138] 3. Physics Engine: If the virtual object (e.g., a game character) uses a physics engine for physical simulation, the physics engine can participate in the calculation of head rotation to ensure that the rotation complies with physical laws. For example, the physics engine can simulate the muscle strength and joint limitations of the game character, making the head rotation of the game character more realistic.
[0139] 4. Animation System: The rotation of the game character's head can be implemented through an animation system, such as skeletal animation or vertex animation. For skeletal animation, the game character's head is composed of a series of bones, each of which can rotate independently. The animation system can adjust the transformation matrix of the relevant bones according to the rotation direction and angle of the game character's head, thereby changing the orientation of the game character's head. For vertex animation, the vertex data of the game character's head can be directly manipulated to change the orientation of the game character's head, thereby achieving the rotation effect.
[0140] 5. Rendering Pipeline: Once the orientation of the game character's head is calculated by the animation system, this information is passed to the rendering pipeline. The rendering pipeline can calculate the final image displayed on the screen based on the transformation matrix of the game character's head and other rendering parameters, such as material, lighting, etc.
[0141] It should be noted that the rotation of the game character's head can be represented by transformation matrices, which can be applied in the vertex shader of the rendering pipeline to change the position and orientation of the vertices. To smoothly and accurately rotate the game character's head in a three-dimensional virtual scene, quaternions can be used to represent the rotation, which can avoid gimbal lock and provide smoother rotation when interpolating. In addition, in skeletal animation, each vertex may be affected by other bones, and the degree of influence of each bone can be determined by bone weights. The animation system can mix the transformations of different bones according to the weights to obtain the final position of the vertex. In the rendering stage, the shader program can use the final position and orientation information of the vertex to determine how to draw the game character's head, such as lighting information, texture mapping, etc.
[0142] In some embodiments, the virtual scene can further include a setting entrance, and before controlling the head of the virtual object to rotate by a corresponding angle in a direction indicated by the view angle rotation operation, the following processing can be further performed: in response to a triggering operation on the setting entrance, displaying a setting interface, wherein the setting interface can be used to set a maximum rotatable angle of the head of the virtual object in different directions (for example, including horizontal and vertical directions), and a rotation speed of the head of the virtual object, and the above-mentioned control of the head of the virtual object to rotate by a corresponding angle in a direction indicated by the view angle rotation operation can be implemented in the following manner: controlling the head of the virtual object to rotate by a corresponding angle in a direction indicated by the view angle rotation operation at the rotation speed, wherein the angle is less than or equal to the maximum rotatable angle corresponding to the direction indicated by the view angle rotation operation.
[0143] For example, continuing to take the virtual object as the game character A controlled by the current player as an example, when controlling the virtual camera corresponding to the game character A (for example, the virtual camera arranged at the eyes of the game character A) to rotate in a direction indicated by the view angle rotation operation, the shoulder of the game character A can be controlled to retreat by a corresponding distance at the same time, so that the problem of the shoulder of the game character A being inserted into the virtual camera during the rotation of the virtual camera can be avoided.
[0144] In some embodiments, the virtual scene can further include a setting entrance, and before controlling the head of the virtual object to rotate by a corresponding angle in a direction indicated by the view angle rotation operation, the following processing can be further performed: in response to a triggering operation on the setting entrance, displaying a setting interface, wherein the setting interface can be used to set a maximum rotatable angle of the head of the virtual object in different directions (for example, including horizontal and vertical directions), and a rotation speed of the head of the virtual object, and the above-mentioned control of the head of the virtual object to rotate by a corresponding angle in a direction indicated by the view angle rotation operation can be implemented in the following manner: controlling the head of the virtual object to rotate by a corresponding angle in a direction indicated by the view angle rotation operation at the rotation speed, wherein the angle is less than or equal to the maximum rotatable angle corresponding to the direction indicated by the view angle rotation operation.
[0145] For example, in a shooting game, a setting entry can also be displayed in the game scene, for example, the setting entry can be displayed in the upper right corner of the game scene, when a click operation of the player is received for the setting entry, a setting interface can be displayed in the game scene, wherein the setting interface can include multiple areas for the player to set the maximum rotatable angle of the head of the virtual object in different directions respectively, and the rotation speed of the head of the virtual object, for example, the player can set the maximum rotatable angle of the head of the virtual object in the horizontal direction and the vertical direction respectively based on the setting interface. For example, the first setting control for setting the maximum rotatable angle of the head of the virtual object in the horizontal direction and the second setting control for setting the maximum rotatable angle of the head of the virtual object in the vertical direction can be displayed in the setting interface, in this way, the angle set by the player in the first setting control can be used as the maximum rotatable angle of the head of the virtual object in the horizontal direction; similarly, the angle set by the player in the second setting control can be used as the maximum rotatable angle of the head of the virtual object in the vertical direction. In addition, the third setting control for setting the rotation speed of the head of the virtual object can also be displayed in the setting interface, in this way, the rotation speed set by the player in the third setting control can be used as the rotation speed set for the head of the virtual object, and the head of the virtual object will rotate at this rotation speed subsequently.
[0146] It should be noted that in addition to being used to set the maximum rotatable angle of the head of the virtual object in different directions respectively and the rotation speed of the head of the virtual object, the setting interface can also be used to set the rotation speed of the virtual camera corresponding to the virtual object and the maximum rotatable angle of the virtual camera in different directions respectively. For example, the fourth setting control for setting the rotation speed of the virtual camera can also be displayed in the setting interface, that is, the rotation speed set by the player in the fourth setting control can be used as the rotation speed of the virtual camera. In addition, the fifth setting control for setting the maximum rotatable angle of the virtual camera in the horizontal direction and the sixth setting control for setting the maximum rotatable angle of the virtual camera in the vertical direction can also be displayed in the setting interface, in this way, the angle set by the player in the fifth setting control can be used as the maximum rotatable angle of the virtual camera in the horizontal direction, and similarly, the angle set by the player in the sixth setting control can be used as the maximum rotatable angle of the virtual camera in the vertical direction.
[0147] In some embodiments, the virtual object can hold a virtual shooting prop (e.g. a virtual gun), and a shooting direction of the virtual shooting prop (e.g. a barrel direction of the virtual gun) can be determined based on an orientation of a body of the virtual object (e.g. when the orientation of the body of the virtual object is leftward, the barrel direction is also leftward), then the step 102 can be implemented by: in response to the view angle turning operation, keeping the shooting direction of the virtual shooting prop unchanged (i.e. keeping the shooting direction of the virtual shooting prop unchanged by keeping the body of the virtual object from turning), and controlling the head of the virtual object to turn by a corresponding angle in a direction indicated by the view angle turning operation.
[0148] For example, in a shooting game, a game character (i.e. a virtual object) displayed in a game scene can hold a virtual shooting prop (e.g. a virtual gun), then when a view angle turning operation triggered by a player is received (e.g. when it is detected that the player presses and drags a middle mouse button), the barrel direction of the virtual gun held by the game character can be kept unchanged by keeping the body of the game character from turning, and the head of the game character can be controlled to turn by a corresponding angle in a direction of the dragging, thus, by keeping the body of the game character and the barrel direction unchanged, and only turning the head of the game character to obtain surrounding information, since the turning head action has a smaller amplitude than the turning body action, the player will not make a sound when controlling the game character to turn the head, thus meeting the demand of the player who wants to obtain surrounding information without making a sound, and improving the game experience of the player.
[0149] In other embodiments, the player can control the game character to shoot with the virtual gun while controlling the game character to turn the head, then the step of keeping the shooting direction of the virtual shooting prop unchanged and controlling the head of the virtual object to turn by a corresponding angle in a direction indicated by the view angle turning operation in response to the view angle turning operation can be implemented by: in response to the view angle turning operation and the shooting operation, keeping the shooting direction of the virtual shooting prop unchanged and controlling the virtual shooting prop to shoot in the shooting direction while controlling the head of the virtual object to turn by a corresponding angle in a direction indicated by the view angle turning operation.
[0150] For example, when the player presses and drags the middle mouse button to the right while pressing the fire key (e.g., the "A" key) on the keyboard, the player can control the game character to turn the head to the right, and keep the virtual gun held by the game character in the same direction (e.g., the forward direction) and control the virtual gun to shoot forward. That is, the view angle of the game character and the direction of the virtual gun can be different, and the player can control the game character to turn the head and control the virtual gun to shoot in the previous direction, so as to further improve the game experience and the game fun of the player. In some embodiments, the orientation of the body of the virtual object can be used to determine the moving direction of the virtual object, and the above step 102 can also be implemented by the following manner: in response to receiving the view angle turning operation in the process of controlling the virtual object to move, keeping the moving direction of the virtual object unchanged (i.e., the body of the virtual object does not turn), and controlling the head of the virtual object to turn to the direction indicated by the view angle turning operation by a corresponding angle.
[0151] For example, the above manner of keeping the moving direction of the virtual object unchanged and controlling the head of the virtual object to turn to the direction indicated by the view angle turning operation by a corresponding angle in response to receiving the view angle turning operation in the process of controlling the virtual object to move can be implemented by the following manner: in response to receiving the moving instruction triggered for the virtual object (e.g., receiving the pressing operation of the "W" key on the keyboard, or receiving the clicking operation of the virtual direction control displayed on the screen), controlling the virtual object to move in the direction indicated by the moving instruction; in response to receiving the view angle turning operation (e.g., the pressing and dragging operation of the middle mouse button) in the process of the virtual object moving in the direction indicated by the moving instruction, keeping the moving direction of the virtual object unchanged, and controlling the head of the virtual object to turn to the direction indicated by the view angle turning operation by a corresponding angle, so as to meet the player's demand of not changing the moving direction of the game character and observing the surroundings.
[0152] For example, taking a game character A controlled by a current player in a game scene as an example, when the player has a demand of not changing the moving direction of the game character A and observing surroundings during controlling the game character A to move, the technical solution provided in the embodiments of the present application can be used to implement, for example, when a pressing operation of the player on a "W" key of a keyboard is received, the game character can be controlled to move forward. It is assumed that a view angle turning operation (for example, a holding and dragging operation of a middle mouse button) triggered by the player is received during controlling the game character A to move forward, the body of the game character A can be kept from turning (since the moving direction of the game character A is determined by the orientation of the body of the game character A, therefore, the moving direction of the game character A will not change when the body of the game character A is kept from turning), that is, during keeping the game character A to continue moving forward, the head of the game character A is controlled to turn to a direction indicated by the view angle turning operation by a corresponding angle, for example, it is assumed that the player holds the middle mouse button and drags it to the right by 1 cm, then the head of the game character A can be controlled to turn to the right by 10 degrees, in this way, the player can control the game character A to turn its head to quickly observe the situation around the game character A while controlling the game character A to sprint to the destination quickly, which improves the game experience of the player.
[0153] In step 103, the second virtual scene picture is displayed.
[0154] Here, the second virtual scene picture can be a virtual scene observed by the virtual object at a second view angle, wherein the second view angle is a view angle corresponding to the head of the virtual object after turning.
[0155] In some embodiments, when there is a virtual camera bound to the virtual object in the virtual scene, for example, there is a virtual camera set near the head of the virtual object in the virtual scene, when the head of the virtual object is controlled to turn, the virtual camera bound to the virtual object can also be controlled to turn synchronously, and then the virtual scene can be shot by the virtual camera after turning to obtain the second virtual scene picture.
[0156] In other embodiments, referring to FIG. 4, FIG. 4 is a second flowchart of the method for interacting with the virtual scene provided in the embodiments of the present application, as shown in FIG. 4, after step 103 shown in FIG. 3 is executed, steps 104 and 105 shown in FIG. 4 can also be executed, which will be described in combination with the steps shown in FIG. 4.
[0157] In step 104, in response to the view angle turning operation being released, the head of the virtual object is controlled to turn by a corresponding angle in the opposite direction of the direction indicated by the view angle turning operation.
[0158] In some embodiments, because the technical solutions provided in the embodiments of the present application are to obtain surrounding information, rather than to change the moving direction of the virtual object, after the surrounding information is obtained, the view angle turning operation is released, for example, taking the view angle turning operation as a moving operation (for example, the operation of the player holding the middle key of the mouse and dragging the mouse to the left), when it is detected that the moving operation is released (for example, the player releases the hand), the head of the virtual object can be controlled to turn in the opposite direction of the direction indicated by the view angle turning operation by a corresponding angle (that is, the head of the virtual object can be controlled to turn back to normal).
[0159] For example, when it is detected that the player holds the middle key of the mouse and drags the mouse to the left by 1 cm, the head of the game character A can be controlled to turn to the left by 10 degrees without turning the body of the virtual object (for example, the game character A controlled by the current player) to make the player observe the situation on the left side of the game character A. Then, when it is detected that the player releases the hand, the head of the game character A can be controlled to turn to the right by 10 degrees, that is, the head of the game character A is controlled to turn back to normal.
[0160] For example, when it is detected that the player holds the middle key of the mouse and drags the mouse to the left by 1 cm, the head of the game character A can be controlled to turn to the left by 10 degrees without turning the body of the virtual object (for example, the game character A controlled by the current player) to make the player observe the situation on the left side of the game character A. Then, when it is detected that the player releases the hand, the head of the game character A can be controlled to turn to the right by 10 degrees, that is, the head of the game character A is controlled to turn back to normal.
[0161] It should be noted that the turning speed of the head of the game character A when turning back to normal and the turning speed when turning in response to the view angle turning operation can be the same or different, and the embodiments of the present application do not make specific limitations thereon. For example, the player can set the turning speed of the avatar of the virtual object when turning in response to the view angle turning operation and the turning speed when the view angle turning operation is released in the setting interface. Of course, the turning speed set by the player can also be used as the turning speed of the head of the virtual object when turning in response to the view angle turning operation and the turning speed when the view angle turning operation is released, and the embodiments of the present application do not make specific limitations thereon.
[0162] In some embodiments, the virtual scene can include a virtual camera corresponding to the virtual object, for example, a virtual camera arranged at the eyes of the virtual object (corresponding to a first-person perspective), and when the head of the virtual object is controlled to turn in the opposite direction of the direction indicated by the view angle turning operation by a corresponding angle, the following processing can also be performed: the virtual camera is controlled to turn in the opposite direction of the direction indicated by the view angle turning operation by the same angle.
[0163] In some embodiments, the virtual scene further comprises a camera rotation speed setting control, and the method further comprises: in response to a setting operation on the camera rotation speed setting control, obtaining a rotation speed set for the virtual camera; and controlling the virtual camera to rotate in the opposite direction of the direction indicated by the view angle rotation operation by the same angle before controlling the virtual camera to rotate in the opposite direction of the direction indicated by the view angle rotation operation by the same angle.
[0164] For example, in a shooting game, a setting control for setting the rotation speed of a virtual camera bound to a virtual object (e.g., a game character A controlled by a current player) can also be displayed in the game scene. The player can set the rotation speed of the virtual camera through the setting control. For example, the rotation speed set by the player in the setting control (e.g., 4 degrees per second) can be taken as the rotation speed of the virtual camera bound to the game character A. Thus, when the virtual camera needs to be controlled to rotate, the virtual camera can be controlled to rotate at the rotation speed. For example, when the view angle rotation operation is detected to be released, the virtual camera can be controlled to return to normal at a rotation speed of 4 degrees per second. Thus, the individual needs of different players can be met.
[0165] In step 105, the first virtual scene picture is switched back from the second virtual scene picture.
[0166] In some embodiments, after the head of the virtual object is controlled to rotate in the opposite direction of the direction indicated by the view angle rotation operation by the same angle, the view angle of the virtual object changes from the second view angle to the first view angle. At this time, the virtual scene picture displayed in the human-computer interaction interface can be switched back from the second virtual scene picture to the first virtual scene picture.
[0167] For example, taking a game character A controlled by a current player as an example, there can be a virtual camera bound to the game character A in the game scene, for example, a corresponding virtual camera can be set near the head of the game character A, and the game scene can be shot by the virtual camera at a first view angle to obtain a first game scene picture. Then, when receiving a view angle turning operation triggered by the player (for example, the player presses and drags the mouse middle key 1 centimeter to the right), the head of the game character A can be controlled to turn 10 degrees to the right while keeping the body of the game character A from turning, and the virtual camera bound to the game character A can also be controlled to synchronously turn 10 degrees to the right. Subsequently, the game scene can be shot by the virtual camera after turning at a second view angle to obtain a second game scene picture, that is, the information on the right side of the game character A can be obtained by controlling the head of the game character A to turn to the right. Finally, when detecting that the view angle turning operation is released (for example, detecting that the player releases the mouse), the head of the game character A can be controlled to turn back to normal (that is, the head of the game character A is controlled to turn 10 degrees to the left), and the virtual camera bound to the game character A can be controlled to synchronously turn back to normal (that is, the virtual camera is controlled to synchronously turn 10 degrees to the left), that is, the view angle of the game character A is switched back from the second view angle to the first view angle, and then the game scene picture displayed in the human-computer interaction interface can also be switched back from the second game scene picture to the first game scene picture to keep consistent with the view angle of the game character A.
[0168] The method for interacting with a virtual scene provided in the embodiments of the present application can keep the body of a virtual object from turning when receiving a view angle turning operation triggered by a player, and only obtain surrounding information by turning the head of the virtual object, so that the player can be provided with a silent observation mode, and the player can choose to expose himself without making a sound to obtain surrounding information, thereby enriching tactical choices in the virtual scene and improving the game experience of the player.
[0169] For example, taking a first-person shooter (FPS) game as an example, the application of the embodiments of the present application in an actual application scenario is described below.
[0170] The embodiment of the present application provides a virtual scene interaction processing method, which can be applied to a first-person shooting game, and provides a motion play method for simulating a character turning head to observe surroundings in the game. For example, a player can control a virtual camera bound to a game character to look around by pressing and dragging a middle mouse button (i.e., a mouse wheel), so as to obtain information around the player without exposing the player's voice. In this way, on the one hand, the player's demand for observing surroundings without changing the moving direction of the game character when controlling the game character to move can be met. For example, the player can control the game character to quickly look around while controlling the game character to sprint to a destination. On the other hand, in a realistic shooting game, the player needs to determine the position of an enemy through voice information. When the game character observes surroundings by turning head, the game character will make a sound when turning head, so as to expose the position of the game character. In contrast, the embodiment of the present application can provide a player with a soundless observation method, so that the player can select to obtain limited visual information without exposing the player's position, thereby enriching the tactical selection.
[0171] Specifically, in the technical solution provided by the embodiment of the present application, a player can control a virtual camera bound to a game character to look around by pressing and dragging a mouse, so as to obtain information around the player. In addition, in order to prevent the player from observing surroundings too much and appearing in a model, a range limit rotatable angle can be configured. In addition, a corresponding 3P character (i.e., a performance of the game character controlled by the player in the eyes of other players) also has an animation performance of turning head. In this way, on the one hand, the player's demand for observing surroundings without changing the moving direction of the game character when controlling the game character to move can be met. On the other hand, the tactical selection of the game is enriched, and the playability of the game is enriched.
[0172] The virtual scene interaction processing method provided by the embodiment of the present application is specifically described below.
[0173] In some embodiments, a player can control a virtual camera (e.g., a virtual camera located near a head of a game character) bound to the game character to rotate by pressing and dragging a mouse, so as to observe surroundings.
[0174] For example, referring to FIG. 5, which is a first application scenario diagram of the method for processing interaction of a virtual scene according to an embodiment of the present application, as shown in FIG. 5, a game character 502 holding a virtual gun 501 is displayed in a first-person view in a game scene, when it is detected that the player presses and drags the mouse middle button upwards, the virtual camera (not shown in FIG. 5, i.e., the virtual camera is invisible to the player, i.e., the virtual camera will not be displayed in the game scene) bound to the game character 502 can be controlled to turn upwards, while the player can also control the head of the game character 502 to turn upwards (i.e., simulate the action of the game character 502 turning his head to look upwards) without turning the body (i.e., limbs and torso) of the game character 502 (thus, the muzzle of the virtual gun 501 held by the game character 502 will not turn), so as to observe the situation above the game character 502; when it is detected that the player presses and drags the mouse middle button to the left, the virtual camera bound to the game character 502 can be controlled to turn to the left, while the player can also control the head of the game character 502 to turn to the left (i.e., simulate the action of the game character 502 turning his head to look to the left) without turning the body of the game character 502, so as to observe the situation to the left of the game character 502; when it is detected that the player presses and drags the mouse middle button to the right, the virtual camera bound to the game character 502 can be controlled to turn to the right, while the player can also control the head of the game character 502 to turn to the right (i.e., simulate the action of the game character 502 turning his head to look to the right) without turning the body of the game character 502, so as to observe the situation to the right of the game character 502. That is, the player can control the virtual camera bound to the game character to turn by pressing and dragging the mouse middle button, so as to observe the situation around without making a sound to expose himself, thereby improving the game experience of the player.
[0175] In some other embodiments, the game developer (or game planner) can configure the observation angle of the game character, for example, the observation angle of the game character can be determined based on the turning angle of the virtual camera, for example, the maximum observation angle of the game character in the vertical upward direction can be 60 degrees, the maximum observation angle of the game character in the vertical downward direction can be 35 degrees, and the maximum observation angle of the game character in the horizontal direction (including horizontal left and horizontal right) can be ±35 degrees.
[0176] It should be noted that the observation angle of the game character will not exceed the maximum turning angle of the virtual camera, for example, when the maximum turning angle of the virtual camera bound to the game character upwards is 90 degrees, i.e., the game character has lifted his body and looks upwards with the muzzle pointing to the sky, the player presses and drags the mouse middle button to observe further upwards, and the observation angle after superimposing the mouse middle button will still not exceed 90 degrees.
[0177] In some embodiments, the player can also adjust the rotation speed of the virtual camera bound to the game character when the mouse middle key is pressed and dragged in the setting interface, and this value can be applied to the rotation in the horizontal direction and the vertical direction at the same time. Of course, the player can also set the rotation speed of the virtual camera in the horizontal direction and the vertical direction respectively in the setting interface, for example, there can be two different setting controls in the setting interface for setting the rotation speed of the virtual camera in the horizontal direction and the vertical direction respectively, and the embodiments of the present application do not make specific limitations thereto.
[0178] For example, referring to FIG. 6, FIG. 6 is a second application scenario diagram of the interactive processing method of the virtual scene provided by the embodiments of the present application, as shown in FIG. 6, the free perspective sensitivity ratio setting control 601 can be displayed in the setting interface, and the player can set the rotation speed of the virtual camera through the free perspective sensitivity ratio setting control 601, for example, assuming that the player sets the ratio to 1 times through the free perspective sensitivity ratio setting control 601, and assuming that the player sets the rotation speed of the virtual camera to 2.5 degrees per second, then the player can control the virtual camera bound to the game character to rotate at a rotation speed of 2.5 degrees per second when the mouse middle key is pressed and dragged subsequently, in this way, the personalized needs of different players can be met, and the game experience of the player is further improved.
[0179] In other embodiments, taking a realistic first-person shooter game as an example, every move of the game character controlled by the player in the game scene will expose sound information, therefore, the player needs to control the sound volume of his own game character, and at the same time can understand the information (such as the position) of the enemy (i.e. the game character controlled by other players) through listening. When the player wants to obtain more visual information without exposing himself, the technical solution provided by the embodiments of the present application can be adopted, that is, only the head of the game character is controlled to rotate (i.e. turning the head to observe) to obtain limited visual information.
[0180] It should be noted that the similar observation behavior also includes that the player controls the game character to directly rotate the game character and the muzzle of the virtual gun held by the game character to observe (i.e., turn around to observe), which has a larger observation angle and the muzzle of the virtual gun held by the game character changes, and is convenient for the player to control the game character to attack in time, but the game character makes a sound when turning around to expose the position of the game character. That is, the turn around to observe makes the game character turn around, make a sound, and expose the position of the game character, and the turn head to observe does not make a sound and expose the position of the game character. In this way, the player can freely select different observation manners according to actual conditions, for example, when the player does not want to make a sound and expose the position of the game character, the player can use the manner of only rotating the head of the game character (for example, the turn head to observe shown in FIG. 7A, at this time, the body of the game character and the muzzle of the virtual gun held by the game character do not rotate) to obtain limited visual field information; when the player wants to obtain more visual field information, the player can use the manner of controlling the game character to directly rotate the game character (for example, the turn around to observe shown in FIG. 7B, at this time, the body of the game character and the muzzle of the virtual gun held by the game character rotate), which enriches the game play and improves the game experience of the player.
[0181] The difference between the turn around to observe and the turn head to observe is further described below from the perspective of other players.
[0182] For example, referring to FIG. 8A, FIG. 8A is a fifth application scene schematic diagram of the interaction processing method of the virtual scene provided by the embodiment of the present application, as shown in FIG. 8A, the turn around to observe makes the whole body of the game character 801 rotate, because the body of the game character 801 rotates, the muzzle of the virtual gun 802 held by the game character 801 also rotates (i.e., other players can see that the body of the game character controlled by the current player and the muzzle of the virtual gun held by the game character turn to the other players), however, because the action amplitude of the turn around to observe is large, the game character 801 makes a sound when turning around to expose the position of the game character 801.
[0183] For example, referring to FIG. 8B, FIG. 8B is a sixth application scene schematic diagram of the interaction processing method of the virtual scene provided by the embodiment of the present application, as shown in FIG. 8B, the turn head to observe only makes the head of the game character 803 rotate, because the body of the game character 803 does not rotate, the muzzle of the virtual gun 804 held by the game character 803 also does not change (i.e., other players can see that only the head of the game character controlled by the current player turns to the other players, but the muzzle of the virtual gun held by the game character does not turn to the other players), because the action amplitude of the turn head to observe is small, the game character 803 does not make a sound when turning the head to expose the position of the game character 803.
[0184] In some embodiments, when a player controls a game character to move, the player has the appeal of not changing the moving direction of the game character and observing the surroundings, for example, when the player controls the game character to sprint towards a destination, the player can quickly check the surrounding situation by using the head turning and observing manner provided in the embodiments of the present application. Or in an indoor environment, when the player wants to control the game character to quickly rush through a door and observe whether there is someone (i.e., a game character controlled by another player) in the door, and at the same time, the player does not want to be hit by the game character controlled by another player because of staying to observe, the player can quickly check by using the head turning and observing manner provided in the embodiments of the present application, thereby increasing the depth of the body skill on the operation level.
[0185] For example, referring to FIG. 9, FIG. 9 is a comparison diagram between the turning around and observing and the head turning and observing provided in the embodiments of the present application, as shown in FIG. 9, in the process of the player controlling the game character to move, the turning around and observing needs the game character to change the whole direction to see the side information; and the head turning and observing does not need to change the moving direction of the game character to see the side information.
[0186] In some embodiments, for the game character displayed in the first person view (i.e., 1P view), the player can control the virtual camera (for example, the virtual camera located near the head of the game character) bound to the game character to turn by pressing and dragging the middle mouse button, to observe the surroundings. Since the whole body model of the game character is displayed in the game scene, in the process of controlling the virtual camera to turn, the shoulder of the game character will be inserted between the virtual camera, in order to prevent the 1P lens from being inserted, the shoulder of the game character can be controlled to retreat correspondingly while the virtual camera is controlled to turn.
[0187] In other embodiments, while the virtual camera bound to the first person view of the game character is controlled to turn, the corresponding third person view (i.e., 3P) game character can be controlled to perform a corresponding head turning action.
[0188] For example, referring to FIG. 10, FIG. 10 is a seventh application scenario diagram of the interaction processing method of the virtual scene provided in the embodiments of the present application, as shown in FIG. 10, when it is detected that the player presses and drags the middle mouse button to the right, the head of the game character in the 3P view can be controlled to turn to the right (i.e., other players can see that the game character controlled by the current player is looking to the right) while the virtual camera bound to the game character in the 1P view is controlled to turn to the right; when it is detected that the player presses and drags the middle mouse button to the left, the head of the game character in the 3P view can be controlled to turn to the left (i.e., other players can see that the game character controlled by the current player is looking to the left) while the virtual camera bound to the game character in the 1P view is controlled to turn to the left.
[0189] It should be noted that the turning head observation does not change the orientation of the body of the game character and the muzzle of the virtual gun held, that is, other players can only see that the head of the game character controlled by the current player is turned, but the orientation of the body of the game character and the muzzle of the virtual gun held does not change.
[0190] The method for processing interaction of a virtual scene provided by the embodiment of the application will be described below in combination with FIG. 11.
[0191] For example, referring to FIG. 11, which is a third flowchart of the method for processing interaction of a virtual scene provided by the embodiment of the application, the steps shown in FIG. 11 will be described.
[0192] In step 201, when it is detected that the player presses and drags the middle key of the mouse, the virtual camera bound to the game character is controlled to rotate.
[0193] In some embodiments, when it is detected that the player presses and drags the middle key of the mouse, the virtual camera (i.e., 1P lens) bound to the game character in the first-person perspective can be controlled to turn, for example, when it is detected that the player presses and drags the middle key of the mouse to the left, the virtual camera can be controlled to turn to the left, so that the player can observe the left side without making a sound; when it is detected that the player presses and drags the middle key of the mouse to the right, the virtual camera can be controlled to turn to the right, so that the player can observe the right side without making a sound.
[0194] It should be noted that the rotation speed of the virtual camera during the turning process can be affected by the sensitivity in the setting, that is, the player can adjust the sensitivity ratio in the setting interface to determine the final rotation speed of the virtual camera.
[0195] For example, referring to FIG. 12, which is a first schematic diagram of a setting interface provided by an embodiment of the present application, as shown in FIG. 12, when receiving a click operation of a player on a setting entry displayed in a game scene, a setting interface 1201 can be displayed in the game scene, wherein "Look Around X Sensitivity" represents the rotation sensitivity of a virtual camera bound to a game character in a horizontal direction, "Look Around Y Sensitivity" represents the rotation sensitivity of the virtual camera bound to the game character in a vertical direction, and the player can also adjust the free perspective sensitivity multiple in the setting interface. Then the final rotation sensitivity of the virtual camera in the horizontal direction = "Look Around X Sensitivity" multiplied by the set free perspective sensitivity multiple. For example, assuming that the "Look Around X Sensitivity" set by the player is 2.5 degrees per centimeter, and the sensitivity multiple set is 2 times, then the final rotation sensitivity of the virtual camera in the horizontal direction is 5 degrees per centimeter, that is, the virtual camera rotates 5 degrees every time the player moves the mouse by 1 centimeter. Similarly, the final rotation sensitivity of the virtual camera in the vertical direction = "Look Around Y Sensitivity" multiplied by the set free perspective sensitivity multiple.
[0196] In addition, the rotation angle of the virtual camera is also affected by the maximum rotatable angle and the angle of the virtual camera itself. For example, continuing to refer to FIG. 12, "Max Look Around Yaw" displayed in the setting interface 1201 represents the maximum rotatable angle of the virtual camera in the horizontal left direction; "Min Look Around Yaw" represents the maximum rotatable angle of the virtual camera in the horizontal right direction; "Max Look Around Pitch" represents the maximum rotatable angle of the virtual camera in the vertical upward direction; and "Min Look Around Pitch" represents the maximum rotatable angle of the virtual camera in the vertical downward direction.
[0197] For example, referring to FIG. 13, which is a schematic diagram of an angle restriction interface according to an embodiment of the present application, as shown in FIG. 13, the virtual camera bound to the game character also has angle restrictions, for example, "Max Yaw" shown in the angle restriction interface 1301 represents the maximum rotatable angle of the virtual camera in the horizontal left direction; "Min Yaw" represents the maximum rotatable angle of the virtual camera in the horizontal right direction; "Max Pitch" represents the maximum rotatable angle of the virtual camera in the vertical upward direction; and "Min Pitch" represents the maximum rotatable angle of the virtual camera in the vertical downward direction. That is, when the player holds the middle mouse button to manipulate the virtual camera bound to the game character to rotate, the angle of rotation will not exceed the angle values of Yaw and Pitch shown in FIG. 13, that is, the maximum angle in the horizontal direction is ±180 degrees, the maximum angle in the vertical upward direction is 75 degrees, and the maximum angle in the vertical downward direction is -85 degrees.
[0198] In step 202, the head of the game character is also controlled to rotate.
[0199] In some embodiments, referring to FIG. 14, which is a second schematic diagram of a setting interface according to an embodiment of the present application, as shown in FIG. 14, in a mixed space, there are nine animations, which respectively represent the head deflection actions of the center, horizontal ±45 degrees, and vertical ±90 degrees, for example, for the point 1401 in the upper left corner, which represents the action of the head of the game character looking upward by 90 degrees and looking left by 45 degrees. When the 1P camera is rotated to the corresponding angle, the head of the 3P character (that is, the game character in the third person perspective) will be superimposed with the animation of the rotation, so that the performance of the game character is more realistic. That is, when the virtual camera corresponding to the 1P perspective is controlled to rotate, the other players can see that the head of the game character will also rotate correspondingly, for example, when the virtual camera is controlled to rotate left, the other players can see that the head of the game character will also rotate left.
[0200] In step 203, when it is detected that the player releases the middle mouse button, the virtual camera bound to the game character is controlled to return to the normal position.
[0201] In some embodiments, before step 203 is performed, the player can also set the return speed (Interp Speed) of the virtual camera in the setting interface, for example, continuing to refer to FIG. 12, "Pitch Offset Interp Speed" shown in the setting interface 1201 represents the return speed of the virtual camera in the vertical direction when returning to the normal position, and "Yaw Offset Interp Speed" represents the return speed of the virtual camera in the horizontal direction when returning to the normal position. Subsequently, when it is detected that the player releases the middle mouse button, the virtual camera can be controlled to return to the normal position according to the return speed set by the player in the setting interface.
[0202] It should be noted that, while controlling the virtual camera bound to the game character to return to normal, the head of the game character can also be controlled to return to normal. For example, the player can also set the return speed of the head of the game character in the setting interface, for example, including the return speed of the head of the game character in the horizontal direction, and the return speed of the head of the game character in the vertical direction, and then when it is detected that the player releases the middle mouse button, the head of the game character can be controlled to return to normal according to the return speed of the head of the game character set by the player in the setting interface.
[0203] In summary, the virtual scene interaction processing method provided by the embodiments of the present application has the following beneficial effects:
[0204] 1. The player can observe the in-game environment without exposing the sound, increasing the choice of observation method and enriching the strategy depth of the game.
[0205] 2. The player can observe the environment around without changing the moving direction of the game character, which has application scenarios in outdoor observation and indoor combat, enriches the operation skills of the game, and improves the game experience of the player.
[0206] The following continues to illustrate an exemplary structure of the implementation of the virtual scene interaction processing apparatus 555 provided by the embodiments of the present application as a software module. In some embodiments, as shown in FIG. 2, the software module stored in the virtual scene interaction processing apparatus 555 in the memory 550 can include a display module 5551 and a control module 5552.
[0207] The display module 5551 is configured to display a first virtual scene picture, wherein the first virtual scene picture is obtained by a virtual object observing a virtual scene at a first view angle; the control module 5552 is configured to, in response to a view angle turning operation, keep the body of the virtual object from turning, and control the head of the virtual object to turn by a corresponding angle in a direction indicated by the view angle turning operation; and the display module 5551 is further configured to switch to display a second virtual scene picture, wherein the second virtual scene picture is obtained by the virtual object observing the virtual scene at a second view angle, and the second view angle is a view angle corresponding to the head of the virtual object after turning.
[0208] In some embodiments, the view angle rotation operation includes a movement operation, where the movement operation includes a sliding operation and a dragging operation; the interaction processing apparatus 555 of the virtual scene further includes an obtaining module 5553 and a determining module 5554, where the obtaining module 5553 is configured to obtain a movement distance of the movement operation; the determining module 5554 is configured to determine an angle at which the head of the virtual object is to be rotated based on the movement distance, where the angle is positively correlated with the movement distance; and the control module 5552 is configured to control the head of the virtual object to rotate the angle in a movement direction of the movement operation.
[0209] In some embodiments, the determining module 5554 is further configured to, when the movement distance is less than a distance threshold, query a mapping table based on the movement distance to obtain the angle at which the head of the virtual object is to be rotated, where the mapping table includes a mapping relationship between different movement distances and different angles; and when the movement distance is greater than the distance threshold, use a pre-set maximum rotatable angle as the angle at which the head of the virtual object is to be rotated.
[0210] In some embodiments, the virtual scene includes at least one direction control, and the view angle rotation operation includes a pressing operation on any direction control; the obtaining module 5553 is further configured to obtain a pressing parameter of the pressing operation; the determining module 5554 is further configured to determine the angle at which the head of the virtual object is to be rotated based on the pressing parameter; and the control module 5552 is further configured to control the head of the virtual object to rotate the angle in a direction indicated by the pressed direction control.
[0211] In some embodiments, the pressing parameter includes a pressing duration and a pressing force; the determining module 5554 is further configured to, when the pressing duration is greater than a duration threshold, determine a pressure interval in which the pressing force is located; and use an angle corresponding to the pressure interval as the angle at which the head of the virtual object is to be rotated, where different pressure intervals correspond to different angles.
[0212] In some embodiments, the determining module 5554 is further configured to, when the pressing force exceeds a pre-set maximum pressure interval, use an angle corresponding to the maximum pressure interval as the angle at which the head of the virtual object is to be rotated.
[0213] In some embodiments, the interaction processing apparatus 555 of the virtual scene further includes a prediction module 5555 configured to invoke a machine learning model to perform prediction processing based on feature data of the virtual scene and feature data of the virtual object to obtain the angle at which the head of the virtual object is to be rotated; and the control module 5552 is further configured to control the head of the virtual object to rotate the view angle in a direction indicated by the view angle rotation operation.
[0214] In some embodiments, the interaction processing apparatus 555 of the virtual scene further includes a training module 5556 configured to obtain feature data of a sample virtual scene and feature data of a sample virtual object; based on the feature data of the sample virtual scene and the feature data of the sample virtual object, call the initialized machine learning model for prediction processing to obtain an angle at which the head of the sample virtual object is to be rotated; determine a difference between the angle at which the head of the sample virtual object is to be rotated and a pre-labeled rotation angle; perform back propagation based on the difference, and update parameters of the machine learning model layer by layer in the process of back propagation.
[0215] In some embodiments, the virtual scene includes a rotation speed setting control; the obtaining module 5553 is further configured to, in response to a setting operation on the rotation speed setting control, obtain a set rotation speed; and the control module 5552 is further configured to control the head of the virtual object to rotate by a corresponding angle in a direction indicated by the view rotation operation at the set rotation speed.
[0216] In some embodiments, the virtual scene includes a virtual camera corresponding to the virtual object, the first virtual scene picture is obtained by the virtual camera shooting the virtual scene at a first view angle; and the control module 5552 is further configured to, when controlling the head of the virtual object to rotate by a corresponding angle in a direction indicated by the view rotation operation, control the virtual camera to rotate by the angle in the direction indicated by the view rotation operation, wherein the second virtual scene picture is obtained by the virtual camera shooting the virtual scene at a second view angle.
[0217] In some embodiments, the control module 5552 is further configured to, when controlling the virtual camera to rotate by the angle in the direction indicated by the view rotation operation, control the shoulder of the virtual object to retreat by a corresponding distance synchronously, wherein the distance is positively correlated with the angle.
[0218] In some embodiments, the control module 5552 is further configured to, in response to the view rotation operation being released, control the head of the virtual object to rotate by an angle in a direction opposite to the direction indicated by the view rotation operation, and switch back from the second virtual scene picture to the first virtual scene picture.
[0219] In some embodiments, the virtual scene includes a virtual camera corresponding to the virtual object; and the control module 5552 is further configured to, when controlling the head of the virtual object to rotate by the angle in the direction opposite to the direction indicated by the view rotation operation, control the virtual camera to rotate by the angle in the direction opposite to the direction indicated by the view rotation operation.
[0220] In some embodiments, the virtual scene further comprises a camera rotation speed setting control; the obtaining module 5553 is further configured to, in response to a setting operation on the camera rotation speed setting control, obtain a rotation speed set for the virtual camera; and the control module 5552 is further configured to control the virtual camera to rotate, at the rotation speed, by an angle in a direction opposite to a direction indicated by the view angle rotation operation.
[0221] In some embodiments, the virtual scene comprises a setting entry; the display module 5551 is further configured to, in response to a triggering operation on the setting entry, display a setting interface, where the setting interface is used to set a maximum rotatable angle of the head of the virtual object in different directions respectively, and a rotation speed of the head of the virtual object; and the control module 5552 is further configured to control the head of the virtual object to rotate, at the rotation speed, by a corresponding angle in a direction indicated by the view angle rotation operation, where the angle is less than or equal to the maximum rotatable angle corresponding to the direction.
[0222] In some embodiments, the virtual object holds a virtual shooting prop; and the control module 5552 is further configured to, in response to the view angle rotation operation, keep the body of the virtual object from rotating and the shooting direction of the virtual shooting prop from changing, and control the head of the virtual object to rotate by a corresponding angle in a direction indicated by the view angle rotation operation.
[0223] In some embodiments, an orientation of the body of the virtual object is used to determine a moving direction of the virtual object; and the control module 5552 is further configured to, in response to receiving the view angle rotation operation during control of the movement of the virtual object, keep the moving direction of the virtual object unchanged, and control the head of the virtual object to rotate by a corresponding angle in a direction indicated by the view angle rotation operation.
[0224] It should be noted that the description of the device embodiments of the present application is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments, and thus is not described herein. For technical details not described in the virtual scene interaction processing device provided by the embodiments of the present application, the description of any one of FIG. 3 or FIG. 4 can be referred to.
[0225] The embodiments of the present application provide a computer program product, which comprises a computer program or computer executable instructions stored in a computer readable storage medium. The processor of the computer device reads the computer executable instructions from the computer readable storage medium, and the processor executes the computer executable instructions, so that the computer device executes the virtual scene interaction processing method provided by the embodiments of the present application.
[0226] The embodiment of the present application provides a computer readable storage medium storing computer executable instructions, wherein the computer executable instructions are stored, and when the computer executable instructions are executed by a processor, the processor executes the interaction processing method of the virtual scene provided by the embodiment of the present application, for example, the interaction processing method of the virtual scene shown in FIG. 3 or FIG. 4.
[0227] In some embodiments, the computer readable storage medium can be FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disc, or CD-ROM memory, and the like; and can also be various devices including one or any combination of the above storage.
[0228] In some embodiments, the executable instructions can be in the form of programs, software, software modules, scripts or codes, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and can be deployed in any form, including being deployed as independent programs or being deployed as modules, components, subroutines or other units suitable for use in a computing environment.
[0229] As an example, the executable instructions can be deployed to execute on one electronic device, or on multiple electronic devices located at one place, or on multiple electronic devices distributed at multiple places and interconnected through a communication network.
[0230] The above is only an embodiment of the present application, and is not used to limit the protection scope of the present application. Any modification, equivalent replacement and improvement made within the spirit and scope of the present application shall be included in the protection scope of the present application.
Claims
1. A method for processing interaction of a virtual scene, applied to an electronic device, the method comprising: displaying a first virtual scene picture, wherein the first virtual scene picture is obtained by a virtual object observing the virtual scene with a first view angle; in response to a view angle turning operation, keeping a body of the virtual object from turning, and controlling a head of the virtual object to turn by a corresponding angle in a direction indicated by the view angle turning operation, and switching to display a second virtual scene picture, wherein the second virtual scene picture is obtained by the virtual object observing the virtual scene with a second view angle, and the second view angle corresponds to the view angle of the head of the virtual object after turning.
2. The method of claim 1, wherein the view angle turning operation comprises a movement operation, and the movement operation comprises a sliding operation and a dragging operation; the controlling the head of the virtual object to turn by the corresponding angle in the direction indicated by the view angle turning operation comprises: obtaining a movement distance of the movement operation; determining the angle to be turned by the head of the virtual object based on the movement distance, wherein the angle is positively correlated with the movement distance; and controlling the head of the virtual object to turn by the angle in the movement direction of the movement operation. The determining the angle to be turned by the head of the virtual object based on the movement distance comprises: when the movement distance is less than a distance threshold, querying a mapping table based on the movement distance to obtain the angle to be turned by the head of the virtual object, wherein the mapping table comprises a mapping relationship between different movement distances and different angles; and when the movement distance is greater than the distance threshold, taking a pre-set maximum turnable angle as the angle to be turned by the head of the virtual object.
4. The method of any one of claims 1 to 3, wherein the virtual scene comprises at least one direction control, and the view angle turning operation comprises a pressing operation on any one of the direction controls; the controlling the head of the virtual object to turn by the corresponding angle in the direction indicated by the view angle turning operation comprises: obtaining a pressing parameter of the pressing operation; determining the angle to be turned by the head of the virtual object based on the pressing parameter; and controlling the head of the virtual object to turn by the angle in the direction indicated by the pressed direction control.
5. The method of claim 4, wherein the pressing parameter comprises a pressing duration and a pressing force; the determining the angle to be turned by the head of the virtual object based on the pressing parameter comprises: when the pressing duration is greater than a duration threshold, determining a pressure interval in which the pressing force is located; and taking an angle corresponding to the pressure interval as the angle to be turned by the head of the virtual object, wherein different pressure intervals correspond to different angles. The method further comprises: when the pressing force exceeds a pre-set maximum pressure interval, taking an angle corresponding to the maximum pressure interval as the angle to be turned by the head of the virtual object.
7. The method of any one of claims 4 to 6, wherein the pressing parameter comprises a pressing duration. 3. The method of claim 2, wherein, 6. The method of claim 5, wherein, The determining the angle at which the head of the virtual object is to be rotated based on the pressing parameter comprises: querying a preset mapping table based on the pressing duration to obtain the angle at which the head of the virtual object is to be rotated, wherein the mapping table comprises a mapping relationship between different pressing durations and different angles, and the angle is positively correlated with the pressing duration.
8. The method of claim 7, wherein, The method further comprises: when the pressing duration is greater than a preset duration threshold, taking the angle corresponding to the duration threshold as the angle at which the head of the virtual object is to be rotated.
9. The method according to any one of claims 1 to 8, wherein, The controlling the head of the virtual object to rotate by the corresponding angle in the direction indicated by the view angle rotation operation comprises: based on the feature data of the virtual scene and the feature data of the virtual object, invoking a machine learning model for prediction processing to obtain the angle at which the head of the virtual object is to be rotated; controlling the head of the virtual object to rotate by the angle in the direction indicated by the view angle rotation operation.
10. The method of claim 9, wherein, Before the invoking the machine learning model for prediction processing, the method further comprises: obtaining feature data of a sample virtual scene and feature data of a sample virtual object; based on the feature data of the sample virtual scene and the feature data of the sample virtual object, invoking the initialized machine learning model for prediction processing to obtain the angle at which the head of the sample virtual object is to be rotated; determining a difference between the angle at which the head of the sample virtual object is to be rotated and a pre-labeled rotation angle; based on the difference, performing back propagation and updating parameters of the machine learning model layer by layer in the process of back propagation.
11. The method of any one of claims 1-10, wherein the virtual scene comprises a rotation speed setting control; before the controlling the head of the virtual object to rotate by the corresponding angle in the direction indicated by the view angle rotation operation, the method further comprises: in response to a setting operation on the rotation speed setting control, obtaining a set rotation speed; the controlling the head of the virtual object to rotate by the corresponding angle in the direction indicated by the view angle rotation operation comprises: controlling the head of the virtual object to rotate by the corresponding angle in the direction indicated by the view angle rotation operation at the set rotation speed.
12. The method of any one of claims 1-11, wherein the virtual scene comprises a virtual camera corresponding to the virtual object, and the first virtual scene picture is obtained by the virtual camera shooting the virtual scene at the first view angle; when the controlling the head of the virtual object to rotate by the corresponding angle in the direction indicated by the view angle rotation operation, the method further comprises: controlling the virtual camera to rotate by the angle in the direction indicated by the view angle rotation operation, wherein the second virtual scene picture is obtained by the virtual camera shooting the virtual scene at the second view angle.
13. The method of claim 12, wherein, when the controlling the virtual camera to rotate by the angle in the direction indicated by the view angle rotation operation, the method further comprises: controlling the shoulders of the virtual object to retreat by a corresponding distance, wherein the distance is positively correlated with the angle.
14. The method of any one of claims 1 to 13, wherein, After switching display of the second virtual scene picture, the method further includes: in response to the view angle turning operation being released, controlling the head of the virtual object to turn in the opposite direction of the direction indicated by the view angle turning operation by the angle, and switching back from the second virtual scene picture to the first virtual scene picture.
15. The method of claim 14, wherein, the virtual scene includes a virtual camera corresponding to the virtual object; when controlling the head of the virtual object to turn in the opposite direction of the direction indicated by the view angle turning operation by the angle, the method further includes: controlling the virtual camera to turn in the opposite direction of the direction indicated by the view angle turning operation by the angle.
16. The method of claim 15, wherein, the virtual scene further includes a camera turning speed setting control; before controlling the virtual camera to turn in the opposite direction of the direction indicated by the view angle turning operation by the angle, the method further includes: in response to a setting operation for the camera turning speed setting control, obtaining a turning speed set for the virtual camera; the controlling the virtual camera to turn in the opposite direction of the direction indicated by the view angle turning operation by the angle includes: controlling the virtual camera to turn in the opposite direction of the direction indicated by the view angle turning operation by the angle at the turning speed.
17. The method of any one of claims 1 to 16, wherein, the virtual scene includes a setting entry; before controlling the head of the virtual object to turn in the direction indicated by the view angle turning operation by the corresponding angle, the method further includes: in response to a triggering operation for the setting entry, displaying a setting interface, wherein the setting interface is used to set maximum turnable angles of the head of the virtual object in different directions respectively, and a turning speed of the head of the virtual object; the controlling the head of the virtual object to turn in the direction indicated by the view angle turning operation by the corresponding angle includes: controlling the head of the virtual object to turn in the direction indicated by the view angle turning operation by the corresponding angle at the turning speed, wherein the angle is less than or equal to the maximum turnable angle corresponding to the direction.
18. The method of any one of claims 1 to 17, wherein, the virtual object holds a virtual shooting prop, and an orientation of a body of the virtual object is used to determine a shooting direction of the virtual shooting prop; the in response to the view angle turning operation, keeping the body of the virtual object from turning, and controlling the head of the virtual object to turn in the direction indicated by the view angle turning operation by the corresponding angle includes: in response to the view angle turning operation, keeping the shooting direction of the virtual shooting prop unchanged, and controlling the head of the virtual object to turn in the direction indicated by the view angle turning operation by the corresponding angle.
19. The method of claim 18, wherein, the in response to the view angle turning operation, keeping the shooting direction of the virtual shooting prop unchanged, and controlling the head of the virtual object to turn in the direction indicated by the view angle turning operation by the corresponding angle includes: In response to the view angle turning operation and the shooting operation, while controlling the head of the virtual object to turn in a direction indicated by the view angle turning operation by a corresponding angle, the shooting direction of the virtual shooting prop is kept unchanged, and the virtual shooting prop is controlled to shoot in the shooting direction.
20. The method of any one of claims 1 to 17, wherein, the orientation of the body of the virtual object is used to determine a moving direction of the virtual object; the response to the view angle turning operation includes keeping the body of the virtual object from turning and controlling the head of the virtual object to turn in a direction indicated by the view angle turning operation by a corresponding angle. the response to the view angle turning operation includes keeping the moving direction of the virtual object unchanged and controlling the head of the virtual object to turn in a direction indicated by the view angle turning operation by a corresponding angle.
21. The method of claim 20, wherein, the response to the view angle turning operation includes keeping the moving direction of the virtual object unchanged and controlling the head of the virtual object to turn in a direction indicated by the view angle turning operation by a corresponding angle. the response to the view angle turning operation includes keeping the moving direction of the virtual object unchanged and controlling the head of the virtual object to turn in a direction indicated by the view angle turning operation by a corresponding angle.
22. An apparatus for processing interaction of a virtual scene, comprising: a display module configured to display a first virtual scene picture, wherein the first virtual scene picture is obtained by a virtual object observing the virtual scene in a first view angle; a control module configured to, in response to a view angle turning operation, keep the body of the virtual object from turning and control the head of the virtual object to turn in a direction indicated by the view angle turning operation by a corresponding angle; the display module is further configured to switch to display a second virtual scene picture, wherein the second virtual scene picture is obtained by the virtual object observing the virtual scene in a second view angle, and the second view angle is a view angle corresponding to the head of the virtual object after turning.
23. An electronic device, comprising: a memory configured to store executable instructions; a processor configured to execute the executable instructions stored in the memory to implement the method for processing interaction of a virtual scene according to any one of claims 1 to 21.
24. A computer readable storage medium storing computer executable instructions, which, when executed by a processor, implement the method for processing interaction of a virtual scene according to any one of claims 1 to 21.
25. A computer program product comprising a computer program or computer executable instructions, which, when executed by a processor, implement the method for processing interaction of a virtual scene according to any one of claims 1 to 21.
Citation Information
Patent Citations
Virtual environment visual angle switching method, equipment and storage medium
CN108717733A
Method and device for controlling virtual reality scene to rotate, storage medium and electric device
CN108905202A
Shooting game control method and device, electronic equipment and storage medium
CN115300913A
Game control method and device, storage medium and equipment
CN115869620A
Virtual scene interaction processing method and device, electronic equipment, computer readable storage medium and computer program product
CN119056052A