2
votes
2answers
120 views

AI and shapes in 2D Grid

I'm working on a grid- and turn-based strategy rpg. My problem is concerning finding best position for my AI to use a skill. But lets start at the beginning. My plan is to make each skill an action ...
5
votes
5answers
1k views

Technical differences between square and hexagon for a grid?

I'm developing a 2D city-building game and trying to decide on the type of grid. There will be vehicles, so the unit movement is important too. I know there are visual differences for using Squares ...
0
votes
3answers
214 views

Line of sight on a 2d grid

I've been looking for similar questions here and on google, but none have worked for me yet. I have a game, where I have a 2d array of square tiles (they're objects with accessible x and y pixel ...
1
vote
1answer
108 views

What's a clean way to find (up to) 3x3 squares within a 6x6 grid?

I have a 6x6 grid where every cell have a color property (simply integer value). Player can change one cell at a time to form rectangles of the same color inside of the grid. New rectangles can only ...
6
votes
3answers
264 views

How can I calculate “All squares within R” in a natural looking manner?

I'm working with a square grid, and I have a couple of effects that target all squares within R; in other words, a circular (or spherical) effect. But, circles being, well, circular, and squares ...
3
votes
3answers
171 views

Using uniform grids for collision detection - Efficient way to keep track of what a cell contains

I was looking for an efficient way to implement collision detection in a 2D game. A way that won't result in an O(n^2) level of complexity. A lot of people recommend to use Uniform Grids for this ...
7
votes
1answer
228 views

Square Grid Polygonal Terrain Query algorithm?

I have a square, fixed-grid terrain with one terrain type per grid unit in my game, and I want to do an arbitrary polygonal terrain query which returns all of the grid units enclosed/intersected by ...
-1
votes
1answer
159 views

Grid based Collision Detection between circles [duplicate]

I am working on a 2d arcade game where I have 5 types of circles with different sizes: The ship, the missiles, and 3 types of monsters. This is what it looks like: Currently I'm using brute force ...
0
votes
1answer
282 views

How to implement uniform grids

Up until now, I implemented all-against-all collision detection in my games. It worked fine. But I reached a point where implementing this kind of collision detection, makes the game run poorly, ...
0
votes
1answer
135 views

What size textures do I need for a 2D grid based game if my tiles are larger than textures I have?

I'm building a grid-based game for iPad, and for usability purposes I've selected my game grid to be built of 75x75 squares. However, so far I've seen that the majority of (free)texture catalogs I can ...
1
vote
1answer
393 views

Grid-Based 2D Lighting Problems

I am aware this question has been asked before, but unfortunately I am new to the language, so the complicated explanations I've found do not help me in the least. I need a lighting engine for my ...
9
votes
2answers
301 views

Falling Blocks and complex shapes

I currently have a simple Tetris-like game and have come across a problem I cannot solve. Unlike Tetris where there is a single falling shape, I have multiple, potentially interlocking shapes that ...
0
votes
1answer
374 views

How can I create a tile-based game map from a large source image?

I'm trying to make a huge tile-based map for my game. I've authored a large source image of the map and saved it, but now I'm unsure how to break this up into tiles and render it as a grid so I can ...
1
vote
2answers
441 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
votes
1answer
203 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 ...
5
votes
1answer
2k 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). ...
4
votes
2answers
1k 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 ...
1
vote
1answer
639 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 ...
1
vote
1answer
365 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 ...
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 ...
3
votes
2answers
2k 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 ...
8
votes
2answers
2k views

How do I rotate a structure of hexagonal tiles on a hexagonal grid?

My 2D isometric game uses a hexagonal grid map. In reference to the image below, how do I rotate the light blue hexagon structures by 60 degrees around the pink hexagons? EDIT: Main hex is (0,0). ...
2
votes
1answer
474 views

Best way to create a 2D right-triangle grid

I would like to create a 2D right triangle grid for a game I am working on. Currently I am creating creating a 2D square grid, and each square contains 2 triangles. I am wondering, is there a way to ...