2D Sprite Animation

This post has 13 Replies | 4 Followers

Top 500 Contributor
Posts 5
sid999 Posted: 01-20-2011 12:26 PM

Hi,

I plan on writing a tile based game, but would like to have lighting effects, etc, and after seeing the sprite demos of SunBurn it looks like it may be prove useful. But I have a few questions:

  1. Is capable of performing sprite animation?
  2. How are sprites handled within the engine? Are they represented as objects/actors/etc?
  3. Can sprites be represented within the editor?
  4. Can SunBurn, in it's current form, be considered useful for writing a 2D game within a 3D environment, i.e. a tile based or platform game?
  5. I've noticed that a lot of 2D work is planned after the current 3D work is completed. When can expect this? I'm wondering if I should hold off until more 2D features are available.

Kind Regards

James

Top 10 Contributor
Posts 5,378
Employee
SunBurn_Studio_Licensee

Hi James,

SunBurn's 2D rendering works very similar to XNA's SpriteBatch - you can add sprites, which are rendered with the scene, using a very easy to use interface.

However SunBurn also allows you to add static sprites, which will continue to be rendered throughout the game (without re-adding them), or until you choose to remove / clear them.

While you can use SunBurn's SceneObject class to contain individual sprites this is not optimal (due to draw calls, batching, and sprite buffer size).  It's often better to create a simplified actor class that emits sprites to SunBurn and allow SunBurn to quickly render all sprites, lighting, and shadows.

You can definitely mix 2D and 3D environments.  Sprites are not yet editable in the editor or affected by collision, though integration with Farseer is possible (video by Matt Bettcher, one of the developers on the Farseer team):

Let me know if this helps!

Follow me on Twitter – development and personal tweets
Awesome XNA Videos – Lighting, Rendering, and game videos

Top 500 Contributor
Posts 5

Thanks John

Just a few more questions :)

  1. Are you able to tell me the type of 2D features you have planned?
  2. Is SunBurn able to generate 2D shadows similar to: http://www.youtube.com/watch?v=anulOO1OiFo?
  3. Is SunBurn able to generate lighting effects similar to: http://www.youtube.com/watch?v=x_oPP5CX8Wk&feature=related?

I've watched the following YouTube videos and can you tell me if these videos are all 2D or a mixture of 3D and 2D sprites?

I am current using TorqueX 2D and they've recently announced that they will no longer being developing TX2D, so I'm on the look out for another 2D capable engine to replace it.

Thanks

James

Top 10 Contributor
Posts 5,378
Employee
SunBurn_Studio_Licensee

Hi James,

All of the SunBurn 2D videos, demos, and examples feature flat 2D sprites (quads with alpha clipped sprites or sprite-sheets for animation).

Here is an example of the player sprite-sheet diffuse and normal maps in the SunBurn Top-down 2D example:

You can use both SunBurn's forward and deferred rendering with 2D games.  Both work equally well, though deferred can render more lights on screen without much of a performance hit.

SunBurn casts top-down (not sideways) 2D shadows.  This allows for a more realistic effect and a great deal of perspective (as you can tell by the number of comments on our youtube videos claiming the sprites are meshes :).

Ideally we're planning for parity between our 3D and 2D features, and certainly some type of 2D scene editing.  However we don't want to get too specific with features, SunBurn already has a lot to offer 2D developers and we don't want people buying for features that are not yet available.

Let me know if this helps!

Follow me on Twitter – development and personal tweets
Awesome XNA Videos – Lighting, Rendering, and game videos

Top 500 Contributor
Posts 5

Thanks John.

My aim, at the moment, is to concentrate on a 2D-styled game and therefore my intests would be in the 2D features of the SunBurn engine.

Based on this I was thinking of integrating SunBurn into the game for rendering and write all the other required features myself. On the other hand, I was thinking of waiting to see what more 2D features are bundled into the SunBurn engine and just do simple 2D rendering for now.

Before making this decision could you tell me:

  1. What other 2D features are being looked into for the engine?
  2. Is there a timeframe for any of these features?
  3. If I were to purcahse SunBurn now would these be part of an "minor" upgrade or a paid "major" upgrade?

I understand these may be too far into the furture to provide any concrete answers, but I'm just trying to get an idea on whether to invest now or wait to see how the engine develops on the 2D front.

Kind Regards

James

Top 10 Contributor
Posts 5,378
Employee
SunBurn_Studio_Licensee

Hi James,

The new 2D features will almost certainly be part of the SunBurn 2.x line (a minor version update).  It's way too early to talk about specific features, but you can imagine things like collision, scene editing, and similar are being considered. :)

You can use SunBurn for rendering now and adopt the new features as they become available (or continue to use your own if already implemented).  While we regularly add new features, we do try to keep them modular so developers can choose to use them or not.

Let me know if this helps!

Follow me on Twitter – development and personal tweets
Awesome XNA Videos – Lighting, Rendering, and game videos

Top 500 Contributor
Posts 5

It's good to hear that the 2D features will be in the 2.x line.

Thanks John.

James

Top 150 Contributor
Posts 26
SunBurn_Community_Licensee

Hi John,

The sprite sheet resource and it's accompanying normal maps in this example appear to have been made from a 3D model.

I've tried making normal maps for a model using Blender by replacing the models materials with a white 100% ambient lit texture, applying a black fog (or Mist) over the depth of the model and rendering this from above.  This produces a greyscale image which is suitable for producing normal maps with, for example, the GIMP, Photoshop or xNormal.  Unfortunately the resulting normal-maps do not have the same amount of detail as the normal maps you have in this example.

The normal maps that you have appear to have been made by rendering the model with specific coloured lights.  Could you share how this is done?

Thank you,

Jock

Top 10 Contributor
Posts 5,378
Employee
SunBurn_Studio_Licensee

Hi Jock,

Creating normal maps from source textures (height, diffuse, or other) is somewhat limited with regard to detail.  If you already have a 3D model it's more accurate to bake out a tangent space normal map from the model.

This can be done with a high to low poly bake-down using the 3D model as the high poly and a quad as the low poly.  I'm not sure how specifically to do this in Blender, but I'm guessing it's supported as Blender is a very complete modeling package.

Let me know if this helps!

Follow me on Twitter – development and personal tweets
Awesome XNA Videos – Lighting, Rendering, and game videos

Top 10 Contributor
Posts 312
Employee

Hey Jock,

We basically took a high poly character model and baked the normal information onto a flat plane. Baking from a 3D object will always give greater normal information than creating one from a texture or heightmap.

Here's a tutorial for baking normal maps in Blender - http://vimeo.com/2936073. I'm not familiar with the program but I assume that our method (baking a high poly object to a plane) would work just the same. We also baked out the diffuse using the same method.

Let me know if that helps,

Alex

Top 150 Contributor
Posts 26
SunBurn_Community_Licensee

Hey Alex and John,

Thank you very much for the excellent support.  I did try something similar with an nVidia tool but I guess I must have been doing it wrong.  I'll be having another look at this at the weekend, I'll let you know how I get on then.

Thank you

Jock

Top 150 Contributor
Posts 26
SunBurn_Community_Licensee

I have managed to get this working and I'm happy with the results.  The video tutorial on baking normal maps was very good but, although I could recreate what was described in the video, I always got a blank normal map when I used my character model joined to the flat as a high-poly model. Using the same models with the xNormal program produced excellent normal maps and I should be able to set up a batch file to automate this.  Unfortunately some of the geometry I am using has n-gons in it and the xNormal program balks at this.  I'm under the impression that if I triangulate these models that will get rid of the n-gons.  I'll be giving this another blast next weekend.

Top 10 Contributor
Posts 5,378
Employee
SunBurn_Studio_Licensee

Hi Jock,

I was able to bake-down a number of 3D objects to planes / sprites in Blender, and the results are great.

I used this bake-down tutorial and placed the plane (the low poly) above the 3D object, as the bake rays cast down from the plane:

Let me know if this helps!

Follow me on Twitter – development and personal tweets
Awesome XNA Videos – Lighting, Rendering, and game videos

Top 150 Contributor
Posts 26
SunBurn_Community_Licensee

Hi John,

Lol! I had the plane below the 3D object.  I'll give it another shot this weekend.

Thanks again,

Jock

EDIT: I didn't try this weekend.  I'm using xNormal for the moment but will have a look at using Blender next weekend.

Page 1 of 1 (14 items) | RSS