A method, device, electronic device and storage medium for controlling a virtual character

By detecting virtual characters entering the target area in smart wearable devices and calculating thrust data, the problem of lack of realism in thrust effects in virtual reality is solved, real thrust simulation and higher immersion are achieved.

CN118121924BActive Publication Date: 2025-03-14BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410231898.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-29
Publication Date
2025-03-14
Estimated Expiration
2044-02-29

AI Technical Summary

Technical Problem

Physical simulations in virtual reality are difficult to perfectly simulate the thrust effect in the real world, resulting in the lack of realism and detail in the thrust effect in virtual scenes, and the current interaction method cannot provide real object contact and feedback.

Method used

By detecting the virtual character entering the target area in the smart wearable device, determining its movement speed, and using the corresponding thrust calculation strategy to calculate the thrust data based on the comparison results, applying thrust to the virtual character, so that it produces a sticky effect in the target area.

Benefits of technology

It realizes the real thrust effect in virtual scenes, enhances the immersion and experience of the game, and allows players to feel the real object contact and feedback through operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118121924B_ABST
    Figure CN118121924B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of information processing technology, and specifically discloses a control method, device, electronic device and storage medium for a virtual character. The method provided in an embodiment of the present application displays a virtual character and a target area in a virtual scene of a smart wearable device, and detects whether the virtual character enters the area through a sensor or other means. When the virtual character enters the target area, the moving speed of the virtual character is determined, and based on the comparison result, the thrust data is calculated using a corresponding thrust calculation strategy. According to the calculated thrust data, the thrust is applied to the virtual character, so that the virtual character produces a sticky effect in the target area, so that the player can feel the simulated thrust through operation. Finally, the real thrust effect is simulated in the game, and the immersion and experience of the game are enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information processing technology, and in particular to a control method, device, electronic device and storage medium for a virtual character. Background Art

[0002] The physical simulation in virtual reality is usually simplified and it is difficult to perfectly simulate the thrust effect in the real world. Therefore, the thrust effect in the virtual scene lacks realism and details, and the current interaction methods are mainly based on handles, touchpads or gesture recognition, which cannot provide real object contact and feedback. It is difficult for players to accurately simulate the thrust operation of objects through these interaction methods. Summary of the invention

[0003] In view of this, embodiments of the present invention provide a control method, device, electronic device and storage medium for a virtual character to solve the problem that the thrust effect in the virtual scene lacks realism and details, and the current interaction method cannot provide real object contact and feedback.

[0004] In a first aspect, an embodiment of the present invention provides a method for controlling a virtual character, the method being applied to a smart wearable device, the method comprising:

[0005] In response to detecting that the virtual character enters the target area, determining a moving speed of the virtual character;

[0006] Comparing the moving speed with a preset speed to obtain a comparison result;

[0007] Thrust data is calculated based on a thrust calculation strategy corresponding to the comparison result, and a thrust application operation is performed on the virtual character according to the thrust data.

[0008] In one embodiment of the present disclosure, the calculating thrust data based on the thrust calculation strategy corresponding to the comparison result includes:

[0009] Determining a target experience value based on a thrust calculation strategy corresponding to the comparison result, wherein the target experience value is obtained based on historical thrust data corresponding to different moving speeds;

[0010] Acquire a thrust application direction vector and a time length of time that the virtual character enters the target area;

[0011] Based on a mapping relationship between a preset time length and a zoom value, determining a target zoom value corresponding to the time length;

[0012] The thrust data is calculated based on the thrust application direction, the moving speed, the target scaling value, and the target experience value.

[0013] In one embodiment of the present disclosure, determining the target experience value based on the thrust calculation strategy corresponding to the comparison result includes:

[0014] If the comparison result is that the moving speed is less than the preset speed, the first experience value is used as the target experience value;

[0015] If the comparison result is that the moving speed is greater than or equal to the preset speed, a second experience value is used as the target experience value, wherein the second experience value is greater than the first experience value.

[0016] In one embodiment of the present disclosure, the step of obtaining the thrust application direction vector includes:

[0017] Obtaining the moving direction corresponding to the virtual character and the area center of the target area;

[0018] The thrust application direction vector is calculated based on the moving direction and the area center.

