Author Topic: Best practices: animating interaction with objects  (Read 627 times)

Eric

  • Rottwheelers
  • Posts: 1,165
    • I can help with story design
I'm at the point in game making where many of my technical questions deal with how to best incorporate animation in the game. I'm not sure if that's a technical question that belongs here, as it's only partially coding related, or in the Critic's Lounge, which seems to be more art-related. Feel free to move it if I've chosen incorrectly, but there's nothing really to criticize in this thread.

So, say I have a character who sits in a chair, or turns the handle on a sink, or otherwise interacts with an object that is a fixture in the room...what's the best method of handling animation for this? Hide the room object as the animation begins and include its image in one animation with the character sprite? Two sets of animated sprites, one for character, one for object? Seems like that would be hard to time. Some third obvious option that I've overlooked?

selmiak

  • Posts: 3,877
  • ǝsıɔɹǝxǝ ʞɔǝu puɐ uıɐɹq
    • I can help with play testing
    • I can help with proof reading
    • I can help with translating
    • I can help with web design
    • selmiak worked on a game that was nominated for an AGS Award!
Re: Best practices: animating interaction with objects
« Reply #1 on: 07 Jun 2014, 08:54 »
If you have the animation frames for your character moving the hand somewhere and then interacting with an environment object and then move the hand back you try to place all your interactable objects in the game on that height. Then just have one view-loop up to where the hand touches the object, animate this in game (blocking), then animate the object unblocking and animate the hand moving back from the object blockable, starting at the same time as the object animates. This is just splitting 1 view-loop into 2 view-loops and no extra work.
Just compare, for example the sink or a valve where the player sees the state of the object (turned on/turned off), if you integrate it into the player animation you need 2 rather complex animations in case the action is reversible, only one if it is a one way action. And you need that for every damned object in the game, contraray to only 1 player-reaches-there-and-back animation cut in half + the object animation started unblocking on the cut.
A case where I'd use the object in the same frames as the player animation is when the player picks up the object and carries it visibly around (and moves it somehwere else like a fuse changing puzzle or uses it all the time like a flashlight). For just picking up stuff you can still use the cut in half normal grab animation and make the object disappear once than hand reaches there and the game has a loop of unblocking action. But then there are also games like tales where every object has its own pick up animation, if you're going for that level of detail (and I know you want it) you still cut the animation in halfes, one part is the hand moving there, then make the object disappear and play the pickup animation for that specific object.

« Last Edit: 07 Jun 2014, 11:12 by selmiak »

Eric

  • Rottwheelers
  • Posts: 1,165
    • I can help with story design
Re: Best practices: animating interaction with objects
« Reply #2 on: 07 Jun 2014, 16:55 »
Thank you, Selmiak! That makes sense, and I am using the basic height/generic option for picking up (most) objects. The half animated option makes perfect sense for everything else. Thanks again!