[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  [Help] AC, Thac0, Thac32 and "Chance to Hit" calculations.

[Help] AC, Thac0, Thac32 and "Chance to Hit" calculations.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Oblisgr   (123 posts)  [Biography] bio
Date Sat 23 Apr 2016 11:05 AM (UTC)
Message
Hello,
I have played AD&D as player and DM so i can understand om basic point in battle calculation.

I can see that each mob/race has an AC, Thac0 and Thac32 stats. I can understand that the AC represends the way the mob will avoid the attck of the enemy. And the Thac0 the try the player has to put (in dice roll) to hit the mob. Actuall AD&D stuff.

Just a few questions:

1. The Thac32 does the same with as Thac0 just for AC=32?

2. The way the battle is calculated?

I imagine that the engine rolls a d20 at every attack and does thac0-roll to get the AC that can be hit like AD&D right?

I see in AreaEditor that a mob of level 1 has near 100 AC, and every level above has lower (like AD&D) and here i get confused. if AC=100 how the hell the attack chance is calculated. Because this way the AD&D formula will now work.

In AD&D level 1 mob without armor and bonus got AC=10 and not AC=100. So...?

If someone want to write me the actual SMAUG battle formula of "chance to hit", please do to help go further in understanding.

Thanks in advance
[Go to top] top

Posted by Nick Gammon   Australia  (22,966 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Sun 24 Apr 2016 02:08 AM (UTC)
Message
I suggest you look at the source. I don't know for sure what the code does with them. I found this in fight.c:


   thac0 = interpolate( ch->level, thac0_00, thac0_32 ) - GET_HITROLL( ch );
   victim_ac = UMAX( -19, ( int )( GET_AC( victim ) / 10 ) );


...

   if( diceroll == 0 || ( diceroll != 19 && diceroll < thac0 - victim_ac ) )
   {
      /*
       * Miss. 
       */
      if( prof_gsn != -1 )
         learn_from_failure( ch, prof_gsn );
      damage( ch, victim, 0, dt );
      tail_chain(  );
      return rNONE;
   }


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


9,965 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]