Questions tagged [tilemap]

Tile map is a technique of re-using small graphic pieces, tiles, over and over again to shape the game field.

Filter by
Sorted by
Tagged with
65 votes
3 answers
59k views

Random map generation

I'm starting/started a 2D tilemap RPG game in Java and I want to implement random map generation. I have a list of different tiles, (dirt/sand/stone/grass/gravel etc) along with water tiles and path ...
Tom O's user avatar
  • 793
10 votes
2 answers
7k views

Choose tile based on adjacent tiles

I am working on a tiled map editor, and I need to choose tiles automatically, based on the adjacent tiles. For example, when placing a road tile, next to another road tile, the two need to be oriented ...
alekop's user avatar
  • 641
30 votes
2 answers
19k views

Algorithm for procedural 2D map with connected paths

Problem to solve: Generate a random 2D dungeon map for a tile-based game where all rooms are connected. I am looking for better solutions than what I currently have. My current solution is that I run ...
user1323245's user avatar
24 votes
3 answers
45k views

How can I create a random "world" in a tile engine?

I am designing a game that is working on a classic tile engine, but whose world is generated randomly. Are there existing games or algorithms that do this? The procedural generation algorithms I have ...
lezebulon's user avatar
  • 1,402
13 votes
2 answers
4k views

Combining Many Small Colliders into Larger Ones

I am creating a game using a tile-map made of many thousands of grid squares. At the moment, each square has a square collider on it for checking collisions. However, with many thousands of tiny ...
Craig Innes's user avatar
3 votes
1 answer
1k views

How do I convert the coordinates of a click to a tilemap position?

How do you turn a tilemap (produced by TileD) for cocos2d where I can click on individual items and get a callback? Is it just a case of converting captured touch and finding out where it is on the ...
zardon's user avatar
  • 35
19 votes
1 answer
9k views

What is the size limit to the Unity 2017.2 Tilemap?

I've been digging through the documentation on the Tilemap feature of Unity 2017.2. Does Unity limit the maximum number of tiles it will support for a particular tilemap mesh? I know that each tile ...
Stephan's user avatar
  • 1,728
13 votes
3 answers
19k views

Road / river generation on 2d grid map

This is a newbie question, but here it goes: My map is a 2d grid, and I want to generate roads and rivers. The route from the starting to ending point must not be the optimal route in number of tiles....
Markos Fragkakis's user avatar
1 vote
2 answers
597 views

Efficiently determining which buildings are connected by roads

I have a question about the most effective way to detect road connection in a tile based world. Some time ago I already asked for "How to improve performance for expensive functions in 2d city builder"...
Yheeky's user avatar
  • 305
1 vote
1 answer
2k views

finding a path from one point to another with obstacles help

Im building a tile based game and im implementing my path finding algorithm. Currently, it can find a path from point A to point B with no problems. However, if there are obstacles between point A and ...
iNFiNiTY's user avatar
30 votes
4 answers
41k views

Generating tile map

I am programming a tile based game and I have some basic tiles (grass, dirt, etc..), but I can't figure out how to make good random map generation, because when I do some really random selection, if ...
Vilda's user avatar
  • 403
6 votes
3 answers
3k views

How do I sort edge tiles for a hex grid in order to draw a border?

I am trying to sort the edge tiles of a region in my hexagon map. Once it is properly sorted, I can then try to walk through them and attempt at creating a Civ style border map, but I can't seem to ...
TyCobb's user avatar
  • 339
5 votes
2 answers
3k views

How do I resolve a collision of a rectangle with two rectangular tiles at once?

I am having some problems with collision detection between a player and the environment in a tile-based game. I have a player objects, Tiles and what I call ...
Androme's user avatar
  • 81
8 votes
3 answers
21k views

How can I convert a tilemap to a Box2D world?

I want to use Box2D physics and lighting with a .tmx map. How can I "convert" a tilemap to Box2D world? My basic idea is to go through the tiles on the map and ...
HUNeater's user avatar
8 votes
2 answers
658 views

Efficiently updating building effect radius coverage

I've already searched for answers but I was not able to figure out the best approach for handling expensive functions/calculations. In my current game (a 2d tile-based city building) the user is able ...
Yheeky's user avatar
  • 305
6 votes
1 answer
5k views

Circle-Rectangle collision in a tile map game

I am making a 2D tile map based putt-putt game. I have collision detection working between the ball and the walls of the map, although when the ball collides at the meeting point between 2 tiles I ...
furiousd's user avatar
  • 163
3 votes
2 answers
1k views

Calculating the number of tiles shown on an isometric map

