CN105031921A - Anticollision method and system in game object disordered mobile process - Google Patents
Anticollision method and system in game object disordered mobile process Download PDFInfo
- Publication number
- CN105031921A CN105031921A CN201510081224.4A CN201510081224A CN105031921A CN 105031921 A CN105031921 A CN 105031921A CN 201510081224 A CN201510081224 A CN 201510081224A CN 105031921 A CN105031921 A CN 105031921A
- Authority
- CN
- China
- Prior art keywords
- game object
- coefficient
- kinergety
- influence coefficient
- impact point
- 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.)
- Pending
Links
Landscapes
- Processing Or Creating Images (AREA)
Abstract
The invention provides an anticollision method and system in a game object disordered mobile process, and relates to the game object mobile field; the method comprises the following steps: a reception step, receiving a mobile order indicating the game object to reach a terminal point, and setting a mobile route, comprising at least one target point, of the game object according to the mobile order; a mobile step, enabling the game object to move to a next target point according to a first preset algorithm, wherein the first preset algorithm refers to: mobile distance and direction= direction vector X mobile distance/unit time X timeslice X motion energy influence coefficient of the present direction; a determination step. The method and system can effectively prevent collisions of the game objects in the disordered mobile process.
Description
Technical field
The present invention relates to game object mobile field, particularly relate to the method and system of the anticollision in the unordered moving process of a kind of game object.
Background technology
In the Games Software works known at present, when a lot of game objects moves in the same area, take to make respective graphic representations parts not overlapping and stop mobile a period of time after the event of colliding, and whom decides with parameters such as volume, speed, priority and dodge the method who waits for and solve this problem.
Prior art have following shortcoming: each role in moving process be until contact on stop again, significantly do not dodge in advance and intend and the behavior such as turning to of taking and deceleration for this reason, often see and to move in the same way before and after two objects but because object speed is very fast below, and constantly answer back to objects in front, or two objects of movement in opposite directions until face hits, the contact of face zero distance is upper just to be stopped.Namely these factitious phenomenons can cause the chaotic and nature of mobile phenomenon, repeatedly the mend the fold after the sheep is lost pathfinding of formula of calling program is made up, the operation of Games Software user can be made again to become very difficult and uncomfortable.
Summary of the invention
The method and system of the anticollision that will provide in the unordered moving process of a kind of game object are provided.
Especially, the invention provides the method for the anticollision in the unordered moving process of a kind of game object, comprise: receiving step, receive the move that instruction game object is reached home, according to the mobile alignment comprising at least one impact point of described move setting game object; Mobile step, described game object is moved to next impact point according to the first preset algorithm, and described first preset algorithm is: the kinergety influence coefficient in displacement and direction=current direction of direction vector * unit interval displacement * timeslice *; First determining step, carries out in the process of movement at described game object according to described first preset algorithm, when meeting first and being pre-conditioned, judges whether described game object arrives the next impact point in described mobile alignment; If arrive described next impact point, then judge whether described game object reaches home, if arrive described terminal, then stop moving and waiting for new instruction, if do not arrive described terminal, then continue to perform described mobile step; If do not arrive described next impact point, then detect the possible colliding object in preset range, obtain the kinergety influence coefficient in current direction according to preset algorithm, detect described game object and whether be more than or equal to default minimum coefficient at the kinergety influence coefficient in current direction; If be less than described minimum coefficient at the kinergety influence coefficient in current direction, then the new direction of motion of described game object is set according to the second preset algorithm, performs described mobile step; If be more than or equal to described minimum coefficient at the kinergety influence coefficient in current direction, judge that whether current direction is consistent with target direction, described target direction refers to the direction pointing to next impact point from current location point; If consistent, then perform described mobile step; If inconsistent, then judge whether described game object is more than or equal to described minimum coefficient at the kinergety influence coefficient of described target direction; If be less than described minimum coefficient at the kinergety influence coefficient of target direction, then perform described mobile step; If be more than or equal to described minimum coefficient at the kinergety influence coefficient of target direction, then adjust the wish moving direction of described game object, make it turn to described target direction, and perform described mobile step.
Alternatively, the kinergety influence coefficient in described current direction is the minimum of a value among the kinematic coefficient of described possibility colliding object; The kinematic coefficient of each described possibility colliding object is according to each described possibility colliding object and the distance of self, the angle in described possibility colliding object and self direction, the numeral be between 0 and 1 that the speed of described possibility colliding object and direction are tried to achieve.
Alternatively, described second algorithm comprises: the first detecting step, detects the kinergety influence coefficient of game object in current direction; Second detecting step, makes N equal 1, detects game object to the new kinergety influence coefficient N1 obtained during anticlockwise N*A degree direction, detects game object to the new kinergety influence coefficient N2 obtained during right rotation N*A degree direction; Second determining step, judges whether N1 and N2 all meets and is more than or equal to described minimum coefficient; If all satisfied, then game object is made to turn to the angle and direction that higher value in N1 and N2 is corresponding; If not all satisfied, then judge whether N1 and N2 is all less than described minimum coefficient; If be not all less than, game object is made to turn to the angle and direction that higher value in N1 and N2 is corresponding; If be all less than, judge whether N equals preset times threshold value M; If be not equal to, the N in the second detecting step replaced with N+1 and continues execution second detecting step; If equal, in the kinergety influence coefficient in N1 and N2 and current direction, select maximum, and make game object deflect the angle and direction that described in road, maximum is corresponding, N=1,2,3 ... M.
Alternatively, described method also comprises: foresee steps, presets the size of described minimum coefficient; Described first is pre-conditionedly: after the determining step of last time is finished interval time reach preset time threshold.
Alternatively, when the translational speed of described game object in continuous very first time threshold value is greater than maximum velocity threshold always, described preset time threshold is very first time value; When the translational speed of described game object in continuous second time threshold (as accumulative 5s) is less than minimum speed threshold value always, described preset time threshold is the second time value; Described second time value is greater than described very first time value.
Present invention also offers the system of the anticollision in the unordered moving process of a kind of game object, comprise: receiver module, receive the move that instruction game object is reached home, according to the mobile alignment comprising at least one impact point of described move setting game object; Mobile module, described game object is moved to next impact point according to the first preset algorithm, and described first preset algorithm is: the kinergety influence coefficient in displacement and direction=current direction of direction vector * unit interval displacement * timeslice *; Judge module, carries out in the process of movement at described game object according to described first preset algorithm, when meeting first and being pre-conditioned, judges whether described game object arrives the next impact point in described mobile alignment; If arrive described next impact point, then judge whether described game object reaches home, if arrive described terminal, then stop moving and waiting for new instruction, if do not arrive described terminal, then continue described game object is moved to next impact point according to the first preset algorithm; If do not arrive described next impact point, then detect the possible colliding object in preset range, obtain the kinergety influence coefficient in current direction according to preset algorithm, detect described game object and whether be more than or equal to default minimum coefficient at the kinergety influence coefficient in current direction; If be less than described minimum coefficient at the kinergety influence coefficient in current direction, then the new direction of motion of described game object is set according to the second preset algorithm, and continues described game object is moved to next impact point according to the first preset algorithm; If be more than or equal to described minimum coefficient at the kinergety influence coefficient in current direction, judge that whether current direction is consistent with target direction, described target direction refers to the direction pointing to next impact point from current location point; If consistent, then described game object is made to move to next impact point according to the first preset algorithm; If inconsistent, then judge whether described game object is more than or equal to described minimum coefficient at the kinergety influence coefficient of described target direction; If be less than described minimum coefficient at the kinergety influence coefficient of target direction, then described game object is made to move to next impact point according to the first preset algorithm; If be more than or equal to described minimum coefficient at the kinergety influence coefficient of target direction, then adjust the wish moving direction of described game object, make it turn to described target direction, and described game object is moved to next impact point according to the first preset algorithm.
Alternatively, the kinergety influence coefficient in described current direction is the minimum of a value among the kinematic coefficient of described possibility colliding object; The kinematic coefficient of each described possibility colliding object is according to each described possibility colliding object and the distance of self, the angle in described possibility colliding object and self direction, the numeral be between 0 and 1 that the speed of described possibility colliding object and direction are tried to achieve.
Alternatively, described second preset algorithm is: the first detecting step, detects the kinergety influence coefficient of game object in current direction; Second detecting step, makes N equal 1, detects game object to the new kinergety influence coefficient N1 obtained during anticlockwise N*A degree direction, detects game object to the new kinergety influence coefficient N2 obtained during right rotation N*A degree direction; Second determining step, judges whether N1 and N2 all meets and is more than or equal to described minimum coefficient; If all satisfied, then game object is made to turn to the angle and direction that higher value in N1 and N2 is corresponding; If not all satisfied, then judge whether N1 and N2 is all less than described minimum coefficient; If be not all less than, game object is made to turn to the angle and direction that higher value in N1 and N2 is corresponding; If be all less than, judge whether N equals preset times threshold value M; If be not equal to, the N in the second detecting step replaced with N+1 and continues execution second detecting step; If equal, in the kinergety influence coefficient in N1 and N2 and current direction, select maximum, and make game object deflect the angle and direction that described in road, maximum is corresponding, N=1,2,3 ... M.
Alternatively, described system also comprises: presetting module, presets the size of described minimum coefficient; Described first is pre-conditionedly: after the determining step of last time is finished interval time reach preset time threshold.
Alternatively, when the translational speed of described game object in continuous very first time threshold value is greater than maximum velocity threshold always, described preset time threshold is very first time value; When the translational speed of described game object in continuous second time threshold is less than minimum speed threshold value always, described preset time threshold is the second time value; Described second time value is greater than described very first time value.
Method of the present invention, due to when kinergety influence coefficient is more than or equal to minimum coefficient, can arrange the new direction of motion, therefore effectively can prevent the collision in the unordered movement of game object.
Further, method of the present invention is due to when game object moves, the kinergety influence coefficient in its displacement and direction=current direction of direction vector * unit interval displacement * timeslice *, therefore the kinergety influence coefficient in current direction can affect game object in the displacement of a timeslice and direction, therefore when kinergety influence coefficient less (representing the obstruction that other objects move to it larger), can translational speed be reduced, reduce the possibility of collision.
According to hereafter by reference to the accompanying drawings to the detailed description of the specific embodiment of the invention, those skilled in the art will understand above-mentioned and other objects, advantage and feature of the present invention more.
Accompanying drawing explanation
Hereinafter describe specific embodiments more of the present invention with reference to the accompanying drawings by way of example, and not by way of limitation in detail.Reference numeral identical in accompanying drawing denotes same or similar parts or part.It should be appreciated by those skilled in the art that these accompanying drawings may not be drawn in proportion.In accompanying drawing:
Fig. 1 is the flow chart of the method for anticollision according to an embodiment of the invention in the unordered moving process of game object;
Fig. 2 is the structured flowchart of the system of anticollision according to an embodiment of the invention in the unordered moving process of game object.
Detailed description of the invention
Below with reference to accompanying drawings exemplary embodiment of the present invention is described in more detail.Although show exemplary embodiment of the present invention in accompanying drawing, however should be appreciated that can realize the present invention in a variety of manners and not should limit by the embodiment set forth here.On the contrary, provide these embodiments to be in order to thoroughly the present invention can be understood, and complete for scope of the present invention can be conveyed to those skilled in the art.
Intrinsic not relevant to any certain computer, virtual system or miscellaneous equipment with display at this algorithm provided.Various general-purpose system also can with use based on together with this teaching.According to description above, the structure constructed required by this type systematic is apparent.In addition, the present invention is not also for any certain programmed language.It should be understood that and various programming language can be utilized to realize content of the present invention described here, and the description done language-specific is above to disclose preferred forms of the present invention.
In description provided herein, describe a large amount of detail.But can understand, embodiments of the invention can be put into practice when not having these details.In some instances, be not shown specifically known method, structure and technology, so that not fuzzy understanding of this description.
Fig. 1 is the flow chart of the method for anticollision according to an embodiment of the invention in the unordered moving process of game object.In the embodiment shown in fig. 1, the method for the anticollision in the unordered moving process of a kind of game object is disclosed.First perform step 10, receive the move that instruction game object is reached home, according to the mobile alignment comprising at least one impact point of move setting game object.Perform step 20 subsequently, receive move, calculate mobile alignment.Perform step 30 subsequently, game object is moved to next impact point according to the first preset algorithm, and the first preset algorithm is: the kinergety influence coefficient in displacement and direction=current direction of direction vector * unit interval displacement * timeslice *.Because each impact point is discrete, just to be separated by comparatively dense, therefore game object appears at next impact point according to above-mentioned algorithm a timeslice, so just seem it is moving, and those skilled in the art can find out, according to the first preset algorithm, when the kinergety influence coefficient in current direction changes between 1 and 0, reality can affect the movement velocity of game object.Carry out in the process of movement at game object according to the first preset algorithm, when meeting first pre-conditionedly (can be such as: after the shorter time of one, an interval such as frame, in other words, the continuous moving time after the determining step of last time is finished reaches time threshold, or the continuous moving distance after the determining step of last time is finished reaches distance threshold) time, perform step 40, judge whether game object arrives the next impact point in mobile alignment, if arrive next impact point, then carry out step 110, judge whether game object reaches home, if reach home, then perform step 120, stop moving and waiting for new move, if do not reach home, then continue to perform step 20, if do not arrive next impact point, then perform step 50, detecting in preset range (can be such as the center of circle with the center of game object, fan-shaped central angle is less than or equal to 180 degree, radius is the sector region of R, 90 degree are less than or equal to by the vector of any point on the center of circle to fan-shaped circular arc and the angle in current direction, R can preset) possible colliding object, the kinergety influence coefficient obtaining current direction according to preset algorithm (is greater than 0 and is less than 1, its value is larger, then object is less with the collision possibility of corresponding possible colliding object, otherwise, then possibility is larger), the kinergety influence coefficient in current direction is possible minimum of a value among the kinematic coefficient of colliding object, the kinematic coefficient of each possibility colliding object is according to each possibility colliding object and the distance of self, the angle in possible colliding object and self direction, the numeral be between 0 and 1 that the speed of possible colliding object and direction are tried to achieve.Then perform step 60, detect game object and whether be more than or equal to default minimum coefficient at the kinergety influence coefficient in current direction.If be less than minimum coefficient at the kinergety influence coefficient in current direction, then perform step 70 and step 20 successively, step 70 is: the new direction of motion arranging game object according to the second preset algorithm.Second preset algorithm for: exclude the possible colliding object corresponding to kinergety influence coefficient, judge that carrying out clockwise a angle rotates the first minimum kinematic coefficient of the possible colliding object in the sector region that obtains from current direction and carry out from current direction the relative size that counterclockwise a angle rotates the second minimum kinematic coefficient of the possible colliding object in the sector region that obtains; If the first kinematic coefficient is comparatively large, then game object is to clockwise a angular movement; If the second kinematic coefficient is comparatively large, to then game object is to counterclockwise a angular movement, a is greater than 0 degree and is less than 180 degree.If be more than or equal to minimum coefficient at the kinergety influence coefficient in current direction, then perform step 80, move towards current direction.Perform step 90 subsequently, judge whether current direction (the current kinetic direction of game object) is consistent with target direction, and target direction refers to the direction pointing to next impact point from current location point; If consistent, then perform step 20; If inconsistent, then perform step 100, judge whether game object is more than or equal to minimum coefficient at the kinergety influence coefficient of target direction; If be less than minimum coefficient at the kinergety influence coefficient of target direction, then perform step 20; If be more than or equal to minimum coefficient at the kinergety influence coefficient of target direction, then perform step 130, the wish moving direction of adjustment game object, makes it turn to target direction, and performs step 20 subsequently.
What below illustrate the kinematic coefficient of a game object A and possibility colliding object B asks method.The volume factor of A and B is defined as follows: the accurate reference radius of bidding is 10, then the volume factor of any object is all X/10.Such as, the radius of the radius of A to be the volume factor of 10 A be 1, B is the volume factor of 20 B is 2.The distance coefficient of A and B is defined as follows: set canonical reference distance between two articles as 100 time, this coefficient is 1, then the distance coefficient of any object is all (actual range * 0.5)/(100*0.5) * volume factor.Distance such as between AB is 80, the radius of A is 10, the radius of B is 20, then distance coefficient=(80*0.5)/(100*0.5*10/10)=0.8 of A, distance coefficient=(80*0.5)/(100*0.5*10/20)=0.4 of B, 0.8*0.5+0.4*0.5=0.6, then now the mutual distance coefficient of A and B is 0.6.The coefficient of angularity of the other side's object towards current object is defined as: set current object when the back side of the other side's object then this coefficient as 0, as current object then obtains the coefficient between 0 to 1 according to the angle towards me within the scope of 180 degree, the other side's object front, right opposite is 1, positive side, left and right is the same with the back side is 0, the change of this value should be non-linear averaging, and when facing, parameter is the closer to 1.Velocity coeffficient is defined as: set the speed of object as being radius/second standard reference value, this coefficient is option, for auxiliary improvement, has the phenomenon of identical behavior when many units that data are identical move simultaneously, and can use also can be inapplicable.(those skilled in the art can run away with to calculate the kinematic coefficient of 0 to 1 according to above several parameter through the formula of oneself definition, do not repeat) herein, in the method for the invention, can select the minimum of a value (i.e. kinergety influence coefficient) of the kinematic coefficient of the multiple possibility colliding object in preset range, the core content performance realizing this patent with this kinematic coefficient is slowed down.
Can find out, in the method for the embodiment of the present invention, current object first can along the normally movement of existing route, and some detectings of carrying out real-time in moving process and judging: 1, whether there is other object in certain limit around self; 2, other object whether is had within the scope of self moving direction and own vol; 3, likely move self to cause in the object of obstruction compare with oneself state one by one what find; 4, according to the other side and the distance of self, with the angle in self direction, the speed of the other side and towards etc. parameter obtain several coefficient of performances; 5, the translational speed regulating self current according to these coefficients and towards etc. state, each object can so operate, thus result be exactly mutually between outside certain limit, all just start to perform the behavior preventing from colliding, slow down mutually and dodge, be benefited mutually, prevent trouble before it happens.The method of the embodiment of the present invention takes the method consistent with the move mode of the objects such as the personage in reality and vehicle and solves the problems referred to above, carry out positive to imminent collision is predicted and takes the generation that reasonable effective measures (slow down, turn to) prevent collision accident to greatest extent, allow complex object in scene more rational and orderly movement and do not produce collision and overlapping.The present invention can by being packaged into class by correlation function, its data can both be imported into by any software by the movable objects of oneself and wherein participate in calculating, namely the effect data after each frame of each object of acquisition that can be simple calculates, from enforcement use, also can apply mechanically the object that behavior that the abstract method provided in this patent carrys out control object reaches obstacle avoidance voluntarily.
In one embodiment of the invention, method of the present invention can also comprise foresee steps: the size presetting minimum coefficient.
Fig. 2 is the structured flowchart of the system of anticollision according to an embodiment of the invention in the unordered moving process of game object.In the embodiment shown in Figure 2, the system of the anticollision in the unordered moving process of game object of the present invention at least can comprise receiver module 100, mobile module 200, judge module 300.Receiver module 100, is configured to: receive the move that instruction game object is reached home, according to the mobile alignment comprising at least one impact point of move setting game object.Mobile module 200 is configured to: game object is moved to next impact point according to the first preset algorithm, and the first preset algorithm is: the kinergety influence coefficient in displacement and direction=current direction of direction vector * unit interval displacement * timeslice *.Judge module 300 is configured to: carry out in the process of movement at game object according to the first preset algorithm, when meeting first and being pre-conditioned, judges whether game object arrives the next impact point in mobile alignment; If arrive next impact point, then judge whether game object reaches home, if reach home, then stop moving and waiting for new instruction, if do not reach home, then continue game object is moved to next impact point according to the first preset algorithm; If do not arrive next impact point, then detect the possible colliding object in preset range, obtain the kinergety influence coefficient in current direction according to preset algorithm, detect game object and whether be more than or equal to default minimum coefficient at the kinergety influence coefficient in current direction; If be less than minimum coefficient at the kinergety influence coefficient in current direction, then the new direction of motion of game object is set according to the second preset algorithm, and continues game object is moved to next impact point according to the first preset algorithm; If be more than or equal to minimum coefficient at the kinergety influence coefficient in current direction, judge that whether current direction is consistent with target direction, target direction refers to the direction pointing to next impact point from current location point; If consistent, then game object is made to move to next impact point according to the first preset algorithm; If inconsistent, then judge whether game object is more than or equal to minimum coefficient at the kinergety influence coefficient of target direction; If be less than minimum coefficient at the kinergety influence coefficient of target direction, then game object is made to move to next impact point according to the first preset algorithm; If be more than or equal to minimum coefficient at the kinergety influence coefficient of target direction, then adjust the wish moving direction of game object, make it turn to target direction, and game object is moved to next impact point according to the first preset algorithm.The kinergety influence coefficient in current direction is herein possible minimum of a value among the kinematic coefficient of colliding object; The kinematic coefficient of each possibility colliding object is according to each possibility colliding object and the distance of self, the angle in possible colliding object and self direction, the numeral be between 0 and 1 that the speed of possible colliding object and direction are tried to achieve.The second preset algorithm herein for: exclude the possible colliding object corresponding to kinergety influence coefficient, judge that carrying out clockwise a angle rotates the first minimum kinematic coefficient of the possible colliding object in the sector region that obtains from current direction and carry out from current direction the relative size that counterclockwise a angle rotates the second minimum kinematic coefficient of the possible colliding object in the sector region that obtains; If the first kinematic coefficient is comparatively large, then game object is to clockwise a angular movement; If the second kinematic coefficient is comparatively large, to then game object is to counterclockwise a angular movement, a is greater than 0 degree and is less than 180 degree.Herein first pre-conditionedly can be: after the shorter time of one, an interval such as frame, in other words, the continuous moving time after the determining step of last time is finished reaches time threshold, or the determining step of last time be finished after continuous moving distance reach distance threshold.In one embodiment of the invention, when the translational speed of described game object in continuous very first time threshold value (as accumulative 3s) is greater than maximum velocity threshold always, described preset time threshold is very first time value (less of 1 frame); When the translational speed of described game object in continuous second time threshold (as accumulative 3s or 5s) is less than minimum speed threshold value always, described preset time threshold is the second time value (comparatively large as 2 frames); Described second time value is greater than described very first time value.
In an embodiment of the present invention, the second preset algorithm can comprise: the first detecting step, detects the kinergety influence coefficient of game object in current direction; Second detecting step, makes N equal 1, detects game object to the new kinergety influence coefficient N1 obtained during anticlockwise N*A degree direction, detects game object to the new kinergety influence coefficient N2 obtained during right rotation N*A degree direction; Second determining step, judges whether N1 and N2 all meets and is more than or equal to described minimum coefficient; If all satisfied, then game object is made to turn to the angle and direction that higher value in N1 and N2 is corresponding; If not all satisfied, then judge whether N1 and N2 is all less than described minimum coefficient; If be not all less than, game object is made to turn to the angle and direction that higher value in N1 and N2 is corresponding; If be all less than, judge whether N equals preset times threshold value M; If be not equal to, the N in the second detecting step replaced with N+1 and continues execution second detecting step; If equal, in the kinergety influence coefficient in N1 and N2 and current direction, select maximum, and make game object deflect the angle and direction that described in road, maximum is corresponding, N=1,2,3 ... M.
In other embodiments of the invention, this system can also comprise presetting module: the size presetting minimum coefficient.
Be to be understood that, in order to simplify the present invention and to help to understand in each inventive aspect one or more, in the description above to exemplary embodiment of the present invention, each feature of the present invention is grouped together in single embodiment, figure or the description to it sometimes.But, the method for this invention should be construed to the following intention of reflection: namely the present invention for required protection requires feature more more than the feature clearly recorded in each claim.Or rather, as the following claims reflect, all features of inventive aspect disclosed single embodiment before being to be less than.Therefore, the claims following detailed description of the invention are incorporated to this detailed description of the invention thus clearly, and wherein each claim itself is as independent embodiment of the present invention.
Those skilled in the art are appreciated that and adaptively can change the module in the equipment in embodiment and they are arranged in one or more equipment different from this embodiment.Module in embodiment or unit or assembly can be combined into a module or unit or assembly, and multiple submodule or subelement or sub-component can be put them in addition.Except at least some in such feature and/or process or unit be mutually repel except, any combination can be adopted to combine all processes of all features disclosed in this description (comprising adjoint claim, summary and accompanying drawing) and so disclosed any method or equipment or unit.Unless expressly stated otherwise, each feature disclosed in this description (comprising adjoint claim, summary and accompanying drawing) can by providing identical, alternative features that is equivalent or similar object replaces.
In addition, those skilled in the art can understand, although embodiments more described herein to comprise in other embodiment some included feature instead of further feature, the combination of the feature of different embodiment means and to be within scope of the present invention and to form different embodiments.Such as, in the following claims, the one of any of embodiment required for protection can use with arbitrary combination.
All parts embodiment of the present invention with hardware implementing, or can realize with the software module run on one or more processor, or realizes with their combination.It will be understood by those of skill in the art that the some or all functions that microprocessor or digital signal processor (DSP) can be used in practice to realize according to the some or all parts in the Web page display apparatus of the embodiment of the present invention.The present invention can also be embodied as part or all equipment for performing method as described herein or device program (such as, computer program and computer program).Realizing program of the present invention and can store on a computer-readable medium like this, or the form of one or more signal can be had.Such signal can be downloaded from internet website and obtain, or provides on carrier signal, or provides with any other form.
The present invention will be described instead of limit the invention to it should be noted above-described embodiment, and those skilled in the art can design alternative embodiment when not departing from the scope of claims.In the claims, any reference symbol between bracket should be configured to limitations on claims.Word " comprises " not to be got rid of existence and does not arrange element in the claims or step.Word "a" or "an" before being positioned at element is not got rid of and be there is multiple such element.The present invention can by means of including the hardware of some different elements and realizing by means of the computer of suitably programming.In the unit claim listing some devices, several in these devices can be carry out imbody by same hardware branch.Word first, second and third-class use do not represent any order.Can be title by these word explanations.
So far, those skilled in the art will recognize that, although multiple exemplary embodiment of the present invention is illustrate and described herein detailed, but, without departing from the spirit and scope of the present invention, still can directly determine or derive other modification many or amendment of meeting the principle of the invention according to content disclosed by the invention, such as, method and system of the present invention is applied in sweeping robot.Therefore, scope of the present invention should be understood and regard as and cover all these other modification or amendments.
Claims (10)
1. a method for the anticollision in the unordered moving process of game object, is characterized in that, comprising:
Receiving step, receives the move that instruction game object is reached home, according to the mobile alignment comprising at least one impact point of described move setting game object;
Mobile step, described game object is moved to next impact point according to the first preset algorithm, and described first preset algorithm is: the kinergety influence coefficient in displacement and direction=current direction of direction vector * unit interval displacement * timeslice *;
First determining step, carries out in the process of movement at described game object according to described first preset algorithm, when meeting first and being pre-conditioned, judges whether described game object arrives the next impact point in described mobile alignment;
If arrive described next impact point, then judge whether described game object reaches home, if arrive described terminal, then stop moving and waiting for new instruction, if do not arrive described terminal, then continue to perform described mobile step;
If do not arrive described next impact point, then detect the possible colliding object in preset range, obtain the kinergety influence coefficient in current direction according to preset algorithm, detect described game object and whether be more than or equal to default minimum coefficient at the kinergety influence coefficient in current direction;
If be less than described minimum coefficient at the kinergety influence coefficient in current direction, then the new direction of motion of described game object is set according to the second preset algorithm, performs described mobile step;
If be more than or equal to described minimum coefficient at the kinergety influence coefficient in current direction, judge that whether current direction is consistent with target direction, described target direction refers to the direction pointing to next impact point from current location point;
If consistent, then perform described mobile step;
If inconsistent, then judge whether described game object is more than or equal to described minimum coefficient at the kinergety influence coefficient of described target direction;
If be less than described minimum coefficient at the kinergety influence coefficient of target direction, then perform described mobile step;
If be more than or equal to described minimum coefficient at the kinergety influence coefficient of target direction, then adjust the wish moving direction of described game object, make it turn to described target direction, and perform described mobile step.
2. method according to claim 1, is characterized in that,
The kinergety influence coefficient in described current direction be described may minimum of a value among the kinematic coefficient of colliding object;
The kinematic coefficient of each described possibility colliding object is according to each described possibility colliding object and the distance of self, the angle in described possibility colliding object and self direction, the numeral be between 0 and 1 that the speed of described possibility colliding object and direction are tried to achieve.
3. method according to claim 1 and 2, is characterized in that, described second preset algorithm is:
First detecting step, detects the kinergety influence coefficient of game object in current direction;
Second detecting step, makes N equal 1, detects game object to the new kinergety influence coefficient N1 obtained during anticlockwise N*A degree direction, detects game object to the new kinergety influence coefficient N2 obtained during right rotation N*A degree direction;
Second determining step, judges whether N1 and N2 all meets and is more than or equal to described minimum coefficient;
If all satisfied, then game object is made to turn to the angle and direction that higher value in N1 and N2 is corresponding;
If not all satisfied, then judge whether N1 and N2 is all less than described minimum coefficient; If be not all less than, game object is made to turn in N1 and N2 comparatively
The angle and direction that large value is corresponding;
If be all less than, judge whether N equals preset times threshold value M;
If be not equal to, the N in the second detecting step replaced with N+1 and continues execution second detecting step;
If equal, in the kinergety influence coefficient in N1 and N2 and current direction, select maximum, and make game object deflect the angle and direction that described in road, maximum is corresponding, N=1,2,3 ... M.
4. method according to claim 3, is characterized in that, also comprises:
Foresee steps, presets the size of described minimum coefficient;
Described first is pre-conditionedly: after the determining step of last time is finished interval time reach preset time threshold.
5. method according to claim 4, is characterized in that,
When the translational speed of described game object in continuous very first time threshold value (as accumulative 3s) is greater than maximum velocity threshold always, described preset time threshold is very first time value (less of 1 frame);
When the translational speed of described game object in continuous second time threshold (as accumulative 5s) is less than minimum speed threshold value always, described preset time threshold is the second time value (comparatively large as 2 frames);
Described second time value is greater than described very first time value.
6. a system for the anticollision in the unordered moving process of game object, is characterized in that, comprising:
Receiver module, receives the move that instruction game object is reached home, according to the mobile alignment comprising at least one impact point of described move setting game object;
Mobile module, described game object is moved to next impact point according to the first preset algorithm, and described first preset algorithm is: the kinergety influence coefficient in displacement and direction=current direction of direction vector * unit interval displacement * timeslice *;
Judge module, carries out in the process of movement at described game object according to described first preset algorithm, when meeting first and being pre-conditioned, judges whether described game object arrives the next impact point in described mobile alignment;
If arrive described next impact point, then judge whether described game object reaches home, if arrive described terminal, then stop moving and waiting for new instruction, if do not arrive described terminal, then continue described game object is moved to next impact point according to the first preset algorithm;
If do not arrive described next impact point, then detect the possible colliding object in preset range, obtain the kinergety influence coefficient in current direction according to preset algorithm, detect described game object and whether be more than or equal to default minimum coefficient at the kinergety influence coefficient in current direction;
If be less than described minimum coefficient at the kinergety influence coefficient in current direction, then the new direction of motion of described game object is set according to the second preset algorithm, and continues described game object is moved to next impact point according to the first preset algorithm;
If be more than or equal to described minimum coefficient at the kinergety influence coefficient in current direction, judge that whether current direction is consistent with target direction, described target direction refers to the direction pointing to next impact point from current location point;
If consistent, then described game object is made to move to next impact point according to the first preset algorithm;
If inconsistent, then judge whether described game object is more than or equal to described minimum coefficient at the kinergety influence coefficient of described target direction;
If be less than described minimum coefficient at the kinergety influence coefficient of target direction, then described game object is made to move to next impact point according to the first preset algorithm;
If be more than or equal to described minimum coefficient at the kinergety influence coefficient of target direction, then adjust the wish moving direction of described game object, make it turn to described target direction, and described game object is moved to next impact point according to the first preset algorithm.
7. system according to claim 6, is characterized in that,
The kinergety influence coefficient in described current direction be described may minimum of a value among the kinematic coefficient of colliding object;
The kinematic coefficient of each described possibility colliding object is according to each described possibility colliding object and the distance of self, the angle in described possibility colliding object and self direction, the numeral be between 0 and 1 that the speed of described possibility colliding object and direction are tried to achieve.
8. the system according to claim 6 or 7, is characterized in that, described second preset algorithm is:
First detecting step, detects the kinergety influence coefficient of game object in current direction;
Second detecting step, makes N equal 1, detects game object to the new kinergety influence coefficient N1 obtained during anticlockwise N*A degree direction, detects game object to the new kinergety influence coefficient N2 obtained during right rotation N*A degree direction;
Second determining step, judges whether N1 and N2 all meets and is more than or equal to described minimum coefficient;
If all satisfied, then game object is made to turn to the angle and direction that higher value in N1 and N2 is corresponding;
If not all satisfied, then judge whether N1 and N2 is all less than described minimum coefficient;
If be not all less than, game object is made to turn to the angle and direction that higher value in N1 and N2 is corresponding;
If be all less than, judge whether N equals preset times threshold value M;
If be not equal to, the N in the second detecting step replaced with N+1 and continues execution second detecting step;
If equal, in the kinergety influence coefficient in N1 and N2 and current direction, select maximum, and make game object deflect the angle and direction that described in road, maximum is corresponding, N=1,2,3 ... M.
9. system according to claim 8, is characterized in that, also comprises:
Presetting module, presets the size of described minimum coefficient;
Described first is pre-conditionedly: after the determining step of last time is finished interval time reach preset time threshold.
10. system according to claim 9, is characterized in that,
When the translational speed of described game object in continuous very first time threshold value is greater than maximum velocity threshold always, described preset time threshold is very first time value;
When the translational speed of described game object in continuous second time threshold (as accumulative 5s) is less than minimum speed threshold value always, described preset time threshold is the second time value;
Described second time value is greater than described very first time value.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510081224.4A CN105031921A (en) | 2015-02-15 | 2015-02-15 | Anticollision method and system in game object disordered mobile process |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510081224.4A CN105031921A (en) | 2015-02-15 | 2015-02-15 | Anticollision method and system in game object disordered mobile process |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105031921A true CN105031921A (en) | 2015-11-11 |
Family
ID=54439258
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510081224.4A Pending CN105031921A (en) | 2015-02-15 | 2015-02-15 | Anticollision method and system in game object disordered mobile process |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105031921A (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105498209A (en) * | 2015-11-30 | 2016-04-20 | 厦门飞信网络科技有限公司 | Map generation method and device preventing barrier locus superposition |
CN106540451A (en) * | 2016-11-17 | 2017-03-29 | 腾讯科技(深圳)有限公司 | The control method for movement of actor model, device and method of data synchronization, system |
CN107185242A (en) * | 2017-04-27 | 2017-09-22 | 腾讯科技(深圳)有限公司 | Many unit method for searching and device |
CN108629847A (en) * | 2018-05-07 | 2018-10-09 | 网易(杭州)网络有限公司 | Virtual objects mobile route generation method, device, storage medium and electronic equipment |
CN109966741A (en) * | 2019-05-09 | 2019-07-05 | 腾讯科技(深圳)有限公司 | Location updating method, device, equipment and storage medium |
CN111167117A (en) * | 2019-12-27 | 2020-05-19 | 深圳市瑞立视多媒体科技有限公司 | Random walking method of unreal object, control system and storage medium thereof |
CN112774204A (en) * | 2021-01-22 | 2021-05-11 | 北京字跳网络技术有限公司 | Role collision avoidance method, device, equipment and storage medium |
CN112807681A (en) * | 2021-02-25 | 2021-05-18 | 腾讯科技(深圳)有限公司 | Game control method, device, electronic equipment and storage medium |
CN113457153A (en) * | 2021-06-24 | 2021-10-01 | 深圳市瑞立视多媒体科技有限公司 | Virtual engine-based vehicle plane movement control method and device |
-
2015
- 2015-02-15 CN CN201510081224.4A patent/CN105031921A/en active Pending
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105498209A (en) * | 2015-11-30 | 2016-04-20 | 厦门飞信网络科技有限公司 | Map generation method and device preventing barrier locus superposition |
CN106540451A (en) * | 2016-11-17 | 2017-03-29 | 腾讯科技(深圳)有限公司 | The control method for movement of actor model, device and method of data synchronization, system |
CN106540451B (en) * | 2016-11-17 | 2018-09-07 | 腾讯科技(深圳)有限公司 | Control method for movement, device and the method for data synchronization of actor model, system |
CN107185242A (en) * | 2017-04-27 | 2017-09-22 | 腾讯科技(深圳)有限公司 | Many unit method for searching and device |
CN107185242B (en) * | 2017-04-27 | 2018-09-04 | 腾讯科技(深圳)有限公司 | More unit method for searching and device |
CN108629847A (en) * | 2018-05-07 | 2018-10-09 | 网易(杭州)网络有限公司 | Virtual objects mobile route generation method, device, storage medium and electronic equipment |
CN109966741A (en) * | 2019-05-09 | 2019-07-05 | 腾讯科技(深圳)有限公司 | Location updating method, device, equipment and storage medium |
CN109966741B (en) * | 2019-05-09 | 2022-06-10 | 腾讯科技(深圳)有限公司 | Position updating method, device, equipment and storage medium |
CN111167117A (en) * | 2019-12-27 | 2020-05-19 | 深圳市瑞立视多媒体科技有限公司 | Random walking method of unreal object, control system and storage medium thereof |
CN111167117B (en) * | 2019-12-27 | 2023-06-02 | 深圳市瑞立视多媒体科技有限公司 | Random walk method of illusion object, control system and storage medium thereof |
CN112774204A (en) * | 2021-01-22 | 2021-05-11 | 北京字跳网络技术有限公司 | Role collision avoidance method, device, equipment and storage medium |
CN112774204B (en) * | 2021-01-22 | 2023-10-20 | 北京字跳网络技术有限公司 | Role collision avoidance method, device, equipment and storage medium |
CN112807681A (en) * | 2021-02-25 | 2021-05-18 | 腾讯科技(深圳)有限公司 | Game control method, device, electronic equipment and storage medium |
CN112807681B (en) * | 2021-02-25 | 2023-07-18 | 腾讯科技(深圳)有限公司 | Game control method, game control device, electronic equipment and storage medium |
CN113457153A (en) * | 2021-06-24 | 2021-10-01 | 深圳市瑞立视多媒体科技有限公司 | Virtual engine-based vehicle plane movement control method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105031921A (en) | Anticollision method and system in game object disordered mobile process | |
AU2017404562B2 (en) | System and method of controlling obstacle avoidance of robot, robot and storage medium | |
CN108692734B (en) | Path planning method and device | |
US20220073076A1 (en) | Method, apparatus, and device for constructing simulated vehicle lane change trajectory, and storage medium | |
CN111813101B (en) | Robot path planning method, device, terminal equipment and storage medium | |
KR102239614B1 (en) | Autonomous driving method and device | |
US20190202056A1 (en) | Robot motion path planning method, apparatus and terminal device | |
US11858494B2 (en) | Method for processing vehicle driving mode switching, vehicle and server | |
CN108021136A (en) | Control method, device and the robot that Robot route of travel is advanced | |
Montes et al. | Trajectory generation based on rational bezier curves as clothoids | |
JP2006146491A (en) | Mobile robot and its following method | |
CN113341941B (en) | Control method and device of unmanned equipment | |
CN109189060A (en) | The point-stabilized control method and device of mobile robot | |
CN114510042B (en) | Method and system for solving abnormal pause motion of robot narrow channel | |
CN115203969A (en) | Control method, device, equipment and storage medium for automatic driving simulation scene | |
CN106303652A (en) | The method for drafting of a kind of interface element and device | |
Althoff et al. | On-line trajectory generation for safe and optimal vehicle motion planning | |
JP2013184233A (en) | Robot and method of generating trajectory thereof | |
CN108268044B (en) | Mobile robot in-place precision control method, system, medium and equipment | |
CN110238841A (en) | The preventing collision method and device of barrier | |
Vieira et al. | Driver assistance system towards overtaking in vehicular ad hoc networks | |
CN106597453B (en) | A kind of mobile device independently builds drawing method and device entirely | |
WO2019186815A1 (en) | Self-propelled device, self-propelling method, and recording medium | |
CN112925313A (en) | Avoidance processing method and device for robot, electronic device and medium | |
CN112445209A (en) | Robot control method, robot, storage medium, and electronic apparatus |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20151111 |
|
RJ01 | Rejection of invention patent application after publication |