Does Interpolate kill Overlap/Collide

outasiteoutasite Member Posts: 417
edited November -1 in Working with GS (Mac)
Working on my game for Brain Tumors, but Iran into a bit of trouble. Tumors move from edges of screen to bottom and when they touch the brain reset. To add flare JP thought it would be cool to make the brain pulse (I love the idea). But When interpolate is on, the overlap/collide feature no longer works and the tumors just continue to through the brain without colliding.

Vid of the working collide.


Rule: size.width <= 161
Interpolate size.width to 180
Interpolate size.height to 160

Rule: size.width >= 179
Interpolate size.width to 160
Interpolate size.height to 140

But when the two rules that turn the interpolate on, are on my tumors no longer recognize the collision with the brain...
Any Help?

Thanks
Michael

Comments

  • rlehmrlehm Member Posts: 320
    I had this issue with a growing explosion. Had to make a 100% opacity image and have it spawn over the other at regular size. Then you would only see the explosion. So I had two actors instead of one.

    Better to animated over grow one image I found. Sucks.
  • outasiteoutasite Member Posts: 417
    damn thanks
  • DizkoDizko Member Posts: 498
    I would avoid interpolate as much as possible with gameplay. Use physics instead. Because interpolate cannot be interrupted after it starts, it tends to cause a bunch of issues.

    I would limit using interpolate for non-gameplay things.
  • DrGlickertDrGlickert Member Posts: 1,135
    Interpolate cannot be interrupted. So yes, interpolate does kill collide/overlap.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Dizko said:
    I would avoid interpolate as much as possible with gameplay.

    no offense, but thats some of the worse advice i ever heard

    Use interpolate as much as u can
  • DrGlickertDrGlickert Member Posts: 1,135
    JohnPapiomitis said:
    Use interpolate as much as u can

    Thats some of the best advice I've ever heard. :-)
  • DizkoDizko Member Posts: 498
    JohnPapiomitis said:
    no offense, but thats some of the worse advice i ever heard

    Use interpolate as much as u can

    For gameplay, really? Explain please, because it has caused nothing but problems for me.

    And I absolutely take offense, because you simply called me out instead of explaining yourself. Saying "no offense" does not absolve you from causing offense.
  • MagoNicolasMagoNicolas Member, PRO Posts: 2,090
    For Collisions to work with interpolate, one of the 2 actors that will collide, must be MOVABLE.

    All my game ePig Dive was done with interpolate, the only actor that have movable checked is eddie (The Pig)

    cheers-
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Dizko said:
    For gameplay, really? Explain please, because it has caused nothing but problems for me.

    And I absolutely take offense, because you simply called me out instead of explaining yourself. Saying "no offense" does not absolve you from causing offense.

    I felt no need to explain myself because using interpolate as much as possible is common knowledge. Ask anyone thats good with gamesalad. It saves a tonnnnn of processing power and lets u uncheck moveable in the physics. It makes a huge difference.

    Just like mago my newest game uses all interpolates and non moveable actors. Also just like him the only moveable actor is the main character, and still uses interpolates, Its also a line drawer type infinite runner, so its all based on collosions and works perfectly. Also the player doesnt actually move at all, everythign else does. if i used anything besides interpolate in all my rules the game wont run on anything but iphone 4, with interpolate and non moveable it runs on all devices perfectly.

    If you learn to work with interpolate it will be your best friend
  • outasiteoutasite Member Posts: 417
    Thanks guys. My brain is set to unmovable. The tumors are movable. The only thing that I changed was interpolate width and height.

    So using physics is out of the picture anyway way. I don't know how to make things bigger with gravity.

    The video shows the tumors colliding just before the size change.

    I don't under stand why my interoperate of the size and width (not position) kill the collide with my tumors which are MOVING towards my brain.

    Breakfast first and then I wil post a vid.
  • quantumsheepquantumsheep Member Posts: 8,188
    outasite said:
    My brain is set to unlovable.

    awwwwww

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • DizkoDizko Member Posts: 498
    Perhaps the interpolate doesn't update the collision shape until it ends?

    You could try using a timer and a change attribute rule to test that theory out.

    Make rule that turns on a timer for: every 0.05 sec (or something very rapid) to do change attribute self.height to self.height +1 (same for width)

    You would have to make a special attribute to trigger the rule on/off and have it turn that trigger off once it's to the size you want.
  • outasiteoutasite Member Posts: 417
    quantumsheep said:
    awwwwww

    QS :D

    Ooopss. Hah. That explains a lot.
    Dizko said:
    Perhaps the interpolate doesn't update the collision shape until it ends?

    You could try using a timer and a change attribute rule to test that theory out.

    Make rule that turns on a timer for: every 0.05 sec (or something very rapid) to do change attribute self.height to self.height +1 (same for width)

    You would have to make a special attribute to trigger the rule on/off and have it turn that trigger off once it's to the size you want.

    What would be better on performance though? A extremely fast timer, or a invisible actor behind the one changing size?
  • DizkoDizko Member Posts: 498
    outasite said:
    Ooopss. Hah. That explains a lot.

    What would be better on performance though? A extremely fast timer, or a invisible actor behind the one changing size?

    They're probably both not all that great, if you use an invisible actor you'd probably have to use constraints right? Constraints are pretty costly.

    I meant my solution as a way to test if it's the actual interpolate that's causing your issue or something else. And if it worked, maybe it would present a possible end solution as well.
  • outasiteoutasite Member Posts: 417
    Dizko said:
    I meant my solution as a way to test if it's the actual interpolate that's causing your issue or something else. And if it worked, maybe it would present a possible end solution as well.

    Yea thats my problem. When interpolate is on, collision is not detected, but when there is a timer, Change attribute updates the shape size and therefore collision can be detected.

    This sucks....
  • StamuStamu Member Posts: 92
    Brain Tumors? for real?
  • outasiteoutasite Member Posts: 417
    Stamu said:
    Brain Tumors? for real?

    This is supposed to mean? Please if you have any comments negative or positive towards the gameplay, art, or anything else other then the "code" in GS post to my game creation log here: Game Creation Log: Cancer Sucks

    I want to keep this thread open for those looking for answers.

    Thanks
    Michael
  • DizkoDizko Member Posts: 498
    outasite said:
    Yea thats my problem. When interpolate is on, collision is not detected, but when there is a timer, Change attribute updates the shape size and therefore collision can be detected.

    This sucks....

    That sucks, but at least you know the exactly what the issue is. Too bad there isn't a scale behavior in GS.
  • outasiteoutasite Member Posts: 417
    I fell in love with the effect. So the simple fix I decided to go with was a invisible actor that does not change in size.

    The "visible' brain interpolates between 160x140 pixels to 180x160 pixels. The "invisible" brain remains in the middle at 170x150, and the effect is still pretty good.
  • AppsRacKAppsRacK Member Posts: 346
    IMHO the best option is to use timer/change attribute combo for precise collision.

    Timer
    ->For 1 sec
    -->Timer
    --->every 0.1 sec
    ---->change attribute "self.size.width" = "self.size.width+1"
    ---->change attribute "self.size.height" = "self.size.height+1"

    This will add 10 pixels to your actor for 1 sec so just adjust it according to your needs. Unless you got double digits quantity of these actors on the scene i dont see any drop on frame rate by doing this.

    p.s this is one of those time i wish GS forum has a code form :)
  • outasiteoutasite Member Posts: 417
    drahc said:
    IMHO the best option is to use timer/change attribute combo for precise collision.

    I was thinking about doing this, but I am always reading about how timers to kill performance.
    I have a weird obsession about making all of my games run at 50 FPS or higher on devices low as 2nd Gen.
    I would want the actor to increase 20 pixels. So a .05 actor would be needed.
    drahc said:
    Timer
    ->For 1 sec
    -->Timer
    --->every 0.1 sec
    ---->change attribute "self.size.width" = "self.size.width+1"
    ---->change attribute "self.size.height" = "self.size.height+1"

    p.s this is one of those time i wish GS forum has a code form :)

    This looks very nice
  • AppsRacKAppsRacK Member Posts: 346
    Well timers will kill the performance of your game if you have plenty running on the scene ALL THE TIME. You could always try it and debug to check if theres any effect on FPS.
Sign In or Register to comment.