Indicates that an entity has an unobstructed view of another entity.
11
votes
1answer
1k views
Draw real time fog of war in 2d game
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, ...
1
vote
3answers
144 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 ...
2
votes
1answer
307 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
305 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
115 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 ...
0
votes
0answers
293 views
RTS-style fog of war woes
So I'm trying to make an RTS-style line of sight fog of war style engine for my grid based game. Currently I am getting a set of vertices by raycasting in 360 degree. Then I use that list of vertices ...
5
votes
2answers
206 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
389 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
251 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
1answer
665 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 ...
2
votes
1answer
339 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 ...
5
votes
3answers
924 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 ...
6
votes
4answers
698 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
582 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 ...
9
votes
4answers
897 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 ...