Skip to main content

Questions tagged [line-of-sight]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
127 views

I have a three-dimensional surface represented by a 3D grid of cells. This 3D grid of cells is in turn represented by a 3D matrix, whose entries are nonzero if a cell corresponds to a "surface ...
PerplexedDimension's user avatar
0 votes
0 answers
109 views

I am creating a 2D game in javascript using pure DOM, on my computer and on my cell phone WebGL or OpenGL do not work. How can I create Lights and shadows effects using Line Of Sight, for example, I ...
Haruki Hotarou's user avatar
1 vote
2 answers
1k views

I've tried Bresenham line and Raycasting, but they don't quite give the results I need (examples in the screenshot). '&' - character '+' - cells that can be attacked by the character '#' - walls ...
Clyeh's user avatar
  • 13
2 votes
2 answers
242 views

I'm trying to implement collision detection with raycasting for my 2D javascript game. The game uses equally-sized tiles as its level structure so to optimize collision detecton I'm trying to use a ...
Siggy7786's user avatar
4 votes
1 answer
2k views

I need to check whether a cell in a 2D grid is visible to the starting cell. I'm currently using amit's supercover line algorithm, this one https://www.redblobgames.com/grids/line-drawing.html#...
Ainsley Harriott's user avatar
0 votes
0 answers
206 views

I've made a very simple 2D top down prototype with Unity. Now I want to expand the thing and add a feature where objects change when the player looks at them. So I have to add a visibility polygon ...
Gener4tor's user avatar
  • 176
23 votes
4 answers
10k views

I'm making an FPS game where, even when a target's whole body is behind a wall or box, but its finger or foot exposed, the AI should be able to detect it and shoot its finger. So far the way I've ...
BrucePai's user avatar
  • 347
0 votes
1 answer
291 views

I'm interested in knowing the techniques on how 2D games hide tiles that are behind walls. This is a really old MMO that is probably the easiest example to show what I'm asking. Here you can see all ...
Manshoe's user avatar
2 votes
1 answer
3k views

I'm embarrassed I can't find this, but I'm wanting to detect intersection with a 3D line segment (not an infinite ray) with a 3D AABB, the AABB being defined as two Vec3f's which represent the Min and ...
ps48's user avatar
  • 69
1 vote
2 answers
1k views

I'm making an enemy object where the enemy look for the player when he's going on a patrol I want the vision cone to changes direction corresponding to the sprite.When the sprite turn right,the cone ...
TankRocket's user avatar
0 votes
1 answer
60 views

TLDR; I just learned this problem can be simplified to: How to determine the time at which a uniformly moving point will intersect with a stationary triangle? Also, how to figure out the time when ...
Coco DaWhiteBerry's user avatar
0 votes
1 answer
186 views

For a gameserver/backend, I have a navmesh for "walkable" areas in form of points/triangles. Now I want to check every gametick if the client is still in a legit place and if he shots/casts a spell, ...
thetemplar's user avatar
0 votes
2 answers
204 views

