Method and device for controlling attribute value of virtual character, electronic device and storage medium

文档序号:1259205 发布日期:2020-08-25 浏览:28次 中文

阅读说明:本技术 虚拟角色的属性值控制方法及装置、电子设备、存储介质 (Method and device for controlling attribute value of virtual character, electronic device and storage medium ) 是由 李瑞恒 于 2020-05-13 设计创作,主要内容包括:本申请实施例提供了一种虚拟角色的属性值控制方法及装置、电子设备、存储介质。该方法包括:获取虚拟角色的当前属性值;在当前属性值低于预设属性阈值时,获取虚拟角色的活动状态;根据虚拟角色的活动状态,执行与活动状态对应的虚拟物品选取策略;根据选取的虚拟物品,自动调节虚拟角色相应的属性值。上述方法减少了用户操作,由于无需用户繁复操作,减少了响应次数,提高了响应速度。(The embodiment of the application provides a method and a device for controlling attribute values of virtual roles, electronic equipment and a storage medium. Acquiring a current attribute value of a virtual role; when the current attribute value is lower than a preset attribute threshold value, acquiring the activity state of the virtual role; executing a virtual article selection strategy corresponding to the activity state according to the activity state of the virtual role; and automatically adjusting the corresponding attribute value of the virtual character according to the selected virtual article. The method reduces user operation, reduces response times and improves response speed because complex operation of the user is not needed.)

1. A method for controlling attribute values of virtual characters is characterized by comprising the following steps:

acquiring a current attribute value of the virtual role;

when the current attribute value is lower than a preset attribute threshold value, acquiring the activity state of the virtual role;

executing a virtual article selection strategy corresponding to the activity state according to the activity state of the virtual role;

and automatically adjusting the corresponding attribute value of the virtual character according to the selected virtual article.

2. The method according to claim 1, wherein the obtaining the active state of the virtual character when the current attribute value is lower than a preset attribute threshold value comprises:

showing an attribute identifier used for indicating the current attribute value of the virtual role;

and when the current attribute value is lower than a preset attribute threshold value, responding to a trigger instruction of the attribute identifier to acquire the activity state of the virtual role.

3. The method of claim 1 or 2, wherein the obtaining the activity state of the virtual character comprises:

acquiring the latest interaction time point of the virtual character and other characters in the virtual scene;

and calculating the time difference between the interaction time point and the current time point, wherein the time difference is used for representing the activity state of the virtual character.

4. The method according to claim 3, wherein executing a virtual item selection policy corresponding to the activity state according to the activity state of the virtual character comprises:

and executing a virtual article selection strategy corresponding to the time difference according to the time difference between the interaction time point and the current time point.

5. The method according to claim 4, wherein executing a virtual article selection policy corresponding to the time difference according to the time difference between the interaction time point and the current time point comprises:

and if the time difference is smaller than a first threshold value, selecting the virtual article with the shortest unlocking time according to the unlocking time correspondingly configured for each virtual article.

6. The method according to claim 5, wherein the selecting the virtual article with the shortest unlocking time according to the unlocking time correspondingly configured for each virtual article comprises:

calculating a numerical difference between the current attribute value and a target attribute value;

and selecting a plurality of virtual articles with the shortest unlocking time according to the unlocking time correspondingly configured for each virtual article, wherein the sum of the attribute value increment amounts corresponding to the plurality of virtual articles is greater than or equal to the numerical difference.

7. The method according to claim 5, wherein if the time difference is smaller than the first threshold, after selecting the virtual article with the shortest unlocking time according to the unlocking time correspondingly configured for each virtual article, the method further comprises:

if the time difference is smaller than the first threshold and larger than the second threshold, displaying a modification control corresponding to the selected virtual article; the first threshold is greater than the second threshold;

when a triggering instruction of the modification control is received, displaying a virtual article list corresponding to the virtual role;

and when a selection instruction of the designated item in the virtual item list is received, replacing the selected virtual item with the designated item according to the designated item indicated by the selection instruction.

8. The method according to claim 4, wherein executing a virtual article selection policy corresponding to the time difference according to the time difference between the interaction time point and the current time point comprises:

and if the time difference is larger than or equal to a first threshold value, selecting the virtual articles with the largest quantity according to the inventory quantity of the virtual articles corresponding to the virtual character.

9. The method according to claim 8, wherein the selecting the largest number of virtual items according to the inventory amount of the virtual items corresponding to the virtual character comprises:

calculating a numerical difference between the current attribute value and a target attribute value;

and selecting a plurality of virtual articles with the largest quantity according to the inventory quantity of the virtual articles corresponding to the virtual roles, wherein the sum of the attribute value increment quantities corresponding to the virtual articles is greater than or equal to the numerical difference.

10. The method according to claim 1, wherein after executing the virtual item selection policy corresponding to the active state according to the active state of the virtual character, the method comprises:

displaying the selected virtual article;

and displaying the unlocking progress of the selected virtual article according to the unlocking time correspondingly configured for each virtual article.

11. The method according to claim 1, wherein automatically adjusting the corresponding attribute values of the virtual character according to the selected virtual item comprises:

and adjusting the attribute value of the virtual role according to the attribute value increasing speed and the attribute value increasing amount correspondingly configured to the selected virtual article and according to the attribute value increasing speed until the adjustment amount of the attribute value of the virtual role reaches the attribute value increasing amount or the attribute value of the virtual role reaches the upper limit.

12. An attribute value control device for a virtual character, comprising:

the attribute acquisition module is used for acquiring the current attribute value of the virtual role;

the state acquisition module is used for acquiring the activity state of the virtual role when the current attribute value is lower than a preset attribute threshold value;

the strategy execution module is used for executing a virtual article selection strategy corresponding to the activity state according to the activity state of the virtual role;

and the attribute adjusting module is used for automatically adjusting the corresponding attribute value of the virtual role according to the selected virtual article.

13. An electronic device, characterized in that the electronic device comprises:

a processor;

a memory for storing processor-executable instructions;

wherein the processor is configured to perform the attribute value control method of the virtual character according to any one of claims 1 to 11.

14. A computer-readable storage medium, characterized in that the storage medium stores a computer program executable by a processor to perform the attribute value control method of a virtual character according to any one of claims 1 to 11.

Technical Field

The present disclosure relates to the field of data processing technologies, and in particular, to a method and an apparatus for controlling attribute values of virtual roles, an electronic device, and a computer-readable storage medium.

Background

With the development of multimedia technology and the popularization of wireless networks, people's entertainment activities become more and more abundant, such as playing games through handheld media devices, playing stand-alone games or online games through computers, and various game types, such as shooting games, adventure games, simulation games, role playing games, leisure chess and card games, and other games.

In most types of games, a player may choose to play with other players, as well as with an in-game AI (a non-player controlled character). For example, in a shooting game, when the blood streak of a player character drops, the blood can be enriched by using virtual articles such as medicines and bandages, so that the situation that the player character directly dies and is affected by the game experience is avoided.

However, at present, when the blood volume is insufficient due to the fact that a character is attacked, a player needs to click various virtual articles to enrich the blood, the operation is complex, the response times of equipment are increased, and the response time is prolonged.

Disclosure of Invention

The embodiment of the application provides a method for controlling the attribute value of a virtual role, which can simplify user operation, thereby reducing response times and response time.

The embodiment of the application provides a method for controlling attribute values of virtual roles, which comprises the following steps:

acquiring a current attribute value of the virtual role;

when the current attribute value is lower than a preset attribute threshold value, acquiring the activity state of the virtual role;

executing a virtual article selection strategy corresponding to the activity state according to the activity state of the virtual role;

and automatically adjusting the corresponding attribute value of the virtual character according to the selected virtual article.

In an embodiment, the obtaining the activity state of the virtual character when the current attribute value is lower than a preset attribute threshold includes:

showing an attribute identifier used for indicating the current attribute value of the virtual role;

and when the current attribute value is lower than a preset attribute threshold value, responding to a trigger instruction of the attribute identifier to acquire the activity state of the virtual role.

In an embodiment, the obtaining the activity state of the virtual character includes:

acquiring the latest interaction time point of the virtual character and other characters in the virtual scene;

and calculating the time difference between the interaction time point and the current time point, wherein the time difference is used for representing the activity state of the virtual character.

In an embodiment, executing a virtual item selection policy corresponding to an active state according to the active state of the virtual role includes:

and executing a virtual article selection strategy corresponding to the time difference according to the time difference between the interaction time point and the current time point.

In an embodiment, according to a time difference between the interaction time point and a current time point, executing a virtual article selection policy corresponding to the time difference, including:

and if the time difference is smaller than a first threshold value, selecting the virtual article with the shortest unlocking time according to the unlocking time correspondingly configured for each virtual article.

In an embodiment, the selecting a virtual article with the shortest unlocking time according to the unlocking time correspondingly configured for each virtual article includes:

calculating a numerical difference between the current attribute value and a target attribute value;

and selecting a plurality of virtual articles with the shortest unlocking time according to the unlocking time correspondingly configured for each virtual article, wherein the sum of the attribute value increment amounts corresponding to the plurality of virtual articles is greater than or equal to the numerical difference.

In an embodiment, if the time difference is smaller than the first threshold, after the virtual article with the shortest unlocking time is selected according to the unlocking time correspondingly configured for each virtual article, the method further includes:

if the time difference is smaller than the first threshold and larger than the second threshold, displaying a modification control corresponding to the selected virtual article; the first threshold is greater than the second threshold;

when a triggering instruction of the modification control is received, displaying a virtual article list corresponding to the virtual role;

and when a selection instruction of the designated item in the virtual item list is received, replacing the selected virtual item with the designated item according to the designated item indicated by the selection instruction.

In an embodiment, according to a time difference between the interaction time point and a current time point, executing a virtual article selection policy corresponding to the time difference, including:

and if the time difference is larger than or equal to a first threshold value, selecting the virtual articles with the largest quantity according to the inventory quantity of the virtual articles corresponding to the virtual character.

In an embodiment, the selecting the virtual item with the largest quantity according to the inventory amount of the virtual item corresponding to the virtual character includes:

calculating a numerical difference between the current attribute value and a target attribute value;

and selecting a plurality of virtual articles with the largest quantity according to the inventory quantity of the virtual articles corresponding to the virtual roles, wherein the sum of the attribute value increment quantities corresponding to the virtual articles is greater than or equal to the numerical difference.

In an embodiment, after executing a virtual item selection policy corresponding to an active state according to the active state of the virtual character, the method includes:

displaying the selected virtual article;

and displaying the unlocking progress of the selected virtual article according to the unlocking time correspondingly configured for each virtual article.

In an embodiment, the automatically adjusting the attribute value corresponding to the virtual character according to the selected virtual article includes:

and adjusting the attribute value of the virtual role according to the attribute value increasing speed and the attribute value increasing amount correspondingly configured to the selected virtual article and according to the attribute value increasing speed until the adjustment amount of the attribute value of the virtual role reaches the attribute value increasing amount or the attribute value of the virtual role reaches the upper limit.

An embodiment of the present application further provides an attribute value control apparatus for a virtual role, including:

the attribute acquisition module is used for acquiring the current attribute value of the virtual role;

the state acquisition module is used for acquiring the activity state of the virtual role when the current attribute value is lower than a preset attribute threshold value;

the strategy execution module is used for executing a virtual article selection strategy corresponding to the activity state according to the activity state of the virtual role;

and the attribute adjusting module is used for automatically adjusting the corresponding attribute value of the virtual role according to the selected virtual article.

An embodiment of the present application further provides an electronic device, where the electronic device includes:

a processor;

a memory for storing processor-executable instructions;

wherein the processor is configured to perform the attribute value control method of the virtual character.

An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored, and the computer program is executable by a processor to implement the method for controlling the attribute value of the virtual character.

According to the technical scheme provided by the embodiment of the application, when the current attribute value is lower than the preset attribute threshold value, the virtual article selection strategy used in the active state is executed according to the active state of the virtual character, so that the virtual article matched with the active state can be automatically selected, the attribute value of the virtual character is adjusted, and the user operation is reduced. And the complicated operation of a user is not needed, so that the response times are reduced, and the response speed is improved.

Drawings

In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required to be used in the embodiments of the present application will be briefly described below.

Fig. 1 is a schematic view of an application scenario of a method for controlling attribute values of virtual roles according to an embodiment of the present application;

fig. 2 is a schematic structural diagram of an electronic device according to an embodiment of the present application;

fig. 3 is a schematic flowchart of a method for controlling attribute values of a virtual character according to an embodiment of the present application;

FIG. 4 is a schematic diagram of a user interface provided by an embodiment of the present application;

fig. 5 is a detailed flowchart of step S320 provided in the embodiment of the present application;

FIG. 6 is a schematic diagram illustrating implementation of different selection strategies according to an activity status according to an embodiment of the present disclosure;

