Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Question about manual sprite assets management

A topic by ppbitb created Sep 09, 2021 Views: 350 Replies: 6
Viewing posts 1 to 5

Hi, I am playing around and trying to create a simple 2d game using OpenGL and C#. I am doing this for education so I am interested in getting small simple things to work by coding them by hand.

So far I am able to draw simple rectangles, apply portion of sprite sheet texture, and periodically update the portion of the texture that is used to give the illusion of animation.

I have 2 questions which are related:

- I have this sprite sheet with a given character. There are multiple   animations: walk, attack, idle, etc.. The issue is that all  spritesheets are 33 pixels tall but one of them is 34 pixels, and the difference is noticeable. How do I handle this? Do I resize the  sheets offline? Do I resize them dynamically when I am loading assets for the game? Do I adjust the size of the OpenGL rectangle I  am mapping them to based on the texture size?

- As a generalization of the first question, what is the typical technique when dealing with assets coming from different sources and potentially not matching perfectly in size? Do I need to edit them  before using them, or should I process them dynamically as I am loading them?

Hope that makes sense and that's not too stupid as questions. If people have learning resources that match this level of knowledge and goal, please feel free to share.

Thanks in advance

(+1)

I usually just scale the model matrix that is used to draw the sprite quad to "resize" sprites.

I would resize them manually. While you can resize them with opengl I'd be concerned that the results wouldn't look as good. Depending on what you are doing it may not matter.

(1 edit)

Results look identical if you scale by a multiple of two and if you use nearest interpolation on your textures. It's faster, too.

(+1)

But that is not what the creator of the topic is asking about. He is talking about a image one pixel taller being noticed. If you are noticing that squishing it down by one pixel or the others up by one pixel may not look good. He can obviously just try it but I would rather do than manipulation by hand.

I normally readjust on the sprite sheet, in your case I would see if I could make all animations 35x35 or go up as high as 48x48 if need be.
It will be easier if everything is as uniform as possible.

Cool, thanks all, seems like there are multiple options