Line of sight (field of vision, LOS, FOV)

Everything about ToME 4.x.x. No spoilers, please

Moderator: Moderator

Post Reply
Message
Author
greycat
Sher'Tul
Posts: 1396
Joined: Tue May 11, 2010 11:51 pm

Line of sight (field of vision, LOS, FOV)

#1 Post by greycat »

There has been discussion of the changes to LOS code in ToME in various threads, and in the in-game chat, and so on. I figured it would be good to have a thread actually dedicated to it, rather than having it creep into other threads (not that we can prevent that).

Some history, first:

Nethack, late 1980s: Ranged attacks in nethack are done by "throwing" (firing) a projectile from a launcher. You press t and then a direction key. Thus, firing only takes place in eight directions, or straight up in the air (to shoot yourself). Fast creatures have a huge advantage over slow creatures, because they can remain out of the line of fire (very different from the line of sight) of their pursuers. At least one in-game monster (unicorn) takes full advantage of this, always trying to stay out of the player's lines of fire (and very capable of doing it, due to its speed).

Wands worked the same way as projectiles, just using a different command. The only differences vs. projectiles are that some wand effects beam (pass through creatures and keep going), and some wand effects ricochet off walls (straight back at you if you hit a wall N/S/E/W, or a 90 degree bounce if you hit a wall diagonally). Spells were added at some point in the 1990s. Apart from the very few spells that have cone-shaped or ball-shaped areas of effect, the rest work just like wands (some are beams, some bounce off walls, etc.).

Some niche/joke weapons like boomerangs were also added. The boomerang flies in a circular path, back to the thrower, unless it hits a monster along the way. But these are not serious tactical options for the most part.

(Some may argue that ToME is not derived from Nethack in any way, but it would be disingenuous to ignore the influence of Nethack upon the entire genre.)

Angband, early 1990s: Ranged attacks in Angband target a creature, or a tile, rather than specifying a compass direction. The game calculates a flight path from the thrower/shooter to the target tile. Depending on the type of projectile, the attack may stop and fail when it hits a wall/creature, or it may continue through creatures (beam), or it may explode into a ball when it hits the wall/creature, etc.

It is very important to note that the flight path calculation goes straight to the target whenever possible, insofar as the square grid map allows. For example,

Code: Select all

########
.BA..###
####t#x#
####.###
Shooter A can hit the target t, because the flight path from A to t goes east, then southeast. However, shooter B cannot hit target t, because the flight path from B to t goes east, then southeast, then east -- but the southeast step hits the wall.

However, it may be possible to target a tile inside the wall to the east of t. If shooter B targets tile x inside the wall, then the flight path from B to x goes 2 tiles east, then southeast, then 2 tiles east. This path takes the projectile through the real target t.

Thus, optimal play often requires tedious targeting beyond the actual creature you're trying to shoot. (The game actually makes this less painful than it sounds, because options can be set to let it remember a target. Once the target has been fixed, you can rapidly shoot at it several times. Still, many players dislike this.)

Under no circumstances can the creature at t shoot either A or B. There is no conceivable flight path that will not hit the wall first. The best t can do is step south, out of the line of fire. Failing that, it may be able to use a ball-shaped blast, catching A and/or B somewhere inside the blast radius (and also potentially harming itself in the process).

This makes proper positioning vitally important. Proper use of the terrain is a fundamental gameplay tactic. Many of the toughest battles in fact require terrain alterations (digging tunnels) to create conditions where the player has a chance to survive. (Bear in mind, the monsters are many, many times more powerful than the player. Virtually every significant endgame monster has mass summon spells, so if you are standing in an open room with the monster, you will be dead very quickly.)

ToME 2, late 1990s: As an Angband/Zangband variant, ToME 2 inherited the basic tactics of Angband. ToME 2's summoning capabilities (both on the part of the player and the monsters) were even stronger than Angband's, so if anything, the use of terrain alterations and line of sight tactics to compensate for hideously strong summoners was even more pronounced in ToME 2 than it was in Angband.

ToME 4, betas 1 through 33, early 2010s: In all the early betas of ToME 4, line of sight and field of fire worked exactly like they did in ToME 2. Which is to say, exactly like Angband. There were some versions where targeting beyond the monster was broken (with physical projectiles, but not with spells -- those always worked properly). But those bugs eventually did get fixed.

ToME 4, betas 34 through 43, early 2010s: In the later betas of ToME 4, field of fire changed to match line of sight. The new paradigm was if you can see it, and it's in range, you can shoot it.

Code: Select all

########
CB...###
####t###
####.###
In beta 34, not only could B shoot t without moving the target indicator, but so could C. Or someone standing even farther west. This didn't really change anything for single-target fire, because you could have targeted beyond the monster to make the shot, but it did eliminate the tedium of doing that.

However, it did change some things for talents that performed automatic targeting. Various Archer talents used multiple-target selections, and Angband-style targeting would often calculate flight paths that hit walls, rather than the creatures, which made these talents largely useless in the early betas. But in beta 34, they suddenly became powerful.

Code: Select all

##########
#........#
#........#
#..d.d...#
#........#
####.#####
####.#####
####.#####
####@#####
####.#####
Take for example the Archer talent "Dual Arrows". You select a 3x3 area, and the game picks two targets inside that area and launches one arrow at each target, using automatic path calculation. In beta 33 and earlier, the archer standing at @ would not be able to hit the drakes (d), because each arrow would hit a wall. Single-target manual selection would have allowed the archer to target beyond the monster, and therefore hit either one of them, but Dual Arrows didn't work that way. But in beta 34, suddenly Dual Arrows was able to hit both of these monsters. The same goes for Volley of Arrows (but not Scatter Shot, which works completely differently).

The same issues applied for Anorithils using Corona, which produces automatically targeted projectiles on spell critical hits. This became dramatically more useful in beta 34.

ToME 4, RC1 through ??, 2012: In ToME 4 RC1, line of sight was changed to be "symmetric". The new paradigm was if you can see it, it can see you. This made the targeting resemble that of Dungeon Crawl (history not covered here). This changed battle tactics in a fundamental way:

Code: Select all

########
CB...###
####t###
####.###
In ToME RC1, not only could B or C shoot t, but t could shoot back. Characters with limited ranged capability could no longer use the terrain in the same ways they had been doing previously. Instead, they needed to change their entire tactical arsenal -- adding some ranged attack capability, or ranged defense, or mobility talents that would allow them to close the gap with ranged attackers.

jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

Re: Line of sight (field of vision, LOS, FOV)

#2 Post by jenx »

That explains a lot, especially RC 1 changes. Thanks.
MADNESS rocks

Hunter
Uruivellas
Posts: 638
Joined: Tue Feb 17, 2004 4:43 pm

Re: Line of sight (field of vision, LOS, FOV)

#3 Post by Hunter »

Thanks. Good analysis. The new paradigm can make for some brutal situations early game...I just tried dancing around the Hive Mother with several generations of Yeek Cursed and...eesh. Can't go toe-to-toe with her for an extended fight and kiting just staves off the inevitable as she shoots around corners. I wonder if there could be some sort of limitation -- range, tactical AI alteration, etc -- on the symmetrical targeting to help in the early game?

bricks
Sher'Tul
Posts: 1262
Joined: Mon Jun 13, 2011 4:10 pm

Re: Line of sight (field of vision, LOS, FOV)

#4 Post by bricks »

You can't just lure her around the corner, then close in? She does have a pretty nasty regimen of ranged talents, I'll admit. Maybe she should get a speed nerf.
Sorry about all the parentheses (sometimes I like to clarify things).

greycat
Sher'Tul
Posts: 1396
Joined: Tue May 11, 2010 11:51 pm

Re: Line of sight (field of vision, LOS, FOV)

#5 Post by greycat »

"Pillar dancing" should still work, but your enemy has to be immediately adjacent to the pillar. Any distance at all, and she'll be able to shoot around it.

Code: Select all

.....
.....
.m#@.
.....
.....
m = monster, @ = you, # = stone pillar

The m can't shoot you from where it's standing, so it has to move. Hopefully it'll move either NE or SE, which will put it next to you. Then you can attack it, or retreat behind the pillar if you're still recovering.

This works very well in the Ring of Blood mini-game. Good luck finding a way to get a pillar between you and the monster in other zones.

Hunter
Uruivellas
Posts: 638
Joined: Tue Feb 17, 2004 4:43 pm

Re: Line of sight (field of vision, LOS, FOV)

#6 Post by Hunter »

bricks wrote:You can't just lure her around the corner, then close in? She does have a pretty nasty regimen of ranged talents, I'll admit. Maybe she should get a speed nerf.
Don't get me wrong -- Yeeks are designed to be hard from the outset, so I'm not really complaining. But there are several situations where melee characters are essentially nerfed by unlimited symmetrical targeting, which is why I was wondering if that particular version of LOS could be limited...say (and just in terms of flavor) saying that a creature peeking around a corner has a range of 3 or something since they can't square away and look all the way down a corridor like one that's moved into a direct path. The Yeek version was just the most extreme. I *could* lure her out, and kept doing so, but it's always been a problem with Yeek melee characters -- the Hive Mother is simply too strong to safely go toe-to-toe with her with a level 2-3 melee character with weak equipment. So a little luck with the drops usually improves the odds considerably. I actually finally beat her by going to the water dungeon following the first two levels of the richt caves and, after several more deaths (swarming is still pretty brutal sometimes and the water dungeon is just harder anyway.) I killed that boss (much easier than the Hive Mother) and returned armed with a couple nice pieces of equipment, more health, better talents, and a fortuitous phase door rune. So it's not impossible, I'll grant.
greycat wrote:"Pillar dancing" should still work, but your enemy has to be immediately adjacent to the pillar. Any distance at all, and she'll be able to shoot around it.

Code: Select all

.....
.....
.m#@.
.....
.....
m = monster, @ = you, # = stone pillar

The m can't shoot you from where it's standing, so it has to move. Hopefully it'll move either NE or SE, which will put it next to you. Then you can attack it, or retreat behind the pillar if you're still recovering.

This works very well in the Ring of Blood mini-game. Good luck finding a way to get a pillar between you and the monster in other zones.
Yeah, I do take advantage of pillar dancing when I can. It's not common to find it in the wild, so to speak, but a little foresight and a digger can help with that. Unfortunately, diggers aren't exactly littering the landscape in the early game.

Mewtarthio
Uruivellas
Posts: 717
Joined: Mon Jul 16, 2012 6:03 pm

Re: Line of sight (field of vision, LOS, FOV)

#7 Post by Mewtarthio »

Hunter wrote:Thanks. Good analysis. The new paradigm can make for some brutal situations early game...I just tried dancing around the Hive Mother with several generations of Yeek Cursed and...eesh. Can't go toe-to-toe with her for an extended fight and kiting just staves off the inevitable as she shoots around corners.
You're playing a race with a notoriously difficult early game (that also happens to die quickly in melee) and a class with a notoriously difficult early game (that also happens to be a melee class). That's a pretty severe example. Most melee classes will have Rush or other ways to close the distance, and most races will have more than 5 starting Constitution and a more reasonable choice of starter dungeons.

Also, if you know that melee Yeeks have a lot of trouble with the Hive Mother, why are you doing the Ritch Tunnels first instead of going after Murgol?

Hunter
Uruivellas
Posts: 638
Joined: Tue Feb 17, 2004 4:43 pm

Re: Line of sight (field of vision, LOS, FOV)

#8 Post by Hunter »

Mewtarthio wrote:
Hunter wrote:Thanks. Good analysis. The new paradigm can make for some brutal situations early game...I just tried dancing around the Hive Mother with several generations of Yeek Cursed and...eesh. Can't go toe-to-toe with her for an extended fight and kiting just staves off the inevitable as she shoots around corners.
You're playing a race with a notoriously difficult early game (that also happens to die quickly in melee) and a class with a notoriously difficult early game (that also happens to be a melee class). That's a pretty severe example. Most melee classes will have Rush or other ways to close the distance, and most races will have more than 5 starting Constitution and a more reasonable choice of starter dungeons.

Also, if you know that melee Yeeks have a lot of trouble with the Hive Mother, why are you doing the Ritch Tunnels first instead of going after Murgol?
Well, yes, I acknowledged that Yeek melee characters are innately difficult. I was just citing my own most recent experience with the implications of the new LOS set-up. My point was independent of that. Rush has a huge cooldown early on, phase door is unreliable, and sources of extra speed are rare at that point. I'm just making observations. Things are what they are, and if DG chooses to listen, I'll be happy. If not, I'll still be happy, just less able to play melee characters the way I used to. This is a point of discussion, not dissension.

