Repeatedly trigger an event with highly accurate timing.

Discussion and feedback on Construct 2

Post » Mon Jun 02, 2014 10:36 am

I discovered Construct 2 quite recently. So far, very intuitive and simple to use—a big thanks to the creators! It seems a great platform for somebody like me who can think logically, but doesn't know any programming language. I'm mostly interested in using Construct 2 to make music apps.

I'm currently working on a metronome, and while I can get it to function how I like, I'm finding it impossible to make the timing solid. It's always fluctuating. Or, to put it another way, there is always a small margin of error which becomes especially noticeable above 76 bpm, as the beat seems to waver back and forwards with up to 1 bpm difference from beat to beat.

I think it's to do with the fact that all the timing options have limited accuracy: the "compare time" or "every x seconds" conditions are tied into the FPS (ticks); object timer behaviors, or "every x seconds" or "wait" commands are all limited to about 0.01s accuracy (sometimes worse).

So, the question is this: if I want to have a metronome beeping steadily and accurately at 61bpm (that's 1 beep every 0.9836), how do I accomplish this in Construct 2? It seems like it's not possible. Or maybe I'm missing something quite basic...!?
B
5
S
1
Posts: 5
Reputation: 285

Post » Mon Jun 02, 2014 1:06 pm

Construct 2 will try to tie the logic of the game to the VSync I think, which maybe is limiting the actual precision you need, also, the browser may take a little time to actually play the Beat sound when you command it to do so. I do not know if the sound playing is tied to the app framerate (and furthermore I 'm not sure the actual triggers can run between ticks), so the precision needed in your case might not be possible to achieve (I'm not sure of that, hope someone else can confirm or revoke it), also, What is a BPM? (Beat per ..?).
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Mon Jun 02, 2014 2:08 pm

BPM = Beats Per Minute

I'd be interested in this too as I would like to create a dynamic music/sound system... the webaudio API does apparently have access to very accurate timing information which would be necessary for this kind of set up. Whether or not it is implemented in Construct is a different matter... I'm going to hazard a guess that as Aphrodite has mentioned, it is tied to the overall delta time system since there doesn't appear to be any way to access any other timing info. Which is a shame because sound/music is often overlooked and the webaudio API gives a lot of control that could have a lot of potential if we could get at it!
B
15
S
6
G
6
Posts: 103
Reputation: 2,968

Post » Mon Jun 02, 2014 8:43 pm

Thanks both of you.

Having looked at it more today, I just don't think there is a way to access the raw system time. Maybe possible using the SDK, but then that's starting to get over my head, and the appeal of C2 is in avoiding all that text-based coding!

It's a shame, because it really limits the possibilities for using C2 in music apps.
B
5
S
1
Posts: 5
Reputation: 285


Return to Construct 2 General

Who is online

Users browsing this forum: A2D and 4 guests