Basic shape animation (logic)

FlyboyTrevy_FlyboyTrevy_ Member, PRO Posts: 148

Im terrible at getting image animation right. If anybody is up to it, I would really appreciate it.

The animation is very basic: The size doesn't matter just make sure its a square image, and that the shapes don't move too much from the middle of the image (meaning the shape will be 50-60% of the image, so not too much to move around). And I just want the shapes to just subtly and slowly just kind of float around, slight rotation, kind of a zero gravity type thing. An animation that can loop over and over (isnt too short) and still look good is needed. Just very nice subtle floaty-ness, and slight rotation.

And in seperate images (so that I can add them over the shapes later and recolor on its own) (same size and dimensions), just make some light mist or fog, with a little bit of twinkle to go over the shapes. A fog or mist that just kind of moves in it's own space very very subtly and slowly as well.

If anyone is up to this, I will greatly appreciate it. I figure this is very very basic considering some of the animations ive seen on GS, some shapes floating around can't be too hard.

Any questions or if you have any ideas or want to take some liberties with it, just reply here. Thanks!

«1

Comments

  • FlyboyTrevy_FlyboyTrevy_ Member, PRO Posts: 148

    Oh and last thing, I'd prefer this is sent to me personally. Thanks!

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880

    Is this a request for paid work?
    (It is against forum rules to ask for free art.)

  • FlyboyTrevy_FlyboyTrevy_ Member, PRO Posts: 148

    Haha, I'm just trying to do something simple for university. I can paypal a fiver someones way. :) But not much more than that

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Five dollars is pretty close to nothing when it comes to paying for animation services. If you choose to post a paid request again, please be clear about how much you are willing to pay. As was mentioned, requests for free artwork are not allowed.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • FallingBoxStudiosFallingBoxStudios Freelance Graphic Designer Member Posts: 822

    $5 is far too little for what you're asking for.

  • SummationSummation Member, PRO Posts: 476

    @ThatEnglishGirl said:
    Haha, I'm just trying to do something simple for university. I can paypal a fiver someones way. :) But not much more than that

    Is this a class assignment?

  • ArmellineArmelline Member, PRO Posts: 5,353

    You can probably achieve the floating effect you need with logic, rather than needing it animated. You can probably achieve the mist effect too.

    And didn't you used to have a different username? Or am I going mad...

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2015

    @Armelline said:
    You can probably achieve the floating effect you need with logic, rather than needing it animated.

    Agreed.

    I'd use something like this:

    Constrain X position to: 22 *sin( self.Time *99) *sin( self.Time *191)+512
    Constrain Y position to: 19 *sin( self.Time *164) *cos( self.Time *166)+384
    Constrain rotation to: 6 *sin( self.Time *233) *cos( self.Time *89)

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    The mist effect could certainly be created with a Particle Effect.

  • FlyboyTrevy_FlyboyTrevy_ Member, PRO Posts: 148

    @Armelline said:
    You can probably achieve the floating effect you need with logic, rather than needing it animated. You can probably achieve the mist effect too.

    And didn't you used to have a different username? Or am I going mad...

    Oh yes haha. Yeah recently a night out and an inside joke had my friends changing every username (and a lot of the time picture) for every account on every website I've ever had ever to this. Still working on getting it all changed back.

  • FlyboyTrevy_FlyboyTrevy_ Member, PRO Posts: 148

    @FallingBoxStudios said:
    $5 is far too little for what you're asking for.

    I was half joking :) But the implementing logic to make a floating motion is very useful guys. I'll be sure to try that out and get back with any questions I have here.

  • FlyboyTrevy_FlyboyTrevy_ Member, PRO Posts: 148
    edited May 2015

    @Socks said:
    Constrain X position to: 22 *sin( self.Time *99) *sin( self.Time *191)+512
    Constrain Y position to: 19 *sin( self.Time *164) *cos( self.Time *166)+384
    Constrain rotation to: 6 *sin( self.Time *233) *cos( self.Time *89)

    This worked great, only its a little fast. Anyway to slow it down, and allow just a little more rotation?

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2015

    @FlyboyTrevy_ said:
    This worked great, only its a little fast. Anyway to slow it down, and allow just a little more rotation?

    Sure thing . . . . here's is where you might adjust SPEED . . .

    Constrain X position to: 22 *sin( self.Time * SPEED) *sin( self.Time * SPEED)+512
    Constrain Y position to: 19 *sin( self.Time * SPEED) *cos( self.Time * SPEED)+384
    Constrain rotation to: 6 *sin( self.Time * SPEED) *cos( self.Time * SPEED)

    . . . and if you want more or less rotation adust the range ('XXX') and SPEED of rotation . . .

    Constrain X position to: 22 *sin( self.Time * SPEED) *sin( self.Time * SPEED)+512
    Constrain Y position to: 19 *sin( self.Time * SPEED) *cos( self.Time * SPEED)+384
    Constrain rotation to: XXX *sin( self.Time * SPEED) *cos( self.Time * SPEED)

    $5 cash . . . . PAYPAL accepted :wink:

  • FlyboyTrevy_FlyboyTrevy_ Member, PRO Posts: 148

    @Socks said:
    $5 cash . . . . PAYPAL accepted :wink:

    I assume you're sarcastic? :)

    It never seems to rotate back the other way, it rotates out to what I've set it to, but never goes back past its original starting position. I made it negative and that obviously just makes it rotate the other direction, with the same effect.

  • FlyboyTrevy_FlyboyTrevy_ Member, PRO Posts: 148

    Well ive encountered a new problem. I didn't see it at the time, but the numbers at the end of the function are placing the actor where the numbers say. Is there ANY way that I could make the formula coordinate independent, so that it does the floaty effect without being assigned a particular location. I can live with it and just adjust the formula on each of the actors rather than just setting the coordinates of the actor, but it does complicate things.

    Thanks

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2015

    @FlyboyTrevy_ said:
    It never seems to rotate back the other way, it rotates out to what I've set it to, but never goes back past its original starting position. I made it negative and that obviously just makes it rotate the other direction, with the same effect.

    I haven't got a clue what phrases like "it rotates out to what I've set it to" might mean ?

  • SocksSocks London, UK.Member Posts: 12,822

    @FlyboyTrevy_ said:
    Well ive encountered a new problem. I didn't see it at the time, but the numbers at the end of the function are placing the actor where the numbers say. Is there ANY way that I could make the formula coordinate independent, so that it does the floaty effect without being assigned a particular location.

    Of course !

    Not meaning to be patronising, but how well do you know GameSalad - i.e. have you only just started playing around with it ?

    If you know how attributes work (an attribute can be any value you want) you should be able to see that you can replace any (or all!) of the values in the equations with an attribute that you can control however you like.

  • LovejoyLovejoy Member Posts: 2,078

    Asking @Socks a questions requires absolute precision and accuracy. Similar to that of Luke when destroying the death star.

    Fortuna Infortuna Forti Una

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2015

    Example (attached), I've changed the numbers at the end of the function to the mouse's X and Y position attributes, now the floating square follows the mouse.

    Example2 (attached), I've changed the numbers at the end of the function to the game.time attribute, now as the game runs the floating square slowly moves up and across the screen.

    Etc etc

    $20 cash . . . . PAYPAL accepted :wink:

  • SocksSocks London, UK.Member Posts: 12,822

    @Lovejoy said:
    Asking Socks a questions requires absolute precision and accuracy. Similar to that of Luke when destroying the death star.

    Lol !

  • FlyboyTrevy_FlyboyTrevy_ Member, PRO Posts: 148

    @Socks said:
    I haven't got a clue what phrases like "it rotates out to what I've set it to" might mean ?

    So the number you specified as XXX in your formula. The actor will rotate out to that degree, then come back to 0 rotation, then back out to that degree, and back to 0 again, and so on and so on. Im asking if theres a way to get it to rotate back the other way past 0, because at the moment its only rotating to the left, or if I make the formula negative, to the right.

    Does that make sense?

  • FlyboyTrevy_FlyboyTrevy_ Member, PRO Posts: 148

    @Socks said:
    Not meaning to be patronising, but how well do you know GameSalad - i.e. have you >only just started playing around with it ?

    If you know how attributes work (an attribute can be any value you want) you should be >able to see that you can replace any (or all!) of the values in the equations with an >attribute that you can control however you like.

    No problem! Id say I'm past beginner, I can figure out most things on my own and I understand the way Gamesalad functions, and I'm able to find my way around new behaviors I don't know and make my own formulas and attributes at this point. If you look back through my history of forum threads (as with most guys starting out) the questions have gotten much less tedious and mundane, as well as rarer and rarer that I ask.

    That said, I didn't think to use an attribute as a fill in for where the actors are going. My goal here is to spawn actors at various locations that just kind of have a subtle floaty movement to them. So for this particular instance making attributes for the actors wouldn't necessarily work. At that point I'd just have to make copies of the actors, and fill in the values manually in the actors, and then spawn the various copies of the actors. Do you see where I'm coming from? ATM I can't seem to quantify how else to approach this.

    If nothing else I'll just have to do that, but I would like a better solution if possible.

  • SocksSocks London, UK.Member Posts: 12,822

    @FlyboyTrevy_ said:
    My goal here is to spawn actors at various locations that just kind of have a subtle floaty movement to them. So for this particular instance making attributes for the actors wouldn't necessarily work.

    It's not clear why you think making an attribute for the actor wouldn't work (maybe I don't understand how your particular game is set up), are you able to say why you think you'd be unable to make an attribute (that presumably located the actor wherever you wanted?).

  • FlyboyTrevy_FlyboyTrevy_ Member, PRO Posts: 148

    Well its just that im spawning say 15 actors, each with their own coordinates they need to spawn at, so my thought process here is that I would either have to have the spawner changing the attribute value before each spawn, or I would have to make a different attribute for each copy of actor I would want to spawn (which would be incredibly redundant).

    So I guess my question is: How would you go about implementing attributes here?

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2015

    @FlyboyTrevy_ said:
    So the number you specified as XXX in your formula. The actor will rotate out to that degree, then come back to 0 rotation, then back out to that degree, and back to 0 again, and so on and so on.

    I see what you mean now, I was just confused by something rotating 'out', rather than simply rotating (I'm easily confused!).

    The code doesn't work as you described, it rotates both clockwise and counterclockwise, and never to the same angle - by that I mean it doesn't rotate to 6° then -6° then 6° then -6° (etc) as the target angle is, itself, subject to a second sine wave, so the angle it rotates to is constantly changing.

    @FlyboyTrevy_ said:
    Im asking if theres a way to get it to rotate back the other way past 0, because at the moment its only rotating to the left, or if I make the formula negative, to the right.

    A sine wave oscillates around a value of 0, so it will rotate equally clockwise and counterclockwise, that's what it does in my original code ['Constrain rotation to: 6 *sin( self.Time *233) *cos( self.Time *89)] - maybe your own implementation of this code has introduced some new element ? Can you cut and paste (or take a screenshot of the particular code/numbers you are using)

  • FlyboyTrevy_FlyboyTrevy_ Member, PRO Posts: 148

    @Lovejoy said:
    Asking Socks a questions requires absolute precision and accuracy. Similar to that of Luke when destroying the death star.

    Dont want to go all OT, but man that whole premise of the death star being blown up by a single hole in the thing really was kind of.... Ah nevermind.

  • FlyboyTrevy_FlyboyTrevy_ Member, PRO Posts: 148
    edited May 2015

    I also just remembered I could technically rotate the actor counter clockwise, and increase the rotation value, and that would make it go both ways....

    EDIT: Dont mean to confuse, but the formula is actually causing it to rotate counterclockwise not clockwise (its rotating right not left like I said), meaning I would rotate the actor clockwise. That was probably painfully confusing. :) Just other way around.

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2015

    @FlyboyTrevy_ said:
    Dont want to go all OT, but man that whole premise of the death star being blown up by a single hole in the thing really was kind of.... Ah nevermind.

    Note to Death Star designer: block hole.

    One thing that always occurred to me was that if you were going to sneak up on a planet and destroy it then don't go calling your machine the Death Star, you are only going to raise suspicions, why not something that's not going to cause a panic like the Fun Star or the Health Star, no one is going to attack something called the Health Star, oh yeah and paint it bright yellow too.

  • SummationSummation Member, PRO Posts: 476

    http://www.ni.com/tutorial/4805/en/

    1. Background on Signals

    Signal modulation changes a sine wave to encode information. The equation representing a sine wave is as follows:

  • FlyboyTrevy_FlyboyTrevy_ Member, PRO Posts: 148

    Well you dont want to convince the population that their sun is rapidly approaching... well I guess there would be no increase in heat. Yeah I agree. The empire is a little too classically "evil".

    Oh and EDIT#2 on that last one, I just tried rotating the actor, and facepalmed, because the function overrides the rotation just like the position anyway...

Sign In or Register to comment.