CN102722650B - Game speed processing method and device applied in game scene - Google Patents

Game speed processing method and device applied in game scene Download PDF

Info

Publication number
CN102722650B
CN102722650B CN201210176979.9A CN201210176979A CN102722650B CN 102722650 B CN102722650 B CN 102722650B CN 201210176979 A CN201210176979 A CN 201210176979A CN 102722650 B CN102722650 B CN 102722650B
Authority
CN
China
Prior art keywords
frame
logical time
game
current
time
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
Application number
CN201210176979.9A
Other languages
Chinese (zh)
Other versions
CN102722650A (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.)
Beijing Pixel Software Technology Co Ltd
Original Assignee
Beijing Pixel Software Technology 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 Beijing Pixel Software Technology Co Ltd filed Critical Beijing Pixel Software Technology Co Ltd
Priority to CN201210176979.9A priority Critical patent/CN102722650B/en
Publication of CN102722650A publication Critical patent/CN102722650A/en
Application granted granted Critical
Publication of CN102722650B publication Critical patent/CN102722650B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Processing Or Creating Images (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The invention provides a game speed processing method and device applied in a game scene. The game speed processing method comprises the following steps: A) setting acquiescent logic time of each frame as current logic time of each frame at the time of game starting, and updating game frames according to the current logic time of each frame; B) receiving and caching a speed regulation parameter input by a user when the game speed is required to be regulated, and then continuously updating corresponding game frames receiving the speed regulation parameter according to the current logic time of each frame; and C) regulating the current logic time of each frame according to the speed regulation parameter after the game frame in the step B is updated, and updating other game frames by taking the regulated current logic time of each frame as the logic time of each frame.

Description

Be applied to processing method and the device of game rate in scene of game
Technical field
The present invention relates to computer technology, be particularly applied to method of adjustment and the device of game rate in scene of game.
Background technology
At present, the form of expression of playing is experiencing a various change, slowing down game rate at a certain special time period or accelerate game rate to make the form of expression of game meet the demand of various change, and makes game user more can a certain particular event of special concern.
In prior art, slowing down game rate or accelerating game rate is all realized by the renewal frequency of adjustment game frame, and wherein, in scene of game, a frame is calculated in the renewal of each logic loops, is designated as game frame.But, because game frame can embody the fluency of playing in scene of game, if game frame is slowly updated, game can be caused not smooth.
Summary of the invention
The invention provides the method for adjustment and device that are applied to game rate in scene of game, for realizing the adjustment of game rate.
Technical scheme provided by the invention comprises:
Be applied to a method of adjustment for game rate in scene of game, comprise:
A, when starting game, the every frame logical time arranging acquiescence, as current every frame logical time, upgrades game frame according to current every frame logical time;
B, when needs adjustment game rate, receives and the following speed adjustment parameter of cache user input, and continues to upgrade corresponding game frame when receiving described adjustment parameter according to described current every frame logical time;
C, after game frame in stepb terminates, according to every frame logical time current described in described adjustment parameter adjustment, using the current every frame logical time after adjustment as current every frame logical time, upgrades the game frame after the game frame in step B terminates.
Preferably, described speed adjustment parameter comprises: start logical time, end logical time and logical time increment;
Step C comprises:
C1, using first game frame after the game frame in step B terminates as going game frame;
C2, is updated to the start logical time by current every frame logical time, upgrades going game frame according to this current every frame logical time;
C3, after going game frame end using next game frame as going game frame;
C4, described current every frame logical time is added described logical time increment, if this result is more than or equal to described end logical time, then using described end logical time as current every frame logical time, perform step C5, otherwise, using the result that obtains as current every frame logical time, and perform step C6;
C5, upgrades going game frame and game frame afterwards according to this current every frame logical time;
C6, upgrades going game frame according to this current every frame logical time, and returns step C3.
In the present invention, between step C4 and step C5, comprise further: the described adjustment parameter removing buffer memory.
In the present invention, between current every frame logical time that described beginning logical time adopted before adjustment game rate and described end logical time.
In the present invention, game frame is: in scene of game, each logic loops is updated to a game frame.
The invention also discloses a kind of adjusting device being applied to game rate in scene of game, comprising:
First updating block, for when starting game, the every frame logical time arranging acquiescence, as current every frame logical time, upgrades game frame according to current every frame logical time;
Second updating block, for when needs adjustment game rate time, receive and cache user input speed adjustment parameter, and continue according to described current every frame logical time to receive described speed adjustment parameter time corresponding game frame upgrade;
3rd updating block, after game frame for upgrading at described second updating block terminates, according to current every frame logical time described in described speed adjustment parameter adjustment, using the current every frame logical time after adjustment as current every frame logical time, the game frame after the game frame of described second updating block renewal terminates is upgraded.
Wherein, described speed adjustment parameter comprises: start logical time, end logical time and logical time increment;
Described 3rd undated parameter performs renewal by following steps:
C1, using described second updating block upgrade game frame terminate after first game frame as going game frame;
C2, is updated to the start logical time by current every frame logical time, upgrades going game frame according to this current every frame logical time;
C3, after going game frame end using next game frame as going game frame;
C4, described current every frame logical time is added described logical time increment, if this result is more than or equal to described end logical time, then using described end logical time as current every frame logical time, perform step C5, otherwise, using the result that obtains as current every frame logical time, and perform step C6;
C5, upgrades going game frame and game frame afterwards according to this current every frame logical time;
C6, upgrades going game frame according to this current every frame logical time, and returns step C3.
Wherein, between step C4 and step C5, comprise further: the described adjustment parameter removing buffer memory.
Wherein, described beginning logical time is before adjustment game rate between current every frame logical time of adopting and described end logical time.
Wherein, game frame is: in scene of game, each logic loops is updated to a game frame.
As can be seen from the above technical solutions, the end logical time of input is carried out with not settling at one go in the present invention the renewal of game frame as current every frame logical time, but first using input the start logical time as current every frame logical time, namely the start logical time of this input is first utilized to perform the renewal of going game frame, afterwards, by the current every frame logical time of every frame logical time increasing amount adjustment, until the final end logical time arriving input.Wherein, the beginning logical time why introducing this input is the renewal avoiding being carried out as current every frame logical time by the end logical time of input with settling at one go game frame on the one hand, it is level and smooth that impact is played, on the other hand, every frame logical time of adopting before distinguishing over adjustment game rate by the beginning logical time of this input, to the effect of game user one speed change immediately.
In addition, in the present invention, by the current every frame logical time of every frame logical time increasing amount adjustment, until the final end logical time arriving input, be then produce a more level and smooth visual artifacts to game user.For the game rate that slows down, then adopt the present invention, all animations in scene of game can be realized, displacement is all slack-off, but role action still keeps level and smooth.
Accompanying drawing explanation
The method flow diagram that Fig. 1 provides for the embodiment of the present invention;
The structure drawing of device that Fig. 2 provides for the embodiment of the present invention.
Detailed description of the invention
In order to make the object, technical solutions and advantages of the present invention clearly, describe the present invention below in conjunction with the drawings and specific embodiments.
Before description method provided by the invention, first the technical term that the present invention relates to is described:
Every frame logical time, be called logic interval, it is the concept relative to real physical time, if in real physics, n millisecond is spaced apart between every frame, but in scene of game, can be spaced apart m millisecond between the every frame of compelled assumptiion, m and n is not necessarily equal, and in scene of game, use m as the time interval foundation between frame, that is, m is the logic interval between frame.
Usually, in scene of game, the renewal of all animations, the renewal of animation displacement or calculating are all triggered by a time source.Based on this, in the present invention, directly can implant the concept of every frame logical time in game frame, afterwards this time source is redirected to one thus logical time to add up the data obtained, to carry out the renewal of game rate, method flow that specifically can be shown in Figure 1.
See the method flow diagram that Fig. 1, Fig. 1 provide for the embodiment of the present invention.As shown in Figure 1, this flow process can comprise the following steps:
Step 101, when starting game, the every frame logical time arranging acquiescence, as current every frame logical time, upgrades game frame according to current every frame logical time.
Step 102, when needs adjustment game rate, receives and the speed adjustment parameter of cache user input, and continues to upgrade corresponding game frame when receiving described adjustment parameter according to described current every frame logical time.
Wherein, described speed adjustment parameter inputs in scene of game by instruction code.
As can be seen from step 102, although this step 102 receives the speed adjustment parameter that user inputs because needing to adjust game rate when a certain game frame, but, this speed is not utilized to adjust the current every frame logical time of parameter adjustment immediately, accordingly, for this game frame, the current every frame logical time before still utilizing upgrades this game frame.This can ensure the level and smooth of scene of game, prevents different due to every frame logical time and picture that is that cause interrupts or fuzzy.
Step 103, after game frame in a step 102 terminates, according to current every frame logical time described in described speed adjustment parameter adjustment, upgrades the current every frame logical time after adjustment game frame afterwards as current every frame logical time.
Particularly, in the present invention, described speed adjustment parameter comprises: start logical time, end logical time and logical time increment; Based on this, step 103 can comprise:
C1, using first game frame after the game frame in step 103 terminates as going game frame;
C2, is updated to the start logical time by current every frame logical time, upgrades going game frame according to this current every frame logical time;
Such as, the current every frame logical time adopted before step 102 adjusts game rate is 15 frames per second, and in step 102, the start logical time of input is 10 frames per second, based on this, the start logical time that this step C2 depends on this input such as 10 frames per second to adjust the renewal of going game frame.
C3, after going game frame end using next game frame as going game frame;
C4, described current every frame logical time is added described logical time increment, if this result is more than or equal to described end logical time, then using described end logical time as current every frame logical time, perform step C5, otherwise, using the result that obtains as current every frame logical time, and perform step C6;
C5, upgrades going game frame and game frame afterwards according to this current every frame logical time;
C6, upgrades going game frame according to this current every frame logical time, and returns step C3.
So far, the flow process shown in Fig. 1 is completed.
As can be seen from the flow process shown in Fig. 1, the end logical time of input is carried out with not settling at one go in the present invention the renewal of game frame as current every frame logical time, but first using input the start logical time as current every frame logical time, namely the start logical time of this input is first utilized to perform the renewal of going game frame, afterwards, by the current every frame logical time of every frame logical time increasing amount adjustment, until the final end logical time arriving input.
So, based on describing above, can obtain, in the present invention, between every frame logical time that the beginning logical time of described input adopted before adjustment game rate and the end logical time of described input.Wherein, the beginning logical time why introducing this input is the renewal avoiding being carried out as current every frame logical time by the end logical time of input with settling at one go game frame on the one hand, it is level and smooth that impact is played, on the other hand, every frame logical time of adopting before distinguishing over adjustment game rate by the beginning logical time of this input, to the effect of game user one speed change immediately.
In addition, in the present invention, by the current every frame logical time of every frame logical time increasing amount adjustment, until the final end logical time arriving input, be then produce a more level and smooth visual artifacts to game user.For the game rate that slows down, then adopt the present invention, all animations in scene of game can be realized, displacement is all slack-off, but role action still keeps level and smooth.
For making the flow process shown in Fig. 1 clearly, the flow process below by described in a concrete arthmetic statement Fig. 1:
First, this algorithm defines following parameter: start logical time b, terminates logical time c, physical time t, every frame logical time increment dt, every frame logical time lt;
Afterwards, based on the specific descriptions of step 103, in the present invention, first by lt=b, namely first by b assignment to lt, to make to utilize this b to carry out the renewal of going game frame;
After the renewal of going game frame completes, and before next game frame upgrades, call following formula:
lt=lt+dt;
if(it>e){it=e}
By this algorithm, achieve above-mentioned steps C1 to step C6.
So far, complete method provided by the invention to describe.
Below device provided by the invention is described:
See the structure drawing of device that Fig. 2, Fig. 2 provide for the embodiment of the present invention.As shown in Figure 2, this device comprises:
First updating block, for when starting game, the every frame logical time arranging acquiescence, as current every frame logical time, upgrades game frame according to current every frame logical time;
Second updating block, for when needs adjustment game rate time, receive and cache user input speed adjustment parameter, and continue according to described current every frame logical time to receive described speed adjustment parameter time corresponding game frame upgrade;
3rd updating block, after game frame for upgrading at described second updating block terminates, according to current every frame logical time described in described speed adjustment parameter adjustment, the current every frame logical time after adjustment is upgraded as current every frame logical time game frame afterwards.
In the present invention, described speed adjustment parameter comprises: start logical time, end logical time and logical time increment;
Described 3rd undated parameter performs renewal by following steps:
C1, using described second updating block upgrade game frame terminate after first game frame as going game frame;
C2, is updated to the start logical time by current every frame logical time, upgrades going game frame according to this current every frame logical time;
C3, after going game frame end using next game frame as going game frame;
C4, described current every frame logical time is added described logical time increment, if this result is more than or equal to described end logical time, then using described end logical time as current every frame logical time, perform step C5, otherwise, using the result that obtains as current every frame logical time, and perform step C6;
C5, upgrades going game frame and game frame afterwards according to this current every frame logical time;
C6, upgrades going game frame according to this current every frame logical time, and returns step C3.
Wherein, between step C4 and step C5, comprise further: the described adjustment parameter removing buffer memory.
In the present invention, between current every frame logical time that described beginning logical time adopted before adjustment game rate and described end logical time.
In the present invention, game frame is: in scene of game, each logic loops is updated to a game frame.
So far, the structure drawing of device shown in Fig. 2 is completed.
As can be seen from the above technical solutions, the end logical time of input is carried out with not settling at one go in the present invention the renewal of game frame as current every frame logical time, but first using input the start logical time as current every frame logical time, namely the start logical time of this input is first utilized to perform the renewal of going game frame, afterwards, by the current every frame logical time of every frame logical time increasing amount adjustment, until the final end logical time arriving input.Wherein, the beginning logical time why introducing this input is the renewal avoiding being carried out as current every frame logical time by the end logical time of input with settling at one go game frame on the one hand, it is level and smooth that impact is played, on the other hand, every frame logical time of adopting before distinguishing over adjustment game rate by the beginning logical time of this input, to the effect of game user one speed change immediately.
In addition, in the present invention, by the current every frame logical time of every frame logical time increasing amount adjustment, until the final end logical time arriving input, be then produce a more level and smooth visual artifacts to game user.For the game rate that slows down, then adopt the present invention, all animations in scene of game can be realized, displacement is all slack-off, but role action still keeps level and smooth.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment made, equivalent replacement, improvement etc., all should be included within the scope of protection of the invention.

Claims (8)

1. be applied to a method of adjustment for game rate in scene of game, it is characterized in that, the method comprises:
A, when starting game, the every frame logical time arranging acquiescence, as current every frame logical time, upgrades game frame according to current every frame logical time;
B, when needs adjustment game rate time, receive and cache user input speed adjustment parameter, and continue according to described current every frame logical time to receive described speed adjustment parameter time corresponding game frame upgrade;
C, after game frame in stepb terminates, according to current every frame logical time described in described speed adjustment parameter adjustment, using the current every frame logical time after adjustment as current every frame logical time, the game frame after the game frame in step B terminates is upgraded; Described speed adjustment parameter comprises: start logical time, end logical time and logical time increment; Step C specifically comprises:
C1, using first game frame after the game frame in step B terminates as going game frame;
C2, is updated to the start logical time by current every frame logical time, upgrades going game frame according to this current every frame logical time;
C3, after going game frame end using next game frame as going game frame;
C4, described current every frame logical time is added described logical time increment, if the result obtained is more than or equal to described end logical time, then using described end logical time as current every frame logical time, perform step C5, otherwise, using the result that obtains as current every frame logical time, and perform step C6;
C5, upgrades going game frame and game frame afterwards according to this current every frame logical time;
C6, upgrades going game frame according to this current every frame logical time, and returns step C3.
2. method according to claim 1, is characterized in that, between step C4 and step C5, comprises further: the described adjustment parameter removing buffer memory.
3. method according to claim 1, is characterized in that, between current every frame logical time that the described start logical time adopted before adjustment game rate and described end logical time.
4., according to the arbitrary described method of claims 1 to 3, it is characterized in that, game frame is: in scene of game, each logic loops is updated to a game frame.
5. be applied to an adjusting device for game rate in scene of game, it is characterized in that, this device comprises:
First updating block, for when starting game, the every frame logical time arranging acquiescence, as current every frame logical time, upgrades game frame according to current every frame logical time;
Second updating block, for when needs adjustment game rate time, receive and cache user input speed adjustment parameter, and continue according to described current every frame logical time to receive described speed adjustment parameter time corresponding game frame upgrade;
3rd updating block, after game frame for upgrading at described second updating block terminates, according to current every frame logical time described in described speed adjustment parameter adjustment, using the current every frame logical time after adjustment as current every frame logical time, the game frame after the game frame of described second updating block renewal terminates is upgraded; Described speed adjustment parameter comprises: start logical time, end logical time and logical time increment;
Described 3rd updating block performs renewal by following steps:
C1, using described second updating block upgrade game frame terminate after first game frame as going game frame;
C2, is updated to the start logical time by current every frame logical time, upgrades going game frame according to this current every frame logical time;
C3, after going game frame end using next game frame as going game frame;
C4, described current every frame logical time is added described logical time increment, if this result is more than or equal to described end logical time, then using described end logical time as current every frame logical time, perform step C5, otherwise, using the result that obtains as current every frame logical time, and perform step C6;
C5, upgrades going game frame and game frame afterwards according to this current every frame logical time;
C6, upgrades going game frame according to this current every frame logical time, and returns step C3.
6. device according to claim 5, is characterized in that, between step C4 and step C5, comprises further: the described adjustment parameter removing buffer memory.
7. device according to claim 5, is characterized in that, between current every frame logical time that the described start logical time adopted before adjustment game rate and described end logical time.
8., according to the arbitrary described device of claim 5 to 7, it is characterized in that, game frame is: in scene of game, each logic loops is updated to a game frame.
CN201210176979.9A 2012-05-31 2012-05-31 Game speed processing method and device applied in game scene Active CN102722650B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210176979.9A CN102722650B (en) 2012-05-31 2012-05-31 Game speed processing method and device applied in game scene

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210176979.9A CN102722650B (en) 2012-05-31 2012-05-31 Game speed processing method and device applied in game scene

