Jump to content

zdoom line of sight when attacking ?


Mewdoom

Recommended Posts

Hello guys,

let say I have a monster that attack the player from lower floor than the player is, there is a way to make the monster check to see if he have enough sight to attack ? I want him to fly up a bit if his fireball would hit the wall instead of the player ?

Share this post


Link to post

A simple line of sight check won't help here. The monster is already doing that but because the size of the projectile is greater than 0 it hits the obstacle at a position that is actually below the real line of sight.

Share this post


Link to post

A monster just can't reliably predict whether its projectile would hit something on its way towards the player, don't even bother.

Something like the monster spawning dummy actors slightly above and below its own eye level, that would check their own line of sight with the monster's target, and report it to the monster somehow, so that the monster would decide whether or not to fire the projectile or whether to move before doing so - might work (although I'm not sure about it), but even if it was possible (and it'd be rather elaborate already), it'd certainly not be foolproof anyway, because it couldn't check for solid things in the path, or moving floors or ceilings that don't obstruct the path yet but will obstruct it a second later, or it'd fail if the target quickly moved into cover just after the check was performed but just before the monster actually fired, and probably more.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...