Indicates that an entity has an unobstructed view of another entity.

learn more… | top users | synonyms

2
votes
3answers
137 views

How do I check whether a camera has unobstructed view of a GameObject?

I want to check if a GameObject is visible to the camera. The renderer.isVisible-method only checks if the camera is turned towards the object, not if there is anything between them (like a wall). ...
0
votes
1answer
151 views

Line of Sight with Bresenham

I have a simple function to determine whether an entity can see another, in a top-down tile-based game (this is actually a tiny bit more complex in my game, to determine whether to see the first ...
5
votes
2answers
120 views

Inconsistent movement / line-of-sight around obstacles on a hexagonal grid

In a roguelike game I've been working on, one of my core design goals has been to allow the player to "Play the game, not the grid." In essence, I want the player's positioning to be tactical, ...
51
votes
7answers
6k views

Can I prevent diagonal movement from exploring more of the map?

In a tile-grid where movement in any of 8 directions takes exactly the same amount of turns (chess-board style rules), can I prevent diagonal movement from showing more new tiles than orthogonal ...
3
votes
1answer
166 views

Determining whether an object is in field of view considering obstacles

I'm thinking of stealth games where an object has a certain field of view that you want to avoid otherwise game over. The field of view may be linear or circular or any arbitrary group of ...
2
votes
2answers
115 views

Calculation: Is a sphere/square/plane visible from a certain point?

I'm searching for a way to detect if a form (shape can be changed if algorithm requires it) is visible from a single point in a 3D tile-based world. This should be used as some kind of wall-hack ...
4
votes
2answers
430 views

MMO, server-side line of sight

I am working on a simple tile-based multiplayer game. I am rather experienced programmer, but not so experienced game developer. The players will see each other depending if there is a blocking ...
3
votes
1answer
348 views

Effecient finding of long-range spotting targets

I'm creating a top-down 2d strategy game, with a square grid map. So far, I've used Bresenham's line drawing algorithm in a circle to determine what's in LOS of each unit, and then targedt one of the ...
1
vote
1answer
170 views

Line draw on “even-q” vertical flat topped hex grid

I'm trying to implement a Line Draw or Line of Sight algorithm for my hex boardgame. Upon reading several different solutions from most common places like the Hex Bible none of the algorithms adapted ...
8
votes
2answers
403 views

Diagonal line of sight with two corners

Right now I'm using Bresenham's line algorithm for line of sight. The problem is I've found an edge case where players can look through walls. Occurs when the player looks between two corners of a ...
1
vote
0answers
121 views

Best way to create line-of-sight occlusion in no-tiled game? [closed]

Suppose I want to create a 2D game where the player can freely move in a map with walls (including diagonal ones). I don't know the best way to create a game like this but I suppose using tiles is not ...
1
vote
1answer
197 views

Quick 3D sight calculation algorithm

I have a tile based board game where units move in 3D space on a 2D isometric view. When calculating attack tiles for a unit, how do I verify that they aren't shooting through a wall or a level too ...
1
vote
3answers
185 views

Geometry problem for area of sight

My player have a line of sight and all objects between the white lines, turns red. To compute this, the following conditions are met: if the angle between the yellow line and the red line are small ...
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
2k 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
340 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 ...
6
votes
2answers
380 views

Robust line of sight test on the inside of a polygon with tolerance

Foreword This is a followup to this question and the main problem I'm trying to solve. My current solution is an hack which involves inflating the polygon, and doing most calculations on the inflated ...
0
votes
2answers
859 views

Detecting if line crosses rectangle in python. Need speed boost

I am currently writing a top down man vs robot shooter. The game works now, but if I have a decent sized level it runs slowly when you are being chased by robots. While just roaming around it can go ...
2
votes
1answer
366 views

Most efficient way to implement walls and shadows in 2d

I am making a 2d top-down programming game similar to robocode. There will be up to 1000 walls (lines) in the arena, and up to 50 robots. Each robot can see in a 90 degree arc, and cannot see through ...
2
votes
2answers
1k views

XNA 2D line-of-sight check

I'm working on a top-down shooter in XNA, and I need to implement line-of-sight checking. I've come up with a solution that seems to work, but I get the nagging feeling that it won't be efficient ...
3
votes
1answer
433 views

How to calculate FOV with four-walled tiles?

I'm working on a 2D tile-based game. I'm trying to calculate FOV and I've implemented walls so they don't take up an entire tile. Instead, they just take up a side of each tile. Similar to: class ...
7
votes
4answers
1k views

Efficient 2d Java Line of Sight for a lot of entities?

My problem today is this: I have many civilians going around, they are classes stored by an arraylist. The idea is when they see another civilian panic, they'll start to panic and it will spread. ...
5
votes
1answer
877 views

How to implement line of sight restriction in actionscript?

I have a problem with a game i am programming. I am making some sort of security game and i would like to have some visual line of sight. The problem is that i can't restrict my line of sight so my ...
11
votes
1answer
2k views

Draw real time fog of war in 2d game [duplicate]

I have game situation as shown in picture: Red dot: player Brown dot: obstacle ( rock, tree, etc) Grey: non visible area ( under fog of war) My question is: how can I draw that kind of shape, ...
5
votes
3answers
2k views

Make my NPC “see” gameobjects around him in Unity

I have a walking NPC that will "see" the wall in front or behind him (2d gameplay) and that will react accordingly. I was thinking to attach him to an invisible collider that would react to objects ...
9
votes
4answers
1k views

Finding unoccluded tiles in tile-based game

I am working on a 2D tile-based game, and right now I'm trying to get a 2d equivalent of shadow volumes to work. I'm having trouble finding the surfaces that should cast shadows. From any point in the ...