[0019] In one embodiment of the present disclosure, the step of applying thrust to the virtual character according to the thrust data includes:

[0020] The input command is shielded within a preset time period, and the thrust data is applied to the virtual character so that the virtual character produces a target effect in the target area.

[0021] In one embodiment of the present disclosure, after performing a thrust application operation on the virtual character according to the thrust data, the method further includes:

[0022] Get input instructions;

[0023] Parsing the input command to obtain the original moving distance of the virtual character;

[0024] Determining a target moving distance of the virtual character based on the distance adjustment ratio within the target area and the original moving distance;

[0025] The virtual character is controlled to move within the target area according to the target moving distance.

[0026] In one embodiment of the present disclosure, after controlling the virtual character to move within the target area according to the target moving distance, the method further includes:

[0027] Detecting a distance value between the virtual character and a center of the target area;

[0028] If the distance value is less than a preset distance value, calculating the target moving speed based on the thrust data and the character mass of the virtual character;

[0029] The target moving speed is set as the maximum moving speed of the virtual character.

[0030] In a second aspect, an embodiment of the present invention provides a control device for a virtual character, the device comprising:

[0031] A detection module, configured to determine a moving speed of the virtual character in response to detecting that the virtual character enters a target area;

[0032] A comparison module, used for comparing the moving speed with a preset speed to obtain a comparison result;

[0033] A processing module is used to calculate thrust data based on a thrust calculation strategy corresponding to the comparison result, and perform a thrust application operation on the virtual character according to the thrust data.

[0034] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, computer instructions being stored in the memory, and the processor executing the method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0035] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method of the first aspect or any corresponding embodiment thereof.

[0036] The method provided in the embodiment of the present application displays a virtual character and a target area in a virtual scene of a smart wearable device, and detects whether the virtual character enters the area through a sensor or other means. When the virtual character enters the target area, the moving speed of the virtual character is determined, and based on the comparison result, the corresponding thrust calculation strategy is used to calculate the thrust data. According to the calculated thrust data, the thrust is applied to the virtual character, so that the virtual character produces a sticky effect in the target area, so that the player can feel the simulated thrust through the operation. Finally, the real thrust effect is simulated in the game, and the immersion and experience of the game are enhanced. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0038] Figure 1is a flow chart of a method for controlling a virtual character according to some embodiments of the present invention;

[0039] Figure 2 is a flow chart of a method for controlling a virtual character according to some embodiments of the present invention;

[0040] Figure 3 is a schematic diagram of a target area according to some embodiments of the present invention;

[0041] Figure 4 is a schematic diagram of a mapping relationship between a time length and a scaling value according to some embodiments of the present invention;

[0042] Figure 5 is a structural block diagram of a method and device for controlling a virtual character according to an embodiment of the present invention;

[0043] Figure 6 It is a schematic diagram of the hardware structure of the electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0045] According to an embodiment of the present invention, a method, device, electronic device and storage medium for controlling a virtual character are provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0046] In this embodiment, a method for controlling a virtual character is provided. Figure 1 is a flow chart of a method for controlling a virtual character according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0047] Step S11, in response to detecting that the virtual character enters the target area, determining the moving speed of the virtual character.

[0048] The method provided in the embodiment of the present application can be applied to smart wearable devices, such as VR devices. In the virtual scene displayed by the smart wearable device, detecting whether the virtual character enters the target area can be achieved by the following steps: First, a virtual character is created in the virtual scene, which can be a graphic model, a character or other forms of visual elements. The virtual character can be presented to the user in 3D on the display screen of the VR device. Secondly, it is detected whether a trigger box falls in the virtual scene. If a trigger box falls, a target area will be generated around the trigger box during the falling process, thereby preventing the virtual character from entering. The target area can be a specific area or a volume in a three-dimensional space. This area is used to simulate the effects of gas flow, wind force, etc. The target area can be understood as a pneumatic simulation area. Then, the sensor technology in the VR device is used to detect the head and hand positions of the user in the virtual scene, as well as the position of the virtual character. By tracking the movement of the user and the virtual character by the sensor, their accurate positions in the three-dimensional space can be obtained. Finally, by comparing the position of the virtual character with the boundary or range of the target area, it is determined whether the virtual character has entered the target area. Distance, collision detection or other algorithms can be used to determine whether the virtual character interacts with the simulation area.

[0049] When the virtual character is detected to enter the target area, corresponding feedback can be provided on the display screen of the VR device, such as changing the color or shape of the virtual character or displaying specific information. By observing the virtual scene in the VR device, the user can know whether the virtual character has currently entered the target area. Through the above steps, it is possible to detect whether the virtual character has entered the target area in the virtual scene in the smart wearable device and provide corresponding visual feedback to the user. It can be used in various application scenarios such as simulating pneumatic effects, conducting virtual reality games or training.

[0050] In one embodiment of the present disclosure, the motion data of the virtual character in the virtual scene is obtained through the sensors and tracking technology in the VR device. The motion data may be information such as the position, direction and acceleration of the virtual character. When it is determined that the virtual character has entered the target area, its speed can be calculated using the motion data of the virtual character. The moving speed is the distance moved by the virtual character in a unit time, which can be calculated by checking the change in the character's position and the time interval. The calculated moving speed is displayed in real time in the virtual scene of the VR device. This can be achieved by displaying a speed indicator around the virtual character, changing the color or shape of the virtual character, etc. The user can see the moving speed of the virtual character by observing the virtual scene. In this way, the moving speed of the virtual character can be determined in the virtual scene. This can be used in various application scenarios such as simulating aerodynamic effects, developing games, and virtual training to provide a more realistic interactive experience and visual feedback.

[0051] Step S12, comparing the moving speed with the preset speed to obtain a comparison result.

[0052] In one embodiment of the present disclosure, a preset speed is set as a reference value according to the requirements of the pneumatic simulation. This can be a fixed value or a value dynamically set according to specific conditions. The moving speed is compared with the preset speed. Numerical comparison, difference calculation or other related methods can be used. Based on the result of the comparison, a comparison result can be obtained. The comparison result is used to indicate whether the speed is greater than, less than or equal to the preset speed, or the calculated speed difference.

[0053] Feedback the comparison results to the user. Corresponding prompts or instructions can be displayed on the display screen of the VR device, such as whether the display speed meets the preset requirements, or giving the specific value of the speed difference. Through the above steps, the moving speed and the preset speed can be compared to obtain the comparison results and provide corresponding feedback to the user. This can be used in virtual training, simulation environments, games and other applications to help users understand the movement of virtual characters and make corresponding judgments and adjustments.

[0054] Step S13, calculating thrust data based on the thrust calculation strategy corresponding to the comparison result, and performing a thrust application operation on the virtual character according to the thrust data.

[0055] In one embodiment of the present disclosure, a thrust calculation strategy is set according to different comparison results. The rules and methods of thrust calculation can be determined according to preset conditions, physical models or other algorithms. According to the previous steps, the comparison result between the moving speed and the preset speed is obtained. Then, based on the comparison result and the thrust calculation strategy, the thrust data to be applied to the virtual character is calculated. The thrust data can be a specific value, or a vector, a direction of force or other related data. The calculated thrust data is applied to the virtual character to implement the thrust application operation. This can be achieved by changing the speed, direction, position or other attributes of the virtual character.

[0056] Finally, the effect of the thrust application operation is fed back in real time in the virtual scene of the VR device. The user can understand the impact of the thrust application operation on the virtual character by observing the movement and behavior of the virtual character in the virtual scene. Through the above steps, the thrust data can be calculated and applied to the virtual character based on the thrust calculation strategy corresponding to the comparison result, thereby realizing the thrust application operation on the virtual character. This can be used in virtual simulation, virtual training, games and other applications to enhance the user's interactive experience and the realism of the virtual scene.

[0057] For example: when the virtual character enters the target area, the thrust data to be applied is calculated based on the comparison result, and the thrust is applied to make the simulated character sticky, thereby presenting the effect that the virtual character is pushed away when the trigger box falls.

[0058] The method provided in the embodiment of the present application displays a virtual character and a target area in a virtual scene of a smart wearable device, and detects whether the virtual character enters the area through a sensor or other means. When the virtual character enters the target area, the moving speed of the virtual character is determined, and based on the comparison result, the corresponding thrust calculation strategy is used to calculate the thrust data. According to the calculated thrust data, the thrust is applied to the virtual character, so that the virtual character produces a sticky effect in the target area, so that the player can feel the simulated thrust through the operation. Finally, the real thrust effect is simulated in the game, and the immersion and experience of the game are enhanced.

[0059] Figure 2 is a flow chart of a method for controlling a virtual character according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0060] Step S21, in response to detecting that the virtual character enters the target area, determining the moving speed of the virtual character. For details, please refer to step S11 in the above embodiment, which will not be described in detail here.

[0061] Step S22, comparing the moving speed with the preset speed to obtain a comparison result.

[0062] In one embodiment of the present disclosure, please refer to step S13 in the above embodiment for details, which will not be repeated here.

[0063] Step S23, calculating thrust data based on the thrust calculation strategy corresponding to the comparison result, and performing a thrust application operation on the virtual character according to the thrust data.

[0064] In one embodiment of the present disclosure, the thrust data is calculated based on the thrust calculation strategy corresponding to the comparison result, including the following steps A1-A4:

[0065] Step A1, determining a target experience value based on a thrust calculation strategy corresponding to a comparison result, wherein the target experience value is obtained based on historical thrust data corresponding to different moving speeds.

[0066] In one embodiment of the present disclosure, the target experience value is determined based on the thrust calculation strategy corresponding to the comparison result, including: if the comparison result is that the moving speed is less than the preset speed, the first experience value is used as the target experience value; if the comparison result is that the moving speed is greater than or equal to the preset speed, the second experience value is used as the target experience value, wherein the second experience value is greater than the first experience value. The first experience value and the second experience value are a value obtained based on past historical data and observations, and the first experience value is used to make the thrust data closer to the actual situation when the moving speed is lower than the preset speed. The second experience value is used to make the thrust data closer to the actual situation when the moving speed is higher than the preset speed. It can be understood that the experience value is used as a reference indicator to assist decision-making and calculate thrust data.

[0067] The target experience value is determined based on the thrust calculation strategy corresponding to the comparison result. Different target experience values ​​are set according to different comparison results to achieve the required thrust effect. This can be applied to application scenarios such as virtual training and game development. According to the comparison results between the moving speed and the preset speed, a suitable target experience value is set to guide the action of the virtual character.

[0068] Step A2, obtaining the thrust application direction vector and the time length of the virtual character entering the target area.

[0069] In one embodiment of the present disclosure, obtaining the thrust application direction vector includes: obtaining the moving direction corresponding to the virtual character and the area center of the target area; and calculating the thrust application direction vector based on the moving direction and the area center.

