jobel's Recent Forum Activity

  • ARGH! sorry, bad mistake on my part... at least that issue is resolved!

    so now back to figuring out if bullet and custom are incompatible...

    also R0J0hound do you have a kofi account or something? I very much appreciate all your help and wouldn't mind buying you a coffee.

    EDIT: oh no, this has been working right all along! it was only my test that was faulty! but the original issue of you helping with family vs family and orbit speed to bullet speed was VERY helpful, so thank you!

    btw I checked that angle calculation MANY times and somehow I missed the Y and Y!

  • DiegoM not sure if you know the answer. Is cos() and sin() compatible with bullet angle of motion?

    the math here is not working for bullet when object are going up/down, but work left/right

    dropbox.com/s/c7butfk0ceoqccl/BounceTest.c3p

  • R0J0hound okay I found its not Custom vs Bullet that is the issue. The issue still happens when I try a bullet vs bullet bounce.

    It works great from angles 0-180 but not 90-270

    Do you think the .AngleOfMotion could that give values that don't agree with sin() or cos()? (movingAngle is -90 when going up)

    I honestly don't know how its not working...

    here's a simple test

    dropbox.com/s/c7butfk0ceoqccl/BounceTest.c3p

  • oh! I always assumed Custom and Bullet speed/angleOfMotion were the same. Maybe they are not?

    I will do some testing around this, I hope there's no major discrepency.

  • LinearSpeed = angularSpeed*radius*pi/180

    R0J0hound

    ah thanks for this! I was testing hitting a key to disable the orbit and transfering the speed to bullet and now that looks exactly right!

    I'm not worried about the bounce as much. The problem is, sometimes there's no collision and the objects just go right through each other. It's usually when its a north/south collision. like shown in the GIF in my previous post. It's almost as if there's no collision detected, which seems very odd.

    As far as circles vs boxes, the way I'm ultimately using them is probably closer to circles, but most sprites in games (unless you are using actual primitives) are drawn art (characters and things) usually have some depth to them, collision polygons are not drawn right to the edge and are usually smaller than the sprite itself. Even if the angle is off slightly it doesn't matter. However, if it goes in the complete wrong direction, or there is no redirect at all is when it doesn't look right.

    the bounce won’t change the angular velocity as is which adds to making the bounce not look right.

    I don't understand this part at all. why wouldn't it, if I transfer it to bullet.speed before the equations?

    all the side to side (east/west) collision work great.

    I thought maybe you set it up that way since your original response was to a question about how to make something like this happen:

    currently this happens (north/south collides):

  • original thread: construct.net/en/forum/construct-3/how-do-i-8/someone-help-calculating-145005

    R0J0hound revisiting the collision formula you gave me and I'm wondering if I got it wrong somewhere.

    This all started when I tried to make the collision happen when one of the objects is using the Orbit behavior. I want the collision to knock the orbital object out of orbit to then start using the bullet behavior.

    So I did a back-of-the-napkin translation of the orbit movement to a bullet "moving angle" by adding 90 to the rotation (in degrees). So if it's in orbit at 0 degrees and moving CW the moving angle is roughly 90 degrees. but it's not working very well.

    However, I noticed some other weird interactions with even non-orbit obstacles. A lot of times when the player is moving up/down, hitting an (non-orbital) obstacle that is moving up/down the collision seems wrong. So I wonder if this exposed something slightly off about the formula, because sometimes its works perfect (so that smells of doing a + instead of - or * instead of / etc..) I tried to mess with it, but I only made it worse!

    Also one other issue is that I am setting a max speed for all objects, could that be a factor?

    check it out here: dropbox.com/s/w3tjtks272tkzaf/orbitHitTest.c3p

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • another thing you can do is add a compressor (audio effect) to a "tag" and then play the sounds through that tag. this will not totally fix the volume but it will help a lot.

    the compressor will act as a "limiter" and will try to squash the volume if it gets too loud.

    play around with the Threshold (lower it) to get it right. And set the Knee to 0 (so its applied right away)

    EDIT: also set the "attack" to something really short like 1 - but it all depends on your sound

  • oh I see what you mean by square or circle. yeah my objects will use collision boxes and won't be primitive shapes. So I guess the 2 Family method will work then.. Thanks for the help!

  • you can remove the for each in the bottom two events and it’ll still work, since the actions only reference themselves.

    oh wow, I didn't even think of that!

  • lionz yeah technically its working.. I just wanted to know the best way to do it.

    R0J0hound

    Another option is multiple object types and one family. We can then utilize iids to reference two different instances at once. Then to modify them you can use pick nth instance. The con is you couldn’t use the overlapping events, so you’d have to roll your own which isn’t too terrible for circles and boxes. Although the loop is a bit more nuanced.

    This was what I wanted but I didn't know if I could do

    Family1 on Collision with Family1
    Family1.IID <> Family1.IID 
    
    

    that second part I was unsure of.. although I don't think it works... how would it know which to pick?

    I need to have multiple objects, so I guess the best way is to do the 2-family method. There shouldn't be too much overhead with sharing family data in a For Each. The most family members there will be less than 10.

  • this is collision code from R0J0hound

    I'm wondering if this is the best way to do this.. I've made it so objects in the same family collide with each other. Maybe there's an easier way so I don't have to do the "For Each" at the bottom and/or make a second family?

    dropbox.com/s/o6yflozq2qg0qtu/pvp_physics.c3p

  • honestly I like making my "empty object" sprites. I make them nice colors and it looks good on the event sheet.

    For example I use a sprite object called "GameTimer". And whenever I need a timer for something I use it for that. I make it nice and orange and it looks like a nice custom object in my event sheet.

    if you can't spare 1 sprite that isn't even rendered you probably have much bigger problems than needing an empty object!

jobel's avatar

jobel

Member since 27 Jul, 2013

Twitter
jobel has 8 followers

Connect with jobel

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • x4
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

18/44
How to earn trophies