🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

3D animation in 2D game

Started by
6 comments, last by sunandshadow 7 years, 4 months ago

Hello guys,

I'm doing a game with friends in Unity, it's a 2D game but I'm using 3D models that are rendered as sprites and then used in the game.

My question is this: how do I make the character follow the animation given by the sprites?
The current way I'm seeing is to make the animation static (like a "treadmill" walk for example) and then move the physics actor accordingly in programmation, but it won't look as good as in the 3d editing software because it won't be an exact replicate of what the move was intended to be.
Is there a way to do it without the animation being on a treadmill?

What are the other ways to go about this?

As an example, here are some animations I created: http://imgur.com/a/qWDDy
I removed the translation of the 3d models so that it's static, but that means I have to program the movement now, it feels like work being done twice.

Thanks for your time ;)

Advertisement

My question is this: how do I make the character follow the animation given by the sprites? The current way I'm seeing is to make the animation static (like a "treadmill" walk for example) and then move the physics actor accordingly in programmation, but it won't look as good as in the 3d editing software because it won't be an exact replicate of what the move was intended to be. Is there a way to do it without the animation being on a treadmill?


This looks like a Visual Arts question, not a Game Design question. Moving.

-- Tom Sloper -- sloperama.com

Maybe the old school technique you are thinking of was to make the animation loop pixel perfect (as the animations were literally made with pixel editors). So if you knew your guy was going to move over a walk loop to the next tile 16 pixels away, you would construct the loop with the in-betweeners moving from tile to tile over these 16 pixels (your animation would no longer be 'on the spot'). Then instead of moving via physics, you would just be drawing the in-betweeners in relation to the start position.

[attachment=34861:Manic_Miner_(ZX)_03.gif]

However when making '2d games' now, especially if you have built 3d models, I would give serious consideration to rendering them as 3d models rather than sprites, for several reasons, such as the texture memory use can quickly start growing very large when animations are needed in multiple directions, and easier depth overlap with the z buffer.

I was thinking of doing a pixel style animation, but I wanted to do a rather complex character with proper rendering (this was just a quicktest).

Well it's the only way I can imagine right now, but I feel like there's surely a better way and that's really what I meant by my question.

I was inspired by this talk:

(animation process for the Ori game)

Maybe you're right and I should not go down the sprite path, however I thought using sprites was interesting because it would allow me to use as much polys, as much bones, skinning techniques that I would want. I felt this was an interesting choice because I don't know much about doing animations specifically for games.

I do know that stuff like animations in multiple directions like: making the head follow other objects in the scene can't be done, but I felt like that was something I didn't need.

If you do know about those different workflows, sprites vs importing the bones in Unity, do you mind explaining what you see as the pro's and con's of each?

If I go the 3d no sprites way, I saw that the "apply root motion" could help for my 1st question, but I don't think I'll go the 3D road though.

What would be a wonderful solution is if I could somehow use a spline to create the motion for my 2D physics actor, is that possible?

Thanks for your answer, much appreciated, it's really hard for me to figure that out ^^

The current way I'm seeing is to make the animation static (like a "treadmill" walk for example) and then move the physics actor accordingly in programmation, but it won't look as good as in the 3d editing software because it won't be an exact replicate of what the move was intended to be.

Working on a treadmill is basically how it's mostly done, it takes practice.

When making the rig, you want the master bone to be where the drop shadow is, where the model makes contact with the ground. You will be working from that point upwards.

In a game the origin point is used for culling and collisions, so when ever you feel like moving the character's master bone remind yourself that it will be done in the engine.

A way to keep moving the animation as you want is to parent the camera to the master bone, this way you can move it in 3D however it renders as if it's standing still ; or just delete the curves that moves the model around.

The thing to remember is that most real time animations in games 2D or 3D is done as if the model is on a treadmill, exclusions to the rule are things like a combo animation, kill animation and cutscene animations.

It's part of learning animations for games.

