Page 1 of 1

the line of sight

Posted: Tue Jun 28, 2011 3:09 am
by kyuubee
i am not sure if it's a bug, but it seems player and monsters have different lines of sight. for instance, i was frozen around a corner when i couldn't see the caster and it was during an ambush on the world map (i fought random adventurers) i.e. it was a lit area, light radius of my lantern shouldn't matter anyway. another incident, even more characteristic, i fought a group of undead, and there was a skeleton archer behind a ghoul and a skeleton warrior, we both tried to shoot each other and while my arrows hit the ghoul his hit me, i.e. it seems it had clear sight while i didn't. is it intended?

Re: the line of sight

Posted: Tue Jun 28, 2011 3:42 am
by tiger_eye
Yeah, this can happen, and it doesn't appear that anything is more broken or more strange than it has always been.

1) Line of sight (LoS) targeting isn't always symmetric, so what you described can happen.

2) Field of vision (FoV) is also not symmetric, so sometimes actor A can see B, but B can't see A.

3) The final kicker is that LoS and FoV are not equivalent to each other, so you can sometimes see things that you can't target (FoV was chosen to be this way, I believe--it's better than being able to target something you can't see). This can result in some funky vision at times, though.

These issues can't really be helped unless one redoes LoS and FoV to be much more sophisticated than they currently are. Fortunately, I am working on such a project! Hmm, let me grab a drink and get back to work on project codenamed "Super Happy Intense Targeting FoV algorithm" (Note: released version will have a better acronym) :D

Re: the line of sight

Posted: Tue Jun 28, 2011 4:44 am
by kyuubee
thank you for the answer.

>and it doesn't appear that anything is more broken or more strange than it has always been

i am new to this game so i didn't know. i got used to dungeon crawl stone soup where los is so symmetric that when you shrink your los you shrink los of every creature in the dungeon :3, so i thought los was somehow symmetric in tome too.

Re: the line of sight

Posted: Tue Jun 28, 2011 6:14 am
by tiger_eye
Wow, default field of vision is extremely permissive in dungeon crawl stone soup (DCSS). Looks like it's the most permissive FoV option available. Even the largest actors in ToME won't have that much vision once I'm finished with my project. By the way, the line of sight targeting path isn't symmetric in DCSS either, even though vision (if A can see B, then B can see A) is symmetric.

DCSS does give a fairly good example of how I'm going to make LoS "just work"(tm) with FoV. It'll be smarter than it is now, so your passive projectiles (i.e., Corona, Hymn of Moonlight) won't hit walls on the way to their targets.

There really isn't a good comparison or analogy that I know of to illustrate how I'm implementing FoV. When I surveyed current FoV methods, none struck me as being particularly suitable for ToME. So, ToME gets to be special, and this should be the last FoV algorithm that T-Engine needs 8) (why should a roguelike library or engine have half a dozen FoV options when all you need is one?!)

Disclaimer: The largest actors in ToME could have the same permissive FoV as in DCSS--my algorithm is very flexible--but I don't think they should :P

Progress report: FoV algorithm is finished and properly tested, I believe. I should whip up a few screenshots sometime. I'm still working on LoS and integrating everything into ToME (and T-Engine if appropriate), though, and this will take a decent chunk of time at my current work pace, which slowed down a bit once the weather became nice :wink: