Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / 2D maths problem, any formular for a cone/triangle shape on a grid?

Author
Message
PowerFang
22
Years of Service
User Offline
Joined: 6th Feb 2004
Location: Australia (But currently in the USA)
Posted: 17th Sep 2004 15:50 Edited at: 17th Sep 2004 16:07
I'm looking into incorperating vision into my bots i am programming and was wondering if there was a nice way to search (i.e. as if they are looking a certain direction) in a cone shape? e.g.:

Player = X
Grid squares that are Visible = 1


00001
00011
00111
01111
X1111
01111
00111
00011
00001

Really need a way to put this into a formula/loop. If possible it needs to check from the person to the point so that if a wall is in the way, the squares behind the wall dont get checked.

It needs to also accept how long the vision is so that it can do it for players with different vision numbers.

Any help appretiated......
PowerFang
22
Years of Service
User Offline
Joined: 6th Feb 2004
Location: Australia (But currently in the USA)
Posted: 17th Sep 2004 16:06 Edited at: 17th Sep 2004 16:08

seems i just needed some food in the belly and to get my mind off the problem for a while

Login to post a reply

Server time is: 2026-06-11 23:20:17
Your offset time is: 2026-06-11 23:20:17