Publications (2)

Publication Number Publication Date
CN102722650A CN102722650A (en) 2012-10-10
CN102722650B true CN102722650B (en) 2015-06-24

Family

ID=46948407

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210176979.9A Active CN102722650B (en) 2012-05-31 2012-05-31 Game speed processing method and device applied in game scene

Country Status (1)

Country Link
CN (1) CN102722650B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106021092A (en) * 2016-05-04 2016-10-12 北京小米移动软件有限公司 Method and device for determining starting duration of application program
CN110300327B (en) * 2019-04-18 2021-06-15 深圳市腾讯网域计算机网络有限公司 Game client performance analysis method, device, terminal and storage medium
CN112546620A (en) * 2019-09-26 2021-03-26 伊姆西Ip控股有限责任公司 Method, apparatus and computer program product for game control

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6361440B1 (en) * 1999-02-04 2002-03-26 Namco Ltd. Game system, game machine, game data distribution machine, network system and information storage medium
CN101770795A (en) * 2009-01-05 2010-07-07 联想(北京)有限公司 Computing device and video playing control method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4319233B2 (en) * 2007-12-11 2009-08-26 株式会社コナミデジタルエンタテインメント Terminal device, game control method, and program

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6361440B1 (en) * 1999-02-04 2002-03-26 Namco Ltd. Game system, game machine, game data distribution machine, network system and information storage medium
CN101770795A (en) * 2009-01-05 2010-07-07 联想(北京)有限公司 Computing device and video playing control method

