CN109725892A - Analyzing logic control method and device - Google Patents

Analyzing logic control method and device Download PDF

Info

Publication number
CN109725892A
CN109725892A CN201711045554.3A CN201711045554A CN109725892A CN 109725892 A CN109725892 A CN 109725892A CN 201711045554 A CN201711045554 A CN 201711045554A CN 109725892 A CN109725892 A CN 109725892A
Authority
CN
China
Prior art keywords
virtual objects
behavior tree
virtual
tree example
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201711045554.3A
Other languages
Chinese (zh)
Other versions
CN109725892B (en
Inventor
刘毅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shanghai Co Ltd
Original Assignee
Tencent Technology Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shanghai Co Ltd filed Critical Tencent Technology Shanghai Co Ltd
Priority to CN201711045554.3A priority Critical patent/CN109725892B/en
Publication of CN109725892A publication Critical patent/CN109725892A/en
Application granted granted Critical
Publication of CN109725892B publication Critical patent/CN109725892B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention discloses a kind of analyzing logic control method and devices, belong to computer field.It include at least one execution route for carrying out logic control to virtual environment in the first behavior tree example the described method includes: obtaining the first behavior tree example;According to the current operational information of virtual environment, target execution route is determined at least one execution route of the first behavior tree example, according to target execution route, the n virtual objects and the corresponding object event of n virtual objects, n that determining needs control are positive integer;By the corresponding second behavior tree example of n virtual objects, controls n virtual objects and execute corresponding object event.The present invention realizes the purpose of automatic control system, to improve the speed of response of system by the first behavior tree example and n the second common coordinative roles of behavior tree example.

Description

Analyzing logic control method and device
Technical field
The present embodiments relate to computer field, in particular to a kind of analyzing logic control method and device.
Background technique
During developing large scale system or game, developer needs to take a significant amount of time the complicated control of setting and patrols Volume.
In the related technology, developer usually utilize finite state machine (English: Finite-State Machine, referred to as: FSM logic control) is carried out to system.It include between limited state (English: State) and each state in finite state machine State transfer relationship, wherein each state in finite state machine is corresponding with the system mode of system.Developer is being arranged When the control logic of system, it is only necessary to add state and state transfer relationship into finite state machine, and corresponding state is set Jump condition.
But with the raising of system logic complexity, developer needs constantly modification or increases in finite state machine State and corresponding state transfer relationship, cause finite state machine excessively too fat to move, influence the speed of response of system.
Summary of the invention
When in order to solve to carry out logic control to system using finite state machine in the related technology, due to finite state machine mistake In it is too fat to move and the problem of cause the speed of response of system to slow down, the embodiment of the invention provides a kind of analyzing logic control method and Device.The technical solution is as follows:
In a first aspect, providing a kind of analyzing logic control method, which comprises
The first behavior tree example is obtained, includes for carrying out logic control to virtual environment in the first behavior tree example At least one execution route;
It is executed according to the current operational information of the virtual environment, described at least one in the first behavior tree example Target execution route is determined in path;
According to the target execution route, determine that n virtual objects for needing to control and the n virtual objects are respectively right The object event answered, the n are positive integer;
By the corresponding second behavior tree example of the n virtual objects, controls the n virtual objects and execute respectively The self-corresponding object event.
Second aspect, provides a kind of analyzing logic control device, and described device includes:
Module is obtained, includes for virtual ring in the first behavior tree example for obtaining the first behavior tree example At least one execution route of border progress logic control;
First determining module, for the current operational information according to the virtual environment, in the first behavior tree example At least one execution route in determine target execution route;
Second determining module, for according to the target execution route, determining n virtual objects for needing to control and described The corresponding object event of n virtual objects, the n are positive integer;
Control module, for controlling the n by the corresponding second behavior tree example of the n virtual objects Virtual objects execute corresponding object event.
The third aspect, provides a kind of logic control implementations, and the logic control implementations include processor and memory, institute It states and is stored at least one instruction, at least a Duan Chengxu, code set or instruction set in memory, at least one instruction, institute An at least Duan Chengxu, the code set or instruction set is stated to be loaded as the processor and executed to realize provided by first aspect Analyzing logic control method.
Fourth aspect provides a kind of computer readable storage medium, at least one finger is stored in the storage medium Enable, at least a Duan Chengxu, code set or instruction set, at least one instruction, an at least Duan Chengxu, the code set or Instruction set is loaded as the processor and is executed to realize analyzing logic control method provided by first aspect.
Technical solution provided in an embodiment of the present invention has the benefit that
It include for carrying out logic control to virtual environment by obtaining the first behavior tree example, in the first behavior tree example At least one execution route, according to the current operational information of virtual environment, at least one in the first behavior tree example is executed Target execution route is determined in path, according to target execution route, determines that n virtual objects for needing to control and n are a virtual right As corresponding object event, control the n corresponding object event of virtual objects execution;It avoids in the related technology Lead to the speed of response of system since finite state machine is excessively too fat to move when carrying out logic control to system using finite state machine The case where slowing down, behavior tree strong using scalability and high reusability carries out analyzing logic control, and behavior tree example is divided into First behavior tree example and the second behavior tree example, are each responsible for the logic control of different levels, i.e., real by the first behavior tree Example and n the second common coordinative roles of behavior tree example, realize the purpose of automatic control system, to improve the response of system Rate.
Detailed description of the invention
Fig. 1 is implementation environment involved in analyzing logic control method provided in an embodiment of the present invention;
Fig. 2 is the flow chart of analyzing logic control method provided by one embodiment of the present invention;
Fig. 3 is the flow chart for the analyzing logic control method that another embodiment of the present invention provides;
Fig. 4 is the flow chart for the analyzing logic control method that another embodiment of the present invention provides;
Fig. 5 is the flow chart for the analyzing logic control method that another embodiment of the present invention provides;
Fig. 6 is the flow chart for the analyzing logic control method that another embodiment of the present invention provides;
Fig. 7 is the flow chart for the analyzing logic control method that another embodiment of the present invention provides;
Fig. 8 is the flow chart for the analyzing logic control method that another embodiment of the present invention provides;
Fig. 9 is the structural schematic diagram of analyzing logic control device provided by one embodiment of the present invention;
Figure 10 is the structural schematic diagram for the analyzing logic control device that another embodiment of the present invention provides;
Figure 11 is the structural schematic diagram of terminal 1100 provided by one embodiment of the present invention;
Figure 12 is the structural schematic diagram of server 1200 provided by one embodiment of the present invention.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention Formula is described in further detail.
In order to facilitate understanding, the noun occurred in the embodiment of the present invention is explained below.
Behavior tree: a kind of mathematical model that plan executes, is substantially a kind of decision tree.Comprising several in every behavior tree A behavior node, wherein behavior node includes control node and execution node.Leaf node of the node as behavior tree is executed, For executing event indicated by the node (or behavior).Control node (being father node in the concept of tree) in behavior tree Be connected (control node and/or execution node) with several child nodes, for selecting (Selector) execution, sequence (Sequence) it executes or parallel (Parallel) executes a certain or certain child nodes.Wherein, selection execution, which refers to, sequentially executes son Node, and stop executing subsequent child node when child node returns to true;Sequence execution, which refers to, sequentially executes each child node, and Child node stops executing subsequent child node when returning to false;Parallel execution, which refers to, sequentially executes all child nodes (no matter returning to true Or false).
Layering behavior tree: including at least two layers of behavior tree.It include two layers of behavior to be layered behavior tree in the embodiment of the present invention It is illustrated for tree, first layer is behavior tree referred to as the first behavior tree for being located at upper layer, and the second layer is the behavior for being located at lower layer Tree is known as the second behavior tree.
First behavior tree example: also referred to as decision behavior tree example is created by the instantiation of the first behavior tree.
It include at least one execution route for carrying out logic control to virtual environment in first behavior tree example.Its In, execution route is used to indicate root node in behavior tree example to be passed through when executing a certain event to the path between leaf node The path that is constituted of each behavior node.
First behavior tree example is used for the current operational information according to virtual environment, determines at least one execution route Target execution route, target execution route are used to indicate the n virtual objects and n virtual objects for needing to control in virtual environment Corresponding object event, wherein n is positive integer.
Optionally, the first behavior tree example supports the multiplexing of m virtual objects in virtual environment.
For example, virtual environment is also referred to as three-dimensional virtual environment or virtual game environment.
Second behavior tree example: being also referred to as basic behavior tree example, is created by the instantiation of the second behavior tree.
Second behavior tree example executes scheduled event, the second behavior tree example and virtual objects one for controlling virtual objects One is corresponding.
In embodiments of the present invention, m virtual objects in virtual environment are multiplexed a first behavior tree example, Mei Gexu Quasi- object has corresponding second behavior tree example, wherein m is greater than n and m is positive integer.
Optionally, each second behavior rime is loaded on a virtual objects, is controlled the virtual objects and is executed predeterminable event. Wherein, virtual objects are the objects with the ability for executing scheduled event.For example, virtual objects are the artificial intelligence in virtual environment It can (Artificial Intelligence, AI) entity.
For example, the second behavior tree example executes in standby, mobile, attack, construction and death for controlling virtual objects At least one basic act.
In the related technology, developer generallys use finite state machine and carries out logic control to system.As system controls The continuous complexity of logic, developer are closed to during finite state machine addition state, needing to add corresponding state transfer System.For example, user adds a state into the finite state machine, then when in existing finite state machine including n state It needs to add (n-1) a state transfer relationship, it is clear that when system has complex control logic, follow-up maintenance and upgrade cost It is higher;Also, in finite state machine state transfer relationship substantial amounts (the quantity m=n* (n-1)/2 of state transfer relationship, Cause finite state machine excessively too fat to move, the final speed of response for influencing institute's control system.
Compared with finite state machine, there is no the concept of state in behavior tree, the degree of coupling of each behavior node in behavior tree It is lower, when carrying out analyzing logic control using behavior tree, different behavior trees can be realized by recombinating different behavior nodes, To realize different logic controls.Also, the behavior node in behavior tree has stronger reusability, the behavior section write Point can be multiplexed by different behavior trees, and follow-up maintenance and upgrade cost are low and be easy to extend.Therefore, multiple applied to control logic When miscellaneous system, the execution efficiency of behavior tree is higher than finite state machine, correspondingly, the speed of response of system is also faster.
But current behavior tree is often that can only control this on the specific virtual objects of carry in systems Virtual objects execute corresponding basic act, are unable to control whole system logic, if desired control whole system logic, then also need Develop many additional resources.
In embodiments of the present invention, a kind of concept of layering behavior tree is proposed, by creating the behavior tree of two levels, That is the first behavior tree and the corresponding second behavior tree of m virtual objects, wherein the first behavior tree (example) is used for according to void The current operational information in near-ring border determines target execution route at least one execution route, and the second behavior tree (example) is used for Controlling virtual objects performance objective event according to target execution route can not only by the combination of the behavior tree of the two levels Enough guarantee that the logic of single virtual object is clear, and the logic of whole system can be controlled.The each embodiment of the present invention is i.e. logical It crosses and the first behavior tree and the second behavior tree is applied to analyzing logic control to improve the response efficiency of system, below using signal The embodiment of property is illustrated.
Referring to FIG. 1, it illustrates implementation environments involved in analyzing logic control method provided in an embodiment of the present invention. Logic control system 100: including decision support system 110, the first behavior tree example 120 and the second behavior tree example 130.
Logic control system 100 is the system operated in logic control implementations, logic control implementations be terminal either Server.Optionally, logic control system 100 is also referred to as game logic control system.
Decision support system 110 is used to provide the current operational information of virtual environment to the first behavior tree example 120, currently Operation information is required reference information, current operational information when the first behavior tree example 120 determines target execution route It is used to indicate situation locating when the first behavior tree example 120 is run in virtual environment.
First behavior tree example 120 is used to obtain the current operational information of virtual environment from decision support system, according to void The current operational information in near-ring border determines target execution route at least one execution route in the first behavior tree example. It include that at least one of defence path 121, attack path 122 and construction path 123 execute road in first behavior tree example 120 Diameter.
Wherein, defence path 121 is used to indicate the path for needing to be implemented defence event, and attack path 122, which is used to indicate, to be needed The path of attack is executed, path 123 is built and is used to indicate the path for needing to be implemented construction event.
The preset interface 131 that second behavior tree example 130 is provided to the first behavior tree example 120, preset interface 131 are Interface between one behavior tree example 120 and the second behavior tree example 130 of virtual objects, preset interface 131 and the second behavior Example 130 is set to correspond.
Optionally, the first behavior tree example 120 and the second behavior tree example 130 pass through the progress information friendship of preset interface 131 Mutual and function call realizes the effect of coordinated control logic control system 100.
Referring to FIG. 2, it illustrates the flow chart of analyzing logic control method provided by one embodiment of the present invention, this reality It applies example to be illustrated so that the analyzing logic control method is for logic control system 100 as shown in Figure 1 as an example, this method packet It includes:
Step 201, the first behavior tree example is obtained, includes for carrying out logic to virtual environment in the first behavior tree example At least one execution route of control.
Optionally, when logic control implementations get the trigger action for corresponding to default entrance, the first row is loaded automatically To set example.Wherein, default entrance is entrance shown by the first interface of predetermined application, and trigger action is used for first Changing interface is second contact surface, the first interface be shown after logging in predetermined application success, for showing default entrance Interface, second contact surface are the interfaces different from the first interface.
For example, predetermined application is " XX game ", " opened when logic control implementations get to correspond in " XX game " It is automatic to load the first behavior tree example when the clicking operation of beginning game " button.
Step 202, according to the current operational information of virtual environment, at least one execution route of the first behavior tree example Middle determining target execution route.
Target execution route is used to indicate n virtual objects for needing to control in virtual environment and n virtual objects respectively Corresponding object event, n≤m and m, n are positive integer.
Logic control implementations pass through the first behavior tree case-based system virtual environment after getting the first behavior tree example Current operational information, and target execution route is determined according to the current operational information of virtual environment.
Step 203, according to target execution route, determine that n virtual objects for needing to control and n virtual objects are respectively right The object event answered.
Logic control implementations are determined in the m virtual objects included by virtual environment and are needed according to target execution route N virtual objects of control load the corresponding second behavior tree example of n virtual objects according to the first behavior tree example.
Step 204, by the corresponding second behavior tree example of n virtual objects, n virtual objects is controlled and are executed respectively Self-corresponding object event.
After the corresponding second behavior tree example of n virtual objects loads successfully, logic control implementations are according to target The corresponding object event of n virtual objects indicated by execution route passes through corresponding second row of n virtual objects To set example, controls n virtual objects and execute corresponding object event.
For example, each virtual objects in the virtual game environment are multiple so that the virtual environment is virtual game environment as an example With a first behavior tree example, each virtual objects have corresponding second behavior tree example.Logic control implementations root Target execution route is determined according to the first behavior tree example, and it is respectively right to obtain wherein n virtual objects according to target execution route The the second behavior tree example answered, according to the first behavior tree and the n got the second behavior tree examples, to n virtual objects into Row logic control.
In conclusion analyzing logic control method provided in this embodiment, by obtaining the first behavior tree example, the first row To include at least one execution route for carrying out logic control to virtual environment in tree example, according to the current of virtual environment Operation information determines target execution route at least one execution route of the first behavior tree example, executes road according to target Diameter determines the n virtual objects and the corresponding object event of n virtual objects for needing to control, each by n virtual objects Self-corresponding second behavior tree example controls n virtual objects and executes corresponding object event;It avoids in the related technology Lead to the speed of response of system since finite state machine is excessively too fat to move when carrying out logic control to system using finite state machine The case where slowing down, behavior tree strong using scalability and high reusability carries out analyzing logic control, and behavior tree example is divided into First behavior tree example and the second behavior tree example, are each responsible for the logic control of different levels, i.e., real by the first behavior tree Example and n the second common coordinative roles of behavior tree example, realize the purpose of automatic control system, to improve the response of system Rate.
Referring to FIG. 3, it illustrates the flow charts of analyzing logic control method provided by one embodiment of the present invention.This reality It applies example to be illustrated so that the analyzing logic control method is for logic control system 100 as shown in Figure 1 as an example, this method packet It includes:
Step 301, the first behavior tree example is obtained, includes for carrying out logic to virtual environment in the first behavior tree example At least one execution route of control.
When logic control implementations get the trigger action for corresponding to default entrance, logic control implementations load the automatically One behavior tree example.
It should be noted that the mode that logic control implementations obtain the first behavior tree example can refer to the implementation of Fig. 2 offer Correlative detail in example, details are not described herein.
Step 302, pass through the current operational information of the first behavior tree case-based system virtual environment.
Optionally, the first behavior tree example obtains the corresponding current operation letter of the first object set from decision support system Breath.
It should be noted that including the first object set and the second object set, the first object set in the embodiment of the present invention Conjunction is object set corresponding with the first behavior tree example, and the first object set includes m virtual objects, the first object set with Second object set is the different object sets there are relativeness, and the object set in addition to the first object set can claim For the second object set.
Optionally, the first object set is also referred to as first party camp, and the second object set is also referred to as second party camp.Than Such as, the first object set is our camp, and the second object set is enemy camp.
Optionally, the first behavior tree example obtains current operational information in real time, alternatively, the first behavior tree example is every predetermined Time interval obtains current operational information.
Wherein, current operational information includes ideal money total quantity, virtual objects total quantity, Virtual Building total quantity and works as At least one of the mark of preceding run case.
Ideal money total quantity is the total quantity of the corresponding ideal money of the first object set, for example, gold coin total quantity.
Virtual objects total quantity is the total quantity of the corresponding virtual objects of the first object set, for example, soldier's total quantity.
Virtual Building total quantity is the total quantity of the corresponding buildings built of the first object set.
The mark of current run case includes attack mark, and attack mark is used to indicate the first object set pair Attack of the Virtual Building and/or virtual objects answered by the second object set.
For example, the corresponding current operational information of first behavior tree the first object set of case-based system is as shown in Table 1.? In the corresponding current operational information of an object set " W1001 ", ideal money total quantity is 300 gold coins, virtual objects total quantity For 5 soldiers, 3 gun turrets are built, i.e. Virtual Building total quantity is 3, and current run case is identified as S01, mark It is under attack that " S01 " is used to indicate the first object set " W1001 ".
Table one
Step 303, according to the current operational information of virtual environment, at least one execution route of the first behavior tree example Middle determining target execution route.
First behavior tree example according to the current operational information got, the first behavior tree example defence path, attack It hits path and builds and determine an execution route in this three execution routes of path, using a determining execution route as target Execution route.
Step 304, the pre- of the corresponding second behavior tree example of m virtual objects is called by the first behavior tree example If interface.
First behavior tree example calls corresponding preset of the corresponding second behavior tree example of m virtual objects to connect Mouthful.
Step 305, according to the preset interface of m the second behavior tree examples, the corresponding object of m virtual objects is obtained State.
First behavior tree example obtains m virtual objects according to m the second corresponding preset interfaces of behavior tree example Corresponding Obj State, preset interface are used to return the Obj State of virtual objects, and Obj State includes standby mode, moves Dynamic state, builds one of state and dead state at attack state.
Optionally, preset interface is GetCurrentState (), and it is virtual right that standby mode (English: IDLE) is used to indicate Stationary on a position as being located at, moving condition (English: RUNNING) is used to indicate virtual objects and is moving, and attacks State (English: ATTACK) is used to indicate virtual objects and is leading off an attack, and builds state (English: BUILDING) and is used to indicate Virtual objects are building Virtual Building, and dead state (English: DIE) is used to indicate virtual objects dead.
Step 306, determine that Obj State is not n virtual objects of dead state from m virtual objects.
First behavior tree example is determined from m virtual objects according to the corresponding Obj State of m virtual objects N virtual objects, this corresponding Obj State of n virtual objects are other Obj States in addition to dead state.
Step 307, by the corresponding second behavior tree example of n virtual objects, n virtual objects is controlled and are executed respectively Self-corresponding object event.
After determining n virtual objects, logic control implementations call the corresponding second behavior tree of n virtual objects Preset function in example controls virtual objects performance objective event.
Optionally, preset function includes first function and/or second function, and first function is also referred to as move function, for holding Row moving event;Second function also referred to as builds function, for executing construction event.
For each virtual objects in n virtual objects, the first behavior tree example calls the second row of the virtual objects For the preset function in tree example, control virtual objects performance objective event includes: the first behavior tree example by calling second First function control virtual objects in behavior tree example execute moving event;And/or first behavior tree example by calling the Second function control virtual objects in two behavior tree examples execute construction event.
In the following, successively introducing the related content of first function and second function.
First function: the input parameter of first function is target position parameter, and target position parameter is used to indicate virtual right As the required target position being moved to, first function is moved to the corresponding target position of target position parameter for controlling virtual objects It sets.
For example, first function is MoveToTarget (target) function, target position parameter is target parameter, this One function is moved to the corresponding target position of target parameter for controlling virtual objects.
Optionally, for each virtual objects in virtual environment, a three-dimensional system of coordinate is established, each virtual objects Position indicates that target position parameter is a three-dimensional coordinate parameter using three-dimensional coordinate form.
Optionally, logic control implementations determine the corresponding target position parameter of virtual objects, by calling first function, control Virtual objects processed are moved on the corresponding target position of target position parameter.
For example, the second behavior tree example determines the corresponding target parameter of virtual objects, by calling MoveToTarget (target) function, control virtual objects are moved on the corresponding target position of target parameter.
It should be noted is that the virtual objects are to carry out attack also after virtual objects are moved to target position It is to be defended, then is the internal logic in the second behavior tree example, the first behavior tree example is in external call the second behavior tree Without concern when example.
Need to illustrate on the other hand, when the instruction of target position parameter be the current location of virtual objects when, control is empty Quasi- object is moved to current location, i.e. control virtual objects remain stationary on current location, at this time the object of the virtual objects State is in standby.
Second function: the input parameter of second function is target type parameter, and target type parameter objectives type parameter is used The type of the Virtual Building of the construction needed for indicating virtual objects, second function is for controlling virtual objects construction and target type The corresponding Virtual Building of parameter.
For example, second function is Build (type) function, target type parameter is type parameter, which is used for It controls virtual objects and builds Virtual Building corresponding with type parameter.
Optionally, logic control implementations determine the corresponding target type parameter of virtual objects, by calling the second behavior tree Second function in example, control virtual objects build Virtual Building corresponding with target type parameter.
For example, the second behavior tree example determines the corresponding type parameter of virtual objects, by calling Build (type) letter Number, control virtual objects build Virtual Building corresponding with type parameter.
Optionally, Virtual Building includes the Virtual Building of at least two types, and target type parameter is empty for unique identification The proposed type built.
In a schematical example, the type of Virtual Building and the corresponding relationship of type parameter are as shown in Table 2.It is empty It is proposed build including level-one gun turret, second level gun turret, three-level gun turret these three types Virtual Building, the target type ginseng of level-one gun turret Number is type1, and the target type parameter of second level gun turret is type2, and the target type parameter of three-level gun turret is type3.
Table two
The type of Virtual Building Target type parameter
Level-one gun turret type1
Second level gun turret type2
Three-level gun turret type3
In conclusion the embodiment of the present invention, which also passes through the second behavior tree example, provides default connect to the first behavior tree example Mouthful, enable the first behavior tree example to carry out information exchange and function call by preset interface and the second behavior tree example, And then the preset function in the second behavior tree example is called by the first behavior tree example, control virtual objects performance objective thing Part.
It should be noted that at least one execution route of the first behavior tree example include defence path, attack path and Build at least one of path, for the convenience of description, when the corresponding Virtual Building of the first object set and/or virtual objects by It is virtual in the first object set to the attack of the second object set, and when the target execution route determined is defence path Object is referred to as the first defence object, and the virtual objects in the second object set are referred to as the first object of attack;When first The corresponding virtual objects of object set are launched a offensive to the second object set, that is, the target execution route determined is attack path When, the virtual objects in the first object set are referred to as the second object of attack, and the virtual objects in the second object set claim For second defence object.
Optionally, above-mentioned steps 303 can be implemented as the following steps by substitution, as shown in Figure 4:
Step 303a judges whether current operational information meets termination condition according to the current operational information of virtual environment.
Termination condition include Virtual Building total quantity be zero, certain types of Virtual Building total quantity is zero, in pre- timing Between in section the disappearance quantity of Virtual Building total quantity be greater than and default terminate at least one of threshold value.Wherein, predetermined amount of time is From the first moment to the certain time at the second moment, the disappearance quantity of Virtual Building total quantity is virtually building at the first moment Build total quantity and the difference between the Virtual Building total quantity at the second moment.
Optionally, termination condition is also referred to as game over condition.
If current operational information meets termination condition, 303b is thened follow the steps;If current operational information is unsatisfactory for terminating item Part thens follow the steps 303c.
Step 303b terminates process if current operational information meets termination condition.
Step 303c judges the current operation thing of current operational information if current operational information is unsatisfactory for termination condition Part identifies whether as attack mark.
A variety of run case in logic control system are corresponding with respective priority, and priority is used to indicate to operation The sequencing that event is handled.Due in a variety of run case, by the highest priority of attack, therefore in logic Control equipment first judge current run case identify whether for attack mark, attack mark be used for unique identification quilt Attack, the i.e. thing of the corresponding Virtual Building of the first object set and/or virtual objects by the attack of the second object set Part.
Optionally, logic control implementations detect in real time current run case identify whether for attack mark, or Person is spaced the identifying whether as attack mark of the current run case of detection at predetermined time intervals.
If the mark of current run case is attack mark, 303d is thened follow the steps;If the mark of current run case Knowledge is not attack mark, thens follow the steps 303e.
Step 303d, if the mark of current run case is attack mark, it is determined that the mesh of the first behavior tree example Marking execution route is defence path.
It is moving event that defence path, which is used to indicate the corresponding object event of n virtual objects,.Determine first When the target execution route of behavior tree example is defence path, for each virtual objects in n virtual objects, pass through calling First function control virtual objects in second behavior tree example execute moving event for example, calling n the second behavior tree examples In MoveToTarget (target) function, so that controlling n virtual objects executes moving event.
Wherein, attack mark be used to indicate the corresponding Virtual Building of the first object set and/or virtual objects by The attack of second object set.
Optionally, when attack when the first object set by the second object set, logic control implementations are in decision support M virtual objects included by the first object set, and the aggregate type of the second object set of determination are determined in system, according to the The aggregate type of two object sets determines defence object set corresponding with aggregate type in m virtual objects, defends object Set includes at least one first defence object.
Wherein, aggregate type is used to indicate the attribute of the first object of attack in second object set, aggregate type and the Two object sets correspond.
Optionally, logic control implementations distribute each second pair previously according to the aggregate type of each second object set As gathering corresponding weighted value, weighted value and the second object set are corresponded.Weight is stored in logic control implementations Defence object set corresponding of the value with the corresponding relationship of the second object set and in weighted value and the first object set is closed System.
In a schematical example, the corresponding relationship of this three is as shown in Table 3.First object set is " W1001 ", first object set " W1001 " include 60 virtual objects, i.e. K001 to K060, with first object set " W1001 " corresponding three second object sets include: the second object set " W2000 ", the second object set " W3000 " and Two object sets " W4000 ".Wherein, the weighted value of the second object set " W2000 " is 0.2, at the first object set " W1001 " In defence object set corresponding with weighted value " 0.2 " be K001 to K010;The weighted value of second object set " W3000 " is 0.3, defence object set corresponding with weighted value " 0.3 " is K011 to K030 in the first object set " W1001 ";Second pair As set " W4000 " weighted value be 0.5, the defence object corresponding with weighted value " 0.5 " in the first object set " W1001 " Collection is combined into K031 to K060.
Table three
When attack of first object set by the second object set, logic control implementations are according to the second object set Weighted value determines n first defence object in defence object set corresponding with the aggregate type, calls n first defence MoveToTarget (target) function in the corresponding second behavior tree example of object, to control n first defence Object executes respective moving event.
Step 303e, if the mark of the current run case of current operational information is not attack mark, judgement is worked as Whether the virtual resource quantity in preceding operation information meets the first preset condition.
Virtual resource quantity includes ideal money total quantity and/or virtual objects total quantity.First preset condition includes void Quasi- monetary sum amount is greater than the first preset threshold and/or virtual objects total quantity is greater than the second preset threshold.
When the mark of the current run case in current operational information is not attack mark, logic control implementations are logical It crosses the first behavior tree example and calls m the second corresponding preset interfaces of behavior tree example, according to m the second behavior tree examples Corresponding preset interface obtains the corresponding Obj State of m virtual objects.
Logic control implementations are according to current operational information and the corresponding Obj State of m virtual objects, in the first row Target execution route is determined at least one execution route to set example, i.e. it is any in execution step 303f and step 303g One.
Step 303f, if the virtual resource quantity in current operational information meets the first preset condition, when m is a virtual right When the quantity for the virtual objects being in standby as in is greater than third predetermined threshold value, determine that the target of the first behavior tree example is held Walking along the street diameter is attack path.
Optionally, " when the quantity for the virtual objects being in standby in m virtual objects is greater than third predetermined threshold value When, determine that the target execution route of the first behavior tree example is attack path " in virtual objects quantity be in standby shape The quantity of the virtual objects of state.
Attack path is used to indicate n virtual objects and the corresponding target of n virtual objects in m virtual objects Event is moving event.I.e. when logic control implementations determine that the target execution route of the first behavior tree example is attack path When, it is virtual by calling the first function in the second behavior tree example to control for each virtual objects in n virtual objects Object executes moving event.For example, MoveToTarget (target) function in n the second behavior tree examples is called, thus N virtual objects of control execute respective moving event.
Optionally, when the first object set is launched a offensive to the second object set, logic control implementations are in decision support M virtual objects included by the first object set, and the aggregate type of the second object set of determination are determined in system, according to the The aggregate type of two object sets determines object of attack set corresponding with aggregate type, object of attack in m virtual objects Set includes at least one first object of attack.Correlative detail can analogy with reference to defence object set method of determination, herein not It repeats again.
Step 303g, if the virtual resource quantity in current operational information meets the first preset condition, when current operation Construction parameter in information meets the second preset condition, and the quantity for the virtual objects being in standby in m virtual objects When greater than five preset thresholds, the target execution route of the first behavior tree example is determined to build path.
Optionally, " when construction parameter the second preset condition of satisfaction in current operational information, and in m virtual objects When the quantity of the virtual objects of standby mode is greater than five preset thresholds, the target execution route of the first behavior tree example is determined For build path " in virtual objects quantity be the virtual objects being in standby quantity.
Wherein, building parameter includes the Virtual Building total quantity and/or Virtual Building type built, the second preset condition Virtual Building total quantity including having built is greater than the 4th preset threshold and/or Virtual Building type includes preset building type.
Optionally, current operational information further includes Virtual Building type, Virtual Building type include gold mine, level-one gun turret, At least one of second level gun turret, three-level gun turret.
For example, the second preset condition include the Virtual Building total quantity built be greater than 3 and/or Virtual Building type include Gold mine and level-one gun turret.
Optionally, it includes p preset building type and p preset building that the second preset condition, which includes: Virtual Building type, The corresponding asd number of type is greater than the 6th preset threshold.For example, the second preset condition includes: that Virtual Building type includes Gold mine and level-one gun turret, and the asd number of gold mine is greater than 1, the asd number of level-one gun turret is greater than 2.
It builds path and is used to indicate n virtual objects and the corresponding target of n virtual objects in m virtual objects Event is moving event and construction event.I.e. when logic control implementations determine that the target execution route of the first behavior tree example is When building path, for each virtual objects in n virtual objects, by calling the first function in the second behavior tree example It controls virtual objects and executes moving event, and second function control virtual objects is called to execute construction event.
For example, calling MoveToTarget (target) function in the second behavior tree example of the virtual objects, and adjust With Build (type) function in the second behavior tree example, corresponded to control the virtual objects and be moved to target parameter Target position on, corresponding with type parameter Virtual Building is built on the target position.
Optionally, the value of n is 1, builds path and is used to indicate the virtual objects being in standby in m virtual objects Object event corresponding with the virtual objects is moving event and construction event.
It should be noted is that in embodiments of the present invention, to be related to preset threshold (such as: the first default threshold Value, the second preset threshold, third predetermined threshold value, the 4th preset threshold, the 5th preset threshold and the 6th preset threshold etc.) value It is not limited.
It needs to illustrate on the other hand, in embodiments of the present invention, the embodiment of the present invention is to termination condition, the first default item The set content of part and the second preset condition is not limited.
In conclusion the embodiment of the present invention in the first behavior tree case-based system also by, to current operational information, first judging The current run case of current operational information identifies whether to identify for attack, and attack mark is used for unique identification quilt Attack, if defence path, which is then determined as target, at least one execution route of the first behavior tree example executes road Diameter;By the way that the event of highest priority will be set as by attack so that if current run case by attack, it is preferential right This is on the defensive by attack.
In the following, introduce respectively three kinds it is possible call the second behavior tree example preset function method, i.e., with anti-road for the imperial carriage The corresponding defence sub-process of diameter, the corresponding attack sub-process of attack path construction sub-process corresponding with path is built.Only with control It is illustrated for each virtual objects performance objective event in n virtual objects processed.
In the first possible implementation, when logic control implementations determine that the target of the first behavior tree example executes When path is defence path, above-mentioned steps 307 can be replaced and be implemented as the following steps, as shown in Figure 5:
Step 501, according to the first function in the second behavior tree example, virtual objects is controlled and execute moving event.
By calling MoveToTarget (target) function, control virtual objects are moved to first behavior tree example On the corresponding target position of target parameter.
Step 502, after control virtual objects execute moving event, judge between virtual objects and the first object of attack Distance whether be less than pre-determined distance threshold value.
Optionally, logic control implementations obtain the first position parameter of virtual objects and the second position of the first object of attack The absolute difference of first position parameter and second position parameter is determined as distance between the two by parameter, judges that distance is It is no to be less than pre-determined distance threshold value.
If the distance between virtual objects and the first object of attack are less than pre-determined distance threshold value, 503 are thened follow the steps;If should Distance is greater than or equal to pre-determined distance threshold value, thens follow the steps 504.
Step 503, if the distance between virtual objects and the first object of attack are less than pre-determined distance threshold value, pass through second Behavior tree example control virtual objects are attacked.
Optionally, when virtual objects are moved on the corresponding target position of target parameter, if virtual objects and first The distance between object of attack is less than pre-determined distance threshold value, then the Obj State of the virtual objects in the second behavior tree example is by moving Dynamic state is switched to attack state.
Optionally, after calling the first function execution moving event in the second behavior tree example, there are certain cold But the period, the first behavior tree can not call first function control virtual objects to execute moving event in cooling time section.
Step 504, if the distance between virtual objects and the first object of attack are greater than or equal to pre-determined distance threshold value, lead to It is standby to cross the second behavior tree example control virtual objects.
Optionally, when virtual objects are moved on the corresponding target position of target parameter, if virtual objects and second The distance between object be greater than or equal to pre-determined distance threshold value, then the Obj State of the virtual objects in the second behavior tree example by Moving condition is switched to standby mode.
In the second possible implementation, when logic control implementations determine that the target of the first behavior tree example executes When path is attack path, above-mentioned steps 307 can be replaced and be implemented as following steps, as shown in Figure 6: step 601, according to First function in second behavior tree example, control virtual objects are moved and are attacked.
By calling MoveToTarget (target) function, control virtual objects are moved to first behavior tree example On the corresponding target position of target parameter, and attacked on target position.
In the third possible implementation, when logic control implementations determine that the target of the first behavior tree example executes Path is when building path, and above-mentioned steps 307 can be replaced and be implemented as the following steps, as shown in Figure 7:
Step 701, according to the first function in the second behavior tree example, virtual objects is controlled and execute moving event.
By calling MoveToTarget (target) function, control virtual objects are moved to first behavior tree example On the corresponding target position of target parameter.
Step 702, after control virtual objects execute moving event, the current operation letter of virtual environment at this time is obtained Breath.
Since the current operational information in decision support system is real-time update, the first behavior tree example is virtual in control After object executes moving event, the current operational information of virtual environment is obtained from decision support system.
Step 703, judge whether the virtual resource quantity in current operational information meets the first preset condition.
First behavior tree example judges whether current virtual resource quantity meets the first preset condition, i.e., current is virtual Whether monetary sum amount is greater than the first preset threshold and/or whether virtual objects total quantity is greater than the second preset threshold, if currently Virtual resource quantity meet the first preset condition, then follow the steps 704;If it is pre- that current virtual resource quantity is unsatisfactory for first If condition thens follow the steps 706.
Step 704, if the virtual resource quantity in current operational information meets the first preset condition, the second behavior is called Set the second function in example.
Optionally, when virtual objects are moved on the corresponding target position of target parameter, and current current operation is believed When virtual resource quantity in breath meets the first preset condition, the first behavior tree example calls the second behavior according to type parameter Set Build (type) function in example
Step 705, according to the second function in the second behavior tree example, virtual objects is controlled and execute construction event.
First behavior tree example by calling Build (type) function, build corresponding with type parameter by control virtual objects Virtual Building, the Obj State of the virtual objects in the second behavior tree example is switched to construction state by moving condition at this time.
Optionally, after calling the first function execution construction event in the second behavior tree example, there are certain cold But the period, the first behavior tree can not call second function control virtual objects to execute construction event in cooling time section.
Step 706, if the virtual resource quantity in current operational information is unsatisfactory for the first preset condition, pass through the second row It is standby that virtual objects are controlled for tree example.
Optionally, when virtual objects are moved on the corresponding target position of target parameter, and in current operational information When virtual resource quantity is unsatisfactory for the first preset condition, the Obj State of virtual objects is by moving condition in the second behavior tree example It is switched to standby mode.
In order to improve efficiency when the first behavior tree example determines target execution route, logic control implementations are the first behavior It sets example and default trigger event is set, so that the first behavior tree example from decision support system without obtaining current fortune in real time Row information.Therefore, after above-mentioned steps 303d, default trigger event whether there is by the first behavior tree example detection, in advance If trigger event is the trigger event of the first object set or the second object set, default trigger event includes that object increases thing Part, object remove event and object sends at least one of event.
Wherein, object increases event and is used to indicate in the first object set that there are a virtual objects to be registered success, right As removal event is used to indicate in the first object set, there are the Obj States of a virtual objects to be switched to dead state, object Sending event to be used to indicate in the first object set, there are the Obj States of a virtual objects to be switched to moving condition.
For example, it is OnSoldierAdd event that object, which increases event, it is OnSoldierRemove thing that object, which removes event, Part, it is OnSoldierSend event that object, which sends event,.
It optionally, further include the following steps after step 303d, as shown in Figure 8:
Step 801, according to the corresponding object of attack quantity of the second object set, corresponding with object of attack quantity the is determined The target of an object set defends number of objects, and object of attack quantity and target defence number of objects have default corresponding relationship.
Wherein, defence number of objects refers to that the quantity of the first defence object in the first object set, object of attack quantity are Refer to the quantity that the first object of attack of the first object set is attacked in the second object set.
Optionally, the current operational information in decision support system further includes the corresponding defence number of objects of the first object set Measure object of attack quantity corresponding with the second object set.
Logic control implementations obtain the first object set pair by the first behavior tree example in real time from decision support system Virtual objects total quantity, defence number of objects and the corresponding object of attack quantity of second set object answered.
Optionally, default corresponding pass of the object of attack quantity with target defence number of objects is stored in logic control implementations System.
In a schematical example, the default corresponding relationship such as table of object of attack quantity and target defence number of objects Shown in four.When object of attack quantity is 1, it is 2 that target, which defends number of objects,;When object of attack quantity is 2, target defence pair As quantity is 3;When object of attack quantity is 5, it is 5 that target, which defends number of objects,;When object of attack quantity is 4, target is anti- Imperial number of objects is 7.Setting side of the present embodiment to the default corresponding relationship of attack number of objects and target defence number of objects Formula is not limited.It is illustrated in the following, being based only upon provided by table four and presetting corresponding relationship.
Table four
Object of attack quantity (a) Target defends number of objects (a)
1 2
2 3
3 5
4 7
Step 802, judge whether the corresponding virtual objects total quantity of the first object set is less than target defence number of objects.
Logic control implementations judge whether the corresponding virtual objects total quantity of the first object set is less than target defence object Quantity executes above-mentioned if the corresponding virtual objects total quantity of the first object set is greater than or equal to target and defends number of objects Step 304;If the corresponding virtual objects total quantity of the first object set, which is less than target, defends number of objects, 803 are thened follow the steps.
Step 803, if the corresponding virtual objects total quantity of the first object set is less than target and defends number of objects, pass through First behavior tree example detection presets trigger event.
Optionally, logic control implementations detect the first object set and the second object set by the first behavior tree example simultaneously Close corresponding default trigger event.
Step 804, when default trigger event is the trigger event of the first object set, determine that the first object set is corresponding Practical defence number of objects.
Optionally, the value for the n in n virtual objects that practical defence number of objects is related to for above-mentioned each embodiment.
In one possible implementation, when the virtual objects that default trigger event includes the first object set increase thing When part, one is added to obtain practical defence number of objects the corresponding virtual objects total quantity of the first object set.
For example, the corresponding virtual objects total quantity of the first object set is 1, presetting trigger event is the first object set OnSoldierAdd event, then practical defence number of objects is 1+1=2.
In alternatively possible implementation, when the virtual objects that default trigger event includes the first object remove event When, the corresponding virtual objects total quantity of the first object is subtracted one and obtains practical defence number of objects.
For example, the corresponding virtual objects total quantity of the first object set is 1, presetting trigger event is the first object set OnSoldierRemove event, then practical defence number of objects is 1-1=0.
Optionally, when logic control implementations determine that the corresponding reality of the first object set defends number of objects, by n's Value is determined as practical defence number of objects, executes above-mentioned steps 304.
Step 805, when default trigger event is the trigger event of the second object set, the first object set is redefined Target defend number of objects.
In one possible implementation, when the virtual objects that default trigger event includes the second object remove event When, the corresponding object of attack quantity of the second object is subtracted one and obtains current attack number of objects, according to current attack number of objects Redefine the target defence number of objects of the first object.
For example, the corresponding virtual objects total quantity of the second object set is 3, presetting trigger event is the second object set OnSoldierRemove event, then current attack number of objects is 3-1=2, according to current attack number of objects " 2 ", root again The target defence number of objects that the first object is determined according to default corresponding relationship is " 3 ".
In alternatively possible implementation, when default trigger event includes that virtual objects send event, by second The corresponding object of attack quantity of object adds one to obtain current attack number of objects, redefines according to current attack number of objects The target of an object defends number of objects.
For example, the corresponding virtual objects total quantity of the second object set is 3, presetting trigger event is the second object set OnSoldierSend event, then current attack number of objects is 3+1=4, according to current attack number of objects " 4 ", basis again Default corresponding relationship determines that the target defence number of objects of the first object is " 7 ".
Optionally, the target defence number of objects and then secondary of the first object set is redefined in logic control implementations Step 802 is executed, i.e., judges whether the corresponding virtual objects total quantity of the first object set is less than target defence number of objects again Amount.
By taking virtual environment is virtual game environment as an example, in a schematical example, when our camp is by enemy In camp when the attack of 3 soldiers, determine the target execution route of the first behavior tree example for defence path, logic control implementations According to default corresponding relationship, target defence number of objects " 5 " corresponding with object of attack quantity " 3 " is determined, i.e. our camp needs It sends 5 soldiers to be on the defensive, and at this time in our camp altogether only includes 4 soldiers, is i.e. logic control implementations are judged Soldier's total quantity " 4 " is less than target defence number of objects " 5 ", trigger event is detected, when detecting that our camp is corresponding When OnSoldierRemove event, i.e., increases a soldier in our camp, send this 4 soldier to defend the 3 of enemy camp A soldier, the soldier in our camp eliminates 1 soldier in enemy camp during defence, then logic control implementations are examined at this time The corresponding OnSoldierRemove event in enemy camp is measured, determines that object of attack quantity is " 2 " at this time, again according to default Corresponding relationship determines that target defence quantity is " 3 ", i.e., our camp only needs 3 soldiers to be on the defensive at this time.
In conclusion it is the default triggering thing of the first behavior tree example setting that the embodiment of the present invention, which also passes through logic control implementations, Part, corresponding, the first behavior tree detects default trigger event, and default trigger event includes that object increases event, object removes thing Part and object send at least one of event;The first behavior tree example is avoided to obtain currently from decision support system always The case where operation information, detects default trigger event by the first behavior tree and carries out decision, it is true to improve the first behavior tree example Set the goal execution route when efficiency.
Following is apparatus of the present invention embodiment, can be used for executing embodiment of the present invention method.For apparatus of the present invention reality Undisclosed details in example is applied, embodiment of the present invention method is please referred to.
Referring to FIG. 9, it illustrates the structural schematic diagrams of analyzing logic control device provided by one embodiment of the present invention. The analyzing logic control device can be by special hardware circuit, alternatively, software and hardware is implemented in combination with as logic control implementations All or part of, the analyzing logic control device include: obtain module 910, the first determining module 920, second determine mould Block 930 and control module 940.
Module 910 is obtained, for realizing above-mentioned steps 201 or 301.
First determining module 920, for realizing above-mentioned steps 202 or 303.
Second determining module 930, for realizing above-mentioned steps 203.
Control module 940, for realizing above-mentioned steps 204.
In the alternative embodiment provided based on embodiment illustrated in fig. 9, as shown in Figure 10, second determining module 930, comprising: the first call unit 931, first acquisition unit 932 and determination unit 933.
First call unit 931, for realizing above-mentioned steps 304.
First acquisition unit 932, for realizing above-mentioned steps 305.
Determination unit 933, for realizing above-mentioned steps 306.
In the alternative embodiment provided based on embodiment illustrated in fig. 9, as shown in Figure 10, the control module 940, packet It includes: first control unit 941 and/or the second control unit 942;
First control unit 941, for for each virtual objects in n virtual objects, by calling the second behavior The first function control virtual objects set in example execute moving event;
Second control unit 942, for for each virtual objects in n virtual objects, by calling the second behavior The second function control virtual objects set in example execute construction event.
In the alternative embodiment provided based on embodiment illustrated in fig. 9, as shown in Figure 10, first control unit 941, It is also used to determine virtual objects corresponding target position parameters, target position parameter is used to indicate to be moved to needed for virtual objects Target position;By calling first function, control virtual objects are moved on the corresponding target position of target position parameter.
In the alternative embodiment provided based on embodiment illustrated in fig. 9, as shown in Figure 10, the second control unit 942, It is also used to determine that the corresponding target type parameter of virtual objects, target type parameter are used to indicate the void built needed for virtual objects The proposed type built;By calling second function, control virtual objects build Virtual Building corresponding with target type parameter.
In the alternative embodiment provided based on embodiment illustrated in fig. 9, as shown in Figure 10, the first determining module 920, For realizing above-mentioned steps 303d.
Control module 940 is also used to for each virtual objects in n virtual objects, by calling the second behavior tree First function control virtual objects in example execute moving event.
In the alternative embodiment provided based on embodiment illustrated in fig. 9, as shown in Figure 10, the first determining module 920, It is also used to when the mark of the current run case in current operational information is not attack mark, it is real by the first behavior tree Example calls m the second corresponding preset interfaces of behavior tree example;It is corresponding default according to m the second behavior tree examples Interface obtains the corresponding Obj State of m virtual objects;It is respectively corresponded to according to current operational information and m virtual objects Obj State, at least one execution route of the first behavior tree example determine target execution route.
In the alternative embodiment provided based on embodiment illustrated in fig. 9, as shown in Figure 10, the first determining module 920, It is also used to realize above-mentioned steps 303f.
Control module 940 is also used to for each virtual objects in n virtual objects, by calling the second behavior tree First function control virtual objects in example execute moving event.
In the alternative embodiment provided based on embodiment illustrated in fig. 9, as shown in Figure 10, the first determining module 920, It is also used to realize above-mentioned steps 303g.
Control module 940 is also used to for each virtual objects in n virtual objects, by calling the second behavior tree First function control virtual objects in example execute moving event, and call second function control virtual objects to execute and build thing Part.
Correlative detail is in combination with referring to figs. 2 to embodiment of the method shown in Fig. 8.Wherein, module 910 is obtained to be also used to realize Any other implicit or disclosed function relevant to obtaining step in above method embodiment;First determining module 920 and Two determining modules 930 are also used to realize any other implicit or disclosed function relevant to step is determined in above method embodiment Energy;Control module 940 is also used to realize any other implicit or disclosed relevant to rate-determining steps in above method embodiment Function.
It should be noted that device provided by the above embodiment, when realizing its function, only with above-mentioned each functional module It divides and carries out for example, can according to need in practical application and be completed by different functional modules above-mentioned function distribution, The internal structure of equipment is divided into different functional modules, to complete all or part of the functions described above.In addition, Apparatus and method embodiment provided by the above embodiment belongs to same design, and specific implementation process is detailed in embodiment of the method, this In repeat no more.
The embodiment of the invention provides a kind of logic control implementations, which includes processor and memory, At least one instruction, at least a Duan Chengxu, code set or instruction set, at least one instruction, at least one section are stored in memory Program, code set or instruction set are loaded by processor and are executed the system logic control to realize above-mentioned each embodiment of the method offer Method processed.
Optionally, which is terminal or server.
Figure 11 is please referred to, it is specific next it illustrates the structural schematic diagram of terminal 1100 provided by one embodiment of the present invention Say: terminal 1100 may include RF (Radio Frequency, radio frequency) circuit 1110, include one or more calculating The memory 1120 of machine readable storage medium storing program for executing, input unit 1130, display unit 1140, sensor 1150, voicefrequency circuit 1160, WiFi (wireless fidelity, Wireless Fidelity) module 1170, the processing for including one or more than one processing core The components such as device 1180 and power supply 1190.It will be understood by those skilled in the art that device structure shown in Figure 11 is not constituted Restriction to equipment may include perhaps combining certain components or different component cloth than illustrating more or fewer components It sets.Wherein:
RF circuit 1110 can be used for receiving and sending messages or communication process in, signal sends and receivees, particularly, by base station After downlink information receives, one or the processing of more than one processor 1180 are transferred to;In addition, the data for being related to uplink are sent to Base station.In general, RF circuit 1110 include but is not limited to antenna, at least one amplifier, tuner, one or more oscillator, It is subscriber identity module (SIM) card, transceiver, coupler, LNA (Low Noise Amplifier, low-noise amplifier), double Work device etc..In addition, RF circuit 1110 can also be communicated with network and other equipment by wireless communication.Wireless communication can be used Any communication standard or agreement, including but not limited to GSM (Global System of Mobile communication, the whole world Mobile communcations system), GPRS (General Packet Radio Service, general packet radio service), CDMA (Code Division Multiple Access, CDMA), WCDMA (Wideband Code Division Multiple Access, wideband code division multiple access), LTE (Long Term Evolution, long term evolution), Email, SMS (Short Messaging Service, SMS (Short Message Service)) etc..Memory 1120 can be used for storing software program and module.Processor 1180 are stored in the software program and module of memory 1120 by operation, at various function application and data Reason.Memory 1120 can mainly include storing program area and storage data area, wherein storing program area can storage program area, Application program needed at least one function (such as sound-playing function, image player function etc.) etc.;Storage data area can deposit Storage uses created data (such as audio data, phone directory etc.) etc. according to terminal 1100.In addition, memory 1120 can be with It can also include nonvolatile memory, for example, at least disk memory, a flash memory including high-speed random access memory Device or other volatile solid-state parts.Correspondingly, memory 1120 can also include Memory Controller, to provide The access of processor 1180 and input unit 1130 to memory 1120.
Input unit 1130 can be used for receiving the number or character information of input, and generate and user setting and function Control related keyboard, mouse, operating stick, optics or trackball signal input.Specifically, input unit 1130 may include touching Sensitive surfaces 1131 and other input equipments 1132.Touch sensitive surface 1131, also referred to as touch display screen or Trackpad collect User on it or nearby touch operation (such as user using any suitable object or attachment such as finger, stylus touch-sensitive Operation on surface 1131 or near touch sensitive surface 1131), and corresponding attachment device is driven according to preset formula. Optionally, touch sensitive surface 1131 may include both touch detecting apparatus and touch controller.Wherein, touch detecting apparatus is examined The touch orientation of user is surveyed, and detects touch operation bring signal, transmits a signal to touch controller;Touch controller from Touch information is received on touch detecting apparatus, and is converted into contact coordinate, then gives processor 1180, and can reception processing Order that device 1180 is sent simultaneously is executed.Furthermore, it is possible to more using resistance-type, condenser type, infrared ray and surface acoustic wave etc. Seed type realizes touch sensitive surface 1131.In addition to touch sensitive surface 1131, input unit 1130 can also include other input equipments 1132.Specifically, other input equipments 1132 can include but is not limited to physical keyboard, function key (such as volume control button, Switch key etc.), trace ball, mouse, one of operating stick etc. or a variety of.
Display unit 1140 can be used for showing information input by user or the information and equipment 110 that are supplied to user Various graphical user interface, these graphical user interface can be made of figure, text, icon, video and any combination thereof. Display unit 1140 may include display panel 1141, optionally, can use LCD (Liquid Crystal Display, liquid crystal Display), the forms such as OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode) configure display panel 1141.Further, touch sensitive surface 1131 can be covered on display panel 1141, when touch sensitive surface 1131 detects on it Or after neighbouring touch operation, processor 1180 is sent to determine the type of touch event, is followed by subsequent processing device 1180 according to touching The type for touching event provides corresponding visual output on display panel 1141.Although in Figure 11, touch sensitive surface 1131 and aobvious Show that panel 1141 is to realize input and input function as two independent components, but it in some embodiments it is possible to will Touch sensitive surface 1131 and display panel 1141 integrate and realize and output and input function.
Terminal 1100 may also include at least one sensor 1150, such as optical sensor, motion sensor and other biographies Sensor.Specifically, optical sensor may include ambient light sensor and proximity sensor, wherein ambient light sensor can be according to ring The light and shade of border light adjusts the brightness of display panel 1141, and proximity sensor can close when terminal 1100 is moved in one's ear Display panel 1141 and/or backlight.As a kind of motion sensor, gravity accelerometer can detect in all directions The size of (generally three axis) acceleration, can detect that size and the direction of gravity, can be used to identify mobile phone posture when static It (for example pedometer, is struck using (such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function Hit) etc.;Other biographies such as the gyroscope, barometer, hygrometer, thermometer, the infrared sensor that can also configure as terminal 1100 Sensor, details are not described herein.
Voicefrequency circuit 1160, loudspeaker 1121, microphone 1122 can provide the audio interface between user and terminal 1100. Electric signal after the audio data received conversion can be transferred to loudspeaker 1121, by loudspeaker 1121 by voicefrequency circuit 1160 Be converted to voice signal output;On the other hand, the voice signal of collection is converted to electric signal by microphone 1122, by voicefrequency circuit 1160 receive after be converted to audio data, then by after the processing of audio data output processor 1180, through RF circuit 1110 to send It exports to memory 1120 to another equipment, or by audio data to be further processed.Voicefrequency circuit 1160 is also possible to wrap Earphone jack is included, to provide the communication of peripheral hardware earphone Yu terminal 1100.
WiFi belongs to short range wireless transmission technology, and terminal 1100 can help user to receive and dispatch electricity by WiFi module 1170 Sub- mail, browsing webpage and access streaming video etc., it provides wireless broadband internet access for user.Although Figure 11 shows Go out WiFi module 1170, but it is understood that, and it is not belonging to must be configured into for terminal 1100, it completely can be according to need It to omit within the scope of not changing the essence of the invention.
Processor 1180 is the control centre of terminal 1100, utilizes each portion of various interfaces and connection whole equipment Point, by running or execute the software program and/or module that are stored in memory 1120, and calls and be stored in memory Data in 1120 execute the various functions and processing data of terminal 1100, to carry out integral monitoring to equipment.Optionally, Processor 1180 may include one or more processing cores;Optionally, processor 1180 can integrate application processor and modulatedemodulate Adjust processor, wherein the main processing operation system of application processor, user interface and application program etc., modem processor Main processing wireless communication.It is understood that above-mentioned modem processor can not also be integrated into processor 1180.
Terminal 1100 further includes the power supply 1190 (such as battery) powered to all parts, it is preferred that power supply can pass through Power-supply management system and processor 1180 are logically contiguous, to realize management charging, electric discharge, Yi Jigong by power-supply management system The functions such as consumption management.Power supply 1190 can also include one or more direct current or AC power source, recharging system, power supply The random components such as fault detection circuit, power adapter or inverter, power supply status indicator.
Although being not shown, terminal 1100 can also include camera, bluetooth module etc., and details are not described herein.
Figure 12 is please referred to, it illustrates the structural schematic diagrams of server 1200 provided by one embodiment of the present invention.Specifically For: the server 1200 is including central processing unit (CPU) 1201 including random access memory (RAM) 1202 and only Read the system storage 1204 of memory (ROM) 1203, and connection system storage 1204 and central processing unit 1201 System bus 1205.The server 1200 further includes that the substantially defeated of information is transmitted between each device helped in computer Enter/output system (I/O system) 1206, and is used for storage program area 1213, application program 1214 and other program modules 1215 mass-memory unit 1207.
The basic input/output 1206 includes display 1208 for showing information and inputs for user The input equipment 1209 of such as mouse, keyboard etc of information.Wherein the display 1208 and input equipment 1209 all pass through The input and output controller 1210 for being connected to system bus 1205 is connected to central processing unit 1201.The basic input/defeated System 1206 can also include input and output controller 1210 to touch for receiving and handling from keyboard, mouse or electronics out Control the input of multiple other equipment such as pen.Similarly, input and output controller 1210 also provide output to display screen, printer or Other kinds of output equipment.
The mass-memory unit 1207 (is not shown by being connected to the bulk memory controller of system bus 1205 It is connected to central processing unit 1201 out).The mass-memory unit 1207 and its associated computer-readable medium are Server 1200 provides non-volatile memories.That is, the mass-memory unit 1207 may include such as hard disk or The computer-readable medium (not shown) of person's CD-ROI driver etc.
Without loss of generality, the computer-readable medium may include computer storage media and communication media.Computer Storage medium includes information such as computer readable instructions, data structure, program module or other data for storage The volatile and non-volatile of any method or technique realization, removable and irremovable medium.Computer storage medium includes RAM, ROM, EPROM, EEPROM, flash memory or other solid-state storages its technologies, CD-ROM, DVD or other optical storages, tape Box, tape, disk storage or other magnetic storage devices.Certainly, skilled person will appreciate that the computer storage medium It is not limited to above-mentioned several.Above-mentioned system storage 1204 and mass-memory unit 1207 may be collectively referred to as memory.
According to various embodiments of the present invention, the server 1200 can also be arrived by network connections such as internets Remote computer operation on network.Namely server 1200 can be connect by the network being connected on the system bus 1205 Mouth unit 1211 is connected to network 1212, in other words, it is other kinds of to be connected to that Network Interface Unit 1211 also can be used Network or remote computer system (not shown).
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Those of ordinary skill in the art will appreciate that realizing whole or portion in the analyzing logic control method of above-described embodiment It may be implemented by hardware step by step, relevant hardware can also be instructed to complete by program, the program can deposit It is stored in a kind of computer readable storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.

Claims (14)

1. a kind of analyzing logic control method, which is characterized in that the described method includes:
The first behavior tree example is obtained, includes for carrying out logic control extremely to virtual environment in the first behavior tree example A few execution route;
According to the current operational information of the virtual environment, at least one execution route of the first behavior tree example Middle determining target execution route;
According to the target execution route, determine that n virtual objects for needing to control and the n virtual objects are corresponding Object event, the n are positive integer;
By the corresponding second behavior tree example of the n virtual objects, it is respectively right to control the n virtual objects execution The object event answered.
2. the method according to claim 1, wherein the virtual environment includes m virtual objects, the basis The target execution route determines n virtual objects for needing to control, comprising:
Default the connecing of the corresponding second behavior tree example of the m virtual objects is called by the first behavior tree example Mouthful;
According to the preset interface of the m the second behavior tree examples, the corresponding object shape of the m virtual objects is obtained State, the Obj State include one of standby mode, moving condition, attack state, construction state and dead state;
Determine that the Obj State is not n virtual objects of the dead state from the m virtual objects.
3. the method according to claim 1, wherein described pass through the n virtual objects corresponding Two behavior tree examples control the n virtual objects and execute corresponding object event, comprising:
The virtual objects described for each of the n virtual objects, by calling the in the second behavior tree example One function controls the virtual objects and executes moving event;And/or
The virtual objects described for each of the n virtual objects, by calling the in the second behavior tree example Two functions control the virtual objects and execute construction event.
4. according to the method described in claim 3, it is characterized in that, described by calling the in the second behavior tree example One function controls the virtual objects and executes moving event, comprising:
Determine that the corresponding target position parameter of the virtual objects, the target position parameter are used to indicate the virtual objects institute The target position that need to be moved to;
By calling the first function, controls the virtual objects and be moved to the corresponding target of the target position parameter On position.
5. according to the method described in claim 3, it is characterized in that, described by calling the in the second behavior tree example Two functions control the virtual objects and execute construction event, comprising:
Determine that the corresponding target type parameter of the virtual objects, the target type parameter are used to indicate the virtual objects institute The type for the Virtual Building that need to be built;
By calling the second function, it is corresponding with the target type parameter described virtual to control the virtual objects construction Building.
6. method according to any one of claims 1 to 5, the current operational information according to the virtual environment, in institute It states and determines target execution route at least one execution route of the first behavior tree example, comprising:
When the current run case in the current operational information be identified as attack mark when, determine first behavior The target execution route for setting example is defence path;
It is described by the corresponding second behavior tree example of the n virtual objects, control the n virtual objects execute it is each The self-corresponding object event, comprising:
The virtual objects described for each of the n virtual objects, by calling the in the second behavior tree example One function controls the virtual objects and executes the moving event.
7. method according to any one of claims 1 to 5, which is characterized in that the current fortune according to the virtual environment Row information determines target execution route at least one execution route of the first behavior tree example, comprising:
When the mark of the current run case in the current operational information is not attack mark, pass through the first row The preset interface of m the second behavior tree examples is called for tree example;
According to the preset interface of m the second behavior tree examples, the corresponding object shape of the m virtual objects is obtained State;
According to the current operational information and the corresponding Obj State of m virtual objects, in the first behavior tree The target execution route is determined at least one execution route of example.
8. the method according to the description of claim 7 is characterized in that it is described according to the current operational information and it is described m it is empty The quasi- corresponding Obj State of object, determines at least one execution route of the first behavior tree example The target execution route, comprising:
When virtual resource quantity the first preset condition of satisfaction in the current operational information, and in the m virtual objects When the quantity of the virtual objects of standby mode is greater than third predetermined threshold value, the target of the first behavior tree example is determined Execution route is attack path;
It is described by the corresponding second behavior tree example of the n virtual objects, control the n virtual objects execute it is each The self-corresponding object event, comprising:
The virtual objects described for each of the n virtual objects, by calling the in the second behavior tree example One function controls the virtual objects and executes the moving event.
9. the method according to the description of claim 7 is characterized in that it is described according to the current operational information and it is described m it is empty The quasi- corresponding Obj State of object, determines at least one execution route of the first behavior tree example The target execution route, comprising:
When the virtual resource quantity in the current operational information meets the first preset condition, construction parameter meets the second default item Part, and the quantity for the virtual objects being in standby in the m virtual objects be greater than five preset thresholds when, determine described in The target execution route of first behavior tree example is to build path;
It is described by the corresponding second behavior tree example of the n virtual objects, control the n virtual objects execute it is each The self-corresponding object event, comprising:
The virtual objects described for each of the n virtual objects, by calling the in the second behavior tree example One function controls the virtual objects and executes the moving event, and second function is called to control described in the virtual objects execution Construction event.
10. a kind of analyzing logic control device, which is characterized in that described device includes:
Obtain module, include for obtaining the first behavior tree example, in the first behavior tree example for virtual environment into At least one execution route of row logic control;
First determining module, for the current operational information according to the virtual environment, in the institute of the first behavior tree example It states and determines target execution route at least one execution route;
Second determining module, for determining n virtual objects for needing to control and the n according to the target execution route The corresponding object event of virtual objects, the n are positive integer;
Control module, for controlling the n virtually by the corresponding second behavior tree example of the n virtual objects Object executes corresponding object event.
11. device according to claim 10, which is characterized in that second determining module, comprising:
First call unit, first acquisition unit and determination unit;
First call unit, for calling the m virtual objects corresponding by the first behavior tree example The preset interface of second behavior tree example;
The first acquisition unit obtains the m virtually for the preset interface according to the m the second behavior tree examples The corresponding Obj State of object, the Obj State include standby mode, moving condition, attack state, construction state and One of dead state;
The determination unit, for determining that the Obj State is not n of the dead state from the m virtual objects Virtual objects.
12. according to the method described in claim 10, it is characterized in that, the control module, comprising: first control unit and/ Or second control unit;
The first control unit, for the virtual objects described for each of the n virtual objects, described in calling First function in second behavior tree example controls the virtual objects and executes moving event;
Second control unit, for the virtual objects described for each of the n virtual objects, described in calling Second function in second behavior tree example controls the virtual objects and executes construction event.
13. a kind of logic control implementations, which is characterized in that the logic control implementations include processor and memory, described to deposit Be stored at least one instruction, at least a Duan Chengxu, code set or instruction set in reservoir, at least one instruction, it is described extremely A few Duan Chengxu, the code set or instruction set are loaded by the processor and are executed to realize such as any institute of claim 1 to 8 The analyzing logic control method stated.
14. a kind of computer readable storage medium, which is characterized in that be stored at least one instruction, extremely in the storage medium A few Duan Chengxu, code set or instruction set, at least one instruction, an at least Duan Chengxu, the code set or instruction Collection is loaded by the processor and is executed to realize analyzing logic control method as described in any of the claims 1 to 8.
CN201711045554.3A 2017-10-31 2017-10-31 System logic control method and device Active CN109725892B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711045554.3A CN109725892B (en) 2017-10-31 2017-10-31 System logic control method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711045554.3A CN109725892B (en) 2017-10-31 2017-10-31 System logic control method and device

Publications (2)

Publication Number Publication Date
CN109725892A true CN109725892A (en) 2019-05-07
CN109725892B CN109725892B (en) 2022-02-22

Family

ID=66293963

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711045554.3A Active CN109725892B (en) 2017-10-31 2017-10-31 System logic control method and device

Country Status (1)

Country Link
CN (1) CN109725892B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112221129A (en) * 2020-10-19 2021-01-15 杭州电魂网络科技股份有限公司 Task triggering method and system based on directed graph

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0313975A2 (en) * 1987-10-29 1989-05-03 International Business Machines Corporation Design and construction of a binary-tree system for language modelling
US5481649A (en) * 1993-03-09 1996-01-02 The University Of Tennessee Research Corp. Method and apparatus using a decision tree in an adjunct system cooperating with another physical system
CA2494799A1 (en) * 2005-01-28 2006-07-28 Roca Engineering Ltd. Method for clustering decision trees in data classifiers
CN102662855A (en) * 2012-04-17 2012-09-12 华为技术有限公司 Storage method and system of binary tree
CN103761108A (en) * 2014-02-14 2014-04-30 杭州朗和科技有限公司 Method and device for achieving behavior tree
CN106250100A (en) * 2016-08-15 2016-12-21 腾讯科技(深圳)有限公司 Analyzing logic control method and device
CN107115673A (en) * 2017-04-27 2017-09-01 腾讯科技(深圳)有限公司 A kind of behavior of Behavior-based control tree performs method and apparatus

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0313975A2 (en) * 1987-10-29 1989-05-03 International Business Machines Corporation Design and construction of a binary-tree system for language modelling
US5481649A (en) * 1993-03-09 1996-01-02 The University Of Tennessee Research Corp. Method and apparatus using a decision tree in an adjunct system cooperating with another physical system
CA2494799A1 (en) * 2005-01-28 2006-07-28 Roca Engineering Ltd. Method for clustering decision trees in data classifiers
CN102662855A (en) * 2012-04-17 2012-09-12 华为技术有限公司 Storage method and system of binary tree
CN103761108A (en) * 2014-02-14 2014-04-30 杭州朗和科技有限公司 Method and device for achieving behavior tree
CN106250100A (en) * 2016-08-15 2016-12-21 腾讯科技(深圳)有限公司 Analyzing logic control method and device
CN107115673A (en) * 2017-04-27 2017-09-01 腾讯科技(深圳)有限公司 A kind of behavior of Behavior-based control tree performs method and apparatus

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112221129A (en) * 2020-10-19 2021-01-15 杭州电魂网络科技股份有限公司 Task triggering method and system based on directed graph

Also Published As

Publication number Publication date
CN109725892B (en) 2022-02-22

Similar Documents

Publication Publication Date Title
CN104516760B (en) A kind of method, device and mobile terminal of operating system hot-swap
CN105024984B (en) Authority setting method, apparatus and system
CN106027108B (en) A kind of indoor orientation method, device and wearable device and mobile terminal
CN107291317B (en) The selection method and device of target in a kind of virtual scene
CN104123276B (en) The hold-up interception method of pop-up, device and system in a kind of browser
CN103207951B (en) Way finding method and device
CN104901991B (en) Virtual resource transfer method, device and system
CN105120090B (en) Operate recognition methods and device
CN104077184B (en) A kind of course control method and computer system of application program
CN106020844A (en) Method and device for determining kernel running configurations in processor
CN103530520A (en) Method and terminal for obtaining data
CN110377527A (en) A kind of method and relevant device of memory management
CN106375582A (en) Vibration control method and apparatus
CN109316743A (en) A kind of game control method, terminal and computer readable storage medium
CN105739839B (en) The selection method and device of multimedia menu item
CN103365658B (en) A kind of resource access method and computer equipment
CN108809805A (en) A kind of information interacting method, system and public's account client
CN106385486B (en) A kind of control method of proximity sensor, device and mobile terminal
CN107682860A (en) Redirect management-control method, device, the network equipment and mobile terminal
CN103533139B (en) Data management method and device of multi-card user and mobile terminal
CN110113779A (en) Test method, system, test platform, mobile terminal and the medium of eSIM card
CN109862184A (en) Terminal and its resource management-control method, computer readable storage medium
CN105282330B (en) The method and device of automatic connection network
CN103458010B (en) Member registration method, device, server and mobile terminal
CN109725892A (en) Analyzing logic control method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant