A method, apparatus, electronic device, and storage medium for controlling a virtual camera.

By acquiring and controlling the motion trajectory, speed, vertical movement, and rotation parameters of the virtual camera, the problem of poor camera movement in turn-based games was solved, enabling rich camera movement methods and high-quality game visuals.

CN115193037BActive Publication Date: 2025-10-28NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210775580.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-01
Publication Date
2025-10-28
Estimated Expiration
2042-07-01

AI Technical Summary

Technical Problem

The camera movement of virtual cameras in existing turn-based games is poor, resulting in monotonous game visuals, lack of aesthetic appeal, and unreasonable composition, which affects the overall game presentation.

Method used

By acquiring the motion trajectory and motion rate parameters of the virtual camera, and combining them with vertical movement and rotation parameters, the camera movement of the virtual camera in the game can be controlled to achieve automatic switching of multiple perspective shots and a variety of camera movement methods.

Benefits of technology

It enhances the dynamism and aesthetics of the game's visuals, enables smooth transitions between multiple camera angles, and improves the overall artistic quality of the combat experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115193037B_ABST
    Figure CN115193037B_ABST
Patent Text Reader

Abstract

This application provides a method, device, electronic device, and storage medium for controlling a virtual camera. The method first acquires the motion trajectory parameters and motion rate parameters of the virtual camera. The motion trajectory parameters determine the virtual camera's motion trajectory in the game, and the motion rate parameters determine the virtual camera's motion rate in the game. Then, based on the motion trajectory and motion rate, the horizontal movement parameters of the virtual camera in the game are obtained, along with the vertical movement and rotation parameters of the virtual camera within the motion trajectory. Based on these parameters, the camera movement parameters of the virtual camera in the game are obtained. Finally, the camera movement of the virtual camera in the game is controlled based on these camera movement parameters. This application can control the virtual camera to move along a designed motion trajectory in the game at a certain speed and rhythm, and can adjust the screen size and shooting angle, achieving a relatively rich range of camera movement methods, thus resulting in better camera movement effects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, electronic device and storage medium for controlling a virtual camera. Background Art

[0002] In turn-based games, camera movement during combat has a crucial impact on the overall combat experience. Currently, the camera movement of virtual cameras in turn-based games is automatically generated by the program, and the camera is fixed during combat. This results in a monotonous and aesthetically unappealing combat flow, leading to unreasonable composition of the game screen and poor overall visual presentation.

[0003] Therefore, existing turn-based games suffer from poor virtual camera movement effects, which need to be improved. Summary of the Invention

[0004] This application provides a virtual camera control method, device, electronic device, and storage medium to alleviate the technical problem of poor camera movement effects in existing turn-based games.

[0005] To address the aforementioned technical problems, this application provides the following technical solutions:

[0006] This application provides a method for controlling a virtual camera, including:

[0007] Obtain the motion trajectory parameters and motion rate parameters of the virtual camera, wherein the motion trajectory parameters are used to determine the motion trajectory of the virtual camera in the game, and the motion rate parameters are used to determine the motion rate of the virtual camera in the game;

[0008] Based on the motion trajectory and the motion rate, the horizontal movement parameters of the virtual camera in the game are obtained;

[0009] The vertical movement parameters and rotation parameters of the virtual camera in the motion trajectory are obtained, and the camera movement parameters of the virtual camera in the game are obtained based on the horizontal movement parameters, the vertical movement parameters and the rotation parameters.

[0010] The camera movement of the virtual camera in the game is controlled based on the camera movement parameters.

[0011] Meanwhile, this application also provides a control device for a virtual camera, including:

[0012] The acquisition module is used to acquire the motion trajectory parameters and motion rate parameters of the virtual camera, wherein the motion trajectory parameters are used to determine the motion trajectory of the virtual camera in the game, and the motion rate parameters are used to determine the motion rate of the virtual camera in the game;

[0013] The first obtaining module is used to obtain the horizontal movement parameters of the virtual camera in the game based on the motion trajectory and the motion rate;

[0014] The second obtaining module is used to obtain the vertical movement parameters and rotation parameters of the virtual camera in the motion trajectory, and to obtain the camera movement parameters of the virtual camera in the game based on the horizontal movement parameters, the vertical movement parameters and the rotation parameters;

[0015] The control module is used to control the camera movement of the virtual camera in the game based on the camera movement parameters.

[0016] This application also provides an electronic device, including a memory and a processor; the memory stores an application program, and the processor is used to run the application program in the memory to perform the steps in the virtual camera control method described in any of the preceding claims.

[0017] This application provides a computer-readable storage medium storing multiple instructions adapted for loading by a processor to execute the steps in the virtual camera control method described above.

[0018] This application provides a method, device, electronic device, and storage medium for controlling a virtual camera. The method first obtains the motion trajectory parameters and motion rate parameters of the virtual camera. The motion trajectory parameters are used to determine the motion trajectory of the virtual camera in the game, and the motion rate parameters are used to determine the motion rate of the virtual camera in the game. Then, based on the motion trajectory and motion rate, the horizontal movement parameters of the virtual camera in the game are obtained, and the vertical movement parameters and rotation parameters of the virtual camera in the motion trajectory are obtained. Based on the horizontal movement parameters, vertical movement parameters, and rotation parameters, the camera movement parameters of the virtual camera in the game are obtained. Finally, the camera movement of the virtual camera in the game is controlled based on the camera movement parameters. This application determines the motion trajectory and speed of a virtual camera in a game by acquiring motion trajectory parameters and motion rate parameters. It can control the virtual camera's horizontal camera movement in the game, and by acquiring vertical movement parameters and rotation parameters, it can control the virtual camera's vertical camera movement and rotation during movement. Therefore, the virtual camera can move along the designed motion trajectory in the game at a certain speed and rhythm to obtain dynamic game scenes. It can also adjust the screen size by moving vertically and adjust the shooting angle by rotating, achieving a richer range of camera movement methods. As a result, the camera movement effect is better, and the presentation effect of the game screen is also better. Attached Figure Description

[0019] The technical solution and other beneficial effects of this application will become apparent from the following detailed description of specific embodiments in conjunction with the accompanying drawings.

[0020] Figure 1 This is a schematic diagram illustrating an application scenario of the virtual camera control method provided in the embodiments of this application.

[0021] Figure 2 This is a flowchart illustrating the virtual camera control method in an embodiment of this application.

[0022] Figure 3 This is a schematic diagram of the first interface in an embodiment of this application.

[0023] Figure 4 This is a schematic diagram of the second interface in an embodiment of this application.

[0024] Figure 5A This is a schematic diagram of the first position of the target point and the virtual camera in an embodiment of this application.

[0025] Figure 5B This is a schematic diagram illustrating the second position of the target point and the virtual camera in an embodiment of this application.

[0026] Figure 5C This is a schematic diagram of the third position of the target point and the virtual camera in the embodiments of this application.

[0027] Figure 6 This is a schematic diagram of the camera movement of the virtual camera after the target location trigger event occurs in an embodiment of this application.

[0028] Figure 7 This is a schematic diagram of the structure of the control device for the virtual camera provided in an embodiment of this application.

[0029] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0030] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0031] This application provides a method, apparatus, electronic device, and storage medium for controlling a virtual camera. The control apparatus for the virtual camera can be integrated into an electronic device, which can be a server or a terminal, etc.

[0032] Please see Figure 1 , Figure 1This is a schematic diagram of a scenario in which the virtual camera control method provided in this application embodiment is applied. The scenario may include a terminal and a server. Terminals, servers, and terminals and servers are connected and communicate through the Internet or other means composed of various gateways. The application scenario includes a server 11 and a user terminal 12. The server 11 includes a local server and / or a remote server, etc., and the user terminal 12 may be a device with game screen display function.

[0033] Server 11 and user terminal 12 are located in a wireless network or a wired network to enable data interaction between them, wherein:

[0034] Server 11 first acquires the motion trajectory parameters and motion rate parameters of the virtual camera. The motion trajectory parameters determine the virtual camera's motion trajectory in the game, and the motion rate parameters determine its motion rate. Based on the motion trajectory and motion rate, the horizontal movement parameters of the virtual camera in the game can be obtained. These parameters guide the virtual camera along which trajectories to translate and at what rate. Next, server 11 acquires the vertical movement parameters and rotation parameters of the virtual camera within its motion trajectory. The vertical movement parameters guide the virtual camera at which trajectory points to move vertically and the distance of that movement, while the rotation parameters guide the virtual camera at which trajectory points to rotate and the direction and angle of that rotation. Finally, server 11 obtains the camera movement parameters of the virtual camera in the game based on the horizontal, vertical, and rotation parameters. Based on these parameters, server 11 controls the virtual camera to perform forward / backward, up / down, and rotational camera movements in the game, and displays the game footage captured by the virtual camera throughout the entire camera movement process on user terminal 12.

[0035] It should be noted that, Figure 1 The system scenario diagram shown is merely an example. The servers and scenarios described in this application embodiment are for the purpose of more clearly illustrating the technical solutions of this application embodiment and do not constitute a limitation on the technical solutions provided by this application embodiment. As those skilled in the art will know, with the evolution of systems and the emergence of new business scenarios, the technical solutions provided by this application embodiment are also applicable to similar technical problems. Detailed descriptions are provided below. It should be noted that the order of description of the following embodiments is not intended to limit the preferred order of embodiments.

[0036] In the embodiments of this application, please refer to Figure 2 , Figure 2 This is a flowchart illustrating the virtual camera control method provided in this application embodiment, specifically including:

[0037] S201: Obtain the motion trajectory parameters and motion rate parameters of the virtual camera. The motion trajectory parameters are used to determine the motion trajectory of the virtual camera in the game, and the motion rate parameters are used to determine the motion rate of the virtual camera in the game.

[0038] The virtual camera control method of this application is mainly applied to turn-based games. Turn-based games refer to games where all characters take turns in battle, and only during their turn can they control and fight. In turn-based games, both the player's and the enemy's sides have multiple characters, positioned in two separate camps, with each character's position set in a preset fixed location. Of course, the virtual camera control method of this application can also be applied to other games that require pre-designing the movement trajectory of the virtual camera. The display of the game screen is achieved through the capture of images by the virtual camera. When the virtual camera is in different positions and facing different directions within the game screen, the captured images will differ, resulting in different game screens presented to the player. Currently, in turn-based games, the virtual camera is fixed in its shooting position, leading to a monotonous combat flow. To improve this, this application designs a scheme that allows the virtual camera to translate and rotate along multiple movement trajectories in the game.

[0039] First, obtain the motion trajectory parameters and motion rate parameters of the virtual camera. The motion trajectory parameters describe the motion trajectory, specifically including descriptions of the starting and ending points of the trajectory, and also descriptions of the positions of multiple intermediate points between the starting and ending points. These parameters determine the unique motion trajectory of the virtual camera in the game. The motion rate parameters describe the motion speed, specifically including descriptions of the rate at which the virtual camera translates along the trajectory to each trajectory point. These parameters determine the unique motion rate corresponding to each trajectory point.

[0040] The motion trajectory and motion rate parameters of the virtual camera are pre-set, and then the server retrieves these parameters. During retrieval, these parameters can be obtained directly from stored code or scripts (i.e., these parameters are pre-stored in the relevant code or scripts and can be directly called later); alternatively, designers can perform configuration operations on the relevant design interface, generating these parameters based on these operations, which are then retrieved by the server; or they can be stored on a remote server and retrieved by sending a retrieval command to the remote server when it is necessary to control the virtual camera's movement.

[0041] In one embodiment, before S201, the method further includes: acquiring multiple position trigger events of the virtual camera in the game, including first position trigger events between different shot sizes and second position trigger events within the same shot size; and determining preset trajectory points corresponding to each position trigger event based on the position trigger events. When the virtual camera moves from one position to another in the game, it is usually accompanied by position trigger events in the game. A position trigger event refers to a specific behavior that triggers the virtual camera to move. For example, if the virtual camera is currently filming a character's combat state at the first position, and when that character's combat state ends and it needs to switch to another character entering combat state, the virtual camera needs to move from the first position to the second position to film the other character's combat state. This character switching behavior can be considered a trigger event. Games typically include multiple position trigger events, each corresponding to a different behavior, and the position the virtual camera needs to move to after the event occurs is also different.

[0042] Taking turn-based games as an example, based on the game mechanics, the virtual camera's view of the game screen can be set to multiple shot sizes. Shot size refers to the difference in the size of the object appearing in the camera's view due to the different distances between the camera and the object being photographed, given a fixed camera focal length. In turn-based games, shot sizes can be divided into four types: close-up, medium shot, full shot, and extreme close-up. A close-up shows only one of our characters, a medium shot shows all our characters, a full shot shows the entire game, and an extreme close-up shows the individual animations of each character's ultimate skill. Players can freely switch between any two shot sizes. Because each shot size requires different content, the virtual camera's position also needs to be adjusted when switching between shot sizes.

[0043] Position-triggered events include first position-triggered events between different shot types and second position-triggered events within the same shot type. Specifically, a first position-triggered event refers to a specific action that triggers a virtual camera to shift its position, causing the captured image to belong to different shot types. For example, when the foreground shot is a long shot, if a player's buff skill triggers and requires showing the frontal view of all allied characters, it needs to switch to a medium shot. In this case, the action of triggering the player's buff skill can be considered the first position-triggered event for switching from a long shot to a medium shot. Conversely, when the foreground shot is a medium shot, if a panoramic overhead view is needed at the start of the enemy's turn, it needs to switch to a long shot. In this case, the action of starting the enemy's turn can be considered the first position-triggered event for switching from a medium shot to a long shot. Of course, the above description is only an example. When switching between two shot types, one or more first position-triggered events can correspond to each, and the specific content of each first position-triggered event can be preset.

[0044] A second position trigger event refers to a specific action that causes the virtual camera to shift its position, resulting in a shot within the same scene category. For example, if our side has four characters, and during our turn, the four characters enter their operational state sequentially, and only one character in the operational state is shot at a time, when character 1 exits the operational state and character 2 enters it, the virtual camera needs to switch from shooting character 1 to shooting character 2. Both shots are close-up shots, so the action of character 2 entering the operational state can be considered a second position trigger event within the close-up. Similarly, the above description is only an example; when switching within the same scene category, one or more second position trigger events can correspond to this, and the specific content of each second position trigger event can be preset.

[0045] Since location-triggered events correspond to changes in the virtual camera's shooting position, after a location-triggered event occurs in the game, the virtual camera needs to move from its current position to a new position. This new position is the optimal shooting location to display new content after the event. For example, when switching to a distant view, the new position could be the center of the game screen; when switching to a close-up view and needing to shoot character 1, the new position could be directly in front of character 1 at a distance of 's'. For each location-triggered event, an optimal shooting position is determined based on the game's shooting requirements. This optimal shooting position serves as a preset trajectory point for that location-triggered event. Therefore, after a location-triggered event occurs in the game, the virtual camera needs to move along the set trajectory towards the preset trajectory point. When another location-triggered event occurs, the virtual camera needs to move from the current preset trajectory point to another preset trajectory point.

[0046] In one embodiment, S201 specifically includes: in response to a trajectory configuration operation on a first interface, obtaining motion trajectory parameters and displaying a motion trajectory curve on the first interface; in response to a speed configuration operation on a second interface, obtaining motion speed parameters and displaying a motion speed curve on the second interface.

[0047] Specifically, the art designer performs a trajectory configuration operation on the first interface. The server responds to this operation, parsing the corresponding motion trajectory parameters and displaying the resulting motion trajectory curve on the first interface, allowing the art designer to visually observe its direction. Both generating and modifying the motion trajectory curve can be done on the first interface, with the curve updated promptly until the desired effect is achieved. The art designer then performs a speed configuration operation on the second interface. The server responds to this operation, parsing the corresponding speed parameters and displaying the resulting speed curve on the second interface, again providing a clear view of its direction. Both generating and modifying the speed curve can be done on the second interface, with the speed updated promptly until the desired effect is achieved. The first and second interfaces can be the same or different interfaces.

[0048] Currently, achieving dynamic camera movement in turn-based combat requires the art team to simulate the battle scene in 3D software, create virtual camera motion trajectories, and then output the motion trajectories of each camera individually. These trajectories are then compiled by the game designers and fed into the game engine, where programmers then implement and observe the effects. However, this process is quite cumbersome. Coordinating the motion of each camera individually results in a massive amount of simulation work and a long development cycle. Furthermore, there are often some discrepancies between the 3D software results and the actual engine performance, increasing subsequent adjustment costs. In addition, this method lacks rhythmic variation in camera movement, resulting in unsatisfactory overall camera movement effects.

[0049] In this application, through the visualization attributes of the first and second interfaces, art designers can directly design the desired effects on the interface, and simultaneously obtain the corresponding motion trajectory parameters and motion rate parameters. After obtaining these parameters, the server can also directly implement the corresponding effects on the engine side, thus eliminating the need to simulate and create each shot in 3D software. This frees up art manpower and reduces programming and planning manpower, significantly lowering the cost of camera movement production. When the virtual camera moves from one preset trajectory point to another, in addition to designing the motion trajectory, the motion rate is also designed to give the virtual camera a certain rhythm during the translation, resulting in richer motion effects. Since the motion rate curve and motion trajectory curve are directly designed by the art designers, and the motion rate parameters and motion trajectory parameters reflect the actual direction of the corresponding curves, the final real camera movement effect obtained based on these parameters has a very high degree of consistency with the designed camera movement effect.

[0050] In one embodiment, the steps of obtaining motion trajectory parameters and displaying motion trajectory curves on the first interface in response to a trajectory configuration operation on the first interface specifically include: receiving position coordinate configuration operations for two preset trajectory points before and after each position triggering event through the first interface; obtaining the position coordinates of the trajectory start point and trajectory end point of each motion trajectory in response to the position coordinate configuration operation, and displaying the motion trajectory curve of each motion trajectory on the first interface.

[0051] Since each location-triggered event corresponds to one translation of the virtual camera, a motion trajectory needs to be designed for the virtual camera for each location-triggered event. The preset trajectory point where the virtual camera was located before each location-triggered event is taken as the trajectory start point, and the preset trajectory point that the virtual camera needs to reach after the event is taken as the trajectory end point. Connecting these two points yields a motion trajectory. It should be noted that the preset trajectory point after each location-triggered event is unique and definite, but there can be more than one preset trajectory point before the event. For example, if a medium shot and a wide shot can switch to a close-up based on the same location-triggered event, then there can be two preset trajectory points before that location-triggered event. Therefore, for each location-triggered event, all possible scenarios need to be considered, and all possible motion trajectories need to be designed.

[0052] In this embodiment of the application, the first interface includes an online editing diagram of a Cartesian coordinate system, which can provide an interface with online coordinate editing functions, such as... Figure 3 As shown, the online editing graph has a pre-established Cartesian coordinate system. The horizontal and vertical axes of the Cartesian coordinate system correspond to the horizontal and vertical axes in the game screen, respectively. In the Cartesian coordinate system, the position coordinates of the starting point A and the ending point B of a certain motion trajectory can be configured by clicking or dragging. The server can respond to the configuration operation, generate the position coordinates of the preset trajectory point A and trajectory ending point B, and display the straight line connecting the trajectory starting point A and trajectory ending point B on the interface. This straight line is the motion trajectory curve corresponding to the motion trajectory. The equation corresponding to the straight line can be displayed next to the curve as needed.

[0053] In the online editing graph of the Cartesian coordinate system, the default trajectory start point A and trajectory end point B are connected by a straight line, meaning the corresponding motion trajectory is a straight line. Therefore, only the position coordinates of the trajectory start point A and trajectory end point B need to be configured. However, if you want the corresponding motion trajectory to be a curve, in addition to configuring the position coordinates of the trajectory start point A and trajectory end point B, you can also configure the position coordinates of one or more intermediate points between the two points. When there are many intermediate points, connecting the trajectory start point A, each intermediate point, and trajectory end point B sequentially will produce a curve effect. Similarly, the server responds to the configuration operation of the trajectory intermediate points and obtains the position coordinates of each intermediate point.

[0054] In response to the above configuration operations, the server can obtain the position coordinates of the starting point and ending point of the trajectory corresponding to multiple motion trajectories, and display the motion trajectory curve of each motion trajectory on the first interface.

[0055] In one embodiment, the steps of obtaining motion rate parameters in response to a rate configuration operation on the second interface and displaying a motion rate curve on the second interface specifically include: receiving time configuration operations and distance configuration operations for each preset time point in each motion trajectory through the second interface; obtaining the motion rate equation corresponding to each motion trajectory in response to the time configuration operation and distance configuration operation, and displaying the motion rate curve corresponding to each motion trajectory on the second interface.

[0056] In this embodiment, the second interface includes an online editing graph of four-parameter equations, which can also provide online coordinate editing functionality, such as... Figure 4 As shown, the online editing graph also has a pre-established Cartesian coordinate system. The online editing graph provides coordinate input boxes for the X-axis and Y-axis. The X-axis represents the time corresponding to each time point during the translation along the trajectory, starting from the starting time corresponding to the starting point of the trajectory. The Y-axis represents the distance corresponding to each time point during the translation along the trajectory, starting from the starting time corresponding to the starting point of the trajectory.

[0057] During the translation along the motion trajectory, each time point has a corresponding motion rate. However, during configuration, only the time and distance at some time points can be configured. These time points are preset time points, and the rates at other time points can be calculated later based on the generated equations. For each motion trajectory, time and distance configuration operations need to be performed for multiple preset time points. During configuration, multiple sets of coordinates can be directly entered in the coordinate input box, such as... Figure 4In the input field, you can directly enter (0, 0), (0.1, 0.9), (0.9, 0.99), and (1, 1). 0, 0.1, 0.9, and 1 represent the time at each point in time, and 0, 0.9, 0.99, and 1 represent the distance traveled at each point in time. The basic units for time and distance can be set according to the needs of the game scene. For example, if you set a time unit to 1 second, then 0.1 and 0.9 represent the 0.1 second and 0.9 second respectively. If you set a time unit to 2 seconds, then 0.1 and 0.9 represent the 0.2 second and 1.8 second respectively. The same applies to distance units. Alternatively, you can import local data instead of entering coordinates in the input field; both methods are configurable.

[0058] In response to this configuration operation, the server fits the coordinates to generate a four-parameter equation and displays the fitted velocity curves for these coordinates in a coordinate system. A four-parameter equation is an equation containing four parameters that represents the relationship between the dependent variable Y and the independent variable X. This four-parameter equation is the velocity equation. For the above coordinates, the fitted four-parameter equation is: Y = (AD) / [1 + (X / C)] B After inputting the coordinates of the points, ]+D can be used to calculate the four parameters A, B, C, and D in the equation, as well as the correlation coefficient R. 2 When the motion rate curve rises gently in a certain segment, it indicates that the designed motion rate is relatively low during that time period, and the virtual camera needs to move slowly. When the curve rises rapidly in a certain segment, it indicates that the designed motion rate is relatively high during that time period, and the virtual camera needs to move quickly.

[0059] In response to the above configuration operations, the server can obtain the motion rate equations corresponding to multiple motion trajectories and display the motion rate curve of each motion trajectory on the second interface.

[0060] S202: Based on the motion trajectory and motion rate, obtain the horizontal movement parameters of the virtual camera in the game.

[0061] In the two steps described above, motion trajectory parameters and motion rate parameters are generated for each motion trajectory. The programmers then establish an interface between the game engine and the art design phase. The server can then obtain these parameters from the interface. Within the game engine, the motion trajectory parameters determine the virtual camera's trajectory in the game, and the motion rate parameters determine the virtual camera's speed along each trajectory. When the motion trajectory and motion rate parameters are obtained through interface configuration, each trajectory matches the motion trajectory curve displayed on the first interface, and the changes in motion rate match the motion rate curve displayed on the second interface. Combining the motion trajectory and motion rate, the horizontal movement parameters of the virtual camera in the game are obtained. These parameters guide the virtual camera on which trajectories to move along and at what speed, achieving the desired camera movement effects for the art designers.

[0062] S203: Obtain the vertical movement and rotation parameters of the virtual camera in the motion trajectory, and obtain the camera movement parameters of the virtual camera in the game based on the horizontal movement, vertical movement and rotation parameters.

[0063] When capturing footage, the virtual camera, in addition to translating along a certain trajectory at a certain speed, also needs to perform certain vertical and rotation operations. Each operation is controlled by corresponding parameters. The horizontal movement parameter determines the change in the virtual camera's position in the game screen, the vertical movement parameter determines the change in the vertical distance between the virtual camera and the game screen during the translation along the trajectory, and the rotation parameter determines the change in the direction and angle of rotation of the virtual camera during the translation along the trajectory. Combining these three parameters yields the camera movement parameters of the virtual camera in the game, which determine the forward and backward camera movement, up and down camera movement, and rotation camera movement in the game.

[0064] In one embodiment, S203 specifically includes: acquiring game display requirement information; determining target point parameters for each trajectory point of the virtual camera on each motion trajectory based on the display requirement information; and determining vertical movement and rotation parameters of the virtual camera on each motion trajectory based on the target point parameters. The display requirement information includes the desired perspective for the game screen in the current scene (e.g., frontal view, top view, oblique view, etc.) and the amount of content to be displayed in the game screen (e.g., displaying all characters and the environment, displaying only character 1, displaying only character 1 and character 2, etc.).

[0065] The information displayed on the screen is also pre-set, and then the server retrieves this information. This retrieval can be done directly from stored code or scripts, meaning this information is pre-stored in the relevant code or scripts and can be directly called later; alternatively, designers can perform configuration operations on the relevant design interface, generating this information based on those operations, which is then retrieved by the server; or it can be stored on a remote server, and retrieved by sending a retrieval command to the remote server when it is necessary to control the virtual camera's movement.

[0066] The virtual camera has a target point when shooting. The line connecting the target point to the center of the virtual camera's shot is perpendicular to the camera's shooting plane. The shooting angle and vertical movement of the virtual camera change with the target point. After obtaining the display requirements information, the target point parameters of the virtual camera can be determined based on the corresponding display angle and content. The target point refers to the optimal shooting point of the virtual camera in its current position. This optimal shooting point allows the image to present the desired content at the required angle. The target point parameters characterize the positional relationship between the target point and the virtual camera's orthographic projection point in the game screen, as well as the vertical distance between the target point and the virtual camera. The positional relationship determines the direction of the target point relative to the orthographic projection point and the distance between them; the greater the distance, the more tilted the virtual camera's shooting angle. The vertical distance determines the vertical distance between the game screen and the virtual camera. Based on this distance, the amount of content displayed at the current shooting angle can be determined. The greater the vertical distance between the target point and the virtual camera, the more content is captured, and the smaller the size of the environment and characters in the image.

[0067] Assuming the game screen has a three-dimensional coordinate system, with the x and y axes located within the game screen and the z-axis perpendicular to the screen, the target point parameters can be represented by coordinates (x, y, z), where x and y represent positional relationships and z represents vertical distance relationships. When the virtual camera's position is fixed, adjusting the x and y values ​​can change the target point's position within the game screen. The virtual camera needs to rotate to ensure the captured content follows the target point's movement. Adjusting the z value changes the vertical distance between the target point and the virtual camera. Since the target point remains within the game screen, only vertical movement of the virtual camera can change the distance between itself and the target point. For a given target point parameter, there is a corresponding specific operational state for the virtual camera. Therefore, after obtaining the target point parameter, the vertical movement and rotation parameters of the virtual camera can be calculated. The vertical movement parameters include the direction and distance of movement when the virtual camera moves along a vertical line within the game screen, and the rotation parameters include the direction and angle of rotation when the virtual camera rotates.

[0068] Specifically, if Figure 5A As shown, in the initial state, assuming the virtual camera's orthographic projection point is located at the center of the game screen, and we want to display a view including all enemy characters and all our characters from a top-down perspective, let the target point parameter be (0, 0, 0). At this time, the virtual camera is located at S1, the target point is located at Q1, the virtual camera is shooting vertically downwards from a top-down angle, and the distance between the virtual camera and the target point is H1. At this time, the vertical movement parameter and rotation parameter of the virtual camera are both 0, and the range of the displayed screen is EF. All enemy characters and all our characters are located between EF.

[0069] like Figure 5B As shown, when the display requirement information indicates that a view including all friendly characters and some enemy characters needs to be displayed from an oblique perspective, the target point parameter is changed to (-1, 0, 0) according to the display requirement information. This means that the target point has moved one unit distance along the -x axis to Q2 relative to its initial position. If the virtual camera is still at its original position S1, in order to make the best shooting point fall on the target point Q2, the virtual camera needs to rotate θ angle in the -x axis direction. Therefore, when the target point parameter is (-1, 0, 0), the corresponding vertical movement parameter of the virtual camera is 0, and the rotation parameter is rotated θ angle in the -x axis direction. At this time, the virtual camera is tilted towards friendly characters to shoot, and the displayed screen range is still EF, but part of the enemy characters will no longer be in the screen.

