91

GIF drawbacks: very limited color palette, typically 256 colors with ugly dithering (yes, you can have more than 256 colors in animated GIF, but this is uncommon) GPUs don't support GIF compression in hardware (means you will have to unpack them on CPU anyway) you only get to pick ONE color for transparency (unless implementing custom processing) no random ...


63

Game programmers have relied on one of two main methods of data storage: store each data file as a separate file store each data file in a custom archive format The drawback to the first solution is the wasted disk space problem, as well as the problem of slower installations. The second solution provides it's own pitfalls, first is that you must write ...


39

Another solution often used to "hide" the game files is folder structure. Keep only your executables and maybe a readme in the main directory and move the game files into a sub folder "data". I don't think that it is very uncommon to do so. Many games I know store their content in such a way.


32

In order to use any image file as a texture in a game, there must be a texture created on the GPU and the pixel data in the image file must be loaded to that texture. GPUs do not support many of the features that image files on CPUs support. They don't support JPG compression, they don't support PNG compression, and with particular reference to GIFs, they ...


23

A sprites-sheet (often refers to a large image that) is supposed to contain the animation frames of a specific 2d character or projectile in a game. You can almost think of it as the model of a 2d-character. It stores all the various animations created for a specific character. A texture-atlas (is often taken to mean a large 2d image that) contains many ...


22

I really like PhysFS for this. It allows you to access either folders or zip archives with the same code. It works well for all stages of a Games lifetime. During development: access the resources directly from a folder hierarchy. This way compressed archives are not in the way and you can rapidly iterate. Initial deployment: zip up your resources for ...


18

The way I do 2D animations is as follows: Sprite Retrieval Class This class can either load an image file or it can load a sprite from a sprite sheet. It's very self explanatory. import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO; public class Sprite { private static BufferedImage ...


16

The problem with using texture atlases and adjacent texels leaking has to do with the way linear texture filtering works. For any point in the texture that is not sampled exactly at the center of a texel, linear sampling will sample 4 adjacent texels and compute the value at the location you asked as the weighted (based on distance from the sample point) ...


13

GIF has a limited color palette. (255) You have to implement parsing and animating the GIF too. So there is not a advancement in time nor in format's technical aspects.


12

I'd suggest using a ZIP file. It's an ubiquitous format and you'll find ready-made libraries that allow you to load files from within a ZIP file. A quick Google search even revealed a zip loader for sfml.


9

Regardless of the level of details and the number of pixels you have, you must start with a thorough understanding on how walking works. If your character looks like shaking its legs, it probably because, that's all you drew : shaking its legs. Just search "Walk cycle" with google image and you'll find plenty of examples. Here is a little example of what ...


9

Pixel art generally responds extremely bad to any scaling. Just a small size adjustment will make pixel art appear either blurry or distorted, depending on what scaling algorithm your engine uses. For that reason it is important to make sure that the graphics are designed in exactly the resolution in which they appear in the finished game. Here is a pixel-...


7

ImageMagick's montage command can do this. For example, to compile a bunch of irregular-sized sprites into a sheet of 32 × 32 pixel tiles, you can do: montage sprite*.png -geometry "32x32>+0+0" -background none sheet.png The -geometry "32x32>+0+0" option above will resize all the sprites to 32 × 32 pixels (adding transparent space ...


7

It may not be a direct answer to your question, but it is my advice ;) Do not move your sprites based on the number of frames, but do it based on wall-clock time. Why? Oh well, it is very easy for a game to have a variable frame-rate, so, imagine your character is jumping from platform to platform, and the PC lags for some reason. If his movement is based ...


7

Technically seen it's the same: It's a big image that contains smaller images (sprites). The 3d vs 2d does not make a difference here since almost all 2d game engines use 3d hardware for rendering....


6

Try Sprite Decomposer or Sprite Vortex, I believe both of them have automatic sprite cutting based on alpha.


6

Usually there is nothing like "cut out every sprite", because you aren't working with the data itself, but just with references. The hero sprite is not known to the application as "[...insert huge data array here...]" but as "Position 0,64 with size of 48x64 on Texture 5". And that data is trivial to generate nothing you could or should sweat over. For GPU ...


6

You need to create a sprite array Sprite[] sprites and fill it using sprites = Resources.LoadAll<Sprite>("Location"); inside Awake().


5

Unless you have a high frame rate and very low size requirements, the number of sprites you're talking about won't matter compared to, say, the audio files (especially music!). If game size was the only requirement, I'd say go with pre-baked animations. As long as you only have ten weapons, either way will be roughly the same amount of work for the artist; ...


5

I have decided to open source my 2D spritesheet and animation tool. It supports automatic sprite selection, combining images, sprite grouping, and multi-sprite animation with rotation. It is written in Java, the github repo is here: https://github.com/darkFunction/darkFunction-Editor Website for the project is: http://darkfunction.com/editor


5

The idea behind condensing sprite sheets is that the actual loading of the file (the sprite sheet) is considered heavy lifting in any game system. Imagine you have this system where all your data types are highly optimized and all these algorithms to reduce the memory foot print but then you have to constantly bottle-neck memory with loading and parsing ...


5

After spending a week searching the web and checking every related blog post, i found the solution. http://www.denysalmaral.com/2012/04/px-spritesrender-3ds-max-scripted.html This script renders and names the images perfectly, after it i combine them using "GlueIT" Works like a charm, Hope it will help others.


4

Hard to say without actually profiling it but some information that might help: When you do not use the rotation parameter or leave it as 0: The rotation transformation is still applied, but SpriteBatch handles it as a special case which costs one Math.Cos and one Math.Sin less for each sprite being drawn, because it already knows that the sine and cosine ...


4

Using a sprite sheet reduces the need for the computer to load a new/different image in order to draw on the screen. Here is an article which shows the performance differences in XNA (in the emulator and on a device) as well as the animation class used.


4

I just can't replicate the issue with FolderBrowserDialog.ShowDialog hanging, so I've created a new version of the app (version 9) which has a new 'Prompt for Export Folder' option. Unchecking this option removes the need for the dialog box. You can download version 9 from my site Alferd Spritesheet Unpacker version 9. On the 'Options' form untick the '...


4

Record your animation sequence into an array; Remember the step you show at this frame; When next frame is coming, make the step increase, if step becomes more than animation length - set it to 0 again; Now you have looped animation. AnimStep: Byte; // Currently displayed animation frame AnimSprite: array [3, 4, 5, 6, 4, 3, 2, 1, 0, 2]; // Array of frame ...


4

There are tools for creating spritesheets from individual images that will also output a meta-data file describing where each image is placed in the spritesheet. For example you could use Texture Atlas Generator to create the spritesheets. In this blog post I show how you'd work with the output to get animations playing in Flash quite effortlessly. Even if ...


4

You might want to consider using a variable frame rate. This way, you can cap the framerate at whatever the monitor's refresh rate is without changing the speed of the game. AranHase has a valid point about glitches resulting from variable frame rates, but you can avoid this by skipping the update loop if the time between the current and previous frame is ...


Only top voted, non community-wiki answers of a minimum length are eligible