Language: 
To browser these website, it's necessary to store cookies on your computer.
The cookies contain no personal information, they are required for program control.
  the storage of cookies while browsing this website, on Login and Register.

Author Topic:  thac0, thacm, ac, wc, dex  (Read 185 times)

0 Members and 1 Guest are viewing this topic.

Dolfo

« on: 11, November 2024, 16:36:23 »
Originally thac0 (to attack armour class 0) was used in old games, where we mainly had ac and monster level to calc the attack chance. For sure thac0 was influenced by weapons and other factors.

It's not a good logic for high ac. Also daimonin somehow changed thac0 to a kind of "general attack chance ignoring ac". So why we use "to attack armour class 0" and then ignore ac in the calculation?

Because old code can't do things easy, we have also thacm ("to attack miss"). This is great. So we have 2 mechanics ignoring ac and rolling in relation to player/monster levels, only to produce a direct hit with 20% more damage or a fumble.

Both values using sint8.

thacm
is also defined as thacm >=126 always fumbles
is also defined as thacm <= -127 never fumbes
this could also go in over and underruns at -128 and +127
in other cases thacm fumble chance is thacm

thac0
is never direct hit when >=126
and always direct hit when <= -126
same here, we could over/underflow before at this ranges
in other cases thac0 direct hit chance is -thac0 (whatever this means in logic behind)

also found this comment
"a race with thac0 will always direct hit, unless he has crappy equipment"

so we see, the original idea was like "to attack armour class 0" and was influenced by gear and other attack factors, where it should normaly always rolls against ac.

behind this we have wc to roll against ac.
so if we dont direct hit or miss in relation to monster levels ignoring ac
we have this comparison
Code: [Select]
else if (hit_obj->stats.wc + roll >= target->stats.ac)
where the roll is mainly a dice 100 influenced by some factors like flying, blind, invi ...
then we hit

to show what pain we have now 20+ years later, we have this nice macro
Code: [Select]
#define ADJTHAC(_V_, _N_) \
    (((_N_) == 0 || (_V_) == 32767) \
     ? (_V_) \
     : (((_N_) <= -126 || (_N_) >= 126) \
        ? SGN((_N_)) * 32767 \
        : (((_V_) == -32767) \
           ? (_V_) \
           : MAX(-32766, MIN((_V_) + (_N_), 32766)))))
I have really no fun to translate this. I am also not sure if we have a 100% protection against sint8 overflows.

Also this system is limited to -126 to +126 range, where wc can go much higher.

So it looks like we had more than one cook cooking this delicious meal.

Why we need thac0 or thacm when we have wc? thac0 was the equivalent to wc in the past.
When we want monster level influences our hit chance, we can simple adjust the wc/ac in relation to the level.

So coming to wc, ac and dex.

Currently dex is influencing wc and ac in a strange way. It's a % in relation to max ac/wc. This leads to situations, where a player is putting on an ac+1/-1 ammy and get in total ac+2/-2. So at some point, players always get more ac/wc than item describe shows, because of this % dex manipulation.

dex should increase ac and wc for sure, but not in % against total ac/wc.

Coming back to above formula for the real attack test.
Code: [Select]
else if (hit_obj->stats.wc + roll >= target->stats.ac)
where roll is mainly a dice 100, we come to this result.

wc 100 always hits ac 100.
wc 100 never hits ac 200.

I would prefer a more balanced logic, that wc 100 against ac 100 would be a 50% chance and I would kill for sure all this thac0/thacm ancient logics.

Make things easier, we can make things better behind.
We could define that very high wc against low ac could produces crit damage.
So precision gear and dex gear(both influencing wc) would increase critchances, where high ac would reduce it.

Very simple.
A 50:50 chance when wc and ac are equal.

we can use an additionaly fumble check in relation to wc, if we want this fumble logic, like wc 10 fumbles each 10 swing, where wc 100 fumbles only each 100 swing.

Comparing wc with ac, we could also reduce/increase damage. Atm we have a second random roll for the damage.

We could also go for crit damage, for example if wc and the roll is that high compared to ac, we get the crit. Atm we have the 20% direct hit independent from ac from thac0 check.

Another idea could be also to increase the crit damage in relation to wc.

So a very skilled weapon master, with high dex/wc against a poor armoured enemy, would nearly always find a way to hit his enemy critical.

So thats the brainstorming, Remove thac0, thacm and rework the wc/ac check, extend it to critchance and critdamage.

