# Tagged Questions

A regular tessellation of a surface to create uniform, contiguous cells arranged in a consistent pattern.

22 views

### Advice on mapping tiles to a height map/3D world

I've been attempting to think of a way to map tiles to a height map. Where a grid can be either layered or integrated into the world data. However, since I am not using voxels I could use some advice ...
25 views

### Optimize field of vision algorithm in a grid tiled map

I am trying to implement Field of View algorithm in my game and I followed the great tutorial here : sight-and-light and here is what I got so far : As you can see it works fine for me :) And then ...
49 views

### Multilevel 2D grid graph and A*

I've coded up a little grid based dungeon game. Everything working quite nicely in a Tile[,]. The AI uses basic GOAP for tasks and A* for moving around. Tile reachability is done using a floodfill. ...
18 views

### Calculating the poly vertices based on the result of Connected Component Labeling

I am making a tile based game. And now I can find all the connected area using the Connected Component Labeling algorithm. But now the problem I am having is how to calculate the poly vertices of ...
22 views

### Concerns about using a 3D tileset grid

I'm thinking of implementing a 3D tile system for my engine, and tie it to it's world streaming system as well. As in, using it for it's terrain for an open world in an engine that theoretically can ...
48 views

### Shifting values or tiles on a 2D grid (1D array)

I recently turned my practice project into a match3-type game. The game uses a 6x10 grid, internally stored into a single array, with each item being a positive integer (0-based). I have a function ...
48 views

### How do I move a unit one grid-square-width per button press in Unity3D?

I'm learning Unity. I'm making a 2D top down Frogger-esque game. I was wondering how you would go about making the player move x pixels per button press. I have this code to move him, currently with ...
36 views

### How Can I Detect Hex Edges and Corners for Catan Map?

