Hot answers tagged

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
  • 126k
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.1k
35 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
  • 126k
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 ...
jgallant's user avatar
  • 8,314
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 ...
Draco18s no longer trusts SE's 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, ...
AndresAbad's 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 ...
Uwe Plonus's 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. ...
DMGregory's user avatar
  • 126k
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
  • 22k
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 ...
Lærne's user avatar
  • 1,055
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 ...
NitrogenReaction's 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 ...
jgallant's user avatar
  • 8,314
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 ...
Hatoru Hansou's 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 ...
ratchet freak's user avatar
5 votes

Memory-Efficient, Optimized Terraria-Like 2D Lighting

One option would be to load lighting information only as it appears on the screen. You would get one performance hit at the beginning as the full screen lighting is calculated, but from there you ...
Kelly Corcoran's user avatar
5 votes

In a tile-based MMO, how do I decide which players need to receive what updates?

Divide your game world into rectangular chunks which are about half the size of the players screen. Keep track of which players are in which chunk. You can easily do that in the code which handles ...
Philipp's user avatar
  • 117k
5 votes
Accepted

Combining Many Small Colliders into Larger Ones

I found usefull this algoritm for love2d engine (lua language) https://love2d.org/wiki/TileMerging ...
dnk drone.vs.drones's user avatar
5 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
  • 117k
4 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

Repeat texture in libgdx

You can use "SetWrap" on your texture and create a TextureRegion based on that Texture. To Create a 3x3 mirrored image (or axb size) ...
Julien's user avatar
  • 174
4 votes

Xna: Texture2D from a png file

A bit late for Raj but for anyone else... ...
Stoort's user avatar
  • 86
4 votes
Accepted

About tiles in games

Per your question, I understand you are not asking for detailed implementation code, since that would be asking for too much more than one single question can offer. So, I understand you are actually ...
MAnd's user avatar
  • 4,907
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.3k
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

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
  • 126k
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
  • 22k
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

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