Welcome to GameHourz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Directional Line of Site

 
   Game Forums (Home) -> Roguelike -> Development RSS
Next:  Medal of Honor - Pacific Assault  
Author Message
andystob

External


Since: Apr 12, 2006
Posts: 2



(Msg. 1) Posted: Wed Apr 12, 2006 2:52 am
Post subject: Directional Line of Site
Archived from groups: rec>games>roguelike>development (more info?)

Hi Guys

I'm working on a Rogue Like in my sparetime, and am implementing a
sight routine.

Rather than being able to move in all directions like most RLs, my
control system will be directional, that is the left and right arrows
are used to adjust the direction the player is facing and the fowards
key will move the player in that direction. (The only other game I have
seen this method is in The Unreal World, which is a fabulous game)

The player will only be able to see in front of him, and I envisage his
LOS will be a semicircle which moves with the player direction.
Therefore I will need to draw an arc - I understand the basics of
circle drawing using the Bresenham formula, am not able to adapt it to
draw arcs.

Can anyone help?

Cheers

Andy

 >> Stay informed about: Directional Line of Site 
Back to top
Login to vote
Gamer_2k4

External


Since: Nov 03, 2005
Posts: 312



(Msg. 2) Posted: Wed Apr 12, 2006 7:02 am
Post subject: Re: Directional Line of Site [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

It shouldn't be too hard:

//assumes createFOV is a function that creates a circle FOV in the
array mySight

createFOV();

if (facing == NORTH)
{
for (int i = sightDist; i <= 2 * sightDist; i++)
for (int j = 0; j <= 2 * sightDist; j++)
mySight[i][j] = false;
}
else if (facing == EAST)
/*
and so on and so on
*/

Obviously the arrays must start at zero, so the length of the array
would have to be 2 * sightDist. The center would be at sightDist.

-sightDist 0 sightDist //intial
0 sightDist 2 * sightDist //modified for array

Just create the circular field of view, store it to an array, and set
the part of the array you don't want to false.

Gamer_2k4
--
"Ha ha! I'll avoid the obvious pun about D-channel packet addressing!"

 >> Stay informed about: Directional Line of Site 
Back to top
Login to vote
Slash

External


Since: Dec 14, 2005
Posts: 119



(Msg. 3) Posted: Wed Apr 12, 2006 7:07 am
Post subject: Re: Directional Line of Site [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

andystob wrote:
> Hi Guys
>
> I'm working on a Rogue Like in my sparetime, and am implementing a
> sight routine.
>
> Rather than being able to move in all directions like most RLs, my
> control system will be directional, that is the left and right arrows
> are used to adjust the direction the player is facing and the fowards
> key will move the player in that direction. (The only other game I have
> seen this method is in The Unreal World, which is a fabulous game)
>
> The player will only be able to see in front of him, and I envisage his
> LOS will be a semicircle which moves with the player direction.
> Therefore I will need to draw an arc - I understand the basics of
> circle drawing using the Bresenham formula, am not able to adapt it to
> draw arcs.
>
> Can anyone help?

What language are you using? libfov has functions for beam LOS, which
is just what you are looking for.

>
> Cheers
>
> Andy
--
Slash
 >> Stay informed about: Directional Line of Site 
Back to top
Login to vote
andystob

External


Since: Apr 12, 2006
Posts: 2



(Msg. 4) Posted: Wed Apr 12, 2006 7:28 am
Post subject: Re: Directional Line of Site [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Back to top
Login to vote
Slash

External


Since: Dec 14, 2005
Posts: 119



(Msg. 5) Posted: Wed Apr 12, 2006 8:21 am
Post subject: Re: Directional Line of Site [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

andystob wrote:
>>> I'm working on a Rogue Like in my sparetime, and am implementing a
>>> sight routine.

Slash wrote:
>>What language are you using? libfov has functions for beam LOS, which
>>is just what you are looking for.

andystob wrote:
> I'm using BlitzMax.

You must then take a look to the libfov sources and translate them to
your language... I think that one is the best way to go.

PD: If you are using google groups, please dont use the quick reply as
it may get confusing for people using real newsreaders, you can reply
by showing message options and clicking the Reply link.

--
Slash
 >> Stay informed about: Directional Line of Site 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Creature intelligence and directional line of sight. - Hi Guys I'm working on a roguelike and I have a question about creature intelligence. My RL uses directional sight: the player can only see in the direction they face, - imagine a semicircle in front of the player that represents the area they can see. ...

Modelling Rays for Line of Sight in an Object-Rich World - Hello fellow developers. I've encountered an interesting way of managing FOV on RogueBasin, the article is titled "Modelling Rays for Line of Sight in an Object-Rich World". There is a link in the article to an example implementation written in...

7DRL: Invader - Well, I've talked myself into attempting a game for the 7DRL challenge. :-) Invader will be a sci-fi RL where the player is the planet's only hope of stopping a dread alien invasion ship. The character's base of operations will be their docked ship. ....

7DRL: TBA! :P - I'm going to throw my hat into the 7drl arena by taking on a project I've wanted to do for ages. I think it will get me past the mental block of actually getting started. My concept is based around the remains of a post apocalyptic world with gang..

7DRL : Commander - It is 13.40 in my time zone (GMT +100). Time to start my 7DRL project: Commander. I will do it in Free Pascal. Plans are quite big so there is real danger of failure. Good luck to all participants of 7DRL contest. -- Michal ''Ancient'' Bielinski
   Game Forums (Home) -> Roguelike -> Development All times are: Ekaterinburg, Islamabad, Karachi, Tashkent (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]