The following messy code implements a decent hex map, but I have no way to detect edges and corners: function blankMap(\$scenario_array){ \$hexMap = null; \$hexCss = "<style media=\"screen\" type=\"...
32 views

### AI: Turn-Based Movement with 2 actions per Unit

I am currently building a turnbased tactics game. The Board is a small (about 4*6) tiled grid. The AI plans all moves of its units, each unit can move 2 times move and attack or attack at ...
73 views

### How can I use a data grid to make an isometric turn based game in GameMaker?

I am making a Hero Quest clone. It is a turn based adventure game with an isometric view point. So far I have been able to turn a 2D map into an isometric view but I believe I need to use a data grid ...
49 views

### How do I handle objects with a width and height in grid-based pathfinding?

I'm using the Jumper library for Love2D to do grid-based pathfinding, which worked fine until I wanted to make larger enemies (with larger collision boxes). How do i do that? My initial idea was to ...
81 views

### How do I correctly shift arrays on a Tetris line clear?

I'm writing a Tetris clone in C++ and I am at the last stage, I need to delete a row when it is full. Once a piece falls it is stored in a boolean array grid[20][10]. For example I check which row is ...
51 views

### place sprites in grid pattern within an area

I have been trying to do this for a few hours in unity now but cant get my head around it. basically i have 4 points(vector3) 1 each for the 4 corners topleft, topright, bottomleft, bottomright. now i ...
35 views

### How to find grid cells not seen by an object

I am writing a VB.NET program. I have a grid view which is made of multiple small cells called grid cell. On the grid view, I have placed an obstacle (red box) and an observer (blue box). My task ...
67 views

### What is easiest way to move towards and along the edge on a hex grid?

I have a hexagonal grid with variable radius. My entity can move exacly 2 hexes per turn. How should I calculate next step towards border and afterwards travelling clockwise around map? Preferred ...
21 views

### Simplifying grid based intersection checking to not need 16 checks from each corner

I'm working on an "underground prisons and fire breathing lizards" inspired CRPG. So far I have implemented a "path drawing" method to, well, show the grid cells that would be involved if one were to ...
47 views

### storing hexagon-based (x/y) movements in a database

Im developing a hex(agon)-grid based game. The game is turn-based. Players move stuff on the map and they need to be allowed to issue movement-orders. Units move a certain amount of movement-points ...
181 views

### 2D grid based placement (limited to 1 tile in each direction) in Unity

I've been trying to get my head around this for hours now, I hope one of you is able to help. I'm trying to make a small game (2D using sprites) that allows you to place blocks (tiles). That is ...
65 views

### Determine if set of connected tiles can fit inside grid

Feel free to edit the title; I had a hard time figuring out how to explain it in a single line. Here goes. I'm trying to generate these grids automatically, and randomly. I have a grid of 25 tiles (...
86 views

### Round position to center of current grid position

The title may not make sense, nor may the question - I'll try nevertheless. I'm attempting to make a game similar to The Powder Toy. Essentially, this is a physics simulation game, where the users ...
42 views

### Detect clusters of tokens on an x y grid

Ok, so I have a two dimensional grid working on integer x and y coordinates. Each of this coordinates can have one and only one token on it. The tokens have the capability of check and return an ...
78 views

### 2d grid vision(eye sensor) for a neural network bot?

I have a 2d grid and neural network bots living above it. What is a good way to give them vision of tiles in front of them? Below I describe my idea that I don't know how to efficiently(or ...
95 views

### Laying an hexagonal 3d grid on a 2d-isometric game

I'm trying to create an hexagonal grid for my 2D game, but I got stuck when determining what exact angles/rotation for this 3d plane to have in order to fit with the current 2d isometric art. So right ...
83 views

### 3D Planetary gravity

so i am making a thing in javascript and i want to have planetary gravity in my "universe". But when i use an equation to calculate the acceleration by gravity i get one number. That is how fast the ...
107 views

### Creating placement grid in Unity

I'm fairly new to C# and Unity, so I don't really know much about it. I want to create an RTS like game where you have a huge grid that the whole world is placed on. Then you can place houses, walls ...
113 views

### How should I store a procedurally generated grid level of an infinite size?

I have a 2d grid level. It infinitely grows. If it was not of infinite size, a 2D array would be perfect, as I need to constantly have each grid talk to its neighbors. For example, with a 2D array,...
117 views

### List cells in a 2D grid that belong in a sector / portion of a circle

Are there any algorithms to find out which cells in a 2D grid lie inside/is part of a slice of a circle - a pie slice shaped region? Essentially, as per image below, I need to list out all the green ...
163 views

### Proper Line of Sight in tile based game

My rendering engine currently takes "xMin, yMin, xMax, yMax" to render a rectangular region of tiles, and will automatically scale based on the size of the panel it is rendering to. However, I am ...
135 views

### Positioning game object on a grid

I am learning how to code by programming easy, 2D games. Here I want to try to get only a map, like in strategy games (2D isometric) and put new objects (pictures) on it. In short: I want load a big ...
90 views

### Collision between complex polyominoes travelling at different velocities

My first post here if there's anything wrong please do highlight it :) First and foremost the problem I'm facing is practically identical to this earlier post here : Falling Blocks and complex shapes ...
141 views

### AI on a 2d grid in python

I'm trying to figure out how to do a simple search/chase AI. I know that I'm going to have to search around the mob entity to figure out if the player is close enough, I could probably get that done ...
170 views

### How to test for adjacency?

I need to come up with a better way to test for adjacency in a grid environment. Imagine that the blue is water, the green is land, and the red dot is a character. What I need to do is efficiently ...
116 views

### Unity: Can I use sprites for tiles to overlay a grid over a plane mesh?

I have a plane mesh in Unity. I have various other meshes on this plane (props) with tags that denote the areas under these props are unwalkable. I raycast, project and generate a grid on this plane ...
124 views

### how to avoid circular references between objects and map

I've been working on a turn based tactics game on a grid. I've been trying to figure out how to store and relate the grid and the objects on it. Essentially, my question boils down to how to ask ...
60 views

### need a pathfinding algorithm from 1 column to another

grid contains weights and I need a max path sum from one column to another possible movement directions are (right, up & down only). Can Djikstra or A* help ??
447 views

### Best way to handle cornering in a 2D maze game?

I want to implement smooth cornering in a grid, much like Pacman moving in his maze. A big difference with Pacman, my characters can stop- thus the player has to keep pressing the controls to keep ...
243 views

### Path finding in 2D grid for objects that can rotate and bigger than one tile (Tetris)

I'm trying to check if there is a path between two locations in a Tetris board. On this question it tells how to account for different shapes: Path finding in grid for objects that occupy more than ...
78 views

### Grid board fill with special cells - predicting movement

I have to create an algorithm which will fill a board, which is made of square cells, with elements. Board can have different sizes and it doesn't have to be a square. Elements fall from top to bottom....
91 views

### Finding the “Important” nodes of a grid path

On a Navmesh Grid, all nodes are essentially vertices or turn-points so the returned path is efficient in that it only involves points where an entity must change its direction. A grid path, however, ...
33 views

### Analyzing movement data for a checkerboard

For a psychology experiment - subject has to learn that the 2D grid is a checkerboard, and collect all the 1s (rewards). How do I test if subjects are actually doing it in the most optimal way -- ...
69 views

### Calculate land center on grid

I have a grid based game. The main map is 2d array with land ids, something like this (here are 2 lands on the map, one formed where the 1's are and one formed by where the 2's are): [ 1 , 2 , 2 ] [ ...
141 views

### Is there such thing as a hybrid View that combines SurfaceView and GridView in Android?

I am trying to develop several Android games that work on a grid system. I will need to update the game surface frequently, so using a GridLayout does not seem to be a good option. The frequent ...
3k views

### How to render infinite universe?

I'm curious what are the best practices in game development industry to render 3d universe? To be more specific: The data points are given and static. Each point has position, color and size; The ...
160 views

### Increment grid by rotation

I'm currently working on a grid for snapping objects side by side. My current script is working fine, but only for game objects which haven't been rotated. Here is an example video of the problem: ...
195 views

### Map building grid to planet

I'm trying to build a space game and one of the key parts is building on spherical planet. I want the buildings to be build on a grid (some building are 1x1, some 6x4,..., kinda like StarCraft). My ...
1k views

### How to detect collision of a wall with grid movement?

I have this little game, where my player is moving around a simple level, using a grid based movement script (See code below). My problem is that I have tried to implement a 2D raycast, which has to ...
249 views

### Finding flexible patterns in a 2D grid

I'm stumped trying to create a matching algorithm for my game. I have a 2D grid like this for example: 0, 0, 0, 0, 0, 0 0, 1, 2, 2, 1, 0 0, 1, 1, 0, 0, 0 0, 0, 2, 0, 1, 0 0, 0, 0, 2, 1, 0 0, 0, ...
90 views

### Grab all tiles within a radius?

I'm working on a 2D tile based game. I want NPC's to be able to destroy tiles, and ideally I would have a function, which takes a central x,y and then based upon a circular area from that point (...