Make Idle actor come alive using animation

nporimanporima Member, PRO Posts: 27
Hey guys, I have an actor(hero) in idle state (standing still) and breathing slowly. I have created about 30 frames of the actor breathing and I now want to add different facial expressions such as blinking, smiling, angry, sad, etc to the actor while in the breathing animated state. This is an interactive game where the user interacts with the hero in the game. The various facial expressions of the hero are used depending on the result produced by the user such as the "angry" face when the user does something silly and makes the hero angry; the "smiling" face if the user does something nice; the "confused" face when the hero is confused and so on. While the breathing is constant (up and down motion), the blinking eyes are random and the facial expressions are activated when the user plays the game to produce certain results.

My problem is trying to apply the facial expressions plus random blinking eyes to a breathing (moving) hero.

Animating the facial expressions and blinking of the hero when not breathing is not a problem as all images + picture of the hero are of the same size. I can easily replace any image in the sequence with any facial expression to obtain the best animation. However when the hero is breathing, the picture size of the hero varies while the image size remain constant. This then makes it difficult to replace any image in the sequence as replacing the correct frame has to be exact to avoid sudden or odd movements in the animation.

As I'm a rookie with gamesalad, any advice would be much appreciated.

Thanks


Comments

  • Thunder_ChildThunder_Child Member Posts: 2,343
    edited February 2014
    Lol. Good luck with that one. Seems like a timer thing to me. But It would take a while to break all that down to 30 frames divided by milliseconds converted into hundreths to put timers or some shiznit like that, that coinside with the hundreths of miliseconds of your breathing actor. It has to be all about timing somehow.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited February 2014
    It didn't sound like the issue was timing, although it if was then this would be helpful. I believe the issue is animating an actor with images of the same size when the actor's size changes (or, as has been mentioned in other threads, animating an actor with images of varying sizes when the actor's size is constant).

    If you Google animate image actor size gamesalad there are some good resources including these:

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

  • SocksSocks London, UK.Member Posts: 12,822
    This then makes it difficult to replace any image in the sequence as replacing the correct frame has to be exact to avoid sudden or odd movements in the animation.
    I am doing a pretty much identical thing, a 21 frame run cycle - and I want the blinking to be random, rather than synced with the run cycle, so I simply made a second identical run cycle where the character has his eyes closed, and at random intervals I swap one of the normal frames for a closed-eyes frame (actually it's row of three frames that gets swapped as 1 is too fast).

    If your actor size and image size remains the same, rather than changing, this is trivial to do, a changing actor or image size makes everything you will do with the character tricky.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    edited February 2014
    Aren't human head positions fairly stable, even while breathing? Watch someone as they are standing or sitting (and just breathing). You will see almost no movement of the head as the chest cavity expands and contracts. The head and the chest cavity both are attached to the spine but move independently from each other.

    A way to do this would be to create new animations where that the head remains stable (as the actor breathes). Then you can superimpose an actor over the head area. That 'head' actor can then change facial expressions. (And perhaps make slight movements that are independent of the rest of the body.)

  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2014
    @Thurman
    Aren't human head positions fairly stable, even while breathing?
    When walking or running your head is comparatively stable, but it still follows a (fairy shallow) sine, even when the run itself is jerky this sine stays quite smooth - there is still movement of the head when breathing, but like you suggest it's pretty minimal.

    Hold on, I'll dig out an example . . . .
  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2014
    @Thurman

    image

    Just found a perfect example, It's even got the sine drawn on it.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    Oops... sorry I should have clearly addressed my above remarks to @nporima. I was reacting to the original comment that @nporima created an actor who was, "in an idle state (standing still) and breathing slowly," and wanted to animate some facial features.

    As @Socks shows, the head a running (or walking) human form does indeed move up and down rhythmically. To include facial features on a running actor will require a bit more finesse.
  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2014
    @RThurman
    Oops... sorry I should have clearly addressed my above remarks to @nporima. I was reacting to the original comment that @nporima created an actor who was, "in an idle state (standing still) and breathing slowly," and wanted to animate some facial features.
    Yeah ! Got that, sorry I was just sticking my nose in as I am doing exactly the same thing as he is (except with a boy with a big pig head :) ), I even have a static 'standing still' state where the character is breathing, just like he is doing - and like you say any movement of the head in a static state is pretty much zero (although if you want a character to look alive or 'breath' (not used literally) I'd recommend keeping everything moving, if only subtly.)
  • nporimanporima Member, PRO Posts: 27
    Thanks guys. I really appreciate all the feedback. Oh... sorry I forgot to mention that the hero is an egg, a normal chicken egg. It doesn't yet have arms or legs until in later versions of the game but it's alive, it's got big blue eyes, black eye brows and a mouth. It also can't move yet and just sits upright while the user interacts with it. I guess I'm trying to achieve something similar to the facial expressions of the 'Red Ball' game app.

    By increasing the number of frames to 30 in the animation I could produce a more natural breathing pattern rather than the jerky movements of many characters evident in many games. Although I was able to include the blinking eyes in the same sequence, it just doesn't look natural. Ditto with the facial expressions.

    So basically, I think that if one analyses the issue further, one is faced with a moving target (hero breathing), an animation sequence for the breathing, another animation sequence for the blinking, another for each different facial expression. The idea then is to combine everything and end up with the hero breathing and blinking naturally while expressing various facial features naturally in response to the users various game inputs.

    I’ve tried combing all the sequences into one single sequence but it just looks robotic, predictable and artificial. It also doesn’t work well when using timers to try and run all animations in a seamless manner because it’s like trying to hit a moving target with a dart from 100 feet away.

    Thunder_Child mentioned timing which I’ve already looked at but will need to do more testing and experimentation.

    In response to Socks comments, yes the animation works well like your running animation but only if the hero is static or not breathing but that would defeat what I’m trying to achieve.
    Sorry Socks, I should’ve mentioned at the start that the actor (hero) is not a human being but will in future game versions grow legs, arms, ears etc.

    I think RThurman has hit the nail on the head as to what I’m trying to achieve. So with that being said, does anyone have any more ideas as I’ve tried everything within my capabilities?

    Cheers

  • SocksSocks London, UK.Member Posts: 12,822
    By increasing the number of frames to 30 in the animation I could produce a more natural breathing pattern rather than the jerky movements of many characters evident in many games. Although I was able to include the blinking eyes in the same sequence, it just doesn't look natural. Ditto with the facial expressions.
    Yep, blinking synced to a 30 frame sequence will just look too regular, definitely best to keep the breathing looped at 30 and the blinking random - I like my blinks to not only occur randomly but randomly change between two ( . . . blink . . . blink . . .) and one (. . . blink . . ).
    I’ve tried combing all the sequences into one single sequence but it just looks robotic, predictable and artificial. It also doesn’t work well when using timers to try and run all animations in a seamless manner because it’s like trying to hit a moving target with a dart from 100 feet away.
    Agreed, using timers for animation can be fiddly, I find using floor(game.time*framerate)%looplength is the best way to run through image sequences (see link: http://forums.gamesalad.com/discussion/63454/fast-frame-swap ).
    In response to Socks comments, yes the animation works well like your running animation but only if the hero is static or not breathing but that would defeat what I’m trying to achieve.
    I'm not 100% sure what you mean ? The method I outlined (and am using myself) works whether the character is moving or static.
  • nporimanporima Member, PRO Posts: 27
    Thanks for the tip on the blinking eyes and the link to the Fast Frame Swap Socks, I'll check them out.
    Sorry about the comment re your running animation as I didn't have time to test your method out but will definitely do so. Had a quick look at the fast frame swaps, it looks promising.


    Cheers
  • SocksSocks London, UK.Member Posts: 12,822
    Thanks for the tip on the blinking eyes and the link to the Fast Frame Swap Socks, I'll check them out.
    Sorry about the comment re your running animation as I didn't have time to test your method out but will definitely do so. Had a quick look at the fast frame swaps, it looks promising.


    Cheers
    No problem, check out the demo files in the first post in that thread.
Sign In or Register to comment.