Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Hot answers tagged

65 votes

What is the term for a 3x3 tile set used to create larger areas?

I'd disagree with the accepted answer here. I'd call this an autotile, and not a 9-slice "9-Slice" (or 9-patch) is usually used to refer to a system where the content creator slices the image along ...
user avatar
  • 113k
39 votes
Accepted

What is the term for a 3x3 tile set used to create larger areas?

A name that will give you actual results in Google is 9-slice. Another way to call it and ask Google about it is 9-patch. As per this chat discussion, 9-pane seems to also be used, but the almighty ...
user avatar
  • 15.4k
34 votes
Accepted

Combinations for tiling two textures together

There's a solid overview of different popular tile combination patterns put together by Boris the Brave, building on some earlier work by Sean Howard. I'll briefly summarize the main categories these ...
user avatar
  • 113k
25 votes
Accepted

Generating tile map

What you could do is randomly generate a Voronoi map like this: Picking random center points (see the black dots) and randomly decide if they are grass or dirt. ...
user avatar
  • 10.5k
25 votes

Generating tile map

You could use perlin noise, which is normaly used for heightmap generation. Perlin noise in games Then you could use the heights as an adviser, how high the chance of grass/dirt occuring in one ...
user avatar
  • 465
15 votes
Accepted

How can I implement smooth tile-based lighting?

A simple way to achieve smooth lighting in a tile based game, is to draw a "lightmap" to a render target, and then drawing this render target over top your scene while alpha blending it. Your light ...
user avatar
  • 8,279
12 votes
Accepted

Fast, simple procedural 2d island generation

One thing I've done in the past for island shapes is to use perlin noise minus a circular shape. It usually produces one big island and some little things off on the side. You can use flood fill or ...
user avatar
  • 5,856
11 votes
Accepted

Where to cast light/shadows in a 2.5D view?

Going to try and doodle up what I mean here as soon as I finish typing this, but: What about merging the two? Use the second (occlude by base) for everything that isn't a wall and the first (occlude ...
user avatar
10 votes

How to split a 2D sprite tile set into individual sprites?

Go to piskelapp.com , then choose 'Create new Piskel'. Click the menu on the right, and choose import your own image; select it, then put the number of size of each tile. After you are done editing, ...
user avatar
9 votes

Generating tile map

http://gamedevelopment.tutsplus.com/tutorials/generate-random-cave-levels-using-cellular-automata--gamedev-9664 here is my version of the cellular automata method start by filling the grid with ...
user avatar
9 votes
Accepted

Why are 16×16 pixel tiles so common?

Tiles and icons (even in UIs like window systems) are often in a size like 16x16 or 24x24 to make it easier to modify the tiles. Most times the tile size is a multiple of 8 because of the folowing ...
user avatar
8 votes
Accepted

Determine whether a shape formed from a series of other shapes is 'unbroken'

This is a basic connected components problem, and can be solved with a single invocation of breadth-first or depth-first search, or any flood-fill algorithm. ...
user avatar
  • 113k
8 votes
Accepted

How can I procedurally find a wall that separates two or more points on a grid-based map?

I will present a general concept and three solutions using that concept. Concept is an Influence map: For each location in the map, you are going to store a number that represent the distance to each ...
user avatar
  • 18.1k
7 votes
Accepted

Technical differences between square and hexagon for a grid?

I'd consider a Square-based grid as a "base" type of tiles in any game. Such grid is simple to imagine and moves over this grid are simple to understand. It's also ...
user avatar
  • 1,320
7 votes

Generating tile map

Select a point on the map. Place desired tile type with a base value such as 40. Keep track of where you placed your newly desired tile. Add the starting point to a list. For each point in this ...
user avatar
  • 171
7 votes
Accepted

How can I tell if an object in a tile grid is surrounded?

Sounds like you're after something like a flood fill algorithm. Basically, something like the following algorithm (you can see other examples on the wikipedia page): ...
user avatar
  • 72.7k
7 votes
Accepted

Storing walls that are between tiles

I start with coordinate systems — the coordinates for grid locations are (x,y) but as Krom mentioned in a different answer, for walls there can be up to two walls for each grid location. That leads to ...
user avatar
  • 5,856
6 votes

Seamless tilemap rendering (borderless adjacent images)

Because by default OpenGL can only wrap the entire texture (GL_REPEAT), and not just part of it, each tile is split off in to a separate texture. Then regions of the same tile are rendered ...
user avatar
  • 29.1k
6 votes
Accepted

How can I have 2 different images seamlessly tile with each other?

Basically, I think what you do is first of all create a tile for each of your terrain types that seamlessly tiles with itself. As you said there are many tutorials available on how to do this. Once ...
user avatar
6 votes
Accepted

Random Placement of Objects on a Tilemap

Both of those pieces of code appear to pick a random location (xx,yy in the first example and x,y in the second), then try to change grass to something else near that location. There are lots of ...
user avatar
  • 5,856
6 votes

How do I determine the draw order of isometric 2D objects occupying multiple tiles?

Here is a solution without resorting to 3D coordinates or splitting your sprite into 1x1 elements, that works if your objects occupy rectangular areas of tiles. Let ...
user avatar
  • 1,025
6 votes
Accepted

Efficiently Handling Entity-Interactions in a Tile-Based World

You have 3 major options: 1: Implement some kind of sorting or data structure. For example: Keep monsters in a list/array (Something you are probably already doing) and sort them by ...
user avatar
6 votes

Add and remove tiles? Or better to have them all loaded off screen?

In a case like this, you are going to want to Pool your world tiles. The idea is to pre-load a fixed amount of tiles that you will be re-using during the rendering of your world. When setting a ...
user avatar
  • 8,279
5 votes

Technical differences between square and hexagon for a grid?

Can't comment yet, so I'll give answer short answer. From my experience, square tiles are a little simpler to implement. If you are using e.g. a two-dimensional array, tile position is array index ...
user avatar
  • 421
5 votes
Accepted

How can I author objects with perspective that fit into a tile-based map but span multiple tiles?

I found an efficient way to build a city fast (or whatever you're trying to build) is definitely to go modular, and make indexed fittings for your buildings. For example: Single buildings, referenced ...
user avatar
  • 1,035
5 votes

How can I do optimal pathfinding for a Tetris piece?

I added another answer for an alternative explanation of the problem. You can think of this problem as Motion Planning in the Configuration Space of the tetris piece. The Configuration Space Define ...
user avatar
  • 3,567
5 votes

How do I determine the draw order of isometric 2D objects occupying multiple tiles?

Brief : This answer suggest to break big sprites into one by one tiles so the zPosition for each sprite which is used to sort them in depth will work correctly. To understand my proposal you will ...
user avatar
5 votes
Accepted

How do I avoid lag when dynamically loading a map chunk?

Start generation early; if a player gets within 3 screen widths of the edge of the generated map start generating more chunks on that edge 1 chunk at a time. Focus generation on the area the player ...
user avatar

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