GameAssets

Pixel Art in Godot & Unity: Sprites and Tileset Setup Guide

· #pixel art #godot engine #unity 2d #gamemaker #tilesets #2d sprites

Pixel Art in Godot & Unity: Sprites and Tileset Setup Guide
Image: The original uploader was NamShubCMX at English Wikipedia. · GPL · Wikimedia Commons

Learn how to set up 2D sprites, tilesets, and animations in engines like Godot and Unity without losing crisp pixel sharp accuracy.

Working with pixel art in modern game engines is an extremely rewarding experience, but it comes with a few technical pitfalls. Although engines like Godot, Unity, and GameMaker are incredibly powerful for 2D development, their default rendering settings are usually designed for high-resolution artwork. This means that without the correct import settings, your perfectly drawn sprites can end up looking blurry, stretched, or misaligned on screen.

In this practical guide, you will learn how to import, configure, and organize pixel art sprites, tilesets, and animations across major game engines—ensuring crisp graphics and a highly efficient workflow for your indie project.

The Blur Challenge: Why Does Pixel Art Get Blurry?

By default, most game engines apply a texture filter called bilinear filtering. This filter is designed to smooth out transitions between pixels to prevent high-definition images from looking jagged when scaled or zoomed in.

However, in pixel art, visible, crisp, and well-defined pixels are the very essence of the visual style. When an engine applies bilinear filtering to a 16x16 or 32x32 pixel image, it attempts to blur the edges to create a smooth transition, resulting in a fuzzy image lacking any sharpness.

To fix this issue, we need to change the texture filtering mode to Nearest Neighbor (or Point Filter). This method instructs the rendering engine to display each pixel exactly as a solid block of color, keeping the retro aesthetic flawless and crystal clear.

Setting Up Sprites in Major Engines

Each game engine has a specific location for tweaking image import settings. Here is how to adjust them in the most popular tools:

1. Godot Engine

Godot is widely praised by the indie community for its stellar native 2D support.

  • Globally (Godot 4): Go to Project > Project Settings > Rendering > Texture Filtering and change the default setting from Linear to Nearest. This applies point filtering to all newly imported textures in the project.
  • Per Image: If you want to change the setting for a specific file, select the image in the FileSystem dock, navigate to the Import tab, change Texture > Filter to Nearest, and click Reimport.
  • Viewport Setup: To maintain pixel aspect ratios when resizing the window, go to Project Settings > Display > Window and set Stretch Mode to canvas_items (or viewport) and Aspect to keep.

2. Unity

Unity handles 2D textures quite flexibly, but it requires a few manual tweaks when importing pixel art files:

  • Select the image or asset folder in the Project window.
  • In the Inspector window, set Texture Type to Sprite (2D and UI).
  • Change Sprite Mode to Single (for individual artwork) or Multiple (for sprite sheets with several frames).
  • Change the Filter Mode setting from Bilinear to Point (no filter).
  • Under Compression, select None or lossless High Quality to avoid visual compression artifacts.
  • Adjust the Pixels Per Unit (PPU) property to match your exact grid size (for example, 16 or 32). This ensures that one Unity world unit corresponds perfectly to one tile of your artwork.

3. GameMaker

GameMaker features a native ecosystem tailored for 2D development:

  • Open your project settings (Game Options for your target platform, such as Windows).
  • Under the Graphics section, uncheck Interpolate colors between pixels.
  • This simple change ensures that all sprites and tilesets in your project are automatically rendered with point filtering.

Organizing Sprite Sheets and Animations

Instead of importing dozens of separate PNG files for every walk or attack frame of your character, industry best practice is to use Sprite Sheets. A sprite sheet consolidates multiple animation frames into a single image organized on a grid.

Slicing the Sprite Sheet

After importing your sprite sheet into the engine, you need to slice it into individual frames:

  • In Unity: Open the Sprite Editor from the Inspector, select Slice > Grid by Cell Size, enter the width and height for each frame (e.g., 32x32 pixels), and click Apply.
  • In Godot: When creating an AnimatedSprite2D node, add a new SpriteFrames. Click the grid icon to slice the texture by specifying the number of rows and columns.
  • In GameMaker: The sprite editor allows you to import an image as a strip and define the frame count upon import (Convert to Frames).

Creating smooth animations requires a lot of time and technical dedication. If your primary focus is programming or game design, using premade, original sprite packs can dramatically speed up the development of your prototypes and final game, allowing you to focus on what makes your gameplay fun.

Mastering Tilesets and Tilemaps for Level Design

A Tileset is an image containing small, reusable building blocks (tiles) like dirt, grass, rocks, and platforms. Using Tilemaps allows you to draw entire environments directly within the engine, optimizing RAM usage and saving hundreds of hours of manual artwork.

How to Avoid Tile Bleeding

A recurring issue when building levels with Tilemaps is the appearance of unwanted thin lines (gaps or transparent artifacts) between tiles during camera movement. This phenomenon is known as Tile Bleeding.

To fix Tile Bleeding in your projects:

  1. Add Padding/Extrusion: Add a duplicated 1-to-2-pixel border around each tile in the image file. Texture atlas software often generates this extrusion automatically.
  2. Disable Camera Smoothing: Ensure the camera's position is always snapped to whole pixel values (Pixel Snap).
  3. Configure the Grid Correctly: In your game engine, make sure the Tilemap cell size matches the exact tile dimensions of your tileset file.

Speeding Up Design with Autotiling

Tools like Godot and GameMaker offer built-in Autotiling (or terrain) systems. With Autotiling configured, you can simply use the brush tool to paint terrain, and the engine will automatically pick the correct corner, edge, and fill tiles based on neighboring rules you set up.

Adjusting the Camera for a Pixel-Perfect Look

Even with textures set to Point filtering, continuous camera movement can cause visual distortion if the game's internal resolution is not kept at integer values.

To achieve a flawless retro look:

  • Work at a Low Native Resolution: Set your project's base resolution to a retro value (such as 320x180 or 480x270, which preserve the 16:9 widescreen aspect ratio).
  • Pixel-Perfect Camera: In Unity, use the official Pixel Perfect Camera package. In Godot, use SubViewport nodes or adjust window scaling to use Integer Scaling only.
  • Round Positions: Force camera and character movements to round their coordinates to integers, preventing sub-pixel rendering that causes visual jittering.

Best Practices for 2D Asset Management

To keep your project organized and ensure high performance as your game grows, follow these best practices:

  • Standardize Dimensions: Establish a base size for the entire project (such as 16x16 or 32x32 pixels for standard environment tiles and characters).
  • Group Textures into Atlases: Combine multiple smaller sprites into larger files to reduce draw calls.
  • Combine Custom Art with Premade Assets: Don't feel obligated to draw every element of your world from scratch. Utilizing high-quality, pre-made 2D asset packs, tilesets, and character models is a common practice that saves months of production time and elevates your indie game's overall look.

Conclusion

Configuring sprites, tilesets, and pixel art correctly is the first step toward giving your 2D game the professional finish and visual crispness players expect. By disabling bilinear filtering, setting up proper pixels-per-unit values, and utilizing features like autotiling and pixel-perfect cameras, your project gains both technical quality and production efficiency. Choose your preferred game engine, structure your texture files properly, and start building amazing 2D worlds today!

Assets to speed up your project

Read next