YesNoOk
avatar

Game-time and state-time (CNS) (Read 2182 times)

Started by Just No Point, September 29, 2015, 12:18:16 am
Share this topic:
Game-time and state-time (CNS)
#1  September 29, 2015, 12:18:16 am
  • ******
    • www.justnopoint.com/
M.U.G.E.N keeps track of the time that has passed in the game. Every time the game is updated (this includes updating the players, checking collisions, and drawing to the screen), we say game-time has increased by one. The time a player has spent in a state is known as the "state-time". The state-time starts at 0 at the beginning of a state, and increases by one tick for every tick of game-time.
Last Edit: September 30, 2015, 03:55:07 pm by Just No Point
Re: Game-time and state-time
#2  September 29, 2015, 03:18:02 pm
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
I think it would be helpful if someone who happens to knows this detail could post it here...

When exactly Gametime begins, and when it ends / pauses / resets?

I imagine it is only active during RoundState = 2

Re: Game-time and state-time
#3  September 30, 2015, 01:13:53 pm
  • ***
  • Glorified Verison of a Pellet Gun
Did a little testing. In WinMUGEN and 1.0, GameTime seems to count up for every tick that the game is 'in a fight'. So from the moment it starts fading in to a fight in RoundState = 0, it's starts counting up, and is only halted by pausing the game or entering a menu (returning to character select, displaying a victory screen or vs screen, etc). Once it enters a battle again, it continues counting from where it left off, meaning the only way to reset this number to zero is to close MUGEN.

In 1.1, GameTime counts up from the moment MUGEN is opened and only stops when MUGEN is closed, regardless if you're in a menu or a battle. With these things in mind, GameTime seems to have very niche uses for characters.
Re: Game-time and state-time
#4  September 30, 2015, 01:34:32 pm
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
Good job testing it out, and thanks!

That definitely behaves differently than I thought

Re: Game-time and state-time
#5  September 30, 2015, 02:10:20 pm
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
gametime%2 will give you a quick 50% probability of triggering something. It's the main use I've found for it, for example when selecting random winposes, due that random<500 will tend to lower values
XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!
Re: Game-time and state-time (CNS)
#6  September 30, 2015, 04:53:21 pm
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
gametime%2 will give you a quick 50% probability of triggering something. It's the main use I've found for it, for example when selecting random winposes, due that random<500 will tend to lower values
gametime%XXX also works good for randomizing triggers in the States -1, -2, and -3.

This technique is very useful for a custom effect in my character... his face has dynamic animations comprised of 1-tick anims, allowing him to change from Walk, Stand, Turn, Run, Walkback, etc, and the animation on his face does not get disrupted.

Spoiler, click to toggle visibilty