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 ...
35
votes
Accepted
Algorithm for procedureral 2D map with connected paths
One of the best, and most used, algorithms I've seen out there is generating dungeons using Binary Space Partitioning.
The best general explanation I've read is the one found in The Chronicles of ...
30
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 ...
27
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, ...
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.
...
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 ...
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 ...
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 ...
17
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 ...
16
votes
How to get all tiles from a Tilemap?
Here is another way to do it with .cellBounds.allPositionsWithin
...
14
votes
Accepted
Efficient way to calculate "vision cones" on 2D tile map?
Yay I found a research paper!
In terms of computational cost Shadow Mapping seems pretty clear winner.
Algorithm used can be found here and a C# implementation can be found here, relevant bit below.
...
14
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 ...
13
votes
Accepted
LibGDX keep camera within bounds of TiledMap
Alright, so you're working with two rectangles here. A larger static one (the map) and a smaller moving one (the camera) inside of it. What you want is to not let the bounds of the smaller rectangle ...
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
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 ...
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
Adapting tilemap algorithm to support isometric tilemap
You don't need to change the parser, just the renderer.
The tiles will be at the 'same' place, except the projection is different.
The good news is that the good context 2d can do isometric just by ...
8
votes
Accepted
AI, Pathfinding - Searching Behavior
Complete vs. incomplete information
What you are looking to do is path finding without complete information. The conceptually sound way to do this would require you to keep track of all of your non-...
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
LibGDX keep camera within bounds of TiledMap
You can easily clamp the camera position to the map boundaries like this:
...
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 ...
7
votes
Accepted
Drawing and scrolling very large zoomed tilemaps
Here are a few strategies you could try:
Precalculate scaled-down versions of your tiles. When you use the full-scale tiles as source and let your engine scale them down everytime it draws them, it ...
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
tilemap × 692tiles × 150
unity × 141
2d × 128
java × 84
c# × 56
libgdx × 55
collision-detection × 51
maps × 51
isometric × 51
javascript × 40
procedural-generation × 40
xna × 34
tiled × 31
algorithm × 28
opengl × 24
c++ × 23
sprites × 22
grid × 22
rendering × 21
path-finding × 21
performance × 16
rpg × 15
mathematics × 14
godot × 14