Maybe you're right and I should not go down the sprite path, however I thought using sprites was interesting because it would allow me to use as much polys, as much bones, skinning techniques that I would want. I felt this was an interesting choice because I don't know much about doing animations specifically for games.

Most modern 2D games don't focus on ether sprites or vectors, they use both to take advantage of all that 2D has to offer, even using 3D.

this shows what a modern 2D workflow is like.

You can do all this in Unity, however it's going to take some coding.


The current way I'm seeing is to make the animation static (like a "treadmill" walk for example) and then move the physics actor accordingly in programmation, but it won't look as good as in the 3d editing software because it won't be an exact replicate of what the move was intended to be.

There is no actual reason for it not to look as good. In 3D animation the fact that a character's leg are moving in a walk cycle and their body is moving forward is unrelated, and turning off the moving-forward animation in the 3D program can be exactly compensated for with a moving-forward animation in the 2D engine. The result should look exactly the same, not worse.

I want to help design a "sandpark" MMO. Optional interactive story with quests and deeply characterized NPCs, plus sandbox elements like player-craftable housing and lots of other crafting. If you are starting a design of this type, please PM me. I also love pet-breeding games.

@[member='sunandshadow'],

What I did was that I animated translating the character, after I erased that translation. I agree that the animation is left untouched but it has lost its movement that perfectly fitted it. And you're only thinking of a movement as simple as walking but what if he's doing arcs while attacking?

@[member='Scouting Ninja'],

The video with Rayman was very interesting, it's definitely helped me understand stuff but more regarding the environment and lighting with layers stuff, The spine2D animation style they're using doesn't fit me because I cannot draw but the idea is definitely interesting. In their specific workflow, they would have to program the movement indeed.

That being said I think I found an answer by rewatching the Ori presentation, I didn't understand that they were using "root motion" from the rig they created in 3D to make the character move, basically they use both the 3D rig + the frames. With that information from the rig they also know when the feet touch the ground and they use that to know when to spawn sounds for the footsteps etc...
If any of you guys have videos that explain the process of creating games that are a mix between 2d and 3d, it's really interesting to me, so please post them ;-)

What I personaly like about the frames animation is that I could do some really nice particles effects like flames and so on, without having to worry about the number of particles or that I don't have to worry about the number of poly's on the characters.

I have 2 questions regarding the Ori workflow where they import the rig and the frames:

As the speaker says in the video, it's a lot of frames/textures meaning a lot of memory that's being used by the animations. As opposed to spine2D where it's a single texture that's rotated around with joints. I can't use that workflow because I can't draw so the only options given to me are: frames from 3d animation and standard 3d animation where the model is also imported in Unity.

1) What are your thoughts on these 2 workflows?
2) Just how much of an optimization will I have to do down the line, the speaker said he had 700 2k textures for animations for all the characters. Since I'm not a genius in optimization/programmation (1 year c++ university background), what do you guys think about this number in terms of sharing the memory with other stuff like environment art, sounds, ai etc...

I know the answer to that last question is probably "it depends on a lot of things" but please give me your thoughts in some more details as I'm sure you guys are more knowledgeable than I am :o

What I personnaly like about the frames animation is that I could do some really nice particles effects like flames and so on, without having to worry about the number of particles or that I don't have to worry about the number of poly's on the characters.

@[member='sunandshadow'],

What I did was that I animated translating the character, after I erased that translation. I agree that the animation is left untouched but it has lost its movement that perfectly fitted it. And you're only thinking of a movement as simple as walking but what if he's doing arcs while attacking?

If it got worse, you must have changed something about it. Did you measure precisely to compare the 3D one and the 2D one? Even with arcs, if you copy precisely what the movement should look like from the player's perspective, the in-game animation should not lose accuracy.

I want to help design a "sandpark" MMO. Optional interactive story with quests and deeply characterized NPCs, plus sandbox elements like player-craftable housing and lots of other crafting. If you are starting a design of this type, please PM me. I also love pet-breeding games.

This topic is closed to new replies.

Advertisement