Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Projectiles and the Z axis  (Read 464 times)

Abyssal Squid

  • Bay Watcher
    • View Profile
Projectiles and the Z axis
« on: July 20, 2007, 10:28:00 am »

From the Future of the Fortress thread

quote:
Originally posted by Toady One:
<STRONG>Projectiles, namely siege weapons, don't currently think very hard about the Z coordinate.  That's kind of a mess in general, since objects flying through 3D space tend to move along parabolic paths, and those don't work to well along grids like the one in DF in the sense that it would be harder to predict what you are going to hit (it could sort of show you a flight path or something, but it wouldn't necessarily be pretty).</STRONG>

I think this could be done without being too ugly.  For siege weapons, you should be able to do some fine aiming (as opposed to straight in one of the cardinal directions, plus a little up or down), and you would see the flight path only while aiming.  You would also see the flight path when aiming "small arms" as well.

You could represent the 3D arc on only one level by drawing a line, where sections on your current level are bright green, sections on a higher or lower level are dark green, and obstructions (where it intersects with the ceiling, a wall, whatever) are red.

You could change the height of the arc by pressing +-, to shoot over a tree, to shoot in a confined tunnel, or to get that last bit of range out of your weapon.

Logged

I3erent

  • Bay Watcher
  • The mounted dwarf has gone bErZeRk
    • View Profile
Re: Projectiles and the Z axis
« Reply #1 on: July 20, 2007, 11:44:00 am »

What if you could aim the siege engine and fire it yourself???  Might be kinda cool maybe it could go into a paralax scrolling/aim mode...in giant 3d ascii!!!!!!!!!
Logged
quot;I got really stoned a couple days ago and ended up talking to THIS GUY. anyway... I''m really drunk now. The guy said: There is this application called "Mya" MI-AH that makes animations of people that he paid $2000 for. F- that Jazz ARMOK ROCKS. FIGHT THE MAN, GO TEAM!

Markavian

  • Bay Watcher
  • DF Map Archive Admin
    • View Profile
    • DF Map Archive
Re: Projectiles and the Z axis
« Reply #2 on: July 20, 2007, 03:07:00 pm »

If DF could do the parabolic calculations, then you could keep the view in top down 2D mode.

Select siege engine.
Enter target mode.
Move cursor to target.
- DF would draw a flashing 'highlighted' line  (say in cyan) between the siege engine and the target.
- DF would automatically choose the angle based on a fixed 'power' setting
- If anything was blocking the parabolic path at a higher level, e.g. the cave ceiling, then the line would turn red at the point in the arc where it was being blocked.

No need for a side-angle view, altho that would be kinda cool.

- Markavian

Logged

Abyssal Squid

  • Bay Watcher
    • View Profile
Re: Projectiles and the Z axis
« Reply #3 on: July 21, 2007, 11:14:00 am »

Right, pretty much what I was suggesting except with cyan instead of green.  A few situations where you'd want direct control over the shape of the arc, though.

First, with a ballista, the overall shape of the arc is unimportant; the thing that matters most is how much of its path is on the level just above the ground.  For example, this:

code:
   xxx
BBx   xx
########

is better than this:
code:
      xxxx 
  xxx    xxx
 x          x
BB            x
###############

since the bolt covers three times as much ground.  You'd want fine control of the shape of the arc rather than the landing point.

Second, there are many situations where you'd want a high arc or a low arc, and except at maximum range, you can use either for a particular target.  You'd want a low, nearly flat arc if you were firing with a low ceiling:

code:
#######
 xxx
Ax   xG
#######

and a very high arc if you were firing over an obstacle out in the open:
code:
  xxx
x # x
A ##  G
#######

Finally, at least in the case of a bow, you wouldn't necessarily have a fixed power, although thinking about I don't see many uses for using less than your maximum pull.

Note: the diagrams are drawn with exaggerated verical scale, and of course you'd see the arc from above.  Going back to the high arc example, suppose you try a lower arc that intersects with the obstacle:

code:
  x#x
Ax## xG
#######


It would be diplayed like this:
code:
..##...
AxX*Xxx
..##...

[ July 22, 2007: Message edited by: Abyssal Squid ]

Logged