Two players (p1 and p2) are standing in a 3D space, represented by points (x1, y1, z1) and (x2, y2, z2). Player 2 is holding a light source, pointing in the direction given by a normalised vector (xn, ...
rranjik's user avatar
  • 103
0 votes
1 answer
2k views

I'm creating line-of-sight code in Unity. It allows a radar to check whether it can see an object, or whether the object is behind an obstacle (a collider). Similarly to Unity's suggestion, I check ...
Denis G. Labrecque's user avatar
2 votes
2 answers
995 views

I am searching for your advice. I have a massive voxelized model, like the one in the picture (but with a few million voxels more..). To reduce the total number of the model’s triangulations, I can ...
Gouz's user avatar
  • 121
2 votes
2 answers
569 views

D&D 4th Edition (the tabletop game) has combat on a 2D map with square tiles. A creature occupies an entire single tile. The attacker has clear sight on the defender if lines can be drawn from ...
user41258's user avatar
  • 131
3 votes
2 answers
4k views

I've a 3D-game using perspective view, through raycasting, I create a mesh that represents the line of sight of my characters. I'm looking for a way to "darken" (think old-school Fog of War - ...
ag4w's user avatar
  • 101
2 votes
1 answer
165 views

I was thinking about creating a polygonal area, for a given unit, in which it can move with a given range (radius) but with care for obstacles. Here is a picture to visualize my idea: My Ideas so far....
LuaNoob's user avatar
  • 161
0 votes
1 answer
191 views

I have a large grid with hundreds of individual agents, each of which is moving around based on its own visual inputs and a fast control algorithm. My question is: How can I efficiently provide each ...
Charles Ofria's user avatar
2 votes
3 answers
226 views

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 ...
hunterex's user avatar
  • 141
3 votes
0 answers
940 views

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 ...
Someguynamedpie's user avatar
4 votes
1 answer
1k views

I have a game grid and I need to figure out which game grid points are not behind occupied grid point from players view. The visible points. I'd like to define a visible point first, because it can ...
Tomáš Zato's user avatar
3 votes
2 answers
339 views

I have a 2D grid, around 20x20, stored as an array. Each grid cell can contain an opaque object or not. I also already have an algorithm to calculate LOS between any two squares via Bresenham. I want ...
Mark Green's user avatar
3 votes
3 answers
956 views

Here I am not talking about how to render fog of war, but how to model exploring of terrain in a more sophisticated way. In a straight-forward approach, terrain explored by a game unit is simply ...
shikui's user avatar
  • 31
6 votes
1 answer
2k views

I've been searching for information on implementing line-of-sight in my game. I've found some great resources for 2D implementations that produce pixel-perfect results, but there's very little info on ...
manabreak's user avatar
  • 1,078
4 votes
3 answers
12k views

I want to check if a GameObject is visible to the camera. The renderer.isVisible-method only checks if the camera is turned ...
Bitcoin M's user avatar
  • 143
0 votes
1 answer
993 views

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 block,...
user2499946's user avatar
7 votes
3 answers
1k views

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 because ...
Darq's user avatar
  • 173
58 votes
7 answers
10k views

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 ...
Mr. Smith's user avatar
  • 813
3 votes
1 answer
564 views

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 pixels/...
MxLDevs's user avatar
  • 143
2 votes
2 answers
385 views

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 ...
OpenAI goto hell's user avatar
4 votes
2 answers
1k views

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 ...
Jakub M.'s user avatar
  • 191
3 votes
1 answer
466 views

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 ...
nihohit's user avatar
  • 595
5 votes
1 answer
1k views

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 ...
MLProgrammer-CiM's user avatar
10 votes
2 answers
1k views

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 ...
Ash Blue's user avatar
  • 254
1 vote
1 answer
507 views

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 ...
Ash Blue's user avatar
  • 254
1 vote
3 answers
433 views

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 or ...
Vinny's user avatar
  • 56
10 votes
2 answers
14k views

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). It'...
CodeMoose's user avatar
  • 537
11 votes
2 answers
21k views

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 ...
CodeMoose's user avatar
  • 537
6 votes
3 answers
4k views

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 ...
Noob Game Developer's user avatar
6 votes
2 answers
1k views

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 ...
David Gouveia's user avatar
0 votes
2 answers
3k views

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 ...
Sudo Bash's user avatar
  • 103
2 votes
1 answer
814 views

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 ...
Joel's user avatar
  • 123
2 votes
2 answers
2k views

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 ...
bionicOnion's user avatar
4 votes
1 answer
816 views

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: ...
bifflechips's user avatar
7 votes
4 answers
3k views

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. ...
user940982's user avatar
6 votes
1 answer
1k views

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 ...
Michiel Standaert's user avatar
12 votes
1 answer
3k views

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, changed ...
user avatar
5 votes
3 answers
3k views

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 ...
Sylario's user avatar
  • 263