at 60fps (vsync)parallax7d wrote:cool, I got that now, thanks for elaboratingS0lll0s wrote:
Whenever the user does something, an event is sent into the queue. At the start of every loop, the whole queue is applied to the callbacks in order; That means as far as love.keypressed and love.mouseclicked are concerned, you can pretend the events are completely real-time, you cannot select entity A, hit delete and select entity B before A gets deleted and mess up the input.
Well, that depends on the time between framesS0lll0s wrote: I just ran a quick test and when I type as fast as I absolutely can there are still a minimum of 5 frames between letters (for hello). I can't manage to type the same key twice in under 7 frames.
When does love.keypressed actually run?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: When does love.keypressed actually run?
Re: When does love.keypressed actually run?
I am not sure if it is possible for a person to hit 60 keys per second.
My Tox ID: 0F1FB9170B94694A90FBCF6C4DDBDB9F58A9E4CDD0B4267E50BF9CDD62A0F947E376C5482610
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: When does love.keypressed actually run?
But when would an action get lost? It wouldn't! It would just be applied the next frame.parallax7d wrote: I figure the fastest APM in the world is 818 = 13.6 actions per second. I guess as long as the fps of the game stay above double that, the chances for a lost command are tiny. It's just so annoying when it does happen!
Re: When does love.keypressed actually run?
If you are making a rhythm based game, you might run into problems with the accuracy. If you consider normal 60fps, its way too inaccurate for rhythm based games, meaning you probably have to make some way polling of keys actually work on separate thread outside of draw / update functions. I am not really sure how it would go though, but that seems to be the only really viable way of being able to read the keypress more often or removing Vsync could also work, but that doesn't seem the best solution out there.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: When does love.keypressed actually run?
You would need to define a valid time range anyway, because no way human reaction time is more precise than 60FPS, so I don't think that's necessary.
Help us help you: attach a .love.
Re: When does love.keypressed actually run?
Maybe the quote itself was not a reply for my rhythm based games, rather than a general answer, but regardless:Robin wrote:You would need to define a valid time range anyway, because no way human reaction time is more precise than 60FPS, so I don't think that's necessary.
Quick searching shows that some versions of Stepmania have 22.5ms time window for marvelous, so that would be +-11ms and it seems that some DDRs have even smaller time window, thus 17ms interval for reading keypresses are far too infrequent for rhythm type of games. The thing is, rhythm game does not base on reaction, rather than prediction and memorizing when to press a button. Also the more constant the delay is, the better it is for rhythm games.
Altho I agree that in most cases the small delay wont matter much, but when it comes to competition such as fps or other very reaction type of a game, the other player using 60fps, and thus 60 times scanning inputs vs other person vsync off and having 200 fps for example, the person who has 200 updates per second might gain a slight edge, depending on a game.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot], Semrush [Bot] and 2 guests