[0070] like Figure 5C As shown, when the display requirement information indicates that a top-down view is needed to show a scene containing some of our characters and some of the enemy characters, changing the target point parameter to (0, 0, 1) according to the display requirement information means that the vertical distance between the target point and the virtual camera relative to the initial state needs to be reduced by one unit. At this time, the virtual camera needs to move one unit distance along the direction closer to the game screen to position S2, so that the final vertical distance between the virtual camera and the target point is shortened from H1 to H2. Therefore, when the target point parameter is (0, 0, 1), the corresponding vertical movement parameter of the virtual camera is to move down one unit distance, and the rotation parameter is 0. At this time, the virtual camera is still shooting downwards, and the display range is still EF, but some of our characters and some of the enemy characters are no longer in the screen.

[0071] When the x, y, and z values ​​of the target point parameters change simultaneously, the virtual camera needs to move vertically and rotate at the same time.

[0072] As can be seen from the above, when the target point parameters change, the vertical movement and rotation operations of the virtual camera will also change accordingly. Therefore, based on the image display requirements information obtained by the server, the vertical movement and rotation parameters of the virtual camera under each target point parameter can be automatically calculated.

[0073] S204: Controls the camera movement of the virtual camera in the game based on camera movement parameters.

[0074] After obtaining the camera movement parameters through the above steps, the server can control the virtual camera to move the camera in the game based on these parameters, so as to display the camera movement effects designed by the art designers and show the corresponding game screen to the user.

[0075] In one embodiment, S204 specifically includes: in response to a target position triggering event, determining the starting point of the target trajectory where the virtual camera is currently located and the ending point of the target trajectory corresponding to the target position triggering event; determining the target motion trajectory corresponding to the target position triggering event based on the starting point and ending point of the target trajectory; and controlling the camera movement of the virtual camera in the game based on the target camera movement parameters corresponding to the target motion trajectory.

[0076] After obtaining the camera movement parameters corresponding to each motion trajectory, the server can have programmers configure these parameters in the game engine. The first position trigger event and its corresponding preset trajectory point for switching between different scene types, as well as the second position trigger event and its corresponding preset trajectory point within the same scene type, are also configured in the engine in the form of a planning table. After the game goes live, if a target position trigger event occurs in the game, the server responds by first determining the current position of the virtual camera, designating it as the starting point of the target trajectory. Then, based on the planning table, it determines where the virtual camera should pan after the target position trigger event occurs, designating that position as the ending point of the target trajectory. After obtaining the target trajectory starting and ending points, a unique target motion trajectory connecting the two can be determined. The target camera movement parameters corresponding to this target motion trajectory are then obtained from the engine. Finally, based on these target camera movement parameters, the virtual camera is controlled to switch from the target trajectory starting point to the target trajectory ending point.

[0077] Specifically, if Figure 6As shown, ABCD represent our four characters, and abcd represent the enemy's four characters. Taking the initial state as a panoramic view as an example, the virtual camera is at S1, the target point is at Q1, and the panoramic view is taken from above. The vertical distance between the virtual camera and the screen is H1. When our character A enters the operation state, this event is a target position trigger event. After this event occurs, according to the scene requirements, the camera needs to face the character A directly. First, respond to the event to determine the starting point S1 of the target trajectory where the virtual camera is currently located and the ending point S2 of the target trajectory corresponding to the event. This indicates that it needs to move from S1 to S2. Then, determine the target movement trajectory from S1 to S2 from multiple preset movement trajectories, and obtain the camera movement parameters corresponding to the target movement trajectory. The camera movement parameters include information such as which trajectory points need to be passed from S1 to S2, what movement speed is required during the movement, what kind of vertical movement is required during the movement, and what direction and angle need to be rotated. Then, based on the camera movement parameters, control the virtual camera to perform the corresponding camera movement operation so that when the virtual camera finally reaches S2, the target point is located at Q2 in front of the character A, the virtual camera moves down to a distance of H2 from the screen, and rotates 90 degrees in the direction of the character A. When the event is triggered at the next target location, S2 is used as the starting point of the target trajectory, and the above process is repeated to control the virtual camera to perform new camera movements, thereby achieving position switching between different shot sizes or within the same shot size and realizing multi-camera camera movement effects.

[0078] This application pre-designs a multi-angle looping camera effect that can match all situations in game combat, achieving automated switching between multiple camera angles. Since the motion trajectory curves for different angles are pre-designed by art designers, compared to camera movements generated by computer programs, the composition is more reasonable, and the transitions between shots are smoother and more fluid, improving the art quality and the overall combat experience.

[0079] In one embodiment, the step of controlling the camera movement of a virtual camera in a game based on target camera movement parameters corresponding to a target motion trajectory includes: monitoring the motion time of the virtual camera along the target motion trajectory; controlling the camera movement of the virtual camera in the game based on the target camera movement parameters before the motion time reaches the preset time corresponding to the target motion trajectory; activating a gyroscope and acquiring preset motion parameters of the gyroscope when the motion time reaches the preset time corresponding to the target motion trajectory; and controlling the camera movement of the virtual camera after the preset time based on the gyroscope and the preset motion parameters.

[0080] When the virtual camera moves along a certain trajectory to the end point of the trajectory, if no new position trigger event occurs, the virtual camera will stop at the end point of the trajectory. At this time, the virtual camera is in a static shooting state, which will make the game screen display lack dynamism. To enrich the camera effects, the camera movement time corresponding to each motion trajectory can be divided into two parts. The movement time of the virtual camera is monitored with a preset time as the dividing point. Before the preset time is reached, the camera movement of the virtual camera is controlled based on the camera movement parameters obtained in the above steps to achieve the camera movement effect preset by the art designer. When the preset time is reached, the gyroscope is activated and the preset motion parameters of the gyroscope are obtained. The preset motion parameters may include preset offset parameters and preset lag parameters. The preset offset parameters may include the offset direction, offset angle, offset rate, etc. of the gyroscope, and the preset lag parameters may include the offset lag time of the gyroscope, etc. Then, based on the gyroscope and the preset motion parameters, the camera movement of the virtual camera is controlled after the preset time, so that the virtual camera can move back and forth at a certain rate within a certain offset range after the preset time, so as to keep the lens in a state of never being still and make the picture full of dynamism, achieving the effect of handheld camera. This can simulate the movement state of location-based service (LBS) games when playing handheld games outdoors.

[0081] When configuring the motion rate for each motion trajectory on the second interface, the time of the last preset time point input is used as the preset time. The preset time corresponds to the end point on the motion rate curve. The preset time can be the time corresponding to the end point of the trajectory, or it can be a time before reaching the end point of the trajectory, which can be set according to needs. After obtaining the motion rate equation, the server can obtain the corresponding motion rate curve based on the equation. After the motion rate curve reaches the end point, it triggers the gyroscope and obtains the corresponding preset offset parameters, thereby providing guidance for camera movement after the preset time. This allows the virtual camera to continue generating new motion trajectories even after reaching the end point of the trajectory, even if no new position trigger event occurs.