I'm currently changing an existing computer game from a top-down view to an isometric view. The map consists of an infinite number of tiles. Only the tiles which are currently visible in the players ...
Chris's user avatar
  • 105
3 votes
1 answer
736 views

[2D] Finding largest possible straight lines around body

I've got a 2D-map, largely consisting of rectangular tiles, but with some none-rectangular objects mixed in as well (tilted lines on corners for example). Take this image as an example: I now need ...
TravisG's user avatar
  • 4,402
3 votes
2 answers
1k views

Making Edges of Hand-Drawn Tileset Match Up

I'm making a tile-based platformer. A friend at college is doing all my art, and so far it's beautifully hand-drawn. The problem is, I can't seem to make the edges of the tilesets match up. He ...
Caleb P's user avatar
  • 33
2 votes
1 answer
206 views

How do I calculate the position of a vehicle moving between tiles, over time?

I'm working on a small multiplayer game where players can create cities, and these cities will be placed on what's called the "world map." The world map is basically a giant coordinate plane made up ...
josh's user avatar
  • 45
2 votes
3 answers
2k views

How to make a noise gradient?

Introduction: I am working on a heat map made by Perlin Noise with the next result: (Figure 1) ...
WhiteGlove's user avatar
1 vote
2 answers
4k views

Calculate Position on Tile Map by single Index

I stumble about a Math Problem for calculating a Position on a dynamic tile-map. So i got a List of Tile Entities. Every Tile got his one unique Index Value and i have to set the parameters for Map ...
Smartis has left SO again's user avatar
1 vote
1 answer
405 views

How can I tell if a set of tiles form an enclosure?

I have this tile-based game I've been messing around with and I want to have a way to check if a set of wall tiles make an enclosed space. Here's some more details: I have a tile map. Each tile has ...
Megabytte's user avatar
1 vote
1 answer
715 views

How can i get a value from object in tmx file in Cocos2d x 3.x?

I want to set my sprite in x coordinate based on an object in TMX map file, this is my code: ...
Abdalltif Basher's user avatar
28 votes
3 answers
11k views

Random seed function for map generation?

I am looking for a function to generate a random tile-based map as the visual boundaries of the map change (by going through the map). I want the map to be infinitely large, and have maze-like ...
Mathias Lykkegaard Lorenzen's user avatar
17 votes
6 answers
9k views

Seamless tilemap rendering (borderless adjacent images)

I have a 2D game engine that draws tilemaps by drawing tiles from a tileset image. Because by default OpenGL can only wrap the entire texture (GL_REPEAT), and not ...
AshleysBrain's user avatar
16 votes
3 answers
11k views

Elegant autotiling

I'm looking for information about how people implement autotiling in their tile-based games. So far I have always improvised it with a bunch of hardcoded "if ... else ..." statements, and now I ...
Radomir Dopieralski's user avatar
10 votes
2 answers
11k views

Tile map/terrain implementation with differing heights of neighbouring tiles

Ahoy! I'm looking for some information about tile maps, or rather, what a specific type of tile map is called. I'm interested in the kind of implementation used in rollercoaster tycoon, or the ...
Zack Brown's user avatar
  • 1,459
9 votes
2 answers
2k views

Is there a name for this technique to put the tiles on the corner of a level?

A very common approach in development of old games is to put the tile set on the corner of a level, to use it as a reference. For example: On this level, the developers put a set of tiles in the ...
Macabeus's user avatar
  • 193
9 votes
4 answers
9k views

LibGDX keep camera within bounds of TiledMap

I have a simple TiledMap which I can render fine. I have a player hopping (with Box2D) around and my camera follows the player around: ...
Ariejan's user avatar
  • 360
8 votes
5 answers
21k views

Unity procedural TileMap generation without creating gameobject per tile

I've been searching internet to find an efficient way to create a procedural tilemap without creating a GameObject per tile. All the TileMap tutorials I've found are creating tiles by creating ...
OldBerkay's user avatar
  • 173
8 votes
2 answers
19k views

Player gets stuck on edges between TilemapCollider2D tiles

I'm currently working on a simple 2D Physics-Based Platformer Project. However, I ran into the following issue: I'm using a Tilemap and a TilemapCollider2D to display the world. When I move the player ...
BloodEchelon's user avatar
6 votes
4 answers
17k views

Effecient tilemap rendering

I have done mostly tile based games, but never really bothered with optimization. I always just rendered all the tiles that convered the viewport. I am currently working on platformer for a mobile ...
omgnoseat's user avatar
  • 1,164
5 votes
1 answer
4k views

Adapting tilemap algorithm to support isometric tilemap

