Soulmachine's Forum Posts

  • Yes it is pretty good

    I'm working on my real app right now and I think I got a good result both on the Computer and touch-devices.

    ...Using the "wallclocktime" seems to work the best.

  • Soulmachine be so nice 2 test this 4 me ?

    https://www.dropbox.com/s/jva90n2bq76qt ... .capx?dl=0

    Hello!

    Interesting capx <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    I did some testing, but only on my computer, in the Chrome webbrowser. Forgot my phone at my neighbour. I can test on it also later if you want?

    -

    I've been thinking and I think if I round my value to the nearest 10th I can get a pretty good result.

  • I see that you talk about milliseconds.

    So ... Also .. C2 works as a sorta kinda sampling machine.

    At a steady 50 FPS the events run 50 times a second.

    Then the 'measuring' happens every 0.02 seconds. Or, you have a random uncertainty between zero and 0.04 seconds.

    At a steady 25 FPS (never happens, dt is always dancing) this is already 0.08 seconds.

    That means nothing in normal circumstances. It does when you want exact measuring, in milliseconds. I think it is impossible to compare devices in that 'quantised' range.

    It's a bit sensitive with beats and music, cause there's a big difference between lets say 0.5s and 0.51s ( 0.5s = 500ms ) (0.51s = 510ms)

    So 0.5s is 120 beats per minute

    ...and 0.51 is 117.64 beats per minute

    so its a big difference that is very audible (noticeable) when it comes to music

  • Hi, thanks for the responses

    Overall it seems to me that the small latency that always is when you use a touch screen is in play somehow.

    Interesting capx you've sent me

    I've tested it on my computer and on my iPhone - and I get different times depending on witch one I use

    PC -TEST

    iPhone - TEST

    I edited your capx a little so I could read the text on my iPhone and I added so you can see the FPS too. http://www.lindsjael.se/soulgames/TapABeat%202.capx

    If anyone would like to also try and see what they get as a result - feel free... I think about 16 taps is good enough for a test. I used a metronome at 120 BPM that I listened to while I tapped - so I could get as consistent readings as possible. Here's a free on-line metronome https://www.starsandcatz.com.au/metronome/

    I tested a couple of times to get into the beat.

    You used the "On tap gesture" that's different from my own tests. I've used "Touching object" or "Is in touch" or "Touch start". I've also tried "On tap object"

    It was interesting with the "On tap gesture"... If I tapped at 120 BPM I only got a tap registered every other tap. So My time between taps are about 1s.

    But if I tapped much slower, like 60 BPM . Every tap got registered? ...thats also 1s between taps.

    If all taps are registered at 120 BPM the time should be around 0.5s.

    I felt it got a little bit more consistent... or should I say less random. Where I got fairly same readings when I used my iPhone ( a touch device ). However the time differs from the Computer readings.

    I looked at the FPS and it stayed between 45-60 all the time.

    I've been thinking of what's the best way to measure the time. I've both tried using delta time and the system expression time.

    Interesting suggestion about the wallclocktime 99Instances2Go I will try it out.

    lamar

    On my own testing I've both used the measurement cleanly as it is ... and used Round. And rounded it up to nearest 0.1 (tenth)

    I get better results rounding I think.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hello!

    I'm measuring the time between taps ( touches ) when I'm making a Bpm-tap function. Bpm = Beats Per Minute, like you use for tempo in music.

    But I'm getting inconsistent results on touch-devices. However it works very nice on a computer, using a mouse.

    I'm wondering if I missed an important mechanic with the Touch-plugin or something that causes problems?

    The main thing I'm interested in is: What's the best way to measure time between two taps in Construct 2?

    My function works like this:

    When the user touches/tap/click a sprite I measure the time between taps.

    I also count each tap so I can calculate an Average value.

    To calculate the BPM I only need a time... for-example 0.5s or 500ms is a Quarternote at 120 BPM.

    I have tried several of the touch-conditions but the one that seem to work best is "Is touching object" or "Is in touch"

    I use this condition followed by a "Trigger once"

    The result is great if I try the app in my computers web browser.

    I have two BPM-values... First the value calculated with the time between the last two taps. Secondly the BPM calculated from an average from all the taps made.

    On a touch-device... I have tested on an iPhone 4S and also on an android-system: Samsung S3. I also did some testing on a Sony, don't remember the model.

    I seem to get the same results from all of them - where the end result is that they give me a BPM-value 1-2 bpms higher than on the computer.

    It seems like overall the measured time between taps is getting a bit higher than on the computer.

    So both my BPM-values the (real) one and the (average) one... gets misleading values.

    I wont get into more details, for now, unless someone asks for more.

  • Sorry, I'll explain a little better.

    In this particular case I have a situation with several players in a multiplayer game.

    One issue with the animations is for example when a player walk ( or move ). Then the player have a walking animation... So if a player walks and other players see that player they all need to see the animation of the legs.

    ...So, when a player walks, I want to start the walking-animation, and when the player stops, I want to stop the animation. And all the other player's needs to see this. Not only the host - and the Peer (client) that is currently walking.

    In short - all the clients needs to know when a player is moving - and if they do, they need to know to start that players walking animation.

  • I see...

    Hmm thats ALOT of "orders" to send and lot of programming. I did this a while ago in another game. The bright side is that if It's set it up well and once it's set up it's pretty easy to send such info to the clients.

    These animations I have in mind for this game has to be changed for all the clients at the same time. It is things like when another player move, they need to see the animation for the legs, and so on...

    I guess I'm kind of forced to do this anyway since it does not work for the clients if I mess with animations in the Common-group.

  • Hello!

    What's the best way to:

    start stop

    change

    ...Animations in a multiplayer game?

    I always start from the multiplayer-template and I use the Groups created for you in that template.

    Should I try to do this in the Common-group or should I do it in the Host-group and send "orders" to the Peer-group so that the peer's also do the animation-changes?

    What's the best way to do it?

  • Ok, thanks...

    Then this is my problem.

    Yep That's pretty much what I did.

    I called a function and sent the local variable as a parameter - the function got 0

  • If I set a Local Variable in an Event and then Call a Function ( jump to a function )

    is the Local Variable lost - for the next coming actions.

    Like... if I have an Event..

    Sets a Local Variable

    then in my actions I have like. Call Function"...."

    And next action Set "something" to "LocalVariable"

    Did the local variable got lost when Construct performed the FunctionCall ?

    I mean Construct jumped to another "location" in the code and back again - and I have a situation where I feel this phenomenon happened to me.

  • I was told there are more WebRTC apps running on iOS than there are running on Android? And I was wondering if anyone has info about when it may be available for the Chrome or Safari web browser?

    Is there a way to make a Construct 2 game that has multiplayer ( using WebRTC ) - that would work on the iOS? Or is it very complicated?

    I believe iOS ( an iPhone ) uses apps.. or wants to use apps, instead of using a web browser as a middle ware. And there's lots of self-sustaining apps out there using WebRTC? But there's not support in Chrome or Safari for WebRTC? This is perhaps because browser support isn't irrelevant for many vendors creating apps.

    *btw I'm an iPhone newbie, just got my first one.

  • Me too got a bit disappointed that iOS didn't support WebRTC

    Here's an interesting article about the subject: https://bloggeek.me/iphone-webrtc-smartphone/

    It looks like different vendors use WebRTC on iOS platforms anyway, despite it's not supported?

  • hmm...

    Perhaps you could try using different states of your car.

    Like "impact" and "pushback" or something.

    So when the car first hits the forcefield you set the state "impact" and do the stuff that you want to happen with the car. Then when that stuff is finished, you set to next state "pushback" and you do that stuff you want to happen there.

    You could also try the Timer behaviour.

    Like when the car hits your forcefield, a timer starts, and after a certain amount of time you can trigger a "pushback"

    Try to use Apply physics force towards position, or towards angle, when you want to affect your car to move in certain directions. You could also try Apply impulse to see if that gets you a better result.

  • Yes Containers in Construct is the thing you need.

    Lets say you create 3 people. And every "person" have lets say. A head, body and legs. 3 things.

    If you start making a sprite representing the head, and call that one "Person".

    Then create another sprite representing a body, and call it "Body".

    And after that you create yet another sprite representing legs, and call it "Legs"

    If you go to, or select your Person-sprite ( the head ) and go to containers in the Properties ( to the left ) ... And click Add object. Just add your Body and Legs there.

    Now the Head, body and Legs are in a container.

    If you later need to select one Person. You use the "Pick by comparison" - event

    There you choose the Person-sprite ( the Head ) - and after that you have an expression... Lets say ( Person.index = person01 ). This way Construct picks the Person.sprite that has person01 in it's instance variable: Person.index

    Then what you later decide to do with that object applies to ALL the sprites in that container. The Head, Body and Legs. So if you want to destroy the "Person" - choosing Destroy Person also destroys the body and legs. It's the same if you want to create a Person. The body and Legs will also be created.

    If you position the person though... the body and legs wont automatically also position them selves correctly. For that you have to preferably use the Pin to behaviour. If you have pinned the Body and Legs to the head and later position the head somewhere, the Body and Legs will follow. The same works if you rotate the head. I do not know about scaling. But at least if you choose the Person object in an event and in the actions you for example use Person - Set scale and below that Body - Set scale and then Legs - Set scale. ...The correct Head, body and legs will be scaled.

    So think like this.

    Have an unique identification for each people. Like Person01, Person02 ... and so on. In an instance variable. Do it when the sprite gets created.

    Use one sprite that controls all the other body parts.. lets say the Head of the person. And put all the other body parts in the heads container.

    When you pick the Head.sprite - ALL the other body sprites also gets picked.

    Try experiment with this in a totally fresh project and I'm sure you will quickly learn how it works. A tip is to position the head and the body parts as you want them to fit together when you're in constructs layout. Because when you create a new object, construct will create the head, and then position the other objects in the container the way you have positioned them in the Constructs layout. If you directly after you created your Head ALSO pin all the body parts to it - then when you position your head all the body parts will also get positioned.

    I hope you get it to work.

  • Can you explain a little more what you want. I did not quite understand what you are looking for?