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

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

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

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

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

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 ...


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

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

You just swap your rows/columns ordering. Iterating from 0 to Frames-1, you first increase X and every time you hit the spritesheets width - increase Y and reset X. The code should be looking like so: for (i = 0; i < Frames; i++) { // Increase the row once every time horizontal range is done if (i != 0 && i % (TempSurface->w / ...


4

I assume you will be using some modern rendering API to draw to the screen, such as OpenGL or D3D. You will certainly want to batch sprites as much as possible and use sprite sheets to reduce the number of textures. A sprite sheet is nothing more than a Texture Atlas (also read this). Once you have a Texture Atlas up and running, it will be up to you how you ...


4

Sort the rendering order by the used sprite sheet and not by distance from camera. This works fine if you use z-buffer and don't render transparent objects. I.e. first draw all the trees (and other objects in the same sprite sheet) into the scene and test and write the depth in z-buffer. Then render all units and do the same. This will result in 2 draw calls ...


4

Ok so based on @Rouze comment regarding the sprite slice renamer, I've managed to mock something up quickly that does the job. Here is the quick mockup I did if anyone else is looking for a quick and dirty way to change the subsprite names. In my research for this subject, it appears I was referring to them as Sub-Sprites when the more known name is Sprite ...


4

The way a computer draws to the screen is very different to say... how we draw on a piece of paper. The computer actually is flipping bits on a memory array, called the video memory. This memory array happens to be represented on the screen as an image a human can understand. With this in mind, let's start: When you draw a sprite—several times, on different ...


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