## My Adventure Game Engine - Making Way For Adventure Engine 2

Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

### Re: My Zelda style adventure engine (DEMO NOW AVAILABLE)

Jasoco wrote:I still need to do walking animations and for the player, attacking animations and other special animations. I don't know how game artists do it! Drawing people is very hard. I hope this is satisfying.
Oh, I agree completely. You have done a rather decent job with those sprites, though.

nevon
Commander of the Circuloids
Posts: 938
Joined: Thu Feb 14, 2008 8:25 pm
Location: Stockholm, Sweden
Contact:

### Re: My Zelda style adventure engine (DEMO NOW AVAILABLE)

Jasoco wrote:They're not the best thing ever, but they'll do. I kinda like them, because I made them myself instead of using already made "placeholder" sprites from other games.

I still need to do walking animations and for the player, attacking animations and other special animations. I don't know how game artists do it! Drawing people is very hard. I hope this is satisfying.
Sure is! The ones you've made are alright though, if a bit plain for the main character. You might want to change the orientation of the shadow on some of those, though. On half of them the light is coming from the right, and on the other half it's coming from the left.

Jasoco
Inner party member
Posts: 3650
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

### Re: My Zelda style adventure engine (DEMO NOW AVAILABLE)

I'm planning on having the characters be like paper dolls. Or Barbie dolls. In that you start with a base character, like a naked Barbie, and add clothes and accessories. So I could have each actor change outfits throughout the game. Especially the player who would need a base character, a clothing layer and a weapon layer. And depending on how I do it, the characters might need 2 or 3 clothing layers. (Shoes, pants, shirt) Guess it all depends on how much I'm willing to draw.

I just wonder if there would be a way to paste all the layers into a separate image data, then use that image data as my sprites instead of drawing each character layer every frame which could potentially lower the FPS. And the FPS is already fluctuating around 45-60.

Here's a curious question...

Which would be faster:
Using 16x16 pixel sprites at 2:2 enlargement scaling in game (Which is what I am doing right now.)
Using 16x16 pixel sprites at 1:1 then using love.graphics.scale to scale the entire screen to 2:2
Using 32x32 double-pixel sprites instead (Which is what I used to use until I realized I could get more tiles into a 1024x1024 pixel sheet and save space. i.e. 1024 tiles vs. 4096 tiles.)

Is there any speed increase if I draw them at 1:1 then scale the screen as opposed to scaling each quad every frame? i.e. scale one image once vs. scaling hundreds of images every time. I ask because it would take a bit of work to convert it all over to this method if I choose to do so. I just want to know if it's gonna actually be worth it.

Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

### Re: My Zelda style adventure engine (DEMO NOW AVAILABLE)

Jasoco wrote:Or Barbie dolls.
I think bartbes will like that.
Jasoco wrote:like a naked Barbie
Yeah, bartbes will definitely like that.
Jasoco wrote:I just wonder if there would be a way to paste all the layers into a separate image data,
As with ImageData:paste()? Or doesn't that handle transparency?
Jasoco wrote:Which would be faster:
Using 16x16 pixel sprites at 2:2 enlargement scaling in game (Which is what I am doing right now.)
Using 16x16 pixel sprites at 1:1 then using love.graphics.scale to scale the entire screen to 2:2
Using 32x32 double-pixel sprites instead (Which is what I used to use until I realized I could get more tiles into a 1024x1024 pixel sheet and save space. i.e. 1024 tiles vs. 4096 tiles.)
The last one would probably be fastest, but I don't think there is any difference between the first two. If you really want to know (and think there is a difference, you could benchmark it)

Jasoco
Inner party member
Posts: 3650
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

### Re: My Zelda style adventure engine (DEMO NOW AVAILABLE)

You don't think drawing all the images at normal size, then doubling up the whole screen would be faster than doubling up all the images every frame?

I'll have to do some tests.

nevon
Commander of the Circuloids
Posts: 938
Joined: Thu Feb 14, 2008 8:25 pm
Location: Stockholm, Sweden
Contact:

### Re: My Zelda style adventure engine (DEMO NOW AVAILABLE)

Jasoco wrote:So I could have each actor change outfits throughout the game. Especially the player who would need a base character, a clothing layer and a weapon layer. And depending on how I do it, the characters might need 2 or 3 clothing layers. (Shoes, pants, shirt) Guess it all depends on how much I'm willing to draw.
Ooo, I love that!

Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

### Re: My Zelda style adventure engine (DEMO NOW AVAILABLE)

Jasoco wrote:You don't think drawing all the images at normal size, then doubling up the whole screen would be faster than doubling up all the images every frame?
Well, I don't know, but I though love.graphics.scale() and friends just added an offset to the drawing scale etc of each image drawn?
Jasoco wrote:I'll have to do some tests.
Yeah, do that.

rhezalouis
Party member
Posts: 100
Joined: Mon Dec 07, 2009 10:27 am
Location: Indonesia
Contact:

### [Response]Testing the Options

Jasoco wrote:I'm planning on having the characters be like paper dolls. ... . So I could have each actor change outfits throughout the game. ... .And depending on how I do it, the characters might need 2 or 3 clothing layers. (Shoes, pants, shirt) Guess it all depends on how much I'm willing to draw.
Great! I'd löve to see that feature. Keep up the good work, Jasoco!
Jasoco wrote:Which would be faster:
Using 16x16 pixel sprites at 2:2 enlargement scaling in game (Which is what I am doing right now.)
Using 16x16 pixel sprites at 1:1 then using love.graphics.scale to scale the entire screen to 2:2
For 10000iterations x 200samples, guess what:

Code: Select all

--sprite16 --> a 16x16 sprite; --sprite32 --> a 32x32 sprite;
love.graphics.draw(sprite16, 100, 100, 0, 2)                   --> 11.52µs/exec
[love.graphics.scale(2);] love.graphics.draw(sprite16, 50, 50) --> 11.65µs/exec
love.graphics.draw(sprite32, 100, 100)                         --> 11.77µs/exec
--maxDeviation = +/-10%.

Surprisingly, there's not much difference. I guess it's yours to decide which's easier to be implemented.
The love.graphics.scale would add another 0.30µs to the main loop (love.draw). Using this data, I think you could approximate your case where multiple images are involved.
Aargh, I am wasting my posts! My citizenshiiiip...

Jasoco
Inner party member
Posts: 3650
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

### Re: My Zelda style adventure engine (DEMO NOW AVAILABLE)

I guess it'd be easier to keep it at 16x16 sprites scaled individually to allow for future expansion (In case I decide to later make the graphics 32x32 high detail instead). I'll probably implement constants for the values eventually though so later I can specify the dimensions at load.
Like:
tileSize = 32, tileScale = 1, screenScale = 1
or;
tileSize = 16, tileScale = 2, screenScale = 1
or;
tileSize = 16, tileScale = 1, screenScale = 2

So I could make 48x48 pixel tiles if I wanted to.

rhezalouis
Party member
Posts: 100
Joined: Mon Dec 07, 2009 10:27 am
Location: Indonesia
Contact: