Announcement

Collapse
No announcement yet.

Knight's attack damage

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Knight's attack damage

    How is it calculated? It looks like it deals hits by the amount frames its attack animation connect to the player. So how many hits/frames/time does it actually do, and how much damage (minimum and maximum) is dealt each hit/frame? Does the run attack (charge) deal more damage than the attack it does when standing still?

    I've tested it out with the a few other people, but it deals different damage all the time even when we let all frames connect without armor on. It looks like the damage points provided by Quake Wiki isn't reliable.

  • #2
    Hello PikaCommando,

    The Knight does not have dedicated attack functions.
    It uses shared (with other monster types) attack functions.
    Please find them all inside fight.qc.


    Regarding your specific questions:

    Originally posted by PikaCommando View Post
    How is it calculated? It looks like it deals hits by the amount frames its attack animation connect to the player.
    Yes, in each regular attack animation sequence the Knight has 3 frames (0.1 seconds each) in which he can do the below calculated damage.
    In each run attack animation sequence the Knight has 5 frames (0.1 seconds each) in which he can do the below calculated damage:
    (random() + random() + random()) * 3


    Originally posted by PikaCommando View Post
    So how many hits/frames/time does it actually do, and how much damage (minimum and maximum) is dealt each hit/frame?
    As you see in the damage formular above:
    Min: 0
    Max: 9


    Originally posted by PikaCommando View Post
    Does the run attack (charge) deal more damage than the attack it does when standing still?
    See above


    Originally posted by PikaCommando View Post
    I've tested it out with the a few other people, but it deals different damage all the time even when we let all frames connect without armor on. It looks like the damage points provided by Quake Wiki isn't reliable.
    As you see from the formular above the damage amount is random (between 0 and 9 per frame). That is why you always get different damage.

    Best wishes,
    Seven

    Comment


    • #3
      I'm not a Quake C expert but I took a look out of curiosity. The knight uses ai_melee or ai_melee_side, each of which does 0-9 points of damage if there is less than 60 units between the knight origin and target origin. This gets rounded up to nearest integer, so getting 0 damage is unlikely but possible (depends on how random their RNG actually is). Let's assume it's really 1-9 in practice.

      How many of these attacks happen would depend on how many animation frames they are attached to I guess. The "run attack" animation looks like it does 5 attacks, while the normal attack does 3. So that would be 5-45 for a charge and 3-27 for a normal attack? Seems to match what the wikia page says.

      Maybe an actual Quake C guy can chime in to confirm or contradict.

      Edit: and it looks like one did, while I had this thread left open in my browser. :-)

      BTW one thing I'm curious about... I wonder why the base ai_melee damage is calculated like this:

      ldmg = (random() + random() + random()) * 3;

      instead of something like this:

      ldmg = random() * 9;

      Edit 2: maybe to reduce the chance of getting 0 damage... seems expensive just for that though.
      Last edited by Johnny Law; 02-22-2017, 12:23 PM.

      Comment


      • #4
        (random()+random()+random()) tends towards 1.5 more often than random()*3 does.
        in theory.

        in practise, random()+random()+random() suffers from qcc bugs in the vanilla qcc, which will miscompile as something like random()*2+random()

        random()*3 has a more flat distribution, meaning its just as likely to return 0 as it is 1.5
        Some Game Thing

        Comment


        • #5
          Ah duh. Should have realized after all my time spent thinking about 2d6 distributions playing Settlers.

          Comment


          • #6
            Hello Johnny Law,

            Correct. Also "The Dark Eye" game is very much like this.

            Comment

            Working...
            X