[0070] Specifically, the sensor technology in the VR device is used to obtain the current position and the previous position of the virtual character, and then the vector difference between the two positions is calculated. The vector difference reflects the moving direction of the virtual character. At the same time, the coordinates of the center point of the target area (such as Figure 3 The center point coordinates may be pre-set fixed coordinates or calculated based on the range of the simulation area. Based on the moving direction of the virtual character and the center point of the target area, the thrust application direction vector may be calculated. The thrust application direction vector may be determined by combining the center of the area with the moving direction of the virtual character.

[0071] For example, the center of the region can be used as the starting point of the thrust, and the moving direction of the virtual character can be used as the direction of the thrust, thereby obtaining a thrust application direction vector pointing in a specific direction. Through the above steps, the moving direction corresponding to the virtual character and the center of the region of the target region can be obtained, and the thrust application direction vector can be calculated based on this information.

[0072] In one embodiment of the present disclosure, after it is determined that the virtual character enters the target area, the clock is triggered to start timing, so that the length of time the virtual character has been in the target area can be obtained.

[0073] Step A3: determining a target zoom value corresponding to the time length based on a mapping relationship between a preset time length and a zoom value.

[0074] Specifically, the mapping rule between the preset time length and the scaling value is set according to the requirements. This can be a linear mapping, exponential mapping, custom function and other different relationship models. Determine the time length to be queried. According to the mapping relationship between the preset time length and the scaling value, find the target scaling value corresponding to the query time length by table lookup, mathematical calculation or other related methods.

[0075] It should be noted that the target scaling value is a floating point value, which represents the value of the floating point curve. The entire force action time is about 1.5 seconds. The mapping relationship between the preset time length and the scaling value is as follows Figure 4 As shown, the time dimension (X-axis) is used as input and the scaling value (Y-axis) is used as output. The thrust time is mapped to the curve, so that the corresponding scaling value can be obtained.

[0076] Step A4, calculating thrust data based on the thrust application direction, the moving speed, the target scaling value and the target experience value.

[0077] Specifically, when the comparison result shows that the moving speed is less than the preset speed, the thrust data is calculated as follows: Impusle = Dir (1-Dir.size()) × CharacterSpeed ​​× CurveValue × 1.2f. In the formula, Impusle represents the thrust data, Dir is the direction, (1-Dir.size()) is the length of the direction vector, CharacterSpeed ​​is the moving speed, CurveValue is the target scaling value, and 1.2f is the first experience value.

[0078] When the comparison result shows that the moving speed is greater than or equal to the preset speed, the thrust data is calculated as follows:

[0079] Impusle = Dir (1-Dir.size()) × CharacterSpeed ​​× CurveValue × 1.5f. In the formula, Impusle represents the thrust data, Dir is the direction, (1-Dir.size()) is the length of the direction vector, CharacterSpeed ​​is the moving speed, CurveValue is the target scaling value, and 1.5f is the first experience value.

[0080] In one embodiment of the present disclosure, a thrust application operation is performed on a virtual character according to thrust data, including: shielding input instructions within a preset time period, and applying thrust data to the virtual character so that the virtual character produces a target effect in a target area.

[0081] Specifically, before applying thrust to the virtual character, the input command of the smart wearable device is shielded within a preset time (such as 0.2s). This can ensure the effectiveness of the thrust operation and prevent the user from applying other operations to the virtual character during the thrust application process. Applying the thrust data to the virtual character includes applying the thrust magnitude and direction to the virtual character. This can be achieved by modifying the position, velocity or acceleration of the virtual character.

[0082] It should be noted that the purpose of applying thrust is to make the virtual character produce a target effect in the target area, and the target effect can be a sticky effect. This means that the virtual character will produce a damping effect under the thrust, making it difficult to move or change direction. Finally, a sticky effect is simulated in the target area.

[0083] The method provided in the embodiment of the present application displays a virtual character and a target area in a virtual scene of a smart wearable device, and detects whether the virtual character enters the area through a sensor or other means. When the virtual character enters the target area, the moving speed of the virtual character is determined, and based on the comparison result, the corresponding thrust calculation strategy is used to calculate the thrust data. According to the calculated thrust data, the thrust is applied to the virtual character, so that the virtual character produces a sticky effect in the target area, so that the player can feel the simulated thrust through the operation. Finally, the real thrust effect is simulated in the game, and the immersion and experience of the game are enhanced.

[0084] In one embodiment of the present disclosure, after applying thrust to the virtual character according to the thrust data, the method further includes the following steps B1-B4:

[0085] Step B1, obtaining input instructions.

[0086] Specifically, sensors (such as accelerometers, gyroscopes, etc.) on smart wearable devices are used to read relevant data. These sensors can detect information such as user movements, postures, gestures, etc. The raw data read by the sensors is parsed and processed to obtain input instructions. The parsing process may involve operations such as filtering the data and calibrating the gyroscope to improve the accuracy and stability of the data. Based on the parsed data, corresponding control instructions are generated. The control instructions can be directional control (such as moving up, down, left, and right) or other custom operations.

[0087] Step B2, parsing the input command to obtain the original moving distance of the virtual character.

[0088] Specifically, control instructions are obtained from smart wearable devices or other input devices. These instructions can be user gestures, actions, button clicks, etc. The obtained control instructions are parsed to determine the direction and method in which the user wants the virtual character to move. For example, the direction of the gesture, the click of a button, etc. According to the parsed control instructions, the distance the virtual character needs to move is determined. This can be determined according to different situations and needs. When determining the moving distance, time and speed factors also need to be considered. Some algorithms or formulas can be used to calculate the specific moving distance so that the virtual character moves at a suitable speed within a given time.

[0089] Step B3, determining the target moving distance of the virtual character based on the distance adjustment ratio within the target area and the original moving distance.

[0090] Specifically, the original moving distance is adjusted according to the distance adjustment ratio in the target area to obtain the target moving distance of the virtual character. This adjustment ratio can be determined according to design requirements or test results to simulate the influence of aerodynamic effects on the movement of the virtual character.

[0091] Step B4, controlling the virtual character to move within the target area according to the target moving distance.

[0092] Specifically, first, the position information of the current virtual character needs to be obtained. According to the current position and the target moving distance, the target position of the virtual character in the target area is calculated. For example, the current position and the target moving distance can be added or subtracted to calculate.

[0093] In one embodiment of the present disclosure, after controlling the virtual character to move within the target area according to the target moving distance, the method also includes: detecting the distance value between the virtual character and the area center of the target area; if the distance value is less than a preset distance value, calculating the target moving speed based on the thrust data and the character mass of the virtual character; and setting the target moving speed as the maximum moving speed of the virtual character.

[0094] Specifically, obtaining the position of the virtual character and the target area: First, the position information of the virtual character and the target area needs to be obtained, which can be coordinates or other appropriate representations. According to the position of the virtual character and the target area, the distance between the virtual character and the center of the area is calculated. The calculated distance value is compared with the preset distance.

[0095] If the distance value is less than the preset distance, the corresponding movement speed calculation and limitation are required. Calculate the target movement speed based on the thrust data and the character mass (or mass parameter) of the virtual character. Set the calculated target movement speed as the maximum movement speed of the virtual character. Subsequent detection is based on the control operation of the smart wearable device. If the control operation is used to control the virtual character to accelerate, it is determined whether the accelerated movement speed exceeds the maximum movement speed. If it exceeds the maximum movement speed, the virtual character is controlled to move at the maximum movement speed. In this way, the movement speed of the virtual character can be calculated and limited to ensure that it moves within a reasonable range and control the speed during acceleration, thereby providing a more realistic and controllable gaming experience.

[0096] In this embodiment, a control device for a virtual character is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0097] This embodiment provides a control device for a virtual character, such as Figure 5 As shown, including:

[0098] A detection module 61, for determining a moving speed of the virtual character in response to detecting that the virtual character enters a target area;

[0099] A comparison module 62, used for comparing the moving speed with a preset speed to obtain a comparison result;

[0100] The processing module 63 is used to calculate the thrust data based on the thrust calculation strategy corresponding to the comparison result, and perform a thrust application operation on the virtual character according to the thrust data.

[0101] In one embodiment of the present disclosure, the processing module 63 includes:

[0102] A determination unit, configured to determine a target experience value based on a thrust calculation strategy corresponding to the comparison result, wherein the target experience value is obtained based on historical thrust data corresponding to different moving speeds;

[0103] An acquisition unit, used for acquiring a thrust application direction vector and a time length of time for the virtual character to enter a target area;

[0104] A query unit, configured to determine a target zoom value corresponding to a time length based on a mapping relationship between a preset time length and a zoom value;

[0105] The calculation unit is used to calculate thrust data based on the thrust application direction, the moving speed, the target scaling value and the target experience value.

[0106] In one embodiment of the present disclosure, the determination unit is used to use the first experience value as the target experience value if the comparison result is that the moving speed is less than the preset speed; if the comparison result is that the moving speed is greater than or equal to the preset speed, use the second experience value as the target experience value, wherein the second experience value is greater than the first experience value.

[0107] In one embodiment of the present disclosure, the acquisition unit is used to acquire the moving direction corresponding to the virtual character and the area center of the target area; and calculate the thrust application direction vector based on the moving direction and the area center.

[0108] In one embodiment of the present disclosure, the processing module 63 is used to shield the input command within a preset time period and apply the thrust data to the virtual character so that the virtual character produces a target effect in a target area.

[0109] In one embodiment of the present disclosure, the device also includes: a control module, which is used to obtain input instructions; parse the input instructions to obtain the original moving distance of the virtual character; determine the target moving distance of the virtual character based on the distance adjustment ratio in the target area and the original moving distance; and control the virtual character to move according to the target moving distance in the target area.