FIG. 7 is a schematic view of a user interface provided by another embodiment of the present application;

fig. 8 is a block diagram of an attribute value control device for a virtual character according to an embodiment of the present application.

Detailed Description

The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.

Like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.

Fig. 1 is a schematic view of an application scenario of a method for controlling attribute values of a virtual character according to an embodiment of the present application. As shown in fig. 1, the application scenario may include a terminal 110, where the terminal 110 may install an application program such as a game, and execute the method for controlling the attribute value of the virtual character according to the embodiment of the present application. The terminal 110 may be a smartphone, a tablet, a desktop computer, etc.

In an embodiment, the application scenario may further include a server 120, the server 120 may be communicatively connected to the terminal 110 through a network, and the server 120 may provide a part of data calculation and data storage services for the terminal 110 according to needs. For example, in the following embodiments, the calculation of the time difference may also be performed by the server 120, the calculation of the attribute value of the virtual character may also be performed by the server 120, and the terminal 110 may obtain the required data from the server 120 for display.

In an embodiment, the application scenario may include a plurality of terminals 110, and the plurality of terminals 110 may be communicatively connected through the server 120, so that data interaction between the terminals 110 and the server 120, and data interaction between the server 120 and another terminal 110 may be converted into interaction between one virtual character and another virtual character in the virtual scenario. The virtual character refers to a virtual movable object such as a human being, an animal and the like in a virtual scene. A virtual scene refers to a fictional environment, such as a game scene. Generally, a user of a terminal 110 may correspond to a virtual character, and the terminal 110 may receive an operation (e.g., sliding, clicking a screen, etc.) instruction from the user and may convert the operation into control (e.g., crawling, shooting, etc.) of the virtual character.

For example, in a shooting game, the terminal a receives a shooting instruction of a user, can control the virtual character a to perform a shooting action, and sends the shooting position and direction of the virtual character a to the server, and the server can calculate a shooting destination and determine that the shooting destination has the virtual character B according to the position of each virtual character. And sending a virtual character B hitting instruction to the terminal A and the terminal B, and displaying the hit picture of the virtual character B by the terminal A and the terminal B, thereby realizing the interaction of the virtual character A and the virtual character B in a virtual scene.

Fig. 2 is a schematic structural diagram of an electronic device according to an embodiment of the present application, where the electronic device 200 may be the terminal 110. The electronic device 200 may include a processor 220; a memory 210 for storing instructions executable by processor 220; wherein the processor 220 is configured to execute an attribute value control method of a virtual character according to the following embodiments of the present application.

The Memory 210 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk or optical disk.

The present application also provides a computer-readable storage medium, in which a computer program is stored, where the computer program can be executed by the processor 220 to complete the method for controlling the attribute value of the virtual character provided in the embodiments of the present application.

Fig. 3 is a schematic flowchart of an attribute value control method for a virtual character according to an embodiment of the present application. The method may be performed by the terminal described above, and the method may include the following steps S310 to S330.

In step S310, the current attribute value of the virtual character is acquired.

The current attribute value is used for representing the energy, blood volume or remaining life of the virtual character at the current moment. The current time may be the time at which the attribute value is obtained. The current attribute value can be cached in the terminal and obtained at regular time according to the designated time interval. In one embodiment, the attribute value of the virtual character may be 100% at the beginning of the game, and based on the type of injury, the attribute value may be decreased accordingly until the value is decreased to 0, and the game is ended or the virtual character is revived after waiting for a certain time. In other embodiments, the attribute values of the virtual character may also gradually decrease over time as the game progresses until the value decreases to 0, the game ends, or a certain time is waited for revival.

In order to enrich game content and improve user experience, in the prior art, a user can trigger corresponding operations, corresponding attribute values are added to virtual characters based on different operations, and the phenomenon that the virtual characters are eliminated when a game is started is avoided, so that the game is forced to quit. However, at present, the operation is complicated, and a user needs to operate other buttons to increase the attribute value of the virtual character in the process of controlling the virtual character in a battle, so that the operation is complicated, the response times of the terminal are increased, and the response time of each time is prolonged. In addition, in the following steps S320 and S340 of the embodiment of the present application, the attribute value may be automatically increased based on the activity state of the virtual character, so that the number of user operations and responses may be reduced, and the response speed may be increased.

In step S320, when the current attribute value is lower than a preset attribute threshold, the activity state of the virtual character is obtained.

