Skip to content

A tool for generating transitions, cliffs and waterfall for 2D top down tile based video games.

License

Notifications You must be signed in to change notification settings

NatanaelAntonioli/TileToad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Why and when should I use TileToad?

TileToad is a Python application designed to facilitate the creation of terrain tilesets by automatically generating neat transitions between tiles and combinations for cliffs, rivers and waterfalls.

In a tile based video game (like the ones made with RPG Maker or 001 Game Creator) the terrain is painted using images (usually square) laid onto the ground referred as tiles. If you don't make transitions between tiles, you'll get a lot of squares. Using transitions, you can make something better, like in the picture bellow. However, making a transition for every combination takes time.

TileToad helps you generating those combinations. It also generates tilesets for cliffs and waterfalls from the same textures.

How to run TileToad

You will need Python 3. Before running for the first time, you will also need to install Pillow with pip install Pillow

Then all you need to do is to run tiletoad.py as you would run any other Python script.

How to generate tilesets

There are 5 input folders you need to worry about when generating tiles. The folder ground contains all textures for ground tiles (like dirt, grass, sand, pavement or rock).

The folder fluid contains all textures for fluid tiles. By fluid, I mean anything that flows or used to flow (like water, ice or lava).

The folder rut contains textures for rut tiles, that will be used to make small cliffs between fluids and ground tiles.

The folder cliff contains textures for cliff tiles, that will be used to make the big cliffs.

After you execute the program, it will generate the following assets in their respective folders inside the folder out:

ground-ground tiles, making the transition between two different ground tiles. Each ground tile is combined with the others, and there are no duplicate combinations

RUT-ground-fluid tiles, making the transition between a ground and a fluid tile with a small cliff. Each ground tile is combined with each fluid tile.

BEACH-ground-fluid tiles, making transition between a ground and a fluid tile without a cliff. Each ground tile is combined with each fluid tile.

fluid-fluid tiles, making the transition between two different fluid tiles. Each fluid tile is combined with the others, and there are no duplicate combinations.

cliff tiles, making the big cliff tiles. Each ground tile is combined with each cliff tile. With the generated sheet, you can make almost any cliff format.

stair tiles, making small tiles for stairs. Each ground tile is combined with each cliff tile.

waterfall tiles, making waterfall and foam tiles. Each fluid tile is used. With the generated sheet, you can make foam in 4 directions, plus full and delimited waterfalls, with special tiles for tops and bottoms.

TileToad will generate a lot of tiles, including some absurd combinations like a smooth frontier between ice and lava. You are not supposed to use every combination, unless you want to.

If you don't want some category of tiles being generated, you can set it to false by editing the header in tiletoad.py.

GENERATE_ground_ground = True
GENERATE_RUT_fluid_ground = True
GENERATE_BEACH_fluid_ground = True
GENERATE_fluid_fluid = True
GENERATE_cliff = True
GENERATE_waterfall = True

How tilesets are generated (and how to change that)

That's for advanced users who want to understand how TileToad works or modify the way tiles are generated. If you just want to generate your tiles with custom textures following the default organization, you can skip this section entirely.

TileToad works mostly by pasting one image on top of another with masks, which are saved in the masks folder. White regions means where the image will be preserved. Pink regions are replaced by transparent pixels.

The simplest case is for beaches and transitions between two tiles of the same category. TileToad first generates full images for each tiles, and then applies a mask for the top one. Then, the images are pasted on top of another.

The same thing is done for foam.

When there's a rut, the program will do another iteration for the rut. It will also generate a plain image a little darker than the outer ground, and make a neat contour out of it.

Generating stairs is very simple, and follows the same logic.

Generating cliffs is a bit more complicated, but also follows the same logic.

Generating waterfalls involves making two plain images and composing them to make the falling water effect. It then applies a pink mask to remove some regions and delimit the waterfall contours.

That means you can edit the masks to change how the tilesets will look. Just make sure to study the code and the images before.

FAQ

Not really a FAQ since no one asked me anything yet.

What is the base size of each tile?

32x32. For now, this can only be changed by modifying the source code.

What job TileToad will spare me to do?

With TileToad, you won't have to worry about manually determining and drawing (or making PhotoShop masks and patterns) for transitions, rivers, cliffs and waterfalls to you game. Just add the base textures, import to your engine and you are good to go.

Will this tool keep me from manually importing and configuring each transition?

As of now, no. TileToad only generates the files, and you have to do all the importing and configuration yourself. However, any engine is welcome to implement features that allows auto-importing of TileToad files or even integration with TileToad itself. I'll make sure to add those engines here when they do.

How can I make tilesets from custom textures?

Just add them to the corresponding folders, as the rest of the documentation explains.

How can I add more tiles and keep the same sequence of generation?

If you plan on adding more tiles over time, make sure the new ones are last in the sources directory. This keeps the order TileToad uses.

My textures are kinda ugly, repeating themselves. What can I do?

Make sure the textures used are seamless.

How can I keep track of which textures I already imported?

I think the best way to import the transitions into an engine is to delete already imported tiles from time to time. This keeps you from scrolling forever just to add a single image. If you made a mistake, just run the program again and all the images will be regenerated.

Attribution notice

Textures used in the demo were taken from OpenGameArt and Itch.io, so I must credit the following contributors:

If you decide to use those textures in your game, you'll also have to credit them.

About

A tool for generating transitions, cliffs and waterfall for 2D top down tile based video games.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages