67
votes
How can I quickly check if my sprite tiles well?
Here's a quick hack that works with any image editor.
If your tile image is called tile.png, create an index.html like this:
<...
37
votes
Accepted
Best practice for map coordinate system
Most games place the map origin in a corner. The main reason for this is that tilemaps are often internally stored in two-dimensional arrays, and most programming languages don't allow negative array ...
29
votes
Accepted
What is the size limit to the Unity 2017.2 Tilemap?
Your RAM is your limit.
The following tests were performed on a system with these specs:
Intel i5-6600
16 GB RAM
NVIDIA GeForce GTX 1070
Windows 7 Home Premium
Here is a script I ran which grows a ...
28
votes
Accepted
How to get all tiles from a Tilemap?
To get an array with all tiles from a rectangular area of your tilemap, use tilemap.GetTilesBlock(BoundsInt bounds). You will get a one-dimensional array of tiles, ...
18
votes
How can I quickly check if my sprite tiles well?
Using photoshop or GIMP, you can use the offset command. If you are working for say a 100x100px image, you can offset it 50px in each direction, and the seam where the image tiles together will be ...
18
votes
How to get all tiles from a Tilemap?
Here is another way to do it with .cellBounds.allPositionsWithin
...
18
votes
Accepted
Player gets stuck on edges between TilemapCollider2D tiles
After trying to write a code that merges the squares effectively (especially for large Tilemaps) both horizontally and vertically I decided to look if there is a better suited collider than the ...
17
votes
How can I quickly check if my sprite tiles well?
Krita has a feature that allows you to edit tiling textures and see the changes update live. By pressing the W key, it enables wrap around mode, which makes this possible. A youtube video of this ...
13
votes
Accepted
How can I fill the interior of a closed loop on a tile map?
Short: After completing the shape you should have a multiple of 2 Points for each affected row on your x-axis. From there it becomes just a matter of splitting up these Pairs of Points for each row ...
12
votes
Best practice for map coordinate system
In theory the location of the origin doesn't matter. All math operations you do when the map is rendered or when objects move on the map work fine regardless of where the origin actually.
However in ...
9
votes
Accepted
Are there definitive, unambiguous terms for hexagon tile orientations?
While I don't know of any truly official convention for classifying these, in the mathematical sense, I'll take Anko's advice and write up what I do know...
Amit Patel (Red Blob Games) wrote what I'd ...
9
votes
Is there a name for this technique to put the tiles on the corner of a level?
It's a palette. Same thing you see some artists doing with colors. They draw a group of a couple of the main colors or even a gradient going between them for easy access. It's much easier to use a ...
8
votes
Accepted
Unity procedural TileMap generation without creating gameobject per tile
Here's what I'm aware of:
Option 1. GameObject per tile. It's not completely horrible in certain cases. Depending on your needs, it could work.. well enough.
Option 2. A single quad or plane ...
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 ...
8
votes
Accepted
Strange warping/shimmering effect with Unity Tilemap and Cinemachine
Note that Cinemachine now has a Pixel Perfect extension that automates the kind of camera calculations I describe further down in this answer. Consider using that, and check the rest of this answer ...
8
votes
Accepted
Is there a name for this technique to put the tiles on the corner of a level?
I don't know if there is a name, but this seems to be something you'd do to conserve memory.
First, a basic tile is very low resolution - just a few pixels across. But when rendered, they are ...
7
votes
How can I deal with tilemap position in the editor?
The select tool.
Clicking any tile with the select tool, the inspector will tell you the position relative to 0,0.
With a little bit of math (and/or additional clicks), you can hone in on whichever ...
7
votes
Accepted
Tile palette off-centered
I fixed it by:
1.) Deleting my current tiles in the tile palette.
2.) In the inspector, after selecting the sprite that I wanted fixed properly on the tile palette, I changed the sprite's pivot ...
6
votes
How can I quickly check if my sprite tiles well?
Make your tile a tiled wallpaper on you desktop. Super easy and no coding or extraneous software.
6
votes
Accepted
How can I generate infinite boundary walls in PICO-8?
Sounds like you want to animate the walls down the screen so that it appears as though the player's ship is moving forward.
Know that the PICO-8 Map is mainly for static backgrounds, so if you want a ...
6
votes
Accepted
Positioning tile sprites so they connect seamlessly
Using the Move tool (not the RectTransform tool)
(Image from Unity docs)
Hold the V key to enable vertex snapping, and hover over the corners of your sprite. The transform gizmo will snap to the ...
5
votes
Map coordinates system
All three uniform 2D grids can be stored in a rectangular grid, you just have to scale and shear it to fit the one you're aiming for.
To know what regions you need to load just transform the viewport ...
5
votes
Accepted
How should I use Monte Carlo method to simulate some police cars that keep patroling in a tile based map?
As a former police officer I can offer some insight into how it really works, which might help refine your process.
Divide your area up into grids and assign a car to patrol in that area, the areas ...
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
...
5
votes
How can I quickly check if my sprite tiles well?
If you want to test multiple images, it may help to have an mini webapp based on Anko's answer. This will let you drag images onto the page to let you test them in quick succession:
...
5
votes
Accepted
Making Edges of Hand-Drawn Tileset Match Up
Here's one method that works well:
(Though I've done a bit of a quick & sloppy job of it here. Original rock texture from this site)
Duplicate your 9-slice and offset it by one tile width (so ...
5
votes
Accepted
How to center a tilemap in Phaser?
I found out why it was not working... I needed to do this:
layer.fixedToCamera = false;
5
votes
Big maps with deep zoom and pan
If you have access to shaders, you can invert the drawing logic. Normally you loop through tiles and draw each one. When you're zoomed out there are a lot of tiles to draw. Zooming out is slower. ...
5
votes
Accepted
Reason for white lines in tile-based game
These lines are caused by the interpolation in the texture sampler which samples texels from adjacent tiles in your tile atlas.
Both bilinear and trilinear (mipmaps) interpolation (and some rounding ...
5
votes
Accepted
Map generator sometimes doesn't work
You get an infinite loop. The statement that increases your counter in the while loop is inside an if statement that checks if the position is in bounds. Else it just sets ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
tilemap × 706tiles × 154
unity × 146
2d × 130
java × 84
c# × 58
libgdx × 55
collision-detection × 53
maps × 52
isometric × 50
javascript × 40
procedural-generation × 40
xna × 34
tiled × 32
algorithm × 28
opengl × 24
c++ × 24
sprites × 23
grid × 23
path-finding × 22
rendering × 21
godot × 17
performance × 16
rpg × 16
mathematics × 14