In an embodiment, the preset attribute threshold may be 100%, 80%, 50% or 30%, and when the current attribute value is lower than the preset attribute threshold, it indicates that the energy, blood volume or life of the virtual character is insufficient, and needs to be increased, so that the activity state of the virtual character can be obtained at this time.

The activity state is used for representing the activity degree of the virtual character in the virtual scene. In the case of a shooting game, for example, the activity states can be classified into a battle state and a fighting state. For example, the number of shots or the number of hits of the virtual character in 10 seconds may be counted, and if the number of shots or the number of hits is greater than a specified value (which may be set empirically), it indicates that the virtual character is in a state of heavy combat, and conversely, if the number of shots or the number of hits is less than or equal to the specified value, it indicates that the virtual character is in a state of getting out of combat. According to the actual situation, the activity state of the virtual character can be more than two, for example, a thinner numerical value interval can be set, so that the fierce combat state can be further divided into a first state and a second state.

In addition to representing the activity state of the virtual character by the number of shots or the number of hit times in a unit time, other parameters can be used to represent the activity state of the virtual character according to actual needs. For example, the time difference between the latest shooting time or the time of being hit and the current time point is larger than the threshold value, which indicates that the player is in a fighting state, and conversely, indicates that the player is still in a fighting state. For other game types, such as fighting games, action games, role playing games, strategy games, etc., other indexes (such as number of punching, number of released weapons, etc.) can be selected to distinguish the active states of the virtual characters according to the game contents.

In step S330, according to the activity state of the virtual character, a virtual item selection policy corresponding to the activity state is executed.

The virtual article selection strategy refers to an algorithm program for determining which virtual article or articles to select. The virtual article selection strategy may be to select a virtual article with the fastest attribute value increase, select a virtual article with the largest number, and select a virtual article with the largest attribute value increase. The characteristics of each virtual article can be configured in advance and stored in the terminal. Virtual items refer to fictional items in a virtual scene, such as drugs, bandages, beverages, first-aid kits, and the like.

Assuming that the virtual character is in a combat fierce state, an algorithm corresponding to the combat fierce state may be executed to determine which virtual article or articles to select. Assuming that the virtual character is in a combat-away state, an algorithm corresponding to the combat-away state may be executed to determine which virtual item or items to select. When the virtual character is in different activity states, different virtual article selection strategies can be executed, so that the automatically selected virtual article can be in accordance with the activity state of the virtual character at the current time as far as possible.

For convenience of understanding, the attribute value is taken as a blood volume, for example. In an embodiment, when the current blood volume is less than 100%, the virtual object that can increase the attribute value fastest is selected assuming that the virtual character is in a violent combat state, and the virtual object with the largest number is selected assuming that the virtual character is in a war-out state.

In an embodiment, the terminal may display the selected virtual item, and display the unlocking progress of the selected virtual item according to the unlocking time correspondingly configured for each virtual item.

The unlocking time refers to the preset effective time of the virtual article, such as 3 seconds. In one embodiment, during the unlocking time of the virtual item, a corresponding attribute value may be added to the virtual character. The unlocking time for different kinds of virtual items may be different. The unlocking progress is used for visually showing the user how much the current unlocking task is completed. The display time refers to the display time of the virtual article, and if the display time is 1 second and the unlocking time is 3 seconds, the display time indicates that the unlocking progress is one third, the terminal can directly display 1/3 to indicate the unlocking progress of the virtual article, and the progress bar filled with 1/3 can also indicate the unlocking progress of the virtual article.

The terminal can display the first virtual object firstly, and adjust the attribute value of the virtual character according to the attribute value increment of the first virtual object within the unlocking time of the first virtual object. And then displaying the second virtual article, and adjusting the attribute value of the virtual character according to the attribute value increment of the first virtual article within the unlocking time of the second virtual article.

FIG. 4 is a schematic illustration of a game interface according to an embodiment. As shown in fig. 4, a virtual character 401 is located in the middle of a game interface, and a terminal may display an icon 402 corresponding to a selected virtual item in the game interface. The unlocking progress may be presented in the form of a "circular progress bar 403" which, when the circular progress bar 403 fills up, indicates that the unlocking is complete. Wherein the progress bar 404 is used to represent the amount of blood remaining in the virtual character 401. There may be a plurality of operation controls 405, each controlling a virtual character to perform different actions, such as 1 representing a crawl, 2 representing a shoot, 3 representing a jump, etc.

