Can Defold handle character sprite made of different parts like Diablo II?

Hey guys, I am huge fan of isometric games and old-school RPGs (not Diablo actually) like Baldur’s Gate, Planescape: Torment, Fallout 1, 2, etc (any fans of these games here?). There are some new games like Pillars of Eternity, Tyranny but devs use 3d-models for characters and this looks m… okay, but not so cool as it was in 90-s with 2d-sprites (IMO). (Small remark: a lot of isometric stuff was not hand drawn, but pre-rendered 3d or “photos” of figures from clay)

That’s a lot of work to draw all the animations by hand but look at Banner Saga It’s amazing :slight_smile: So, how can we enhance the production proccess to be able minimize costs of time? Make stylized 3d-models! But, actually it’s really hard to make 3d-models look like hand drawn. I have not seen any really cool stuff. Any examples here?

So the solution is to use pre-rendered 3d-models. I’ve made some research when working for one guy and end up with nice workflow for Blender.

Examples:
PowerAttackIdle2_Run_Attack_PowerAttack_Roll_with_Cloak

There are no problems here, actually. But let’s say, I want to change weapon or armor of character. And here starts the hell :smiley: A lot of layers, directions, etc. That’s why, almost all devs use 3d-models for customization of character today.

But Blender is so cool and I can make things like that with it:
Layers

I’ve tried Defold already and seems it can handle this stuff but I am not sure. So here are some questions:

  1. Let’s say I want to make a game for desktop with customizable player character (and player character only, no customization for enemies) who can act in 8 directions;

  2. I have 7 animations (Attack, Death, Deffence, Idle, PowerAttack, Roll, Run) in 8 directions each for parts: Armor, Body, Cloak, ShouldersBottom, ShouldersTop, Weapon. 14,4 MBs total

  3. The first question is - can Defold handle this stuff actually?

  4. The second - what is the best way of implementing this?

I have some thoughts about structure. You can find 3 approaches below (2nd and 3rd are almost similar actually). Are they ok?

--E = East, N = North, NE = North-East, etc

--1st approach 
--player.collection > part of the character.game_object >> all the animations for this part in one sprite
player.collection
	body.game_object
		body.sprite
			Idle_E.animation
			Idle_N.animation
			Idle_NE.animation
			Idle_NW.animation
			Idle_S.animation
			Idle_SE.animation
			Idle_SW.animation
			Idle_W.animation
			Attack_E.animation
			...
	armor.game_object
			...

--2nd approach
--player.collection > part of the character.game_object >> animation.game_object >>> sprite for this animation with directions only for this animation
player.collection
	body.game_object
		body_Idle.game_object
			body_Idle.sprite
				E.animation
				N.animation
				NE.animation
				NW.animation
				S.animation
				SE.animation
				SW.animation
				W.animation
		body_Attack.game_object
			body_Attack.sprite
				E.animation
				N.animation
				...
		body_Run.game_object
			body_Run.sprite
				...
	armor.game_object
		armor_Idle.game_object
			armor_Idle.sprite
				E.animation
			...
--3rd approach
--player.collection > direction of player.game_object >> part of the character.game_object >>> sprite with animations for only for this direction
player.collection
	E.game_object
		E_body.game_object
			E_body.sprite
				Attack.animation
				Death.animation
				Defence.animation
				Idle.animation
				PowerAttack.animation
				Roll.animation
				Run.animation
		E_armor.game_object
			E_armor.sprite
				Attack.animation
				Death.animation
				...
	N.game_object
			...
			

I think 2nd is okay. Instead of having mess of animations in one sprite, we have separate objects with sprites that we can disable/enable with messages (one could not disable sprites, only objects).

So, guys what do you think? Idea of implemeting all of this in Defold is really intrigues me so it would be nice to hear any feedback from you! Thanks!

UPD: If you like 2d stuff such as me, you definitely should check Domina game. This is pixel art game with a looooot of customization stuff. All hand drawn. The game mainly done by one guy, actually.

3 Likes

I really look forward to seeing what you do with this!

Some thoughts:

  • I am guessing that Defold will handle it just fine. I know Tarnumius has had issues with using lots of textures, but I think he has around 1 Gigabyte, so a handful of megabytes should be no problem. If you intend to have big hordes of enemies on-screen at once using this technique you might hit a limit from all the overdraw.

  • Render Order/Z-position — It depends on your animations, but dealing with this could be a real deal breaker. For example, with your east-facing character and that side-to-side sword swing—At the beginning, the sword is drawn behind the body, cloak, arms, etc, but then he swings it around and it needs to be drawn in front of everything else. Also the different parts may need to change draw order depending on the facing direction. If facing North, the cloak will overlap the body, but facing South, it’s the opposite.
    Thinking out loud, if you could get some depth data for each animation, it wouldn’t be too hard to animate the Z position of each part, which makes it more of a workflow problem than a technical one (i.e. how do you create that “depth data”).

1 Like

Yes, I have noticed this kind of problem too (if we talk about attack gif and sword on it). Maybe this kind of approach can help?

But, if we talk just about different directions there is no problem here because with Blender I can do masking.

Cloak North:
Image0001

Cloak South:
Image0001

So actually, all the parts are on the same Z position.

But let’s say, I want to change weapon or armor of character.

If you plan to have a lot of different gear parts that the player is going to swap out then this sounds like it will be a bit of a headache to do with sprite cheats! I don’t think memory will be a problem, but as @ross.grams said - overdraw might.

but devs use 3d-models for characters and this looks m… okay

So the solution is to use pre-rendered 3d-models.

Why not use the 3d-models in Defold (except that 3d in Defold currently isn’t as supported as 2d)? It should be possible to setup the materials and render script to render them in pretty the same style as Blender.

On an unrelated note: This reminded me of Simon Trümplers cool article about parallax in 2D games.

1 Like

Yup, that works, but since your animation is in sprite sheets instead of positions, you need some method of figuring out that Y position that the Z is based on. It’s not a big deal for static poses, but I’m not sure how you would do it for animations.

That’s definitely worth a try, but I think you may get nasty artifacts at the edges? Maybe not with unfiltered/pixelated textures.

I have 7 animations for every part in 8 direction each, all checked. It seems that there are no artifacts. At least noticeable. :slight_smile: All gifs are combined of parts with masking.

2 Likes

I’d suggest just to prerender every possible combination. It will look the best and work the best.
Even if takes gigabyte or two of disk space.
You may somehow limit number of combinations by not allowing some elements with others. E.g. level system for equipment or magic element incompatibility.

2 Likes

you would basically have to use a masking technique, that’s how we used to do it back in the visual basic days, every armor or piece of equipment had a sprite sheet of it’s own which would then sit on a separate layer on the sprite itself. Let me know if that works, as I’ve just started using Defold myself, trying to create a similar effect for a 2D platformer.