I'm using Phaser to build an isometric game. The framework doesn't have support for isometric tilemaps yet, so I'm starting to write a PR for it to support. What I currently have, loading an ...
Daniel Ribeiro's user avatar
5 votes
1 answer
1k views

generate box2d bodies from isometric tiled map

I followed the tutorial here to generate box2d bodies from a tiled map and that worked fine.... for orthogonal tiled maps. Unfortunately isometric maps use their own coordinate system where (0, 0) is ...
Vincent Williams's user avatar
4 votes
1 answer
1k views

Create a seemless grid-based polygonal tileset

The aesthetics I am going for is demonstrated by many simulation games such as Simcity. But I am looking at this particular example: Polygonal Planet Project by Oskar Stålberg. I understand the ...
bitinn's user avatar
  • 161
4 votes
5 answers
6k views

How can I deal with tilemap position in the editor?

Right now it is quite hard in Unity 2017.2 to track where is the (0, 0) coordinate in the tilemap editor, when painting. I tend to use a displayable dummy game ...
Luis Masuelli's user avatar
3 votes
2 answers
2k views

Checking if an object is inside bounds of an isometric chunk

How would I check if an object is inside the bounds of an isometric chunk? for example I have a player and I want to check if its inside the bounds of this isometric chunk. I draw the isometric chunk'...
Amit Assaraf's user avatar
3 votes
1 answer
793 views

In Slick2D, how can I generate a 2D platformer map from an image?

I'm fairly new to game development. I've been messing around with Slick2D. My map consists of rectangular objects. I want to use an image to represent my map, similar to this: How could I generate a ...
Jon's user avatar
  • 31
2 votes
1 answer
109 views

Array of map data renders the map the opposite way

A while ago by following some tutorials I made a game map array consisting of 0, 1 and 2. I program it the way I want to see it: ...
Limpuls's user avatar
  • 189
2 votes
1 answer
957 views

Basic Random Tile Map Generation

Currently I've got a map like this: It's pretty simple but what I want is that area of tiles to be random, with the number of tiles present being random (Within a minimum and maximum amount of tiles ...
codelyoko373's user avatar
2 votes
1 answer
732 views

How to load a separate map from a text file?

I have a text file that I am using for my map for the tiles to be allocated. This works fine, but I am running into issues figuring out how I would go about loading in a different part of the map. ...
Jt792019's user avatar
2 votes
1 answer
1k views

Tile Palette problem in Unity

I am working on isometric tilemap in Unity 2019.4.8f1. In the Tile Palette panel, the selection is always 1 block away. Please see this screenshot: In the screenshot, apparently I selected an empty ...
Raptor's user avatar
  • 141
2 votes
2 answers
474 views

Tile map collision is not working properly

I am having problems setting collision between my sprite and the tiles. I have only done the code for colision for moving upwards but some places on the map it moves up and some places it doesn't. ...
Sigh-AniDe's user avatar
2 votes
1 answer
1k views

Rending 2D Tile World (With Player In The Middle)

What I have at the moment is a series of data structures I'm using, and I would like to render the world onto the screen (just the visible parts). I've actually already done this several times (lots ...
Mick's user avatar
  • 205
2 votes
3 answers
819 views

Error in Finding Nearest Hexagonal Tile

Using Openfl for a game using hexagonal tiles Working out the problem of walkability in a game, and I've run into an issue with my Hexagonal tiles. I think it is an odd rounding error of sorts. When ...
J. A. Streich's user avatar
2 votes
2 answers
2k views

How to calculate the direction a ball must bounce

I have a tile engine I have made. I can detect collision between the ball(the player) and the tiles. When a collision is detected all the colliding tiles are stored inside a list. My question now is, ...
Ziamor's user avatar
  • 181
2 votes
1 answer
5k views

Pygame 2D Scrolling Map

I have currently a pygame program that stores tiles in a 2d list like [[1,1,1] [1,1,1] [1,1,1]] where the 1 is a tile object. I have the character centered in ...
Ryan's user avatar
  • 145
2 votes
2 answers
335 views

Looking for an elegant way to represent fixed parts of a randomly generated level map

I'm coding from scratch a small experimental game on a medium-sized random rectangular square tile map. (Say, a map of a dungeon.) There are several types of tiles (for example: floor, wall, monster, ...
Alexander Gladysh's user avatar
2 votes
1 answer
819 views

Pixel thin lines appearing between sprites on camera move

I'm going to apologize in advance for the lack of screenshots, but this was a very hard thing to capture, but very obvious to see. I'm using LibGDX to create a tile base rogue-like. Everything is ...
tVoss42's user avatar
  • 141