No need to check against monster levels or dex, both will influence the wc/ac before.
« Last Edit: 11, November 2024, 19:37:18 by Dolfo »
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. Man in White don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of your life. You are not the patient, you are their customer. Never forget this!

Dolfo

« Reply #1 on: 13, November 2024, 08:47:57 »
There is another unclean logic in relation to ac and resists.

What is the orginaly meaning of AC? It's the Armour Class. Higher it is, harder it is to hit.
But when we passed a succesfullly test against the AC, we have resists?

What the hell.  ::)

We have AC, we ignore this with thac0 system, what is mutated to a thac and thacm system and behind we have resists.

So to clean this mess, i would remove thac0, thacm, then define AC more as parry/block/dodge chance.

So armour get no more ac, armour has resists, where a shield gets high ac because of the block chance. Also long weapons get higher wc/ac than short weapons, reflecting the range advantage in a combat. dex and light or speedy gear would increase the dodge chance. A naked mage can for sure better dodge a hit than a full plate mail warrior.

So normally heavy plates should have 0 or negativ ac.

But then we have next problem, with 32 different attack/resist types. Atm resists is for sure sure nice to have, but its easier to build the dodge(ac) against 32 attack types.

Having 40 ac on a heavy armour sucks. Same if we have 200+ wc on one item. This is hard with such mechanics to build a clean logic around.

Some armours need for sure an ac nerf. If we want high dodge chances on armour, we can use also dex. dex goes in ac value.

But the main problem is still our 32 attack types. ac is often the only mechanic players have to survive, because its impossible to get high resists against monsters attacking with multiply attack types.

So starting to nerfing op ac gear needs something to compensate this. I would first change the dex to ac/wc formula.

ac = ac + dex - 10.

This way we keep old logic, where dex 10 is neutral. All lower 10 will decrease ac, all higher increase. So high dex chars would lead to high dodge chance.

Nerfing a broken high ac armour like kaotm could be compensate with adding some dex to it. Perhaps also speed.

So there is a combat before we reach a hit. One attacks, other defends. We could see wc also as attack, where ac is defend value.

Next is : current logic says, if wc = ac we alway hit, if wc < ac + 100 we always fail.
For sure we have this other soup thac and thacm for a direct hit or a fumble.

Perhaps we can change the logic from to use 1 dice 100 and compare linear ac and wc

to 2 rolls

attacker rolls his dice with 0 - wc, where defender rolls his dice with 0 - ac

I will try this. for sure -wc on kilrin priest gear and a 200+ wc weapon need to find a solution for that.

The goal is to wrap all in this wc against ac logic.

A chance to hit also if ac is extreme high.
A chance to fail also if wc is extreme high.

A chance for a "direct hit" or better a crit hit.
A chance for a "extrem worse hit" a fumble, where perhaps next swing is delayed a little.
« Last Edit: 13, November 2024, 08:53:15 by Dolfo »
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. Man in White don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of your life. You are not the patient, you are their customer. Never forget this!

Dolfo

« Reply #2 on: 16, November 2024, 08:41:23 »
I am coming closer, but old code make it not easy.

Here is the old logic to adjust monster ac/wc values.
Code: [Select]
    /* + level/10 to catch up the equipment improvements of the players. */
    op->stats.ac = base->stats.ac + (op->level / 10) - ac_mali;
    op->stats.wc = base->stats.wc + (op->level / 10) - wc_mali;
    wc_tmp = &op->arch->clone;
    if(op->stats.wc == (wc_tmp->stats.wc + ((int)op->level / 10)))
          op->stats.wc = MobACWC[op->level];
    if(op->stats.ac == (wc_tmp->stats.ac + ((int)op->level / 10)))
         op->stats.ac = MobACWC[op->level];
where op->stats.xx coming from the definitions for the mobs, where xx_mali coming from forces like slow, fear, ... where MobACWC is a table mainly scaling from 1 to 80 in relation to level 1-127.

This is hard to understand, because this soup is overcooked by several different cooks now.
I think originaly idea was.

If monster has his own ac/wc definition take this, if not take the definition from the table.

Later someone added a scale and gave some extra ac/wc in relation to level (each 10 level +1 ac/wc).
But instead of making the check first and then add this extra ac/wc if nessary, above logic add the logic to both, to original object and to the compare object.

Finally someone added the mali this way, that we trigger the table logic only if an object has set a unique value but dropped by the mali, so it looks like it has not set the unique value.