As for why I was going into the tunnels instead of scuba diving, I've always found the tunnels much easier. I prefer to have a few levels and extra hp/skills before venturing into Murgol's Lair because limited visual range + hard-hitting range attacks tends to be more dangerous in my opinion. Flame-spitters and pinners are also dangerous, but easier to see coming and don't do damage-over-time. Also, the AI in the ritch tunnels seems to make it easier to line the opponents up and block the range attackers. Perhaps others disagree, but I've learned to do the tunnels first after several dozen Yeek characters. Just personal preference -- I find them more survivable for a starting Yeek. I assume you consider the opposite true, which probably speaks to our disparate playing styles.

lukep
Sher'Tul Godslayer
Posts: 1712
Joined: Mon Mar 14, 2011 10:32 am
Location: Canada

Re: Line of sight (field of vision, LOS, FOV)

#9 Post by lukep »

Interesting quirk of the current FoV system: diagonal tunnels block LoS only past the first tile. That means you can make "anti-sumoning corridors" like:

Code: Select all

@#######
#m######
##m#####
###m####
####m###
#####m##
######m#
#######m
where "@" is the player and "m" are monsters. There is only LoS between the player and the first monster, all of the others are hidden. I see great potential for Dig or Shattering Charge in combat now.
Some of my tools for helping make talents:
Melee Talent Creator
Annotated Talent Code (incomplete)

kazak
Thalore
Posts: 174
Joined: Fri Mar 04, 2005 8:04 pm
Location: colorado

Re: Line of sight (field of vision, LOS, FOV)

#10 Post by kazak »

Huh. One thing I just noticed, this now removes your ability to safely shoot ball spells around corners (like Scatter Shot or Chill of the Tomb).

Code: Select all

#.....#
#.x.x.#
###.###
###@###
Obviously, shooting at "x" used to carve out a hole for the player, allowing for safe short-range nuking. Now it apparently hits you as well.

Frumple
Sher'Tul Godslayer
Posts: 1517
Joined: Sat May 15, 2010 9:17 pm

Re: Line of sight (field of vision, LOS, FOV)

#11 Post by Frumple »

Should be fine aiming a tile north (or north-east/west, depending) of x in most cases. The LoS changes hasn't done much of anything to the occasional need to finagle your AoE radius by aiming at empty tiles.

overtrix
Archmage
Posts: 412
Joined: Fri Jan 17, 2003 9:33 am
Location: Les Corbières sauvages

Re: Line of sight (field of vision, LOS, FOV)

#12 Post by overtrix »

The most recent seems to me an immense change, which may find a need to nerf various opponents or make the game too chess-like. Some mage-of-the-moment has 400HP and the same again of shield, its quarry is a unique with 3000HP and disabling talents which seem to cool down faster than fish & chips on a winter's night in Manchester - the mage has a chance because its brain-in-your-head is vastly more able to recognize, coordinate and use features of the situation. Now the situation's changed, become more banal, and the brain-in-my-head is getting kicked all over the place. Maybe I'm just getting old and grumbly, that's a definite possibility :P

greycat
Sher'Tul
Posts: 1396
Joined: Tue May 11, 2010 11:51 pm

Re: Line of sight (field of vision, LOS, FOV)

#13 Post by greycat »

overtrix wrote:The most recent seems to me an immense change, which may find a need to nerf various opponents or make the game too chess-like. Some mage-of-the-moment has 400HP and the same again of shield, its quarry is a unique with 3000HP and disabling talents which seem to cool down faster than fish & chips on a winter's night in Manchester - the mage has a chance because its brain-in-your-head is vastly more able to recognize, coordinate and use features of the situation. Now the situation's changed, become more banal, and the brain-in-my-head is getting kicked all over the place. Maybe I'm just getting old and grumbly, that's a definite possibility :P
It's not just you. The loss of the player's ability to take advantage of the terrain in tactical situations makes the monsters much more dangerous, and requires totally new strategies in order to survive.

Post Reply