[0082] As can be seen from the above embodiments, the virtual camera control method of this application determines the motion trajectory and motion rate of the virtual camera in the game by acquiring motion trajectory parameters and motion rate parameters. It can control the virtual camera to move horizontally in the game. By acquiring vertical movement parameters and rotation parameters, it can control the virtual camera to move vertically and rotate during movement. Therefore, the virtual camera can move along the designed motion trajectory in the game at a certain speed and rhythm to obtain a dynamic game screen. It can also adjust the screen size by moving vertically and adjust the shooting angle by rotating, realizing a richer range of camera movements. Therefore, the camera movement effect is better, and the presentation effect of the game screen is also better.

[0083] Furthermore, this application pre-designs a multi-angle looping camera effect, which can switch between different camera effects in the game in response to location-triggered events. By adjusting the target point parameters, a panning effect can be achieved in the game, and by activating the gyroscope at a preset time when moving along the motion trajectory, a handheld camera effect can be achieved. That is, unlike the fixed camera effects of similar games on the market, this application can simultaneously achieve automated camera effects of multiple angles, panning, and handheld cameras.

[0084] Accordingly, such as Figure 7 As shown, this application also provides a control device for a virtual camera, specifically including:

[0085] The acquisition module 10 is used to acquire the motion trajectory parameters and motion rate parameters of the virtual camera, wherein the motion trajectory parameters are used to determine the motion trajectory of the virtual camera in the game, and the motion rate parameters are used to determine the motion rate of the virtual camera in the game;

[0086] The first obtaining module 20 is used to obtain the horizontal movement parameters of the virtual camera in the game based on the motion trajectory and the motion rate;

[0087] The second obtaining module 30 is used to obtain the vertical movement parameters and rotation parameters of the virtual camera in the motion trajectory, and obtain the camera movement parameters of the virtual camera in the game based on the horizontal movement parameters, the vertical movement parameters and the rotation parameters;

[0088] The control module 40 is used to control the camera movement of the virtual camera in the game based on the camera movement parameters.

[0089] In one embodiment, the control device for the virtual camera further includes:

[0090] The first acquisition module is used to acquire multiple location trigger events of the virtual camera in the game, the location trigger events including first location trigger events between different shot sizes and second location trigger events within the same shot size;

[0091] The determination module is used to determine the preset trajectory points corresponding to each location trigger event based on the location trigger events.

[0092] In one embodiment, the acquisition module 10 includes:

[0093] The first acquisition submodule is used to respond to the trajectory configuration operation on the first interface, acquire the motion trajectory parameters, and display the motion trajectory curve on the first interface;

[0094] The second acquisition submodule is used to acquire the motion rate parameters in response to the rate configuration operation on the second interface, and to display the motion rate curve on the second interface.

[0095] In one embodiment, the first acquisition submodule includes:

[0096] The first receiving unit is configured to receive, through the first interface, position coordinate configuration operations for two preset trajectory points before and after each location trigger event;

[0097] The first acquisition unit is used to acquire the position coordinates of the starting point and ending point of each motion trajectory in response to the position coordinate configuration operation, and to display the motion trajectory curve of each motion trajectory on the first interface.

[0098] In one embodiment, the second acquisition submodule includes:

[0099] The second receiving unit is used to receive time configuration operations and distance configuration operations for each preset time point in each motion trajectory through the second interface;

[0100] The second acquisition unit is used to acquire the motion rate equation corresponding to each motion trajectory in response to the time configuration operation and the distance configuration operation, and to display the motion rate curve corresponding to each motion trajectory on the second interface.

[0101] In one embodiment, the second obtaining module 30 includes:

[0102] The third acquisition submodule is used to acquire information about the game's screen display requirements;

[0103] The first determining submodule is used to determine the target point parameters of each trajectory point of the virtual camera on each motion trajectory based on the display requirements information of the screen.

[0104] The second determining submodule is used to determine the vertical movement parameters and rotation parameters of the virtual camera on each motion trajectory based on the target point parameters.

[0105] In one embodiment, the control module 40 includes:

[0106] The third determination submodule is used to determine the starting point of the target trajectory where the virtual camera is currently located and the ending point of the target trajectory corresponding to the target location trigger event in response to the target location trigger event.

[0107] The fourth determining submodule is used to determine the target motion trajectory corresponding to the target position triggering event based on the target trajectory start point and the target trajectory end point;

[0108] The control submodule is used to control the camera movement of the virtual camera in the game based on the target camera movement parameters corresponding to the target motion trajectory.

[0109] In one embodiment, the control submodule includes:

[0110] The monitoring unit is used to monitor the motion time of the virtual camera along the target's motion trajectory;

[0111] The first control unit is used to control the camera movement of the virtual camera in the game based on the target camera movement parameters when the movement time has not reached the preset time corresponding to the target movement trajectory.

[0112] The second control unit is used to activate the gyroscope and acquire the preset motion parameters of the gyroscope when the motion time reaches the preset time corresponding to the target motion trajectory, and control the camera movement of the virtual camera after the preset time based on the gyroscope and the preset motion parameters.

[0113] Unlike existing technologies, the virtual camera control device provided in this application determines the virtual camera's trajectory and speed in the game by acquiring motion trajectory parameters and motion rate parameters. It can control the virtual camera's horizontal camera movement in the game, and by acquiring vertical movement parameters and rotation parameters, it can control the virtual camera's vertical camera movement and rotation during movement. Therefore, the virtual camera can move along the designed trajectory at a certain speed and rhythm in the game, resulting in dynamic game visuals. It can also adjust the screen size by moving vertically and adjust the shooting angle by rotating, achieving a richer range of camera movement methods. As a result, the camera movement effect is better, and the presentation of the game visuals is also better.

[0114] Accordingly, embodiments of this application also provide an electronic device, such as... Figure 8 As shown, the electronic device may include a radio frequency (RF) circuit 801, a memory 802 including one or more computer-readable storage media, an input unit 803, a display unit 804, a sensor 805, an audio circuit 806, a WiFi module 807, a processor 808 including one or more processing cores, and a power supply 809, among other components. Those skilled in the art will understand that... Figure 8 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:

[0115] The radio frequency circuit 801 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink information from the base station and hands it over to one or more processors 808 for processing; additionally, it transmits uplink data to the base station. The memory 802 can be used to store software programs and modules. The processor 808 executes various functional applications and data processing by running the software programs and modules stored in the memory 802. The input unit 803 can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.

[0116] Display unit 804 can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the server. These graphical user interfaces can be composed of graphics, text, icons, videos, and any combination thereof.

[0117] The electronic device may also include at least one sensor 805, such as a light sensor, a motion sensor, and other sensors. Audio circuitry 806 includes a speaker that provides an audio interface between the user and the electronic device.

[0118] WiFi is a short-range wireless transmission technology. Electronic devices using the WiFi module 807 can help users send and receive emails, browse web pages, and access streaming media, providing users with wireless broadband internet access. Although Figure 8 WiFi module 807 is shown, but it is understood that it is not a necessary component of the electronic device and can be omitted as needed without changing the nature of the application.

[0119] The processor 808 is the control center of the electronic device. It connects various parts of the phone through various interfaces and lines. By running or executing software programs and / or modules stored in the memory 802, and calling data stored in the memory 802, it performs various functions of the electronic device and processes data, thereby monitoring the phone as a whole.

[0120] The electronic device also includes a power supply 809 (such as a battery) that supplies power to various components. Preferably, the power supply can be logically connected to the processor 808 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system.

[0121] Although not shown, electronic devices may also include cameras, Bluetooth modules, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 808 in the server loads the executable files corresponding to the processes of one or more applications into the memory 802 according to the following instructions, and the processor 808 runs the applications stored in the memory 802 to achieve the following functions:

[0122] Obtain the motion trajectory parameters and motion rate parameters of the virtual camera, wherein the motion trajectory parameters are used to determine the motion trajectory of the virtual camera in the game, and the motion rate parameters are used to determine the motion rate of the virtual camera in the game;

[0123] Based on the motion trajectory and the motion rate, the horizontal movement parameters of the virtual camera in the game are obtained;

[0124] The vertical movement parameters and rotation parameters of the virtual camera in the motion trajectory are obtained, and the camera movement parameters of the virtual camera in the game are obtained based on the horizontal movement parameters, the vertical movement parameters and the rotation parameters.

[0125] The camera movement of the virtual camera in the game is controlled based on the camera movement parameters.

[0126] In one embodiment, the function is implemented as follows:

[0127] The virtual camera is acquired through multiple location trigger events in the game, including first location trigger events between different shot sizes and second location trigger events within the same shot size.

[0128] Based on the location-triggered events, determine the preset trajectory points corresponding to each location-triggered event.

[0129] In one embodiment, the function is implemented as follows:

[0130] In response to the trajectory configuration operation on the first interface, the motion trajectory parameters are obtained, and the motion trajectory curve is displayed on the first interface;

[0131] In response to the rate configuration operation on the second interface, the motion rate parameter is obtained and the motion rate curve is displayed on the second interface.

[0132] In one embodiment, the function is implemented as follows:

[0133] The first interface receives the position coordinate configuration operation for two preset trajectory points before and after each location trigger event;

[0134] In response to the position coordinate configuration operation, the position coordinates of the starting point and ending point of each motion trajectory are obtained, and the motion trajectory curve of each motion trajectory is displayed on the first interface.

[0135] In one embodiment, the function is implemented as follows:

[0136] The second interface receives time configuration and distance configuration operations for each preset time point in each motion trajectory.

[0137] In response to the time configuration operation and the distance configuration operation, the motion rate equation corresponding to each motion trajectory is obtained, and the motion rate curve corresponding to each motion trajectory is displayed on the second interface.

[0138] In one embodiment, the function is implemented as follows:

[0139] Obtain information regarding the game's visual display requirements;

[0140] Based on the display requirements, determine the target point parameters of each trajectory point of the virtual camera on each motion trajectory;

[0141] Based on the target point parameters, the vertical movement parameters and rotation parameters of the virtual camera on each motion trajectory are determined.

[0142] In one embodiment, the function is implemented as follows:

[0143] In response to a target location trigger event, determine the starting point of the target trajectory where the virtual camera is currently located and the ending point of the target trajectory corresponding to the target location trigger event;

[0144] Based on the starting point and ending point of the target trajectory, determine the target motion trajectory corresponding to the target position triggering event;

[0145] The camera movement of the virtual camera in the game is controlled based on the target camera movement parameters corresponding to the target's motion trajectory.

[0146] In one embodiment, the function is implemented as follows:

[0147] Monitor the motion time of the virtual camera along the target's motion trajectory;

[0148] When the motion time has not reached the preset time corresponding to the target motion trajectory, the camera movement of the virtual camera in the game is controlled based on the target camera movement parameters;

[0149] When the motion time reaches the preset time corresponding to the target motion trajectory, the gyroscope is activated and the preset motion parameters of the gyroscope are obtained. Based on the gyroscope and the preset motion parameters, the camera movement of the virtual camera after the preset time is controlled.

[0150] Unlike existing technologies, the electronic device provided in this application determines the motion trajectory and speed of a virtual camera in a game by acquiring motion trajectory parameters and motion rate parameters. It can control the virtual camera's horizontal camera movement in the game, and by acquiring vertical movement parameters and rotation parameters, it can control the virtual camera's vertical camera movement and rotation during movement. Therefore, the virtual camera can move along the designed motion trajectory in the game at a certain speed and rhythm to obtain dynamic game scenes. It can also adjust the screen size by moving vertically and adjust the shooting angle by rotating, achieving a richer range of camera movement methods. As a result, the camera movement effect is better, and the presentation effect of the game screen is also better.

[0151] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the detailed description above, and they will not be repeated here.

[0152] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0153] Therefore, embodiments of this application provide a computer-readable storage medium storing a plurality of instructions that can be loaded by a processor to perform the following functions:

[0154] Obtain the motion trajectory parameters and motion rate parameters of the virtual camera, wherein the motion trajectory parameters are used to determine the motion trajectory of the virtual camera in the game, and the motion rate parameters are used to determine the motion rate of the virtual camera in the game;

[0155] Based on the motion trajectory and the motion rate, the horizontal movement parameters of the virtual camera in the game are obtained;

[0156] The vertical movement parameters and rotation parameters of the virtual camera in the motion trajectory are obtained, and the camera movement parameters of the virtual camera in the game are obtained based on the horizontal movement parameters, the vertical movement parameters and the rotation parameters.

[0157] The camera movement of the virtual camera in the game is controlled based on the camera movement parameters.

[0158] In one embodiment, the function is implemented as follows:

[0159] The virtual camera is acquired through multiple location trigger events in the game, including first location trigger events between different shot sizes and second location trigger events within the same shot size.

[0160] Based on the location-triggered events, determine the preset trajectory points corresponding to each location-triggered event.

[0161] In one embodiment, the function is implemented as follows:

[0162] In response to the trajectory configuration operation on the first interface, the motion trajectory parameters are obtained, and the motion trajectory curve is displayed on the first interface;

[0163] In response to the rate configuration operation on the second interface, the motion rate parameter is obtained and the motion rate curve is displayed on the second interface.

[0164] In one embodiment, the function is implemented as follows:

[0165] The first interface receives the position coordinate configuration operation for two preset trajectory points before and after each location trigger event;

[0166] In response to the position coordinate configuration operation, the position coordinates of the starting point and ending point of each motion trajectory are obtained, and the motion trajectory curve of each motion trajectory is displayed on the first interface.

[0167] In one embodiment, the function is implemented as follows:

[0168] The second interface receives time configuration and distance configuration operations for each preset time point in each motion trajectory.

[0169] In response to the time configuration operation and the distance configuration operation, the motion rate equation corresponding to each motion trajectory is obtained, and the motion rate curve corresponding to each motion trajectory is displayed on the second interface.

[0170] In one embodiment, the function is implemented as follows:

[0171] Obtain information regarding the game's visual display requirements;

[0172] Based on the display requirements, determine the target point parameters of each trajectory point of the virtual camera on each motion trajectory;

[0173] Based on the target point parameters, the vertical movement parameters and rotation parameters of the virtual camera on each motion trajectory are determined.

[0174] In one embodiment, the function is implemented as follows:

[0175] In response to a target location trigger event, determine the starting point of the target trajectory where the virtual camera is currently located and the ending point of the target trajectory corresponding to the target location trigger event;

[0176] Based on the starting point and ending point of the target trajectory, determine the target motion trajectory corresponding to the target position triggering event;

[0177] The camera movement of the virtual camera in the game is controlled based on the target camera movement parameters corresponding to the target's motion trajectory.

[0178] In one embodiment, the function is implemented as follows:

[0179] Monitor the motion time of the virtual camera along the target's motion trajectory;

[0180] When the motion time has not reached the preset time corresponding to the target motion trajectory, the camera movement of the virtual camera in the game is controlled based on the target camera movement parameters;

[0181] When the motion time reaches the preset time corresponding to the target motion trajectory, the gyroscope is activated and the preset motion parameters of the gyroscope are obtained. Based on the gyroscope and the preset motion parameters, the camera movement of the virtual camera after the preset time is controlled.

[0182] Unlike existing technologies, the computer-readable storage medium provided in this application determines the motion trajectory and speed of a virtual camera in a game by acquiring motion trajectory parameters and motion rate parameters. It can control the virtual camera's horizontal camera movement in the game, and by acquiring vertical movement parameters and rotation parameters, it can control the virtual camera's vertical camera movement and rotation during movement. Therefore, the virtual camera can move along a designed trajectory at a certain speed in the game, resulting in dynamic game visuals. It can also adjust the screen size by moving vertically and adjust the shooting angle by rotating, achieving a richer range of camera movement methods. As a result, the camera movement effect is better, and the presentation of the game visuals is also better.

[0183] The foregoing has provided a detailed description of a virtual camera control method, apparatus, electronic device, and computer-readable storage medium provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the technical solutions and core ideas of this application. Those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A method for controlling a virtual camera in a turn-based game, characterized in that, include: Obtain the motion trajectory parameters and motion rate parameters of the virtual camera, wherein the motion trajectory parameters are used to determine the motion trajectory of the virtual camera in the game, and the motion rate parameters are used to determine the motion rate of the virtual camera in the game; Based on the motion trajectory and the motion rate, the horizontal movement parameters of the virtual camera in the game are obtained; The vertical movement parameters and rotation parameters of the virtual camera in the motion trajectory are obtained, and the camera movement parameters of the virtual camera in the game are obtained based on the horizontal movement parameters, the vertical movement parameters and the rotation parameters. The camera movement of the virtual camera in the game is controlled based on the camera movement parameters; The steps for obtaining the vertical movement parameters and rotation parameters of the virtual camera in the motion trajectory include: Obtain information regarding the game's visual display requirements; Based on the display requirements, determine the target point parameters of each trajectory point of the virtual camera on each motion trajectory; Based on the target point parameters, determine the vertical movement parameters and rotation parameters of the virtual camera on each motion trajectory; The display requirements include the game screen's perspective information and the content information to be displayed; the content information includes character information and / or environment information. The target point parameters are used to characterize the positional relationship between the virtual camera and the orthographic projection point in the game screen, as well as the vertical distance relationship between the target point and the virtual camera.

2. The virtual camera control method as described in claim 1, characterized in that, Before the steps of obtaining the motion trajectory parameters and motion rate parameters of the virtual camera, the following steps are also included: The virtual camera is acquired through multiple location trigger events in the game, including first location trigger events between different shot sizes and second location trigger events within the same shot size. Based on the location-triggered events, determine the preset trajectory points corresponding to each location-triggered event.

3. The virtual camera control method as described in claim 2, characterized in that, The steps to obtain the motion trajectory parameters and motion rate parameters of a virtual camera include: In response to the trajectory configuration operation on the first interface, the motion trajectory parameters are obtained, and the motion trajectory curve is displayed on the first interface; In response to the rate configuration operation on the second interface, the motion rate parameter is obtained and the motion rate curve is displayed on the second interface.

4. The virtual camera control method as described in claim 3, characterized in that, The steps of obtaining the motion trajectory parameters in response to the trajectory configuration operation on the first interface and displaying the motion trajectory curve on the first interface include: The first interface receives the position coordinate configuration operation for two preset trajectory points before and after each location trigger event; In response to the position coordinate configuration operation, the position coordinates of the starting point and ending point of each motion trajectory are obtained, and the motion trajectory curve of each motion trajectory is displayed on the first interface.

5. The virtual camera control method as described in claim 3, characterized in that, The steps of obtaining the motion rate parameters in response to a rate configuration operation on the second interface and displaying the motion rate curve on the second interface include: The second interface receives time configuration and distance configuration operations for each preset time point in each motion trajectory. In response to the time configuration operation and the distance configuration operation, the motion rate equation corresponding to each motion trajectory is obtained, and the motion rate curve corresponding to each motion trajectory is displayed on the second interface.

6. The virtual camera control method as described in claim 2, characterized in that, The steps of controlling the camera movement of the virtual camera in the game based on the camera movement parameters include: In response to a target location trigger event, determine the starting point of the target trajectory where the virtual camera is currently located and the ending point of the target trajectory corresponding to the target location trigger event; Based on the starting point and ending point of the target trajectory, determine the target motion trajectory corresponding to the target position triggering event; The camera movement of the virtual camera in the game is controlled based on the target camera movement parameters corresponding to the target's motion trajectory.

7. The virtual camera control method as described in claim 6, characterized in that, The step of controlling the camera movement of the virtual camera in the game based on the target camera movement parameters corresponding to the target motion trajectory also includes: Monitor the motion time of the virtual camera along the target's motion trajectory; When the motion time has not reached the preset time corresponding to the target motion trajectory, the camera movement of the virtual camera in the game is controlled based on the target camera movement parameters; When the motion time reaches the preset time corresponding to the target motion trajectory, the gyroscope is activated and the preset motion parameters of the gyroscope are obtained. Based on the gyroscope and the preset motion parameters, the camera movement of the virtual camera after the preset time is controlled.

8. A control device for a virtual camera in a turn-based game, characterized in that, include: The acquisition module is used to acquire the motion trajectory parameters and motion rate parameters of the virtual camera, wherein the motion trajectory parameters are used to determine the motion trajectory of the virtual camera in the game, and the motion rate parameters are used to determine the motion rate of the virtual camera in the game; The first obtaining module is used to obtain the horizontal movement parameters of the virtual camera in the game based on the motion trajectory and the motion rate; The second obtaining module is used to obtain the vertical movement parameters and rotation parameters of the virtual camera in the motion trajectory, and to obtain the camera movement parameters of the virtual camera in the game based on the horizontal movement parameters, the vertical movement parameters and the rotation parameters; The control module is used to control the camera movement of the virtual camera in the game based on the camera movement parameters; The steps for obtaining the vertical movement parameters and rotation parameters of the virtual camera in the motion trajectory include: Obtain information regarding the game's visual display requirements; Based on the display requirements, determine the target point parameters of each trajectory point of the virtual camera on each motion trajectory; Based on the target point parameters, determine the vertical movement parameters and rotation parameters of the virtual camera on each motion trajectory; The display requirements include the game screen's perspective information and the content information to be displayed; the content information includes character information and / or environment information. The target point parameters are used to characterize the positional relationship between the virtual camera and the orthographic projection point in the game screen, as well as the vertical distance relationship between the target point and the virtual camera.

9. An electronic device, characterized in that, It includes a memory and a processor; the memory stores an application program, and the processor is used to run the application program within the memory to perform the steps in the method for controlling a virtual camera in a turn-based game according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that is executed by a processor to implement the steps of the method for controlling a virtual camera in a turn-based game according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Virtual camera control method and device and computer equipment

    CN113908543A