.9 fix I've not seen mentioned - Interpolate
quantumsheep
Member Posts: 8,188
Hey all,
Apologies if this has been mentioned already, but I didn't see it in the release notes and personally, I think it's a tiny thing with big plusses for us.
Interpolate now has, as far as I can tell, collision attached to it.
This is awesome. It means you can make actors move smoothly, change size etc etc with interpolate, and that they will behave in the same way as an actor that uses 'move to' and all that.
Additionally, you can switch off the 'moveable' tag in an actor's attributes, potentially saving some fps (though I can't vouch for that!).
Real world example:
In a shooter, you can have a boss character that interpolates position and size but still has collision - so you can shoot it!
Or use interpolate to launch missiles up the screen, rotate, then move back down the screen.
Or have enemies 'zoom' onto the screen in an ordered and cool fashion.
I really like it, and like I said, not sure others have spotted it!
Hope that helps!
QS
Apologies if this has been mentioned already, but I didn't see it in the release notes and personally, I think it's a tiny thing with big plusses for us.
Interpolate now has, as far as I can tell, collision attached to it.
This is awesome. It means you can make actors move smoothly, change size etc etc with interpolate, and that they will behave in the same way as an actor that uses 'move to' and all that.
Additionally, you can switch off the 'moveable' tag in an actor's attributes, potentially saving some fps (though I can't vouch for that!).
Real world example:
In a shooter, you can have a boss character that interpolates position and size but still has collision - so you can shoot it!
Or use interpolate to launch missiles up the screen, rotate, then move back down the screen.
Or have enemies 'zoom' onto the screen in an ordered and cool fashion.
I really like it, and like I said, not sure others have spotted it!
Hope that helps!
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Comments
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
-JJ
it seems the collision detection only works once the interpolate has finished..interpolating.
whilst it's running, the collisions don't register.
I have three enemy spaceships that would disagree with those findings!
They interpolate down to the middle of the screen, stop, fire, then interpolate off-screen.
During all of these three phases, my shots are registering as hits on them!
Curiouser and curiouser...
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
As mentioned in The Unofficial GameSalad Textbook, throw the Interpolate behaviors in timer if the collision detection isn't working properly. If I'm remembering correctly, I think it was improved with 0.8.9 so I could remove the timer.
I created a test scene
2 actors, with a collision rule that changed the value of an attribute, so I could view and debug.
here is what I did to test.
1. moved actor 1 to actor 2 - collision worked
2. moved actor 2 to actor 1 - collision worked
I then added 2 interpolates to actor 2 (width and hight)
1. moved actor 1 onto actor 2 as it was changing size - collision doesn't register. Once interpolation was finished, then moved actor 1, and collision registers
2. Moved actor 2 onto actor 1 as it was interpolating - collision doesn't register
3. Wait for actor 2's interpolation to finish, then move it into actor 1 - collision registers.
As beefy says. It's the size interpolation that's the issue. not interpolation in itself. Movement interpolations seem to work a treat.
It's as though, the new collision size doesn't "kick in" until the interpolation has actually finished.
in-fact....my tests show that that IS the case.
AsI have stated in another post, I'm not sure if to report this as a bug, as it might just be expected behaviour.
If anyone fancies yellowing up this thread to shed some light on it?
Damn me for trying to make a 3d (ish) game
I misread it as interpolation in general - if it's a scaling issue, then I stand corrected!
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
it's hard with "undocumented" features, as some stuff obviously seems to work ok (movement related interpolations) and some stuff not (size based interpolations)
and with that, I'm off to size interpolate my belly by eating this cheese and ham toastie.
I havent got my mac here with me now but i think .. i will check for you ... i did something along these lines;
1. Interpolate the size and width to what you want minus say 10
2. When inetrpolating stops at target destination minus i had a rule that when it reaches the minus 10 it then carries on interpolating to the actual target.
3. Have a rule with what collides that says if its above the target minus say 11, then collide.
This way it was getting close to the final target size. Stopping and having a new collision size at 10 pixels less than the final size. Then the rule that states if its above that minus 11 pixels then it will collide as it will stop and register a new size.
The stop happens so quickly you dont notice any change in movement.
e.g. You want to interpolate to 100
interpolate x and y to 90
when width and height is > 89, interpolate w & h to 100.
When width and height is > than 89 collide
That way it grows to your desired specs but will collide when in that last section.
I achieved mine by applying something similar to that, again i cant fully remember as i dont have my mac with me, hope that helps a bit though.
I dont think its a bug as such but would be great if they could tweak how it works so you dont have to apply any workarounds.
will give something like that a go.
Yeah, my thoughts are that it's not a bug too. Just how interpolate works.
I must admit, I didn have a bit of a play around with wrpping stuff in timers at the time I was trying to get it to work....but I wasn't trying too hard. Just swearing at the screen a lot.
@Photics. Yeah, with a bit of maths, and a bit of imagination, you can get some pretty nice 3dish effects going.
the next test for myself is to get some more full on effects going. Afterburner/outrun style.
Pretty possible for sure.
I might post up some vids of what I have been up to soon.
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io