Character Creation - sprite sizes for optimal results

Started by Toonloon, Fri 10/06/2011 16:16:12

Previous topic - Next topic

barefoot

If a character has 11 frames in an animation view then it will run through all11..

IE 0 to 10..


barefoot
I May Not Be Perfect but I Have A Big Heart ..

Toonloon

Quote from: Matti on Mon 27/06/2011 15:01:29
You don't have to tell AGS to use a certain amount of frames, AGS does that automatically.

Also, please don't multipost, you can edit your posts.

Sorry about that. I will edit my posts from now when I have updates.

I'm not sure I understand about what AGS does automatically. I can see Roger has 9 frames for walking. Are you saying if I add 10 frames it will use 10? I can't see how.

Khris

What's not to see?
AGS takes the character's NormalView and uses frame 0 of every loop as standing frame and all the other ones as walking animation.
It doesn't matter how many you put in there, AGS is perfectly capable of storing that number for further use, why wouldn't it be?

I'm sorry, maybe I'm completely misunderstanding your question, but I can't even remotely see why that would be a problem for the engine's own editor?

suicidal pencil

#23
Quote from: AGS Help, System limits
30000  imported sprites
.
.
.
unlimited loops per view
unlimited frames per loop

You could potentially have a view with 1,000 loops, and 30,000 (maximum amount of imported sprites) frames per loop. When you tell AGS to animate one of those loops, it will go through each and every one of those thirty-thousand frames. (@40 fps & delay = 1, it would take 12 minutes and 30 seconds to see that animation beginning to end. Absurd I know but AGS will let you do it.)

If only the object limit was more then 40...

Toonloon

Thanks for your patience guys. I really appreciate it.

I should probably explain what I'm doing then maybe you can tell me how I'm missing the apparently obvious.

I've double clicked Sprites in the top right window then right clicked the roger character frames and replaced them with my own.

Sprite number 2020 - 2029 are the Roger walking sprites. Then at 2030 it changes to a different animation of him walking up the screen. If I add more frames from 2030, as you say I can, won't the game use those extra frames to use the walk up the screen animation?

Maybe there is another way of doing this that I'm not getting right.

Matti

The sprite numbers don't matter at all and only importing sprites into the editor doesn't change the game at all (except for making it larger ;)). You need to insert sprites in the view's loops in order to change the animation (e.g make it longer).

Maybe you should go through the tutorial..

Khris

It looks like you completely missed the views portion of AGS.
Those are used to arrange sprites for the purpose of having animations.
It's in there where you set a loop's length and which sprites are in them and in what order.
They can hold more than one loop so you can organize your animation loops more efficiently, and in the case of walking views, there's a loop number for every walking direction.

Double-click Roger's walk view (I believe it's called "VIEW1") and in there you can freely assign sprites to the frames. You can remove frames, add new ones to the end, insert them, even flip them (so you don't have to draw a second side-view unless you want to).

It's up to you whether you're going to leave the roger sprites in the game or not, too.

The only thing you need to be careful with is renumbering or deleting sprites that are already assigned to something else in the editor, for instance as a GUI's background image or of course, to a frame in a view.
Every sprite is assigned using the sprite slot number, so replacing them is always fine.


Toonloon

Thanks Khris.

I found a very helpful video tutorial and you were absolutely right - I wasn't using the VIEW1 tab when adding my animations. Now I've seen how that is used, I've got my guy walking left and right (no up and down animations yet) and there is no pixellated mess around him.

Thanks everyone. I did try the FAQ's, but there's a LOT of information in there for a newbie, and I must have skipped over something or it wasn't included.

monkey0506

If you actually go through the tutorial included in the manual (the "Starting off" tutorial), there's an entire section of that tutorial devoted to this. It's part 7, "Getting Started with AGS - Part 7: Animations and cutscenes".

I'd also like to point out that simply using GIF is not an acceptable alternative to creating a proper alpha channel. If you ever want to use anti-aliasing in any of your sprites (to get "smooth" edges) then you're going to have to use PNG and you're going to have to create a proper alpha channel.

JPEG doesn't support alpha channels at all. If one exists it will be flattened and destroyed. Beyond that, since the format is lossy, it loses color information when you save your image. This can actually, especially when being paired with an improper alpha channel that has been flattened, cause artifacting in your image. It distorts the existing colors, and is therefore the worst possible format for using color- and pixel-sensitive images, such as for games.

GIF supports only 256 colors with 1-bit alpha transparency. Likely for individual images you shouldn't need 256 colors to begin with, and if you do then you might need to reconsider how you're creating these images. If for some reason an individual sprite did have more than 256 colors, it would cut it down to 256 colors, and generate dithering where colors had been removed. GIFs also don't support full alpha channels, so anti-aliasing is impossible in GIF images. GIF only supports full-opaque or fully-transparent pixels; you cannot have partially transparent pixels in a GIF image.

PNG supports full true-color images with full alpha-channel support. It's a lossless format which means whatever color your pixels are when you save the image is exactly the color they will be when you load your image back. Since it supports full alpha channels, you can have partially transparent pixels, which means you can have anti-aliasing which allows you to have smooth edges in your images. This is particularly relevant in higher resolution games. In my experience, it can even typically produce smaller images than JPEG, and without losing color information.

If you're seeing artifacts when you're saving a PNG image, it is because you are using an improperly created alpha channel which should be fixed.

Toonloon

How would I create an alpha channel for a PNG please? I'm assuming that the alpha channel would be the silouhette of my player character, is that correct?

Khris

The alpha channel is an additional channel that stores the transparency of every pixel. Its visual representation is usually a gray-scale image where white is 100% opaque and black is 100% transparent (or the other way 'round), with gray in between.

In photoshop, instead of painting on the layer called "Background", create a new layer and delete the Background. You should end up with the transparency grid (instead of a solid color). If you draw on that and save it as PNG, the alpha channel should end up in the file.

Edit: btw, in case this wasn't mentioned yet: in order to use sprites with alpha channel, you have to set the game's color depth to 32bit and re-import any alpha sprite (a 16bit setting makes AGS discard the alpha channel upon import).

Toonloon

Khris - you're a genius!! I do know quite a bit about alpha channels and I was at a loss to understand why my animations weren't working. I changed the colour set up to 32bit and my guy is disappearing perfectly now! The scripting thing you posted looked a little daunting to me at my present level of knowledge, so I'm delighted that I was able to get this to work with PNG's and alpha channels. Thank you, thank you!

RetroJay

Well... Bugger me sideways with a fish fork and bake me for quarter of an hour. :D

Khris has done it again. (can I marry your brain?)

I have tried searching and testing and pulling my hair out on how to do alpha channels.
It was so bloody simple. I use 'paint shop pro' and it works exactly the same.

Fantastic.
Jay.

SMF spam blocked by CleanTalk