Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more
66 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 ...
DMGregory's user avatar
  • 135k
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 ...
Vaillancourt's user avatar
  • 16.3k
36 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 ...
DMGregory's user avatar
  • 135k
16 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 ...
jgallant's user avatar
  • 8,424
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 ...
Theraot's user avatar
  • 26.9k
7 votes
Accepted

Should the entity handle his own movement?

There are no right or wrong ways to do things. Only ways which work for you or don't work for you. There are several competing philosophies in mainstream game architecture. A: Object-oriented ...
Philipp's user avatar
  • 120k
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 ...
jgallant's user avatar
  • 8,424
5 votes

Elegant autotiling

I arrived here by Googling this problem myself, read the linked articles, and produced a relatively compact solution which generates the common set of 47 tiles. It requires a 2x3 tileset for the ...
Pennie Quinn's user avatar
4 votes

How can I implement smooth tile-based lighting?

an engine agnostic way to do it is to use average light mapping. First, you need to generate a black and white map as a 2D array of booleans that is the size of the world where the blocks are True and ...
UDXS's user avatar
  • 141
4 votes
Accepted

How to generate tile patterns in one dimension, then in a second dimension?

Looks to me like it works like this: You have different biomes: road, rail, river, grass+trees, etc. Randomise a sequence of these like: ...
Engineer's user avatar
  • 29.6k
4 votes

Create a seemless grid-based polygonal tileset

This can be done with a generalization of Wang Tiles or Corner Tiles. These associate labels with the boundaries of a tile, and enforce the constraint that two tiles that meet along a particular ...
DMGregory's user avatar
  • 135k
4 votes

How can someone make 3D tiles not looking like perfect cubes?

Usually to render a large quantity of gird aligned cubes is to use a method known as "Marching cubes". Note: the main alternative is to use ray casting and voxels (point cloud data), which is less ...
Theraot's user avatar
  • 26.9k
4 votes

Drawing huge amount of tiles in Monogame (XNA) efficiently

Graphics cards are optimised to draw a few things lots of times rather than the other way around. In your case, you have a lot of things (different textures) that you want to draw a lot of times (...
loodakrawa's user avatar
4 votes
Accepted

Array-based tilemaps and bounding box (aabb?), how to do efficient tile collisions?

The reason there isn't a standard AABB or partition strategy for tile-based maps is that it's already easier to detect collisions against it than using AABBs. ...
Jimmy's user avatar
  • 9,019
4 votes

Why LineRenderer texture stretching when I set it to tiled?

I know this thread is old but for anyone who happens to have the same problem, all you need to do is go to the image file itself and set wrap mode from clamp to repeat. https://forum.unity.com/threads/...
Anonymous User's user avatar
4 votes
Accepted

How to avoid rows on screen when cutting spritesheet tiles?

Keep in mind that context.scale does not change the internal resolution of the canvas. It just adds a multiplication factor to all coordinates you pass to the drawing functions. Due to floating point ...
Philipp's user avatar
  • 120k
4 votes

Unity 2D animated tiles library: IsSelected variable not working or not present within RuleTileEditor.cs

Open Unity On top of Unity window, you will see your version number. Will look something like, Unity 2020.3.8f1 Go to: https://github.com/Unity-Technologies/2d-extras On Unity 2d Extras Github, check ...
pixel's user avatar
  • 41
3 votes
Accepted

How do I merge colliders in a tile-based game?

Ok, so I solved this problem using the Clipper library: http://www.angusj.com/delphi/clipper.php The library has an all in one .cs file, so the easiest way to use it in unity, is to just paste this ...
Felipe Müller's user avatar
3 votes

How to code a multi level isometric map?

One approach to a multilayered map would be an array (or 2-dimensional array) of linked lists or vectors holding tile objects. So your tile struct would either hold a pointer to the next tile above it,...
Salajouni's user avatar
  • 154
3 votes

How do you do tile-based movement in Phaser?

The player should have a position, that can be any number, and a target position. When the current position is equal to the target position, check the input, and set the new target position ...
Bálint's user avatar
  • 14.9k
3 votes
Accepted

Drawing huge amount of tiles in Monogame (XNA) efficiently

I found out that SpriteBatch is not suitable for drawing tiles. One reason is that sprites are meant for dynamic objects and are used for multiple purposes. Another reason is that it's incredibly CPU-...
Guguhl Pluhs's user avatar
3 votes
Accepted

Need some insight on mesh triangulation and geodesic spheres

My preferred approach is to split the geosphere into flat charts, bent a little to fit a simple square grid so they're easier to reason about: Let's say we split the underlying icosahedron into 5 of ...
DMGregory's user avatar
  • 135k
3 votes
Accepted

Why did sprites sometimes flicker or disappear in very old games?

I managed to patch together an answer for the Nintendo Entertainment System (NES) based on some Wikipedia articles and some discussion with a professor of mine. Before I begin it's important to note ...
Charanor's user avatar
  • 7,860
3 votes
Accepted

How should I store world data in a 2D grid sandbox game?

But here is the problem, since not every tile's size is 1x1, some may take 2x3 block size. and if i just put in Array this object's pointer, there is 6 same pointer will store in single array. Don't ...
Philipp's user avatar
  • 120k
3 votes
Accepted

How can I fine-tune my movement values in a 2D block-based platformer?

There is a lot you can do with a mathematical approach to game design, but in the end you won't get around systematic playtesting. A good way to identify places in your game which are too hard are ...
Philipp's user avatar
  • 120k
3 votes
Accepted

How do I create a single tile in Unity 2019+

The tutorial, "Ruby's Adventure: 2D Beginner" is a 3D project. I restarted the tutorial and changed it to 2D using the menu "Edit -> Project Settings... -> Editor -> Default Behavior Mode". Next, I ...
mhvelplund's user avatar
3 votes
Accepted

How to make different Rule Tiles interact with each other?

For my purposes, this example from Unity's Github worked flawlessly (Source): ...
caleidon's user avatar
  • 571
3 votes

Isometric ordering issue with moving entities taller than one block

Usually we would sort objects by their ground position. In fact, we can argue there are two orders: Sort objects by their ground position, back to front. Sort object by their elevation, bottom to top....
Theraot's user avatar
  • 26.9k

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