I change above code. No need for the table first. We can simply say ac/wc = monster level.
Next problem is, we have ac/wc definitions mainly on all our monsters. Above code reflects, that these values are for sure to low.

So for normal monsters, we need to scale somehow the level in ac/wc, where we could have situations, where a map maker want exactly the adjusted ac/wc value.

This is not possible. We can not have both. We must decide, if we want scale ac/wc or not.

Also this extra +11 ac/wc for a lvl 110 feels not that strong.

I would go for this logic.

Code: [Select]
ac = monster ac + monster level - ac_mali;
wc = monster wc + monster level - wc_mali;
« Last Edit: 16, November 2024, 08:52:07 by Dolfo »
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. Man in White don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of your life. You are not the patient, you are their customer. Never forget this!

Dolfo

« Reply #3 on: 20, November 2024, 19:34:04 »
So this above monster ac/wc adjust logic is for sure more than one troll. I spend more time to analyse this. I checked the monster arches with archwizard. Mainly all mobs are defined same way with ac 28 and wc 15. I ran around with debug print and scanned a ton of different mobs.

I tried to understand the difference between base ac/wc and clone ac/wc. From my point of view, base stats are the values can coming from mapmaker adjustments, where clone stats is coming from the arches directly.

So with this backup knowledge I can say this now.

The core idea of this logic was, that we compare the base values from the monster with the clone values coming from arches, so if a mapper sets a unique value, we use this, if not we use the dynamic scale by monster level.

1. problem on this logic is that all definitions in the arches are mainly same (wc 15 ac 28)
2. problem is if a mapper wants to set exactly these values wc15/ac28 on his map, he triggers the dynamic logic
3. problem is all definitions in the arches are only used for this one check and to trigger the dynamic, and are ignored behind this.
5. besides that the comparison includes ac_mali, so a depletion effect decides also if we trigger dynamic or not
5. besides that the redundant level/10 add on both sides of the check is unnessary
   
so the real logic should be more something like
if ac/wc is unset, we trigger dynamic scaling
if ac/wc is set we use this value

Also to not ignore the settings of the arches, perhaps try this? if mapmaker has overwritten the arches, take the pure values from mapmaker, if base and arch clone are same, use the base values from arches and add a dynamic scaling in relation to monster levels.

I try this.
Code: [Select]
arch_clone = &op->arch->clone;

if (base->stats.ac == arch_clone->stats.ac)
 op->stats.ac = arch_clone->stats.ac + op->level - ac_mali;
else
 op->stats.ac = base->stats.ac - ac_mali;
     
if (base->stats.wc == arch_clone->stats.wc)
 op->stats.wc = arch_clone->stats.wc + op->level - wc_mali;
else
 op->stats.wc = base->stats.wc - wc_mali;
« Last Edit: 20, November 2024, 20:16:15 by Dolfo »
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. Man in White don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of your life. You are not the patient, you are their customer. Never forget this!

Dolfo

« Reply #4 on: 24, November 2024, 12:05:08 »
To update this. Here are the current used balance changes.

wc/ac is nerfed back to originally formula.
if wc is same than ac we get a 100% chance, if ac is 100 points higher than the wc, we have a 0%.
we have also a "always hit" between 1-10% and a "always miss" between 1-10% depends on the ac/wc. So high wc against low ac,  can reduce their always miss to 1%.

After the hit, we have a pure dexterity test for the crit chance. 1 dex is 1% chance where 125 dex is 100% chance for a critical hit.

dex also scales before in the ac/wc with 1 point for each 2 points dex above 10 dex. so dex under 10 reduces ac/wc.

when we get a critical hit, there is a third roll for the critdamage.
Code: [Select]
int df = 20 + RANDOM_ROLL(hitter->stats.Dex / 2, hitter->stats.Dex * 2);
so all crits have at least the old 20% direct hit bonus plus additionally bonus in relation to their dex and luck on that roll. dex 100 char could scale between 70% and 220% extra crit damage.

Additionally when a player miss, there is also a dex test, if it is only a normal miss or a fumble. Fumble will delay players next attack, so low level dex players often fumbles, where high dex players can reduce their fumble to 1%.

So dex is important now for ac/wc bonus, for crit chance, crit damage, fumble chance and trap find/disarm.

Coming to str ...

