Minimum timer value? (everything working, just curious)

I have a simple question/answer game that I am making, not to publish but to get better with GS, that goes something like this:

I have a question come up on the screen and the user (me!) has to press one of three buttons to choose the answer... then the question explodes if its the right answer! Yes, cheesy but everyones gotta learn from the basics! :p

The three buttons all change an attribute called "answer" with the values 1,2 or 3

I then have a "controller" actor that has a timer in it that fires every 0.2 seconds to check the "answer" attribute to see what answer the user has inputted, it then compares it to the correct answer.

Everything is working fine so this thread is not asking for help, but I was wondering whats the minimum that we can set for the timer without totally screwing up the user experience for the users? (Especially if they are using a year or two old phone)

Whats the lowest you have set/dare to set your timer/s in your (published) games?

Comments

  • SocksSocks London, UK.Member Posts: 12,822

    You don't really need to check if the answer is correct every 0.2 seconds, you can do it just once when the user makes their choice.

  • HopscotchHopscotch Member, PRO Posts: 2,782
    edited December 2014

    @ryast, 0.02-0.04s is roughly the duration of one code cycle in GS, so even a timer firing every 0s will only check every 0.02 seconds at most.

    Accommodating old phones, in the scenario you describe is unnecessary. If you want to use the timer as you are, make it check every 0s. The code cycle is tied to the draw call, so even if your game is really graphically heavy and you should have lag on old phones, there is still no danger of events being missed.

    However, I would suggest not using a timer in your "controller" at all. Just have a rule checking if the answer attribute is greater than 0, assuming 0 is the unanswered state. The rule will trigger as soon as the attribute changes its value.

    Then do your comparing and reset the "answer" attribute back to 0 for the next question.

    Rules are event based and fire as soon as its condition becomes true.

  • ryastryast Member Posts: 145

    Aha! Thanks guys! I thought I had to keep checking over and over again till it changes, no idea it does it "automatically".

    Not the answer I was expecting, but better as I have learned more than one new thing :)

  • ryastryast Member Posts: 145
    edited December 2014

    Hey again!

    It's not really working all that well without a timer.

    Here is my code project file:
    http://fast-online-web-proxy.de/gs/LearningTest.gameproj.zip

    The code is extremely simple (i'm a noob learning) but just to go over it quick:
    - The spawner actor on the right has all the main code, including the timer.
    - Basically, there are two numbers: one thats displayed and one thats coming next, they should not be the same
    - On the bottom is a button that forces the next number to be 7, then when that goes into the display box keep pressing the bottom number so the display box and the next box are both equal to 7.
    Since I have the timer it changes the "next number" to some other number but not using the timer it keeps it both at 7 for a long time.

    The whole thing is simple, its longer and more confusing to write it :)
    let me know if you don't understand the project or need any clarification.

    Thanks!

    Note: the only reason it's in iPad size is I heard it should be that size if I later want to make it work on all resolutions and all phone sizes

Sign In or Register to comment.