Also Published As

Publication number Publication date
CN102722650A (en) 2012-10-10

Similar Documents

Publication Publication Date Title
US9129394B2 (en) CPU-GPU parallelization
US8888590B2 (en) Graphics render matching for displays
CN102722650B (en) Game speed processing method and device applied in game scene
US8643653B2 (en) Web-based animation
CN107924667A (en) The refresh rate to match with predictive time shift compensation
CN103996069B (en) A kind of BPNN training methods and device based on more GPU
WO2007120802A3 (en) System and methodology for management and modification of human behavior within a goal-oriented program
CN108986063A (en) The method, apparatus and computer readable storage medium of gradient fusion
CN104461718A (en) Frame playing method and client end for game application
CN107547629A (en) Method, apparatus, electronic equipment and the computer-readable recording medium that client static resource is downloaded
CN105607937B (en) A kind of hot patch method and apparatus
CN106339300A (en) Method and system for acquiring FPS of third-party game
CN102447689B (en) Information updating prompt method and network client side
CN104866339A (en) Distributed persistent management method, system and device of FOTA data
CN110270092A (en) The method and device and electronic equipment that frame per second for electronic equipment is promoted
CN107357592A (en) A kind of event-handling method and device based on state machine mechanism
CN105435450A (en) Game implementing method for pre-generating game battle segments
CN103049628A (en) Accelerating method and system of online game
CN104360906B (en) A kind of High Level Synthesis dispatching method based on difference constrained system Yu iteration mould
CN101436065A (en) Substrate production plan generating method
CN104375793A (en) Embedded system background image update-displaying method
CN102682461B (en) A kind of animation rendering intent, system and animation player
CN113797534B (en) Self-adaptive method and device for maintaining smoothness of pictures
CN111161685A (en) Virtual reality display equipment and control method thereof
CN105373456A (en) Memory testing method for reducing cache hit rate

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant