The grid tag has no wiki summary.
0
votes
2answers
38 views
Converting hexagon grid coordinate system
As I have been building on a RTS game based on hexagon grid built in javascript. I stumbled across a problem regarding the coordinate system. Have been trying to implement a A-star system to find ...
1
vote
2answers
102 views
Algorithm for exploring/filling grid map
I'm working on a small game that takes place on a grid map. I'd like to write an AI that is able to explore the grid map by filling as much of its available space as possible.
From any given position ...
-1
votes
1answer
60 views
Refering to an object from an array in Java [closed]
In my game, the whole thing is based off of grids. So the map is a dual dimensional array of 32 (32 x 32 grid map). Now what I want to be able to do is to grab a grid and be able to access it and ...
14
votes
2answers
820 views
Why Hex Maps instead Octagon Maps?
I understand the advantage of Hex Maps over Square Grids. But I get a question: Why aren't used Octagons maps instead? At least (I think) will be easier cross (+) movement (up,down,left,right) and xis ...
3
votes
2answers
170 views
Grids and vertices
I have no idea what this is even called or even to start searching how to solve this problem. So figured I would post here for any information at all. Specially looking for already known solutions to ...
0
votes
1answer
73 views
How do I make an entity move once per second in crafty.js
I am trying to implement "Snake" using crafty.js but I can't seem to get the snake entity to move just once in a second. How do I do this?
8
votes
1answer
113 views
Flowfield density conversion
I'm trying to implement flowfield navigation, as described in http://grail.cs.washington.edu/projects/crowd-flows/
but I can't understand how the Density Function in Figure 4 of the paper is supposed ...
1
vote
1answer
95 views
Travelling in a 2D grid
I have a 2D grid (x,y coordinates) where each cell corresponds to each pixel of the interface that I am working with and I have a point A(x1,y1). Now I need to travel around in the grid, and I wont ...
12
votes
1answer
337 views
Get ring of tiles in hexagon grid
Thanks to this post I'm able to collect adjacent tiles to a given tile.
But I'm pretty much stuck on an algorithm that gives me only a "ring" of tiles specified by an offset. The algorithm given in ...
0
votes
1answer
152 views
How to attach a sprite to a TMXTiledMap at a particular coordinate, in AndEngine?
I am trying to add a sprite at a "grid" location on the tiled map. The TMX tiled Map is like a grid, and you can access the size of the grid by calling mTMXtiledMap.getTileRows() and ...
3
votes
1answer
185 views
Fluid Particle Grid
So recently I have been looking at some fluid simulation techniques, specifically Smoothed Particle Hydrodynamics. One of the key components is a grid to avoid O(n^2) searches. I have been having some ...
13
votes
2answers
267 views
Territory patrol planning
I am developing a game/simulation where agents are fighting for land. I have the situation shown in the picture below:
These creatures are walking around and occupying pieces of land they step on ...
-2
votes
1answer
116 views
In a regular grid, how can I tell which tile a position is in?
I have a position on the screen, how do I calculate which grid tile that position is inside?
I know the number of tiles in the grid, and the size of the screen (including how many tiles fit on it ...
2
votes
1answer
302 views
More efficient way to implement Line of sight on a 2d grid with ray casting?
Consider a 2d grid of tiles, and an approximated sphere of coordinates - centered on the player - that represents line of sight. The goal is to block the line of sight beyond obstacles (ie walls).
...
3
votes
2answers
298 views
Simulating “line of sight” with obstacles on 2d grid?
Ran into an interesting problem. I need to figure out how to simulate line of sight - simple enough, just on a 2d grid with obstacles. Either a grid cell is visible, or it's not.
I can get something ...
5
votes
1answer
113 views
Finding cells between two points (along line) to finding obstacles
My game is in 3D environment partitioned with 2D grids in 2 dimensioned array
So I can get any cell/node by passing row and col like return _nodes[r][c].
When the an attacker attacks an enemy with ...
3
votes
2answers
269 views
AI remembering obstacles without a grid
For some research purpose I've build a small tanks game where you have 1 tank controlled by a player and one or more NPC tanks.
Now I want these NPC tanks to navigate through a field which they have ...
1
vote
4answers
681 views
How do I create a 2D tile map?
I'm new to game development and I want to try it out, like many others amongst us :)
I need to create a gridmap. The map needs to be divided in squares. Each square represents a location. For ...
6
votes
4answers
434 views
Generating triangles from a square grid
I have a 2D square grid of values representing terrain elevations, and I want to generate triangles from that grid to make a 3D view of the terrain. My first thought was to split each square ...
0
votes
1answer
162 views
Alternatives to NSMutableArray for storing 2D grid - iOS Cocos2d
I'm creating a grid-based iOS game using Cocos2d. Currently the grid is stored in an NSMutableArray that contains other NSMutableArrays (the latter are rows in the grid). This works ok and performance ...
3
votes
3answers
152 views
How to choose cell to put entity in in an uniform grid used for broad phase collision detection?
I'm trying to implement the broad phase of my collision detection algorithm. My game is an arcade game with lot of moving entities in an open space with relatively equivalent sizes.
Regarding the ...
1
vote
4answers
137 views
Logic that can traverse all possible layouts, but not checking every combination of identical pieces?
Suppose we have a grid of arbitrary size, which is filled by blocks of various widths and heights. There are many 2x2 blocks (meaning they take a total of 4 cells in the grid) and many 3x3 blocks, as ...
7
votes
3answers
597 views
Storing a Hex Grid
I've been creating a small hex grid framework for Unity3D and have come to the following dilemma. This is my coordinate system (taken from here):
It all works pretty nicely except for the fact I ...
10
votes
2answers
368 views
Finding shapes in 2D Array, then optimising
I've just been allowed an image...The image below from my game shows some darkened blocks, which have been recognised as being part of a "T" shape. As can be seen, the code has darkened the blocks ...
1
vote
1answer
196 views
Creating an interactive grid for a puzzle game
I am trying to make a slitherlink game, and am not too sure how to approach creating the game, more specifically the grid structure on which the puzzle will be played on.
This is what a empty and ...
2
votes
1answer
132 views
Should I take line thickness into consideration for a grid based light game?
I'm currently rewriting some horrific code I wrote for a prototype and have stumbled right at the start! The game I'm working on revolves around directing light and there is a small ambiguity in ...
1
vote
1answer
811 views
Efficient algorithm for match-3 block detection and clearing?
So I'm making a game with elements of a match-3 puzzler (e.g. Columns, Bejeweled, Tetris Attack). However, I don't know where to begin in terms of creating an algorithm that lets me detect matches ...
1
vote
2answers
623 views
How can I make a tile appear on top of another without completely blocking the tile below?
Making a small RPG with libdgx just for learning about how to draw tiled maps and move around in them. I've got the tiles drawn and OrthographicCamera stuff figured out so I can see my world. My ...
1
vote
2answers
207 views
Get position of tile in tileset
Take this image: http://ScrnSht.com/nkvusq
How can i get the position of tile 14 (or any other) when only knowing the following:
Tile ID: 14
Rows: 4
Columns: 7
The end result should be 2x4.
1
vote
1answer
335 views
How can I snap a game object's position to a grid?
I'm making a game that involves "falling block" gameplay elements. The problem is, I'm not quite sure how to make it so that the blocks will snap to some kind of grid, in other words, I'm not sure how ...
5
votes
2answers
996 views
3D terrain map with Hexagon Grids
I'm working on a hobby project (I'm a web/backend developer by day) and I want to create a 3D Tile (terrain) engine. I'm using XNA, but I can use MonoGame, OpenGL, or straight DirectX, so the answer ...
2
votes
1answer
216 views
Space Invaders-type game: Keeping the enemies aligned with each other as they turn around?
OK, so here's the lowdown of the problem I'm trying to solve.
I'm developing a game in PyGame that's a cross between Space Invaders and Columns. I'm trying to make the motion of the enemies similar ...
1
vote
1answer
503 views
Drawing 2D Grid in 3D View - Need help with method
I'm trying to draw a simple 2D grid for an editor, to able to navigate more clearly around the 3D space, but I can't render it:
Grid2D class, creates a grid of a certain size at a location and should ...
2
votes
1answer
233 views
Detect if square in grid is within a diamond shape
So I have a game in which basically everything is a square inside a big grid. It's easy to check if a square is inside a box whose center is another square:
*** x
*o* --> x is not in o's ...
3
votes
3answers
449 views
Keeping player aligned to grid in Pacman
I am making a Pacman game using XNA. The game is tile based, with each tile being 32 pixels. As the player moves, I need to know whenever it is perfectly on a tile (ie position of 32, 64, etc...) so ...
4
votes
3answers
1k 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 ...
2
votes
2answers
289 views
Detecting Units on a Grid
I am making a little turn based strategy game in pygame, that uses a grid system as the main map to hold all the characters and the map layout. (Similar to Fire Emblem, or Advance Wars)
I am trying ...
0
votes
2answers
623 views
OpenGL align grid like glOrtho but with gluPerspective?
Using gluPerspective makes OpenGL's grid really messy and rather hard to use especially when trying to do mouse input. The grid that perspective uses is completely messed up compared to the grid you ...
2
votes
1answer
660 views
Help with a Fast 2D Grid-Based world rendering technique
First I'm going to give you my current situation and explain what I'm attempting. I will then pose my question below. I will attempt to include a "TL;DR" for those of you who prefer things to be ...
1
vote
1answer
652 views
Displaying a grid based map using C++ and sdl
I am trying to create a roguelike game using c++ and SDL. However, I am having trouble getting it to display the map, which is represented by a 2d array of a tile class.
Currently, my code is this:
...
1
vote
1answer
1k views
Any way to set up a grid for a board game in cocos 2d?
My first idea was to create a 2d array for my columns and rows, but it seems like there should be a better, or possibly cleaner, way to achieve this. Each square on the grid is going to have a ...
4
votes
3answers
310 views
Creating the nodes for path finding during run time - more like path making and more
I'm making my 1st game. I'm using javascript as I currently want to learn to make games without needing to learn another language but this is more of a general game dev question.
It's a 2d turn-based ...
1
vote
1answer
317 views
Getting fastest path on a grid
How would I go about finding the fastest path to connect two points on a grid? I'm making a 2D game and the map is based around a grid.
I need to be able to account for any blocked tiles that the ...
1
vote
2answers
653 views
Reference a single 2d Rectangle in an array
What I am attempting to do probably has a very simple answer but I can't make heads or tails of it no matter how hard I try. Provided I'm a newb.
What I am trying to do is after I create a grid of ...
4
votes
2answers
1k views
Grid/cell based light system
I am working on a top-down, 2d cell-based RPG game. I would like to implement a cell based lighting system, something like this and this.
I basically have several light sources and light deteriorates ...
0
votes
1answer
1k views
Basic A star implementation tutorial [duplicate]
Possible Duplicate:
Pseudo-code examples of A*?
Hey guys Iam making a TD game and now I am stucked in implementing A star algo. I know there are many 3d party softwares but they are ...
3
votes
2answers
738 views
How can I make grid tiles/plane transparent
I have made a grid using multiple planes. Now I want to place a image on this grid so that user cant see the grid I have made and I ll have access of all points of the image using grid.
The problem ...
1
vote
1answer
5k views
What is grid in Unity and how can I implement it?
I'm a beginner. I need to place a grid on my map in Unity and would like to access it to place a simple object on mouse click. How can I achieve this ?
I am unable to understand the grid ...
3
votes
2answers
1k views
Algorithm to fit shapes to 2D grid?
Let's say you have an n-by-m grid. Some squares are occupied, some are not.
You want to know where in the grid you can fit arbitrary shapes such as to not hit an occupied square. The shapes would ...
12
votes
2answers
5k views
Hexagonal grid/tiles tutorials
Are there any platform or language agnostic (preferably step by step) tutorials regarding creating hexagonal grid based maps/games? I'm mainly interested in grid/tiles basics and not advanced game ...