str got a buff, each 2 points above 10 str is like you put on a damage ring 1.0 now. This means ogres are beasts now in melee in slaying level 1 ants with their starter str bonus. A superior strength item (+7 str) should be same than a superior damage item, both grant 3.5 damage. Different is that str only works for melee, where damage also works for range.

I also changed the scaling of str and damage to add it as pure damage, so damage on rings or armour items are scaling same way than on weapons. Additionally damage gear is influenced by con/qual, like it is on weapons.

I also changed the strength self spell. It can be casted only once. The scale is in relation to spell level 15,30,46,60,75,90,105.

105 is buffing str +8.

Also the time of the buff scales harder in relation to the level from around 6 seconds for a level 1 cast to around 11 minutes 30 seconds for a level 110 cast.

In relation to str I fixed also a weight bug, a missing bracket in a formula gave players more weight then described.

Now for each str point above 10 a player get 5kg more carry, below str 10 player get a carry reduce.

Talking about damage again

2handed weapons get a 2handed strike bonus of 50% on normal (one tile) mobs
Polearm weapons get a polearm strike bonus of 100% on big (multi tile) mobs

Damage gain from guild is also transfered now to the flying missile objects.

Guild attack speed buffing is reduced to 0.125 for mercs, palas, fighters and rangers.
All players get a speed scaling in relation to their skill levels. The scaling is 20,40,60, 80,100, where 60 is neutral. So low skilled players starting swinging/shooting slower than "normal", where high speed players swinging/shooting faster.

There is a cap to not go lower than 0.5 in attack speed. A sling with skill level 100 and in a guild with a bonus is 0.5 speed now.

Talking about skills, punch skill is faster now, also with the new str bonus a level 1 ogre punches beginner ants with 10 damage.

Important for mages is that skills also give ac. So a mage with a ph skill lvl 110 get 55 ac for that. Mages ignoring their ph training will miss this extra dodge chance.

We have new ammo for rangers in iluma, also local shop keeper cleaned his ammo stocks, make it easier to find the ammo.

New ammo is piercing ammo, can hit 2 mobs in a row with one shot. Piercing dont work on big tile mobs, they are to fat to pierce them.  :P

I also removed the old miss logic, that missiles continue flying when missed a monster. So a miss on a monster stops the missile now. If you want hit 2 mobs in a row, use piercing ammo. Atm this ammo is limited to attack max 2 mobs, but could be increased for more piercing in a row, if we want.

So to come to an end here.

If you fight against "airborne" mobs you get a penality of -10 wc for that hit. Also floating mobs like ghosts have this bonus against you.
« Last Edit: 24, November 2024, 12:15:13 by Dolfo »
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. Man in White don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of your life. You are not the patient, you are their customer. Never forget this!

_people_

« Reply #5 on: 27, November 2024, 05:03:20 »
Great changes! :) I never took much time to understand the old formulas for ac/wc/thac but it seems more sensible now.

What was the fastest achievable (with real items) sling attack time before? I'm not sure if this is an issue but when we cap the low end of attack speed, are high-end bows/xbows inherently more DPS than a high-end sling since they won't be capped as sling will be?
-- _people_ :)

Dolfo

« Reply #6 on: 27, November 2024, 17:39:53 »
Sling is intern using a 7 for speed (8 is 1.0 attack speed). We had also 0.30 weapon speed bonus on guilds before. So slings could go down to 5 speed (0.625) with guilds.

Guilds are changed now to give max 0.125 speed. So a sling 7 with guild is 6 and with level 100 skill is 4. Thats where also the cap is at 0.5 speed.

Also the speed values for range gear can't scale different from x * 0.125.

Crossbows can go now from 9 to 6 with skill level 100 and a guild, thats 0.75 speed.

Need to look again in melee speed in relation to rage skill, because this skill also influence attack speed. So could be with rage we reach the cap to fast.
« Last Edit: 27, November 2024, 17:45:08 by Dolfo »
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. Man in White don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of your life. You are not the patient, you are their customer. Never forget this!

Tags:
 

Related Topics

  Subject / Started by Replies Last post
6 Replies
4578 Views
Last post 18, May 2011, 00:15:34
by _people_
2 Replies
4492 Views
Last post 06, June 2011, 04:28:39
by Astinash
4 Replies
2031 Views
Last post 10, December 2012, 07:07:51
by B5_Misidian
2 Replies
140 Views
Last post 21, February 2022, 05:51:33
by Delrisst
0 Replies
53 Views
Last post 08, April 2022, 02:40:53
by Dolfo