[0110] In one embodiment of the present disclosure, the device also includes: a calculation module, used to detect the distance value between the virtual character and the area center of the target area; if the distance value is less than a preset distance value, the target movement speed is calculated based on the thrust data and the character mass of the virtual character; and the target movement speed is set as the maximum movement speed of the virtual character.

[0111] See also Figure 6 , Figure 6 is a schematic diagram of the structure of an electronic device provided by an optional embodiment of the present invention, such as Figure 6 As shown, the electronic device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system).

[0112] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0113] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0114] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the use of an electronic device based on the presentation of a small program landing page, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0115] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0116] The electronic device further comprises a communication interface 30 for the electronic device to communicate with other devices or a communication network.

[0117] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0118] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0119] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for controlling a virtual character, characterized in that: The method comprises: In response to detecting that the virtual character enters the target area, determining a moving speed of the virtual character; Comparing the moving speed with a preset speed to obtain a comparison result; The thrust data is calculated based on the thrust calculation strategy corresponding to the comparison result, and the thrust application operation is performed on the virtual character according to the thrust data, wherein the thrust data is calculated based on the thrust application direction, the moving speed of the virtual character, the target scaling value and the target experience value, the target experience value is obtained based on the historical thrust data corresponding to different moving speeds, and the target scaling value is determined by the length of time the virtual character enters the target area.

2. The method according to claim 1, characterized in that The calculating the thrust data based on the thrust calculation strategy corresponding to the comparison result includes: Determining a target experience value based on a thrust calculation strategy corresponding to the comparison result; Acquire a thrust application direction vector and a time length of time that the virtual character enters the target area; Based on a mapping relationship between a preset time length and a zoom value, determining a target zoom value corresponding to the time length; The thrust data is calculated based on the thrust application direction, the moving speed, the target scaling value, and the target experience value.

3. The method according to claim 2, characterized in that The determining of the target experience value based on the thrust calculation strategy corresponding to the comparison result includes: If the comparison result is that the moving speed is less than the preset speed, the first experience value is used as the target experience value; If the comparison result is that the moving speed is greater than or equal to the preset speed, a second experience value is used as the target experience value, wherein the second experience value is greater than the first experience value.

4. The method according to claim 2, characterized in that: The step of obtaining the thrust application direction vector comprises: Obtaining the moving direction corresponding to the virtual character and the area center of the target area; The thrust application direction vector is calculated based on the moving direction and the area center.

5. The method according to claim 1, characterized in that The step of applying thrust to the virtual character according to the thrust data comprises: The input command is shielded within a preset time period, and the thrust data is applied to the virtual character so that the virtual character produces a target effect in the target area.

6. The method according to claim 1, characterized in that After performing a thrust application operation on the virtual character according to the thrust data, the method further includes: Get input instructions; Parsing the input command to obtain the original moving distance of the virtual character; Determining a target moving distance of the virtual character based on the distance adjustment ratio within the target area and the original moving distance; The virtual character is controlled to move within the target area according to the target moving distance.

7. The method according to claim 6, characterized in that After controlling the virtual character to move within the target area according to the target moving distance, the method further includes: Detecting a distance value between the virtual character and a center of the target area; If the distance value is less than a preset distance value, calculating the target moving speed based on the thrust data and the character mass of the virtual character; The target moving speed is set as the maximum moving speed of the virtual character.

8. A control device for a virtual character, characterized in that: The device comprises: A detection module, configured to determine a moving speed of the virtual character in response to detecting that the virtual character enters a target area; A comparison module, used for comparing the moving speed with a preset speed to obtain a comparison result; A processing module is used to calculate thrust data based on a thrust calculation strategy corresponding to the comparison result, and perform a thrust application operation on the virtual character according to the thrust data, wherein the thrust data is calculated based on a thrust application direction, a moving speed of the virtual character, a target scaling value, and a target experience value, the target experience value is obtained based on historical thrust data corresponding to different moving speeds, and the target scaling value is determined by using the length of time the virtual character enters the target area.

9. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 7.

11. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Motion sensing game method based on pushing action

    CN116196626A