In step S340, according to the selected virtual item, the attribute value corresponding to the virtual character is automatically adjusted.

In one embodiment, assuming that the selected virtual object includes a virtual object a and a virtual object B, the unlocking time of the virtual object a is 2 seconds, the blood volume can be increased by 60, the unlocking time of the virtual object B is 3 seconds, the blood volume can be increased by 50, and the blood volume of the virtual character can be increased by 60 within the unlocking time (for example, 2 seconds) of the virtual object a. Within the unlocking time of virtual item B (e.g., 3 seconds), the blood volume of the regulating virtual character increases by 50. Assuming that the upper limit of the blood volume is 100, if the blood volume is increased by 50 and exceeds 100, the blood volume of the virtual character can be adjusted to 100. According to the requirement, the selected virtual articles can be displayed in sequence so as to be unlocked in sequence, and can also be displayed simultaneously so as to be unlocked simultaneously.

In an embodiment, the attribute value increase speed and the attribute value increase amount corresponding to each virtual article may be configured in advance, so that the terminal may adjust the attribute value corresponding to the virtual character according to the attribute value increase speed within the unlocking time of the virtual article. For example, assuming that the attribute value is blood volume, the virtual article a increases the blood volume by 60 within 2 seconds, the blood volume increase value (e.g. 20) per unit time (e.g. every 500 milliseconds) can be calculated, and the blood volume value (e.g. 20) can be increased every unit time (e.g. every 500 milliseconds) until the blood volume is increased by 60 or the real-time blood volume reaches the preset upper limit. The terminal may present the real-time blood volume to the user in the form of a blood strip.

According to the technical scheme provided by the embodiment of the application, when the current attribute value is lower than the preset attribute threshold value, the virtual article selection strategy used in the active state is executed according to the active state of the virtual character, so that the virtual article matched with the active state can be automatically selected, the attribute value of the virtual character is adjusted, and the user operation is reduced. And the complicated operation of a user is not needed, so that the response times are reduced, and the response speed is improved.

In an embodiment, as shown in fig. 5, step S320 in the above embodiment may include the following steps S321 to S322.

In step S321, presenting an attribute identifier for indicating a current attribute value of the virtual character;

in an embodiment, the terminal may obtain the attribute value corresponding to the virtual role in real time, and display the attribute identifier on the user interface, and the user may know the real-time attribute value (i.e., the current attribute value) by looking at the attribute identifier. The attribute identification may be a number, pattern, or progress bar (e.g., blood bar) representing the current attribute value.

In step S322, when the current attribute value is lower than the preset attribute threshold, a trigger instruction for the attribute identifier is responded to, and an active state of the virtual role is obtained.

When the user clicks the attribute identifier, the terminal may receive a trigger instruction for the attribute identifier. And when the current attribute value is lower than the preset attribute threshold value and a triggering instruction of the attribute identifier is received by a user, the activity state of the virtual role can be acquired.

In one embodiment, as shown in FIG. 6, the following steps S601-S602 may be taken to obtain the activity status of the virtual character.

In step S601, the latest interaction time point between the virtual character and other characters in the virtual scene is obtained.

In step S602, a time difference between the interaction time point and a current time point is calculated, and the time difference is used to characterize an activity state of the virtual character.

For example, the last interaction time point may be the last shot time, hit time, move time (e.g., punch), move time, weapon release time, and the like. When the time difference between the interaction time point and the current time is less than a certain specified value, the virtual character can be considered to be still in a fierce activity state, and when the time difference is greater than the certain specified value, the virtual character can be considered not to participate in the activity for a longer time. Based on the time difference, the activity state of the virtual character can be determined.

Due to the different activity states, different virtual article selection strategies are implemented. Therefore, the virtual article selection strategy corresponding to the time difference can be executed according to the time difference between the latest interaction time point and the current time point. For example, the first policy is executed when the time difference is smaller than a first threshold, and the second policy is executed when the time difference is equal to or greater than the first threshold.

In an embodiment, as shown in fig. 6, step S603 may first determine whether the time difference is smaller than a first threshold (e.g. 10 seconds), and step S604: if the time difference is smaller than the first threshold, the virtual article with the shortest unlocking time can be selected according to the unlocking time correspondingly configured for each virtual article. Step S604': and if the time difference is larger than or equal to a first threshold value, selecting the virtual articles with the largest quantity according to the inventory quantity of the virtual articles corresponding to the virtual character.

As described above, the unlocking time refers to the predetermined time of the virtual article, and the adjustment of the attribute value of the virtual character can be completed only within the unlocking time. Therefore, when the time difference is smaller than the first threshold, the virtual character can be considered to be in a violent activity state, and the virtual article with the shortest unlocking time can be selected, so that the attribute value of the virtual character can be adjusted as fast as possible according to the attribute value increment and the attribute value increasing speed of the virtual article.

In one embodiment, when the virtual character is in a hard activity state, the attribute value of the virtual character may be adjusted to a target attribute value (e.g., 100%), so that a plurality of virtual objects may need to be selected. To determine which virtual items to select, in one embodiment, a numerical difference between the current attribute value and the target attribute value may be calculated. Assuming that the current attribute value is 10% and the target attribute value is 100%, a numerical gap of 90% can be calculated. Then, according to the unlocking time correspondingly configured for each virtual article, a plurality of virtual articles with the shortest unlocking time can be selected, and the sum of the attribute value increases of the plurality of virtual articles is ensured to be greater than or equal to 90% (namely, the numerical value difference).

For example, if the unlocking time of the virtual item A, B, C is sequentially increased, and there is only one virtual item for each type of virtual item, the attribute value of the virtual item a is increased by 50%, and the attribute value of the virtual item B is increased by 30%, then another virtual item C needs to be selected, so that the sum of the attribute value increases of the virtual item A, B, C is greater than or equal to 90%. Assuming more than one virtual article a, two virtual articles a may be selected such that the sum of the attribute value increases of the virtual articles is greater than 90% (i.e., the numerical difference).

Similarly, when the virtual character does not participate in the activity for a long time, the attribute value of the virtual character may also be adjusted to the target attribute value (for example, 80%, the target attribute values of the virtual character in different activity states may be the same or different), so that a plurality of virtual articles may need to be selected. To determine which virtual items to select, in one embodiment, a numerical difference between the current attribute value and the target attribute value may be calculated. Assuming that the current attribute value is 20% and the target attribute value is 80%, a value gap of 60% can be calculated. Then, the virtual item with the largest stock quantity can be accessed according to the stock quantity of each virtual item, and the sum of the attribute value increases of the plurality of virtual items is ensured to be greater than or equal to 60%.

In one embodiment, as shown in fig. 6, step S605 may determine whether the time difference is smaller than a first threshold (e.g., 10 seconds) and larger than a second threshold (e.g., 3 seconds), wherein the first threshold is larger than the second threshold. Step S606 shows the modification control corresponding to the selected virtual item if the time difference is smaller than the first threshold and larger than the second threshold. Step S607, when receiving the trigger instruction of the modification control, displaying the virtual item list corresponding to the virtual role; step S608 is, when receiving a selection instruction for a specified item in the virtual item list, replacing the selected virtual item with the specified item according to the specified item indicated by the selection instruction.

As shown in fig. 7, the user interface may display an icon 402 of the selected virtual item B, reminding the user that the number of the virtual items B will decrease by one, that is, the attribute value of the virtual character will be adjusted according to the increase of the attribute value of the virtual item B. The modification control 406 may be located at the periphery of the displayed virtual item B, and when a trigger instruction of the user to click on the modification control 406 is received, the virtual item list 407 is presented. The type and the number of virtual articles currently owned by the virtual character can be displayed in the virtual article list 407, when a user clicks a certain virtual article (namely, a designated article) in the virtual article list 407, the terminal receives a selection instruction of the designated article, the selection instruction can carry an identifier of the designated article, and then the designated article selected by the user can be used for replacing the automatically selected virtual article.

Therefore, when the time difference between the latest interaction time point and the current time point is smaller than the first threshold and larger than the second threshold, although a proper virtual article is automatically selected, the activity state is not particularly violent, so that a modification control is added, and the user can modify the automatically selected virtual article. In one implementation, assuming that the trigger instruction of the modification control is not received after the specified time is exceeded, it may be considered that the user agrees to the automatically selected virtual article, an unlocking stage of the virtual article may be entered, and the attribute value of the virtual article is adjusted according to the attribute value increase of the virtual article within the unlocking time.

In an embodiment, as shown in fig. 6, in step S609, if the time difference is smaller than the second threshold, the attribute value of the virtual character may be adjusted directly according to the automatically selected virtual item.

The following is an embodiment of the apparatus of the present application, which can be used to execute an embodiment of the method for controlling attribute values of a virtual character described above in the present application. For details that are not disclosed in the embodiments of the apparatus of the present application, please refer to the embodiments of the attribute value control method of the virtual character of the present application.

Fig. 8 is a block diagram of an attribute value control device for a virtual character according to an embodiment of the present application. As shown in fig. 8, the apparatus includes: an attribute acquisition module 810, a state acquisition module 820, a policy enforcement module 830, and an attribute adjustment module 840.

The attribute obtaining module 810 is configured to obtain a current attribute value of the virtual role.

A state obtaining module 820, configured to obtain an active state of the virtual character when the current attribute value is lower than a preset attribute threshold.

And the policy executing module 830 is configured to execute a virtual item selection policy corresponding to the activity state according to the activity state of the virtual role.

And the attribute adjusting module 840 is configured to automatically adjust the attribute value corresponding to the virtual character according to the selected virtual article.

The implementation processes of the functions and actions of each module in the device are specifically described in the implementation processes of the corresponding steps in the attribute value control method of the virtual role, and are not described herein again.

In one embodiment, the status acquisition module 820 includes: the identifier display unit is used for displaying the attribute identifier used for indicating the current attribute value of the virtual role; and the state acquisition unit is used for responding to a trigger instruction of the attribute identifier when the current attribute value is lower than a preset attribute threshold value, and acquiring the activity state of the virtual role.

In an embodiment, the state acquiring unit includes: the time point obtaining subunit is configured to obtain a latest interaction time point between the virtual character and another character in the virtual scene; and the time difference calculating subunit is used for calculating the time difference between the interaction time point and the current time point, and the time difference is used for representing the activity state of the virtual character.

In an embodiment, the policy executing module 830 is specifically configured to: and executing a virtual article selection strategy corresponding to the time difference according to the time difference between the interaction time point and the current time point.

In an embodiment, the policy executing module 830 includes: and the first selection unit is used for selecting the virtual article with the shortest unlocking time according to the unlocking time correspondingly configured for each virtual article if the time difference is smaller than a first threshold value.

In an embodiment, the first selecting unit includes: the first calculating subunit is used for calculating the numerical difference between the current attribute value and the target attribute value; and the first selection subunit is used for selecting a plurality of virtual articles with the shortest unlocking time according to the unlocking time correspondingly configured for each virtual article, and the sum of the attribute value increment amounts corresponding to the plurality of virtual articles is greater than or equal to the numerical difference.

In an embodiment, the apparatus further includes: the control display module is used for displaying the modification control corresponding to the selected virtual article if the time difference is smaller than the first threshold and larger than the second threshold; the first threshold is greater than the second threshold; the list display module is used for displaying the virtual article list corresponding to the virtual role when receiving the trigger instruction of the modification control; and the item replacing module is used for replacing the selected virtual item by the specified item according to the specified item indicated by the selection instruction when the selection instruction of the specified item in the virtual item list is received.

In an embodiment, the policy executing module 830 includes: and the second selecting unit is used for selecting the virtual articles with the largest quantity according to the stock quantity of the virtual articles corresponding to the virtual character if the time difference is larger than or equal to a first threshold value.

In an embodiment, the second selecting unit includes: the second calculating subunit is used for calculating the numerical difference between the current attribute value and the target attribute value; and the second selection subunit is used for selecting a plurality of virtual articles with the largest quantity according to the inventory quantity of the virtual articles corresponding to the virtual roles, and the sum of the attribute value increment quantities corresponding to the virtual articles is greater than or equal to the numerical difference.

In an embodiment, the apparatus further includes: the article display module is used for displaying the selected virtual article; and the progress display module is used for displaying the unlocking progress of the selected virtual article according to the unlocking time correspondingly configured for each virtual article.

In an embodiment, the attribute adjusting module 840 is specifically configured to adjust the attribute value of the virtual character according to the attribute value increasing speed and the attribute value increasing amount configured corresponding to the selected virtual article, until the adjustment amount of the attribute value of the virtual character reaches the attribute value increasing amount or the attribute value of the virtual character reaches the upper limit.

In the embodiments provided in the present application, the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.

In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.

18页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:游戏场景的编辑方法、装置、存储介质和电子装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类