Art/Animation Question: Sprite Implementation

Hi all. I’m new to the forums so I apologize if I put this thread in the wrong place. I am an artist and animator for a 2d game, and have run into a problem with the implementation of a beanstalk element for one of the levels. Sorry for only having links to the images. I can’t seem to get them to show up in the post.

The idea is to create a beanstalk that looks like it is perpetually growing and spiraling in “3D” space. To do this, I first created a main stalk with a looping grow animation that you can see here:

http://sta.sh/0jrr544wel0

Then I created random vine sprites that wrap around and randomly generate along the stalk as the player moves down the level. A link to the diagram:

http://sta.sh/02qgeqky9wm

And lastly, each vine will have an animation created for it of a beanstalk leaf spiraling
upwards:

http://sta.sh/011tus1sdp4a

However, this creates a very large amount of frames that take up a lot of memory. We also lose some random generation abilities for the leaves. Is there a better way to try and implement this idea with 2d sprites?

Or is there a more efficient way that we could do this with a 3d model, and still have it look like a 2d object? Can Unity handle shadeless textures and freestyle lines from Blender? Here is a link to another graphic in the game for reference:

http://sta.sh/01dy5zlpph61

If we implement a 3D model, it would have to match this sprite style.

Thanks to anyone who can help. If something is confusing in the post, let me know, and I will try to explain as best I can.

Hey guys,

I’m working with Lucky on this project and unfortunately we’re at a point were we can’t continue until we get this sorted, so any advice on how we should tackle this would be greatly appreciated!

Cheers :slight_smile:

Can you use those as source images and generate two sprite structures in code? Call them GameObjects A and B. For each of them, add the beanstalk sprite and then a random selection of vines on a higher layer as child GameObjects.

Start showing A, gradually moving it up on the Y-axis. Show B connected to the bottom of A on the Y-axis. When A is offscreen, get rid of it. Create a new GameObject C, and show it below B. When B is offscreen, get rid of it, etc.

Hi TonyLi,

We want the leaves to be able to generate at random sizes and spiral up the third stalk as the whole beanstalk continuously spirals/grows up the screen. However, an animation has to be created of the leaf for each stalk variation, producing a massive amounts of frame. The method that you mention is one my team has tried for implementation, but unfortunately it is not giving us great results. It still creates huge memory consumption and a lack of random leaf generation abilities.

Would there be any other way to try and implement this idea with animated 2d sprite textures?

Or is there a way that we could do this with a 3d model, and still have it look like a 2d object, like the other reference game graphic: http://sta.sh/01dy5zlpph61

The 2D method I described shouldn’t take much memory at all, since you’re reusing and scaling the same textures, but I see what you mean that it doesn’t quite look the way you want. (Here’s the very rough prototype I tested with, in case you’re interested. It’s a Unity 5 package.)

You probably want to use a 3D model with a toon shader. Try the one built into Unity first. It may not give you what you want, but several other toon shaders are available on the Asset Store.

Hi TonyLi, yes that’s what we’ve tried to do, the problem comes with the leafs that goes in the exterior stalk, they should go around the main stalk and then advance to the next stalk

What’s going wrong? I’ll confess that I’ve never animated a beanstalk before, but I jumped in because it seems like an interesting question. Can you construct the stalk procedurally? Spawn pieces before they become visible, and despawn them when they go offscreen. Each piece can have attachment points or rules about what can attach to it and where. Is there some snag to this line of thinking that I’ve missed?

Initially I wasn’t really understanding the problem, and still kind of don’t but here is some suggestions that may help, in addition to TonyLi’s great advice.

Using a 3D model may actually be helpful - applying it to the secondary smaller stock at attachment points as Tony described, but I don’t get why there is such a huge memory consumption, unoptimized sprites maybe?
Since you will be randomly generating the model at specific points, it will need to be setup to begin at those attachment points at a specific frame in the animation. This is doable, but doesn’t sound fun to setup.

I use Max so some translation may be needed.
I would attempt a composite/blend material, using a 85% self illuminated material blended with a toon shader to add the outline detail and secondary 2 tone shade on top, tweak until perfect. This should get you close to matching the 2D look you desire.

1 Like

Hi theAnimator2b,

Memory issues / large frame counts are one of the main problems we’re having with the animation. We are looking into how our sprites to see what may be if there may be an issue in their export.

As for the model, I am a little confused on what you mean by “applying it to the secondary smaller stock”. Do you mean that it is an invisible layer below the 2d sprites I already created? Or that I could leave the main stalk without the leaves as a 2d sprite and wrap the smaller stalk around the bigger one as a 3d model? (My experience with Unity is pretty much zero, so I am unfamiliar with its functionality.)

Thanks for the shader tips. If we do end up having part of the beanstalk 3d, that is definitely something I will try.
I am not sure if toon lines in Blender will work the same as in Maya and Max, but it is definitely worth a shot. :slight_smile:

If you make any part of the beanstalk into a full 3D model, I recommend making the whole thing out of 3D model(s). Then use a shader to make it look 2D, similarly to what Telltale does in their games to make 3D models look like comic book characters.

Agree with TonyLi and I’d also consider only using 3D if you absolutely need to, just because it’s so much easier drawing an image. But if moving at all consider 3D and if moving in zed - 3D is probably a better option.

What I was describing for 3D in the previous post was only for the leaves being attached to the 2D smaller vine you have already created. You’ll only need one prefab animated leaf (unless I’m mistaken) that can be called at the attachment points TonyLi explained, but the point of having the leaves look properly oriented is they will be called at specific frames of the animation depending upon where they are at on the vine, which attachment point they are spawning at.
Probably best to hold what you got, incorporating TonyLi’s solution and solving the memory consumption problem.