CN103699802B - The method and system of scene logic are uniformly controlled in a kind of scene of game - Google Patents
The method and system of scene logic are uniformly controlled in a kind of scene of game Download PDFInfo
- Publication number
- CN103699802B CN103699802B CN201310750654.1A CN201310750654A CN103699802B CN 103699802 B CN103699802 B CN 103699802B CN 201310750654 A CN201310750654 A CN 201310750654A CN 103699802 B CN103699802 B CN 103699802B
- Authority
- CN
- China
- Prior art keywords
- event
- refreshing
- random number
- scene
- refreshed
- 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.)
- Active
Links
Landscapes
- Pinball Game Machines (AREA)
Abstract
The invention discloses the method and system of scene logic are uniformly controlled in a kind of scene of game, the composition each event of scene of game and the refreshing frequency of each are determined with NPC quantity, the problem of the control logic program for needing design complicated during the shell script exploitation that each event is independently carried out in thus avoid prior art, and can pass through to change the parameters such as priority, the refreshing frequency of each event in multiple affair logical mappings, flexibly the event in scene of game is configured.
Description
Technical field
The present invention relates to the method for scene logic is uniformly controlled in computer realm, more particularly to a kind of scene of game and is
System.
Background technology
Scene of game in online game and some single-play games is touched by refreshing monster, task triggering, story of a play or opera animation
Send out, multiple composition of matter such as speech play are realized, play strange upgrading, complete the bodies of playing such as task, viewing story of a play or opera to meet user
The needs tested.
Each event of scene of game is independently to carry out shell script exploitation mostly in the prior art, each script journey
Sequence includes the content of the correspondence event and performs various Rule of judgment and logic of event etc., and this is for program staff
Speech, the script for individually writing each event undoubtedly increase workload.Further, complete trip is formed in comprehensive each event
During play scene, it is necessary to complicated control logic program, the shell script of these events is combined, due to each thing
The shell script of part is each independent, is also independent, therefore comprehensive each event foot by the Rule of judgment and logic of each event
This process is complicated and huge, time-consuming and laborious;Also, existing technology is based on, if when game plan needs to carry out to scene
During adjustment, just must link up with programmer, change control logic program, due to modification extremely inconvenience, it is thus impossible to flexible right
Event in scene of game is configured.
The content of the invention
For above-mentioned problem of the prior art, the invention provides the side of scene logic is uniformly controlled in a kind of scene of game
Method and system.
The technological means that the present invention is adopted are as follows:The method of scene logic is uniformly controlled in a kind of scene of game, including:
Set up multiple affair logical mappings, the multiple affair logical mappings include refreshing amount threshold, multiple event contents and
It is default, for the refreshing frequency of each event, and default each Event Priority;
Travel through the multiple affair logical mappings, read and refresh amount threshold, and compare in scene of game NPC volume residuals with
Refresh the size calculating difference of amount threshold;
When in scene of game, NPC volume residuals are less than amount threshold is refreshed, according to thing in the multiple affair logical mappings
The priority of part order from high to low is successively read event, and performs event brush according to each refreshing frequency for being read event
Newly, wherein, the refreshing frequency summation of the event being read is less than or equal to the difference;When NPC volume residuals etc. in scene of game
In or more than refresh amount threshold when, do not carry out event refreshing.
Further, in the multiple affair logical mappings also include correspondence each event event random number, the event with
Machine number is the natural number more than 0 less than or equal to 100;When the event of execution refreshes, also refresh random number, the refreshing including generating
Random number is the natural number more than 0 less than or equal to 100, and compares event random number and refresh random number size, random when refreshing
When number is more than the event random number, the refreshing of the event random number correspondence event is not performed;It is less than or equal to when random number is refreshed
During the event random number, the refreshing of the event random number correspondence event is performed.
Further, thing is successively read according to the priority order from high to low of event in the multiple affair logical mappings
Part, and according to each be read event refreshing frequency perform event refresh the step of include, read highest priority event,
And the corresponding refreshing frequency of event according to the highest priority performs event refreshing, when reaching, the event is corresponding to refresh secondary
After number, then the event of next priority is read, and the corresponding refreshing frequency of event according to the priority performs the brush of the event
Newly.
Further, when complete it is all be read event refreshing after, reset the refreshing frequency value of all events being refreshed.
Further, the refreshing frequency for resetting all events being refreshed is by the refreshing of each event being refreshed time
Number is set to former refreshing frequency and the difference for being refreshed number of times.
Present invention also offers the system that scene logic is uniformly controlled in a kind of scene of game, including:
First module, for setting up multiple affair logical mappings, the multiple affair logical mappings include refreshing amount threshold, many
Individual event content and it is default, for the refreshing frequency of each event, and default each Event Priority;
Second module, for traveling through the multiple affair logical mappings, reads and refreshes amount threshold, and compare in scene of game
NPC volume residuals and the size calculating difference that refresh amount threshold;
Three module, when NPC volume residuals are less than amount threshold is refreshed in scene of game, according to the multiple affair logic
In mapping, the priority of event order from high to low is successively read event, and holds according to each refreshing frequency for being read event
Act part to refresh, wherein, the refreshing frequency summation of the event being read is less than or equal to the difference;When in scene of game, NPC is remained
When remainder amount is equal to or more than refresh amount threshold, event refreshing is not carried out.
Further, in the multiple affair logical mappings also include correspondence each event event random number, the event with
Machine number is the natural number more than 0 less than or equal to 100, and first module is further used for when execution event refreshes, generates and brush
New random number, the refreshing random number is the natural number more than 0 less than or equal to 100, and compares event random number and refresh random
Number size, when random number is refreshed more than the event random number, does not perform the refreshing of event random number correspondence event;Work as brush
When new random number is less than or equal to the event random number, the refreshing of the event random number correspondence event is performed.
Three module is further used for the event for reading highest priority, and corresponding according to the event of the highest priority
Refreshing frequency performs the event and refreshes, and after the event corresponding refreshing frequency is reached, then reads the event of next priority, and
The refreshing of the event is performed according to the corresponding refreshing frequency of the event of the priority.
The three module be further used for when complete it is all be read event refreshing after, reset all things being refreshed
The refreshing frequency value of part.
The three module be further used for by the refreshing frequency of each event being refreshed be set to former refreshing frequency with
It is refreshed the difference of number of times.
Using the method and system that scene logic is uniformly controlled in scene of game provided by the present invention, determined with NPC quantity
Surely each event of scene of game and the refreshing frequency of each are constituted, the foot of each event in thus avoid prior art, is independently carried out
The problem of the control logic program for needing design complicated during this program development, and can be each in multiple affair logical mappings by changing
The parameters such as the priority of event, refreshing frequency, flexibly configure to the event in scene of game.
Description of the drawings
Fig. 1 is the method exemplary embodiments schematic flow sheet that scene logic is uniformly controlled in a kind of scene of game of the invention.
Specific embodiment
The principle and feature of the present invention are described below in conjunction with accompanying drawing, example is served only for explaining the present invention, and
It is non-for limiting the scope of the present invention.
The present invention is that, based on realization considered below, for scene of game, the refreshing of event is based on scene of game
The behavior decision of the game role of middle player's control, and for, in existing online game and some single-play games, player is controlled
The behavior of the game role of system is mostly interacting between NPC, in brief, that is, kills the task that NPC completes game settings,
And refresh multiple events such as monster, task triggering, the triggering of story of a play or opera animation, speech play in scene of game and be to rely on game object for appreciation
Interacting between the game role and NPC of family's control, therefore, event whether refresh can according to NPC quantity in the scene come
Judge.
Based on above-mentioned consideration, the invention provides a kind of same method for controlling scene logic in scene of game, such as Fig. 1 institutes
Show, including:
Set up multiple affair logical mappings, the multiple affair logical mappings include refreshing amount threshold, multiple event contents and
It is default, for the refreshing frequency of each event, and default each Event Priority;
Traversal multiple affair logical mappings, read and refresh amount threshold, and compare NPC volume residuals and refreshing in scene of game
The size calculating difference of amount threshold;
When in scene of game, NPC volume residuals are less than amount threshold is refreshed, according to thing in the multiple affair logical mappings
The priority of part order from high to low is successively read event, and performs event brush according to each refreshing frequency for being read event
Newly, wherein, the refreshing frequency summation of the event being read is less than or equal to the difference;When NPC volume residuals etc. in scene of game
In or more than refresh amount threshold when, do not carry out event refreshing.
Wherein, in multiple affair logical mappings, event random number, the event random number can be correspondingly arranged to each event
Be more than 0 less than or equal to 100 natural number, when subsequent step perform event refresh when, generate refresh random number, the refreshing with
Machine number is the natural number more than 0 less than or equal to 100, and compares event random number and refresh random number size, when refreshing random number
During more than the event random number, the refreshing of the event random number correspondence event is not performed;Institute is less than or equal to when random number is refreshed
When stating event random number, the refreshing of the event random number correspondence event is performed.Try as an example, when certain event refreshing is performed,
The event random number of the event is 60, then the probability that the surface event has 60% performs refreshing, when subsequent execution event refreshes
When, when the refreshing random number of generation is less than or equal to 60, performs event and refresh.
Further, when in scene of game, NPC volume residuals are less than amount threshold is refreshed, according to multiple affair logical mappings
The priority of middle event order from high to low is successively read event, and performs thing according to each refreshing frequency for being read event
Part refreshes, and can first read the event of highest priority using the priority according to event, and according to the thing of the highest priority
The corresponding refreshing frequency of part performs the event and refreshes, and after the event corresponding refreshing frequency is reached, then reads next priority
Event, and the corresponding refreshing frequency of event according to the priority performs the refreshing of the event, as long as meeting the thing being read
The refreshing frequency summation of part is less than or equal to NPC volume residuals in scene of game and refreshes difference between amount threshold;Attempt
One, such as priority five events from high to low in multiple affair logical mappings, are included, and the refreshing frequency of the first event is
1, the refreshing frequency of second event is 2, and the refreshing frequency of the 3rd event is 3, when NPC volume residuals in scene of game and refreshing number
When difference between amount threshold value is 4, priority the first event of highest is first read, and refreshes the first event 1 time, then read excellent
First weigh time high second event, and refresh second event 2 times, finally read the 3rd minimum event of three's priority, and only brush
New 3rd event 1 time, with meet the refreshing frequency summation of event being read less than or equal to NPC volume residuals in scene of game with
Refresh the requirement of difference between amount threshold;When above-mentioned event random number is considered, if the event random number of the first event is 60,
When second event, the event random number of the 3rd event are 100, after the first event is read, if the event random number for generating is more than
When 60, do not refresh the first event, read second event afterwards, refreshing second event 2 times reads the 3rd event, refreshes the 3rd thing
Part 2 times.
Furthermore, as a kind of special circumstances, when the refreshing frequency summation of all events in multiple affair logical mappings is less than trip
In play scene between NPC volume residuals and refreshing amount threshold during difference, the refreshing frequency summation time brush of all events is only carried out
Newly, and End Event refresh;Examination is as an example, it is assumed that priority five events from high to low are included in multiple affair logical mappings,
And first the refreshing frequency of event be 1, the refreshing frequency of other events is 0, then complete after the first event is refreshed all
Event refresh, End Event refresh step.
Further, when complete it is all be read event refreshing after, reset the refreshing frequency value of all events being refreshed,
It is preferred that the refreshing frequency of each event being refreshed is set to former refreshing frequency and the difference for being refreshed number of times.Try as an example,
Priority five events from high to low are for example included in multiple affair logical mappings, and the refreshing frequency of the first event is 1, second
The refreshing frequency of event is 2, and the refreshing frequency of the 3rd event is 3, when NPC volume residuals in scene of game and refreshing amount threshold
Between difference when being 4, first read priority the first event of highest, and refresh the first event 1 time, then read priority time
High second event, and refresh second event 2 times, the 3rd minimum event of three's priority is finally read, and only refreshes the 3rd
Event 1 time, that is, complete all refreshings for being read event, and corresponding the first event to reading, by the brush of the first event
New number of times resets to 0, to the second event for reading, the refreshing frequency of second event is reset to 0, to the 3rd event for reading,
The refreshing frequency of the 3rd event is reset to into 2.
Present invention also offers the system that scene logic is uniformly controlled in a kind of scene of game, including:
First module, for setting up multiple affair logical mappings, the multiple affair logical mappings include refreshing amount threshold, many
Individual event content and it is default, for the refreshing frequency of each event, and default each Event Priority;
Second module, for traveling through the multiple affair logical mappings, reads and refreshes amount threshold, and compare in scene of game
NPC volume residuals and the size calculating difference that refresh amount threshold;
Three module, when NPC volume residuals are less than amount threshold is refreshed in scene of game, according to the multiple affair logic
In mapping, the priority of event order from high to low is successively read event, and holds according to each refreshing frequency for being read event
Act part to refresh, wherein, the refreshing frequency summation of the event being read is less than or equal to the difference;When in scene of game, NPC is remained
When remainder amount is equal to or more than refresh amount threshold, event refreshing is not carried out.
Further, in the multiple affair logical mappings also include correspondence each event event random number, the event with
Machine number is the natural number more than 0 less than or equal to 100, and first module is further used for when execution event refreshes, generates and brush
New random number, the refreshing random number is the natural number more than 0 less than or equal to 100, and compares event random number and refresh random
Number size, when random number is refreshed more than the event random number, does not perform the refreshing of event random number correspondence event;Work as brush
When new random number is less than or equal to the event random number, the refreshing of the event random number correspondence event is performed.
Three module is further used for the event for reading highest priority, and corresponding according to the event of the highest priority
Refreshing frequency performs the event and refreshes, and after the event corresponding refreshing frequency is reached, then reads the event of next priority, and
The refreshing of the event is performed according to the corresponding refreshing frequency of the event of the priority.
The three module be further used for when complete it is all be read event refreshing after, reset all things being refreshed
The refreshing frequency value of part.
The three module be further used for by the refreshing frequency of each event being refreshed be set to former refreshing frequency with
It is refreshed the difference of number of times.
It should be noted that the method that scene logic is uniformly controlled in the scene of game of present invention offer, art technology
Personnel can realize comparison therein, calculating and various actions by programming, therefore, in the scene of game that the present invention is provided
The system for being uniformly controlled scene logic may be considered the device of corresponding method, wherein the corresponding function of each module can also pass through
Program is arranged to be realized, will not be described here.
Presently preferred embodiments of the present invention is the foregoing is only, not to limit the present invention, all essences in the present invention
Within god and principle, any modification, equivalent substitution and improvements done etc. are should be included within the scope of protection of the invention.
Claims (10)
1. the method for scene logic is uniformly controlled in a kind of scene of game, it is characterised in that included:
Multiple affair logical mappings are set up, the multiple affair logical mappings include refreshing amount threshold, multiple event contents and preset
, for the refreshing frequency of each event, and default each Event Priority;
The multiple affair logical mappings are traveled through, is read and is refreshed amount threshold, and compare NPC volume residuals and refreshing in scene of game
The size calculating difference of amount threshold;
When in scene of game, NPC volume residuals are less than amount threshold is refreshed, according to event in the multiple affair logical mappings
Priority order from high to low is successively read event, and performs event refreshing according to each refreshing frequency for being read event,
Wherein, the refreshing frequency summation of the event being read is less than or equal to the difference;When in scene of game NPC volume residuals be equal to or
During more than refreshing amount threshold, event refreshing is not carried out.
2. method according to claim 1, it is characterised in that also include correspondence each thing in the multiple affair logical mappings
The event random number of part, the event random number are the natural number more than 0 less than or equal to 100;When the event of execution refreshes, also wrap
Include generation refresh random number, the refreshing random number be more than 0 less than or equal to 100 natural number, and compare event random number and
Refresh random number size, when random number is refreshed more than the event random number, do not perform event random number correspondence event
Refresh;When random number is refreshed less than or equal to the event random number, the refreshing of event random number correspondence event is performed.
3. method according to claim 1, it is characterised in that according to the priority of event in the multiple affair logical mappings
Order from high to low is successively read event, and performs bag the step of event refreshes according to each refreshing frequency for being read event
Include, read the event of highest priority, and the corresponding refreshing frequency of event according to the highest priority performs event refreshing,
After the event corresponding refreshing frequency is reached, then the event of next priority is read, and according to the event correspondence of the priority
Refreshing frequency perform the refreshing of the event.
4. method according to claim 3, it is characterised in that when complete it is all be read event refreshing after, reset institute
There is the refreshing frequency value of the event being refreshed.
5. method according to claim 4, it is characterised in that the refreshing frequency of all events being refreshed of the replacement is
The refreshing frequency of each event being refreshed is set to into former refreshing frequency and the difference for being refreshed number of times.
6. the system of scene logic is uniformly controlled in a kind of scene of game, it is characterised in that included:
First module, for setting up multiple affair logical mappings, the multiple affair logical mappings include refreshing amount threshold, multiple things
Part content and it is default, for the refreshing frequency of each event, and default each Event Priority;
Second module, for traveling through the multiple affair logical mappings, reads and refreshes amount threshold, and compare NPC in scene of game
Volume residual and the size calculating difference that refresh amount threshold;
Three module, when NPC volume residuals are less than amount threshold is refreshed in scene of game, according to the multiple affair logical mappings
The priority of middle event order from high to low is successively read event, and performs thing according to each refreshing frequency for being read event
Part refreshes, wherein, the refreshing frequency summation of the event being read is less than or equal to the difference;When NPC remainders in scene of game
When amount is equal to or more than amount threshold is refreshed, event refreshing is not carried out.
7. system according to claim 6, it is characterised in that also include correspondence each thing in the multiple affair logical mappings
The event random number of part, the event random number are the natural number more than 0 less than or equal to 100, and first module further uses
In when the event of execution refreshes, generate and refresh random number, the refreshing random number is the natural number more than 0 less than or equal to 100, and
Relatively event random number and refreshing random number size, when random number is refreshed more than the event random number, do not perform the event
The refreshing of random number correspondence event;When random number is refreshed less than or equal to the event random number, the event random number pair is performed
Answer the refreshing of event.
8. system according to claim 7, it is characterised in that three module is further used for the thing for reading highest priority
Part, and the corresponding refreshing frequency of event according to the highest priority performs the event and refresh, when reaching the corresponding brush of the event
After new number of times, then the event of next priority is read, and the corresponding refreshing frequency of event according to the priority performs the event
Refreshing.
9. system according to claim 8, it is characterised in that the three module is further used for when completing all reading
After taking the refreshing of event, the refreshing frequency value of all events being refreshed is reset.
10. system according to claim 9, it is characterised in that the three module is further used for being refreshed each
The refreshing frequency of event be set to former refreshing frequency and the difference for being refreshed number of times.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310750654.1A CN103699802B (en) | 2013-12-31 | 2013-12-31 | The method and system of scene logic are uniformly controlled in a kind of scene of game |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310750654.1A CN103699802B (en) | 2013-12-31 | 2013-12-31 | The method and system of scene logic are uniformly controlled in a kind of scene of game |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103699802A CN103699802A (en) | 2014-04-02 |
CN103699802B true CN103699802B (en) | 2017-04-05 |
Family
ID=50361329
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310750654.1A Active CN103699802B (en) | 2013-12-31 | 2013-12-31 | The method and system of scene logic are uniformly controlled in a kind of scene of game |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103699802B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105404381A (en) * | 2015-11-06 | 2016-03-16 | 珠海全志科技股份有限公司 | Terminal device operation frequency control method and system |
CN107537156B (en) * | 2017-08-28 | 2020-07-14 | 深圳市乐易网络股份有限公司 | Non-player character refreshing method and device and server |
CN111617486A (en) * | 2020-05-12 | 2020-09-04 | 杭州非奇科技股份有限公司 | Game level editing method and editor |
CN113101669B (en) * | 2021-04-20 | 2024-06-25 | 网易(杭州)网络有限公司 | Refreshing method, refreshing device, equipment and medium for virtual object in game |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1987881A (en) * | 2006-12-22 | 2007-06-27 | 北京金山软件有限公司 | Method and device for distributing non-player control role ingame |
CN102136025A (en) * | 2010-12-31 | 2011-07-27 | 北京像素软件科技股份有限公司 | Intelligent controlling method of non player characters |
CN102810061A (en) * | 2012-05-18 | 2012-12-05 | 北京像素软件科技股份有限公司 | Method for editing non-player-controlled character |
-
2013
- 2013-12-31 CN CN201310750654.1A patent/CN103699802B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1987881A (en) * | 2006-12-22 | 2007-06-27 | 北京金山软件有限公司 | Method and device for distributing non-player control role ingame |
CN102136025A (en) * | 2010-12-31 | 2011-07-27 | 北京像素软件科技股份有限公司 | Intelligent controlling method of non player characters |
CN102810061A (en) * | 2012-05-18 | 2012-12-05 | 北京像素软件科技股份有限公司 | Method for editing non-player-controlled character |
Also Published As
Publication number | Publication date |
---|---|
CN103699802A (en) | 2014-04-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103699802B (en) | The method and system of scene logic are uniformly controlled in a kind of scene of game | |
Pasternak et al. | Tips for creating a block language with blockly | |
US20210146260A1 (en) | Method, apparatus, computer program and recording medium for providing game service | |
CN104205052B (en) | The method and system of measured device is emulated with field programmable gate array | |
CN104133667B (en) | Realize method, device and the artificial intelligence editing machine of artificial intelligence behavior | |
US9478107B2 (en) | Game machine, and control method of controlling computer and computer program used therefor | |
WO2007014201A3 (en) | Computer implemented character creation for an interactive user experience | |
CN104866109A (en) | Gesture operation and control method of mobile terminal, gesture operation and control system of mobile terminal and mobile terminal | |
CN106621335A (en) | System and method for monster distribution in game scene | |
CN106708483A (en) | Generating method and generating device of control interface of internet-of-things equipment | |
KR101501830B1 (en) | Simulation method and system result of the Baseball game interference | |
Moor et al. | libFAUDES—An open source C++ library for discrete event systems | |
CN107977577A (en) | access instruction access detection method and device | |
CN106919322A (en) | The method and apparatus for controlling virtual lens in gaming | |
CN106776056A (en) | Game data processing method, device and server | |
CN103699232A (en) | Command input method and device | |
CN109414620A (en) | Drawing device and selection method | |
CN105373442B (en) | Method and apparatus for supervisory memory data error states | |
CN106815009A (en) | The method and system of the multiple movable body behaviors of simulation | |
Breslin | 01010000 01001100 01000001 01011001: Play Elements in Computer Programming. | |
CN106445085B (en) | Interaction control method and device based on virtual reality | |
Reeson et al. | An interactive constraint-based approach to Sudoku | |
CN104036133A (en) | Chess game system | |
KR20190141553A (en) | User created contents storytelling puzzle system and application | |
CN109977024A (en) | The cpu chip emulator for supporting NVM to download in real time |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |