Set input priority


#1

Hi! There is any way to give more priority to the input of the game, or to a certain function?

In my game I have some frame drops in low end devices and the input is processed on enter frame, so the input is a little rough. I would like to process de input independently of the game loop. I am porting to HTML and I know that there are no threads, but there is a way to set a priority or achieve this behaviour?


#2

I think it works as it should now. If input was framerate independent how would you sync it with decisions in the game?
What actually are you controlling with input?


#3

In fact I am handwriting, so I don’t care the immediate response of the game, I want a soft draw even if the line is not drawn immediately.


#4

On HTML5, we should fire input events as they come, independent of enter frame. Perhaps you can listen to these events, and store up what is happening, then perform your drawing on enter frame, or perhaps you can even do your drawing code as input is received, then OpenFL will just render it later when it’s a frame


#5

I am listening the mouse move event, but if the frame rate is slow there are fewer calls to de event. Perhaps if there are multiple events between frames, only the last event is attended?


#6

I suppose this would be specific to the browser? We don’t do any queuing/caching on our end


#7

So Input running independently from the enter frame is general for OpenFL or just specific targets?


#8

It should be general for OpenFL, though we do add sleep to touch input on Android, since the frequency really hurts performance on some phones