1. Hey! Guest! The 35th GMC Jam will take place between November 28th, 12:00 UTC - December 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

Making Rhythm game (snapping notes)

Discussion in 'Game Design, Development And Publishing' started by Joh, Aug 21, 2019.

  1. Joh

    Joh Member

    Joined:
    Jul 23, 2016
    Posts:
    67
    Hi, I've done a bunch of research on the subject and while it seems like GM is not exactly the best friend of Rhythm game (limited Audio system & functions) it seem doable.

    borrowing from multiple sources, I went with a deltatime to seconds system to bypass the fps/lag potential issues. And while I'm very early in (haven't even checked how it synchronizes with sound),

    I'm facing an odd issue: I can't seem to place notes at a consistant pace/rhythm with "snapping".

    Gist of sytem:
    create
    Code:
    seconds=0
    fullwindow=60 //1 minute, just the testing time scale (loop)
    subdiv=4 //number of subdivision between beats
    bpm=120
    beatpersec=60/bpm
    increment seconds every step
    Code:
    seconds += (delta_time*0.000001);
    on click, create note at second.

    Note is created like this
    Code:
    vbeat=round((seconds%fullwindow)/(beatpersec/subdiv))*(beatpersec/subdiv); //snap
    //can ignore the fullwindow, its just to loop position.
    sc_create_note(vbeat)
    I'm wondering if there's a flagrant flaw in there.
    If i click as fast as I can, I can usually have notes in 3 "subbeats" in a row before one skips (even if i didn't slow down) sometimes only 2. If i allow holding (keyboard_check()) all subbeats DO fill. So I'm wondering, do fps somehow cause some "unlucky" beats to be skipped? is there a mechanical limit, say one click takes "0.3sec" thus if a beat was 0.2sec, you eventually miss one? I feel my code should work and it does when I don't use snapping, so I am confused on what is going on.


    The idea overall is to be able to place note by ear. but to have them "snap" to beats or subbeats for consistency.
    (wasn't too sure, in design or help section, but some previous threads were here, + i am quite open to other designs)

    Thanks
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice