Method and device for adjusting position of virtual camera in game scene
By obtaining the height of the virtual character in the game scene and adjusting the virtual camera parameter values, the problem of the virtual camera position setting not adapting to body size differences is solved, and a more flexible and realistic virtual camera position adjustment is achieved, improving the game visual effects.
Patent Information
- Application Number
- CN202111580303.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-22
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2041-12-22
AI Technical Summary
In the existing technology, due to the unified parameters preset in the game scene, the virtual camera position setting is not adapted to the body size differences of different virtual characters and targets, resulting in huge differences in the game visual effects and failing to achieve the expected lens effect.
By obtaining the height of the virtual character in the current game scene, determining the height range, and adjusting the virtual camera parameter value based on the mapping relationship, the virtual camera position is adjusted in real time to adapt to the height and terrain differences of different virtual characters.
The flexibility of adjusting the virtual camera position has been improved, which increases the realism and impact of the game and improves the visual effects of the game.
Smart Images

Figure CN114225408B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of game technology, and in particular to a method and device for adjusting the position of a virtual camera in a game scene. Background Art
[0002] To ensure a realistic, impactful, and comfortable experience, modern action games often use a preset camera position to ensure combat. This position automatically adjusts as the player's avatars and targets move. However, due to the significant size variations among avatars and the size of the currently locked-on targets, the preset camera position cannot accommodate all avatars or targets. This results in significant variations in visual effects and fails to achieve the desired camera effect. Summary of the Invention
[0003] The purpose of the embodiments of the present application is to provide a method and device for adjusting the position of a virtual camera in a game scene, which solves the problem in the prior art of setting the position of a virtual camera according to unified parameters preset in the game scene, resulting in poor visual effects of the game. The specific technical solution is as follows:
[0004] In a first aspect of the implementation of the present application, a method for adjusting the position of a virtual camera in a game scene is first provided, comprising: obtaining a height corresponding to a first virtual character in the current game scene, wherein the first virtual character is a virtual character other than a second virtual character corresponding to a game user; determining a height interval into which the height falls; determining a preset virtual camera parameter value corresponding to the height based on a mapping relationship between the height interval and the virtual camera parameter value; and adjusting the position of the virtual camera in the current game scene based on the determined preset virtual camera parameter value.
[0005] Optionally, before obtaining the height of the first virtual character in the current game scene, the method further includes: determining the values of multiple different parameter combinations corresponding to multiple different height intervals, wherein the virtual camera parameters include multiple parameters, and the parameter combination is obtained by combining at least part of the multiple parameters; and establishing the mapping relationship between the multiple different height intervals and the values of the multiple different parameter combinations.
[0006] Optionally, adjusting the position of the virtual camera in the current game scene based on the determined preset virtual camera parameter value includes: determining the value of each parameter in the parameter combination corresponding to the height range based on the mapping relationship; comparing the value of each parameter in the parameter combination with the value of the corresponding parameter of the virtual camera in the current game scene; and adjusting the position of the virtual camera in the current game scene according to the comparison result.
[0007] Optionally, the multiple parameters include at least one of an offset parameter of the virtual camera position offset, an offset parameter of the virtual camera observation point position, a width of the virtual camera observation point dead zone range, and a height of the virtual camera observation point dead zone range.
[0008] Optionally, obtaining the height corresponding to the first virtual character in the current game scene includes: in the current game scene, determining a virtual character corresponding to a non-player locked by the second virtual character as the first virtual character; and determining the height corresponding to the first virtual character.
[0009] Optionally, obtaining the height corresponding to the first virtual character in the current game scene includes: determining multiple virtual characters corresponding to non-game players in the current game screen, selecting the virtual character with the tallest height, the second tallest height, or the virtual character closest to the second virtual character among the multiple virtual characters as the first virtual character; and determining the height of the first virtual character as the height corresponding to the first virtual character.
[0010] Optionally, before obtaining the height corresponding to the first virtual character in the current game scene, the method further includes: determining the current position of the virtual camera based on a default parameter value of the virtual camera corresponding to the current game scene.
[0011] Optionally, before determining the height interval into which the height falls, the method further includes: determining the height interval according to at least one of the following: the height of the virtual character in the game scene, the terrain in the game scene.
[0012] In a second aspect of the implementation of the present application, a device for adjusting the position of a virtual camera in a game scene is also provided, including: an acquisition module for acquiring the height corresponding to a first virtual character in the current game scene, wherein the first virtual character is a virtual character other than the second virtual character corresponding to the game user; a first determination module for determining the height interval into which the height falls; a second determination module for determining a preset virtual camera parameter value corresponding to the height based on a mapping relationship between the height interval and the virtual camera parameter value; and an adjustment module for adjusting the position of the virtual camera in the current game scene based on the determined preset virtual camera parameter value.
[0013] Optionally, the device also includes: a third determination module, used to determine the values of multiple different parameter combinations corresponding to multiple different height intervals before obtaining the height of the first virtual character in the current game scene, wherein the virtual camera parameters include multiple parameters, and the parameter combination is obtained by combining at least part of the multiple parameters; and an establishment module, used to establish the mapping relationship between the multiple different height intervals and the values of the multiple different parameter combinations.
[0014] Optionally, the adjustment module includes: a first determination unit, used to determine the value of each parameter in the parameter combination corresponding to the height range based on the mapping relationship; a comparison unit, used to compare the value of each parameter in the parameter combination with the value of the corresponding parameter of the virtual camera in the current game scene; and an adjustment unit, used to adjust the position of the virtual camera in the current game scene based on the comparison result.
[0015] Optionally, the multiple parameters include at least one of an offset parameter of the virtual camera position offset, an offset parameter of the virtual camera observation point position, a width of the virtual camera observation point dead zone range, and a height of the virtual camera observation point dead zone range.
[0016] Optionally, the acquisition module includes: a second determination unit, used to determine, in the current game scene, a virtual character corresponding to a non-player locked by the second virtual character as the first virtual character; and a third determination unit, used to determine the height of the first virtual character as the height corresponding to the first virtual character.
[0017] Optionally, the acquisition module includes: a processing unit, used to determine multiple virtual characters corresponding to non-game players in the current game screen, and select the virtual character with the tallest height, the second tallest height, or the virtual character closest to the second virtual character among the multiple virtual characters as the first virtual character; a fourth determination unit, used to determine the height of the first virtual character as the height corresponding to the first virtual character.
[0018] Optionally, the device further includes: a fourth determination module, configured to determine the current position of the virtual camera based on a default parameter value of the virtual camera corresponding to the current game scene before obtaining the height corresponding to the first virtual character in the current game scene.
[0019] Optionally, the device further includes: a fifth determining module, configured to determine the height interval according to at least one of the following items before determining the height interval into which the height falls: the height of the virtual character in the game scene, the terrain in the game scene.
[0020] In the third aspect of the implementation of the present application, an electronic device is also provided, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; the memory is used to store computer programs; and the processor is used to implement the method steps described in the first aspect when executing the program stored in the memory.
[0021] In a fourth aspect of the implementation of the present application, a computer-readable storage medium is further provided, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the method described in the first aspect.
[0022] In an embodiment of the present application, after obtaining the height corresponding to the first virtual character in the current game scene, the preset virtual camera parameter value corresponding to the height is determined according to the height range into which the height falls and the mapping relationship, thereby adjusting the position of the virtual camera in the current game scene. That is, through the embodiment of the present application, the position of the virtual camera in the game scene can be adjusted according to the height corresponding to the virtual character other than the second virtual character corresponding to the game user, that is, the position of the virtual camera can be adjusted in real time according to the virtual character in the game scene, which improves the flexibility of the virtual camera position adjustment and also increases the authenticity and impact of the game, and solves the problem in the prior art that the position of the virtual camera is set according to the unified parameters preset in the game scene, resulting in poor visual effects of the game. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art.
[0024] Figure 1 This is a flow chart of a method for adjusting the position of a virtual camera in a game scene according to an embodiment of the present application;
[0025] Figure 2 This is a second flow chart of a method for adjusting the position of a virtual camera in a game scene according to an embodiment of the present application;
[0026] Figure 3 Schematic diagram of the structure of a device for adjusting the position of a virtual camera in a game scene according to an embodiment of the present application;
[0027] Figure 4 Schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0028] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0029] In the following description, the suffixes such as "module" and "unit" used to represent elements are only used to facilitate the description of this application and have no specific meaning. Therefore, "module" and "component" can be used interchangeably.
[0030] The embodiment of the present application provides a method for adjusting the position of a virtual camera in a game scene, such as Figure 1 As shown, the method includes:
[0031] Step 102, obtaining a height corresponding to a first virtual character in the current game scene, wherein the first virtual character is a virtual character other than a second virtual character corresponding to the game user;
[0032] Step 104, determining the height interval into which the height falls;
[0033] Step 106, determining a preset virtual camera parameter value corresponding to the height based on a mapping relationship between the height interval and the virtual camera parameter value; and
[0034] Step 108: Adjust the position of the virtual camera in the current game scene based on the determined preset virtual camera parameter values.
[0035] Through the above steps 102 to 108, after obtaining the height corresponding to the first virtual character in the current game scene, the preset virtual camera parameter value corresponding to the height is determined according to the height range into which the height falls and the mapping relationship, thereby adjusting the position of the virtual camera in the current game scene. That is, through the embodiment of the present application, the position of the virtual camera in the game scene can be adjusted according to the height corresponding to the virtual character other than the second virtual character corresponding to the game user, that is, the position of the virtual camera can be adjusted in real time according to the virtual character in the game scene, which improves the flexibility of the virtual camera position adjustment and also increases the authenticity and impact of the game, and solves the problem in the prior art that the position of the virtual camera is set according to the unified parameters preset in the game scene, resulting in poor visual effects of the game.
[0036] In an optional implementation manner of the embodiment of the present application, Figure 2 As shown, the method of the embodiment of the present application also includes:
[0037] Step 100: Before obtaining the height corresponding to the first virtual character in the current game scene, determine the current position of the virtual camera based on the default parameter values of the virtual camera corresponding to the current game scene.
[0038] That is, in the embodiment of the present application, before adjusting the position of the virtual camera, upon entering the current game scene, the virtual camera has an initial default parameter value, and the current position of the virtual camera is determined based on this parameter value. The virtual camera default parameters are related to the current game scene, which can be determined by the current position of the game player character, and the current position of the game player character can have different terrains, that is, different terrains require corresponding adjustments to the position of the virtual camera. In other words, the virtual camera default parameters corresponding to different terrains in the game scene are different. In other words, the terrain / topography (mainly the height) of the current position of the game player character determines the initial default parameter values of the virtual camera in the current scene.
[0039] In an optional implementation of the embodiment of the present application, the method of obtaining the height corresponding to the first virtual character in the current game scene involved in the above step 102 may further include:
[0040] Step 11: In the current game scene, determine a non-player virtual character locked by the second virtual character as the first virtual character;
[0041] Step 12: Determine the height of the first virtual character as the height corresponding to the first virtual character.
[0042] It can be seen from the above steps 11 and 12 that the height involved in the embodiment of the present application can be the height of the first virtual character locked by the second virtual character. For example, in a shooting game, the second virtual character controlled by the game player locks the enemy through the weapon currently held (such as a pistol, sniper rifle, etc.), then the height of the enemy is the height of the first virtual character.
[0043] In another optional implementation of the embodiment of the present application, the method of obtaining the height corresponding to the first virtual character in the current game scene involved in the above step 102 may further include:
[0044] Step 21, determining multiple virtual characters corresponding to non-game players in the current game screen, and selecting the virtual character with the tallest height, the second tallest height, or the virtual character closest to the second virtual character among the multiple virtual characters as the first virtual character;
[0045] Step 22: Determine the height of the first virtual character as the height corresponding to the first virtual character.
[0046] Through the above steps 21 and 22, it can be known that the first virtual character in the embodiment of the present application can be the virtual character with the tallest height among the multiple virtual characters corresponding to the non-game players in the current game screen, or the virtual character with the second tallest height, or it can be the virtual character closest to the second virtual character in the current game screen. In other words, the method for determining the height of the first virtual character can be applicable to shooting games, and can also use other types of game scenes, such as role-playing games (RPGs). It can be seen that the method in the above steps 11 to 12, as well as the method in steps 21 and 22, can adapt to the determination of the height of virtual characters in various games. In addition, the present application is not limited to the above height determination method. For example, the average height of the multiple virtual characters corresponding to all non-game players in the current game screen can also be used as the height corresponding to the first virtual character.
[0047] In an optional implementation manner of the embodiment of the present application, before determining the height interval into which the height falls in step 104, the method of the embodiment of the present application may further include:
[0048] Step 103 : determining a height range based on at least one of the following: a height of a virtual character in the game scene, or a topography of the game scene.
[0049] It can be seen that the height interval in the embodiment of the present application is determined based on the height of the virtual character in the game scene and / or the terrain in the game scene, wherein the virtual character includes a first virtual character and a second virtual character. In one example, the height interval can be determined based on the height of the second virtual character (player character). For example, if the height of the second virtual character is 1.8m, then a height interval is formed by increasing or decreasing 20cm based on 1.8m. In another example, the height of the second virtual character can be used as a reference, but the height interval can be determined based on the height difference between the highest height and the lowest height among multiple first virtual characters in the current game scene. For example, if the highest height among multiple first virtual characters is 4m and the lowest height is 1.2m, then the height difference between the two is 2.8m. Then, a height interval can be formed by increasing 40cm based on the highest height, or by increasing 80cm based on the highest height.
[0050] Furthermore, if the initial game scene contains a large number of virtual characters, the height intervals can be set to a larger value, for example, a 60cm difference between the height intervals. This can reduce the number of times the virtual camera position is switched back and forth in the game scene. When the game scene contains a small number of virtual characters, the height interval differences can be adjusted in real time, for example, to 20cm. This allows for more precise adjustment of the virtual camera position. In other words, in the embodiments of the present application, the granularity of dividing the height intervals can be adjusted according to actual needs.
[0051] It should be noted that the height difference between the above-mentioned virtual characters can also take into account the different terrain differences in the game scene. For example, if the highest point in the game scene is a hillside and the lowest point is flat ground, then the height difference between the two characters needs to be calculated by adding the altitude difference between the highest and lowest points in the scene. In other words, the granularity of the height interval division in the embodiment of the present application can be determined based on the height difference between the virtual characters, and the height difference refers to the height difference including the altitude difference of the current scene.
[0052] In addition, the above-mentioned height range values and height values are only examples, and the specific values can be set accordingly according to actual conditions.
[0053] In another optional implementation of the embodiment of the present application, before obtaining the height of the first virtual character in the current game scene involved in the above step 102, the method of the embodiment of the present application may further include:
[0054] Step 21, determining values of a plurality of different parameter combinations corresponding to a plurality of different height intervals, wherein the virtual camera parameters include a plurality of parameters, and the parameter combination is obtained by combining at least part of the plurality of parameters; and
[0055] Step 22: Establish a mapping relationship between a plurality of different height intervals and a plurality of different parameter combination values.
[0056] It can be seen from the above steps 21 and 22 that there is a mapping relationship between different height intervals and different parameter combinations in advance. Therefore, it is only necessary to determine the height interval. Based on the mapping relationship, the value of the virtual camera parameter corresponding to the height interval can be directly determined. In the specific example, the multiple parameters included in the virtual camera parameters may refer to the offset parameters of the virtual camera in the game scene. Specifically, the multiple parameters include at least one of the offset parameters of the virtual camera position offset, the offset parameters of the virtual camera observation point position, the width of the virtual camera observation point dead zone range, and the height of the virtual camera observation point dead zone range.
[0057] In another optional implementation of the embodiment of the present application, the method of adjusting the position of the virtual camera in the current game scene based on the determined preset virtual camera parameter value involved in the above 106 may further include:
[0058] Step 31: determining the value of each parameter in the parameter combination corresponding to the height interval based on the mapping relationship;
[0059] Step 32, comparing the value of each parameter in the parameter combination with the value of the corresponding parameter of the virtual camera in the current game scene; and
[0060] Step 33: Adjust the position of the virtual camera in the current game scene according to the comparison result.
[0061] It can be seen from the above steps 31 to 33 that if the values of the corresponding parameters of the virtual camera in the current game scene are consistent with the values of each parameter in the determined parameter combination, there is no need to adjust the parameter position of the virtual camera. If they are inconsistent, it is necessary to adjust the position of the virtual camera in the current game scene according to the values of each parameter in the determined parameter combination, that is, the position of the virtual camera can be adjusted in real time.
[0062] Corresponding to the above Figure 1 , the embodiment of the present application also provides a device for adjusting the position of a virtual camera in a game scene, such as Figure 3 As shown, the device includes:
[0063] An acquisition module 32 is configured to acquire a height corresponding to a first virtual character in a current game scene, wherein the first virtual character is a virtual character other than a second virtual character corresponding to the game user;
[0064] A first determining module 34 is used to determine the height interval into which the height falls;
[0065] A second determining module 36 is configured to determine a preset virtual camera parameter value corresponding to a height based on a mapping relationship between the height interval and the virtual camera parameter value; and
[0066] The adjustment module 38 is configured to adjust the position of the virtual camera in the current game scene based on the determined preset virtual camera parameter values.
[0067] Through the device of the embodiment of the present application, after obtaining the height corresponding to the first virtual character in the current game scene, the preset virtual camera parameter value corresponding to the height is determined according to the height range into which the height falls and the mapping relationship, thereby adjusting the position of the virtual camera in the current game scene. That is, through the embodiment of the present application, the position of the virtual camera in the game scene can be adjusted according to the height corresponding to the virtual character other than the second virtual character corresponding to the game user, that is, the position of the virtual camera can be adjusted in real time according to the virtual character in the game scene, which improves the flexibility of the virtual camera position adjustment while also increasing the authenticity and impact of the game, and solves the problem in the prior art that the position of the virtual camera is set according to the unified parameters preset in the game scene, resulting in poor visual effects of the game.
[0068] Optionally, the apparatus of the embodiment of the present application may further include: a third determining module, configured to determine values of a plurality of different parameter combinations corresponding to a plurality of different height intervals before obtaining the height of the first virtual character in the current game scene, wherein the virtual camera parameters include a plurality of parameters, and the parameter combination is obtained by combining at least part of the plurality of parameters; and
[0069] The module is used to establish a mapping relationship between multiple different height intervals and values of multiple different parameter combinations.
[0070] Optionally, the adjustment module 38 in the embodiment of the present application may further include: a first determination unit, used to determine the value of each parameter in the parameter combination corresponding to the height interval based on the mapping relationship; a comparison unit, used to compare the value of each parameter in the parameter combination with the value of the corresponding parameter of the virtual camera in the current game scene; and an adjustment unit, used to adjust the position of the virtual camera in the current game scene based on the comparison result.
[0071] Optionally, the multiple parameters in the embodiment of the present application include at least one of an offset parameter of the virtual camera position offset, an offset parameter of the virtual camera observation point position, a width of the virtual camera observation point dead zone range, and a height of the virtual camera observation point dead zone range.
[0072] Optionally, the acquisition module 32 in the embodiment of the present application may further include: a second determination unit, used to determine, in the current game scene, a virtual character corresponding to a non-player locked by the second virtual character as the first virtual character; and a third determination unit, used to determine the height of the first virtual character as the height corresponding to the first virtual character.
[0073] Optionally, the acquisition module 32 in the embodiment of the present application may further include: a processing unit, used to determine multiple virtual characters corresponding to non-game players in the current game screen, and select the virtual character with the tallest height, the second tallest height, or the virtual character closest to the second virtual character among the multiple virtual characters as the first virtual character; a fourth determination unit, used to determine the height of the first virtual character as the height corresponding to the first virtual character.
[0074] Optionally, the device in the embodiment of the present application may further include: a fourth determination module, used to determine the current position of the virtual camera based on the default parameter value of the virtual camera corresponding to the current game scene before obtaining the height corresponding to the first virtual character in the current game scene.
[0075] Optionally, the device in the embodiment of the present application may further include: a fifth determination module, configured to determine the height interval according to at least one of the following items before determining the height interval into which the height falls: the height of the virtual character in the game scene, the terrain in the game scene.
[0076] The present application also provides an electronic device, such as Figure 4 As shown, it includes a processor 401, a communication interface 402, a memory 403 and a communication bus 404, wherein the processor 401, the communication interface 402, and the memory 403 communicate with each other through the communication bus 404.
[0077] Memory 403, used for storing computer programs;
[0078] Processor 401 is used to execute the program stored in memory 403 to achieve Figure 1 The method steps in Figure 1 The method and steps are the same as in , and will not be repeated here.
[0079] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0080] The communication interface is used for communication between the above terminal and other devices.
[0081] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage. Alternatively, the memory may be at least one storage device located away from the processor.
[0082] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
[0083] In another embodiment provided in the present application, a computer-readable storage medium is also provided, which stores instructions. When the computer-readable storage medium is run on a computer, it enables the computer to execute the method for adjusting the position of a virtual camera in a game scene described in any of the above embodiments.
[0084] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the method for adjusting the position of a virtual camera in a game scene described in any of the above embodiments.
[0085] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0086] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0087] Each embodiment in this specification is described in a related manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiment is generally similar to the method embodiment, so the description is relatively simple. For related parts, refer to the description of the method embodiment.
[0088] The above description is only a preferred embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the scope of protection of the present application.
Claims
1. A method for adjusting the position of a virtual camera in a game scene, comprising: Obtaining a height corresponding to a first virtual character in the current game scene, wherein the first virtual character is a virtual character other than a second virtual character corresponding to the game user; determining a height interval into which the height falls; Determining a preset virtual camera parameter value corresponding to the height based on a mapping relationship between the height interval and the virtual camera parameter value; and Adjusting the position of the virtual camera in the current game scene based on the determined preset virtual camera parameter value; Before obtaining the height of the first virtual character in the current game scene, the method further includes: Determining values of a plurality of different parameter combinations corresponding to a plurality of different height intervals, wherein the virtual camera parameters include a plurality of parameters, and the parameter combination is obtained by combining at least part of the plurality of parameters; and Establishing the mapping relationship between the multiple different altitude intervals and the multiple different parameter combination values; The multiple parameters include an offset parameter of a virtual camera position offset, an offset parameter of a virtual camera observation point position, a width of a dead zone range of the virtual camera observation point, and a height of a dead zone range of the virtual camera observation point; Before determining the height interval into which the height falls, the method further includes: determining the height interval according to at least one of the following: the height of the virtual character in the game scene, the terrain in the game scene.
2. The method according to claim 1, characterized in that The adjusting the position of the virtual camera in the current game scene based on the determined preset virtual camera parameter value includes: Determining, based on the mapping relationship, the value of each parameter in the parameter combination corresponding to the height interval; Comparing the values of the parameters in the parameter combination with the values of the corresponding parameters of the virtual camera in the current game scene; and The position of the virtual camera in the current game scene is adjusted according to the comparison result.
3. The method according to claim 1, characterized in that The obtaining of the height corresponding to the first virtual character in the current game scene includes: In the current game scene, determining a non-player virtual character locked by the second virtual character as the first virtual character; The height of the first virtual character is determined as the height corresponding to the first virtual character.
4. The method according to claim 1, wherein The obtaining of the height corresponding to the first virtual character in the current game scene includes: Determine multiple virtual characters corresponding to non-game players in the current game screen, and select the virtual character with the tallest height, the second tallest height, or the one closest to the second virtual character among the multiple virtual characters as the first virtual character; The height of the first virtual character is determined as the height corresponding to the first virtual character.
5. The method according to claim 1, wherein Before obtaining the height corresponding to the first virtual character in the current game scene, the method further includes: The current position of the virtual camera is determined based on default parameter values of the virtual camera corresponding to the current game scene.
6. A device for adjusting the position of a virtual camera in a game scene, characterized in that: include: An acquisition module, configured to acquire a height corresponding to a first virtual character in a current game scene, wherein the first virtual character is a virtual character other than a second virtual character corresponding to the game user; A first determining module is used to determine the height interval into which the height falls; A second determining module is configured to determine a preset virtual camera parameter value corresponding to the height based on a mapping relationship between the height interval and the virtual camera parameter value; and An adjustment module, configured to adjust the position of the virtual camera in the current game scene based on the determined preset virtual camera parameter values; The device further includes: a third determining module configured to determine values of a plurality of different parameter combinations corresponding to a plurality of different height intervals before obtaining the height of the first virtual character in the current game scene, wherein the virtual camera parameters include a plurality of parameters, and the parameter combination is obtained by combining at least part of the plurality of parameters; and An establishment module is used to establish a mapping relationship between multiple different height intervals and values of multiple different parameter combinations; The multiple parameters include an offset parameter of a virtual camera position offset, an offset parameter of a virtual camera observation point position, a width of a virtual camera observation point dead zone range, and a height of a virtual camera observation point dead zone range; The device further includes: a fifth determining module, configured to determine the height interval according to at least one of the following items before determining the height interval into which the height falls: the height of the virtual character in the game scene, the terrain in the game scene.
7. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory for storing computer programs; A processor, configured to implement the method according to any one of claims 1 to 5 when executing a program stored in a memory.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Program, and image processor with computer for executing program
JP2015212965A