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:  Find Traps/Remove Traps  (Read 2467 times)

0 Members and 1 Guest are viewing this topic.

Dolfo

« Reply #30 on: 09, November 2022, 21:04:13 »
Hm, ok. I have started to delete the non used rune code. Perhaps later at some point we also rename rune.c to trap.c? I have removed the 5% always fail, always success chance. I was also not a fan of this.

Checked your formulas. So you mainly say, best is to have same skilllevel against a traplevel to reach the max of 50% success, where the rest comes from dexterity.

I played in past also pen and paper rpg's, very often we had there a kind of average stat range (9-11 or 8-12) and if you where above you gained a bonus and if you where below you gained a malus. I don't like this system that much, where we can increase our stats to 50+. This looks strange to define a average range here. But i try to implement your formulas. We better test this in game and wait for player reactions, how this feels.

I have a problem with our current trap level and trap hideness definitions. Both values are adjusted in trap adjust by using the map difficulty value.

Its's mostly
trap level = map difficulty +/-5%
hideness = map difficulty +/-5% + rnd (0,19)

So we have always hideness very close to trap level and it's mostly useless to define a hidenness. We would have same effect with only trap level and use the rnd (0,19) roll in trap find logic.

Is there a better way, can we say lower traps are often better hidden than higher traps, or is it the opposite? Or do we things like

trap level is map difficulty +/-5%
trap hidennous is map difficulty +/-x% where we adjust x higher than 5%? So we have have higher ranges for the hidennous of a trap?
« Last Edit: 10, November 2022, 01:11:28 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. School medicine 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 you life. School medicine is corrupted by bad humans, like politician, like media.

Dolfo

« Reply #31 on: 10, November 2022, 01:27:33 »
So i can't sleep and thought more about this. I would first remove the + rnd (0,19) in trap adjust. There is no reason for this. Also this +/- 5% formula is leading to
always trap level 1 at difficulty 1
trap level +/-1 at difficulty 20
trap level +/-5 at difficulty 100

Next i have thought about your 50% max. Why a level 110 skill should only give 50% to find/remove a trap level 1? I wouldn't max this to 50%. But to define skill level 1 has 50% chance against trap level 1, i think is a very good logic.

I would also go for a clean and simply (x% dex) logic. So with 50 dex you gain 50% chance. Could be also interesting to split the rolls? So you have one roll against the trap with your skill and a second roll against the trap with your dex. Could be also interesting to inform the player, which role has succeeded, like
"You disarmed the trap using your trap disarm skill." or
"You disarmed the trap because of your high dexterity.

This would also give new players without skill a small chance to disarm a trap by dex.

So you can reach 100% against lower traps, but also 0% against higher traps using your skill?
But you have always the chance from your dex to handle a trap, independed from it level?

I also thought, do we need 2 definitions for a trap difficulty, like level and hideness?
« Last Edit: 10, November 2022, 01:35:50 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. School medicine 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 you life. School medicine is corrupted by bad humans, like politician, like media.

Dolfo

« Reply #32 on: 10, November 2022, 02:03:57 »
What you think about this?

<success %> = max(min(50 + <dex> + <skill level> - <trap level>), 100),0)

This means a new char without skill (0) but dex 11 has 60% chance to handle a level 1 trap?
A char with skill 110 and dex 50 has 100% chance to handle a level 110 trap?
Traps higher than 110 he will loose 1% chance each point?

We can also say, if a char has no skill he don't get the 50, so he need first to learn skill at least to level 1 to get the 50%.

would change the formula to
<success %> = max(min("if(skill)50else0" + <dex> + <skill level> - <trap level>), 100),0)

Edit: We can also try avoiding a trap. So instead of using dex for disarm trap, dex can help, when a trap is triggered. Then a player get a chance to avoid this trap. Currently we have 100% hit chance of a trap.

We can also try to say 1 point dex against trap level 1 leads to a 50% chance to avoid this trap or we say 1 point dex leads to 1% chance to avoid the trap level 1. Perhaps 50 dex leads to a 25% chance to avoid a level 100 trap. Theoreticcaly we can also use ac against traps. Why should help ac against a monster hits to dodge them, but not against trap hits?

So a lot of more chaos to think of.  :P
« Last Edit: 10, November 2022, 02:46:26 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. School medicine 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 you life. School medicine is corrupted by bad humans, like politician, like media.

Dolfo

« Reply #33 on: 10, November 2022, 11:00:24 »
Ok, a lot of chaos now. I cleaned trap_adjust. I have also seen that this functions builds +/- 20% trap level and hiddenness, not +/-5%. So we have a good range on higher map difficulties. We have better visible traps could be higher in level or better hidden traps could be lower in level. I have removed the extra (0-19) roll on hiddeness.
Code: [Select]
void trap_adjust(object_t *trap, int difficulty)
{
    if (difficulty < 1)
        difficulty = 1;

    int off = difficulty / 5;

    trap->level = RANDOM_ROLL(difficulty - off, difficulty + off);
    // if (trap->level < 1) trap->level = 1; // above formula can not reach <1

    // stats.cha = trap hiddenness
    trap->stats.Cha = RANDOM_ROLL(difficulty - off, difficulty + off);
    // if (trap->stats.Cha < 1) trap->stats.Cha = 1; // above formula can not reach <1
}
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. School medicine 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 you life. School medicine is corrupted by bad humans, like politician, like media.

Dolfo

« Reply #34 on: 10, November 2022, 12:05:26 »
Renamed remove_trap to disarm_traps (plural). In container.c, skills.c and skill_util.c. So we have clean plural definitions for find_traps and disarm_traps in skill.c and clean singular definitions for trap_disarm and trap_see. Perhaps it's also cleaner to change trap_see to trap_find?

Here is current trap_see (trap_find).
Edit: changed exp logic.
Code: [Select]
// function uses 2 different rolls, one for see trap against hiddenous of trap, other for id trap against trap level
int trap_see(object_t *op, object_t *trap, int level)
{
 if (level<1) return 0; // savetycheck
 int see_trap = 0, id_trap = 0;

 // did we see trap?
 ndi(NDI_UNIQUE, 0, op, "Dex : %d", op->stats.Dex);
 ndi(NDI_UNIQUE, 0, op, "level : %d", level);
 ndi(NDI_UNIQUE, 0, op, "Cha : %d", trap->stats.Cha);
 ndi(NDI_UNIQUE, 0, op, "level : %d", trap->level);
 ndi(NDI_UNIQUE, 0, op, "dam : %d", trap->stats.dam);
 int chance = max(min(50 + op->stats.Dex + level - trap->stats.Cha, 100),0);
 int roll = RANDOM_ROLL(0, 99);
 ndi(NDI_UNIQUE, 0, op, "find trap : roll %d < chance %d)?", roll, chance);
 if (trap->stats.Cha<=1
    || roll<chance)
 {
  see_trap=1;
 }

 if (see_trap)
 {
  // did we id trap?
  chance = max(min(50 + op->stats.Dex + level - trap->level, 100),0);
  roll = RANDOM_ROLL(0, 99);
  ndi(NDI_UNIQUE, 0, op, "id trap : roll %d < chance %d)?", roll, chance);

  if (roll<chance)
  {
   id_trap=1;
   if (!QUERY_FLAG(trap, FLAG_IDENTIFIED))
   {
    SET_FLAG(trap, FLAG_IDENTIFIED);
   }
  }

  // we only calculate exp and give messages to players
  if (op->type == PLAYER)
  {
   int trap_exp = MAX(1, (trap->stats.Cha)) * MAX(1, trap->stats.dam);

   if (id_trap)
   {
    trap_exp = trap_exp + MAX(1, trap->level) * MAX(1, trap->stats.dam);
    ndi(NDI_UNIQUE, 0, op, "You spot a %s (lvl %d)!", trap->name, trap->level);
   }
   else
   {
    ndi(NDI_UNIQUE, 0, op, "You spot a trap, but can't identify it!");
   }
   exp_adjust(CONTR(op), SK_FIND_TRAPS, trap_exp, EXP_FLAG_CAP );
  }
  return 1; // trap seen
 }
 return 0; // trap not seen
}

I have tried this:
2 rolls, 1 for see trap against hiddenous, 1 for id trap against level
exp comes now from hiddenous and level instead from map difficulty and level (map difficulty is in hiddenous)
I have removed the *5, because this mainly meaned skill 10 below trap is 0% success, skill 10 above is 100% success. Without the *5, it's skill 50 below trap is 0%, skill 50 above trap is 100%. This also scales better with dex in formula.

So a level 1 skill with 10 dex has 60% chance against trap 1.

When we think of the generation of traps in trap_adjust we can get on "110 difficulty maps" traps up to 132. To handle such traps with 110 skill and 50 dex, this comes to 50+50+110-132 chance here, so 78% chance. To get 100% chance for this 132 trap a player needs 110 skill and 72 dex.

And i think we have higher difficulties in map, leading to much higher trap level and hiddenous values?
« Last Edit: 14, November 2022, 15:22:58 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. School medicine 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 you life. School medicine is corrupted by bad humans, like politician, like media.

Dolfo

« Reply #35 on: 11, November 2022, 13:40:23 »

This is how it looks currently. You see also some debug messages in, to see the trap stats and the rolls.

This is on Fanrir's chests, they are defined with 20 hiddenness. So my current exp calc gives this big amount on exp for finding this traps, but only less exp to remove this traps. It's a level 1 mouse trap with 2 damage.

My formula idea is mostly trap level * trap damage. This would lead to damage=exp on trap level 1 and 100*damage=exp on trap level 100. Thinking of traps level 110 inflicting 500 damage this is a good amount of exp (55000). And we have higher traps than 110 and i think also more damage than 500?

Because we have also this hiddeness i currently used (trap level+hiddeness)/2*trap damage for find traps, where a fail to id the trap also reduces the exp to the half.

On trap disarm i currently used trap_level*2(is see this is bug, should be *1) and give exp*2 on non id traps. I see this is also buggy above, so normaly this mouse trap level 1 dealing 2 damages should give 2 exp or 4 exp when it was unidenified.

I reduced the disarm chance by 50%, when it is unidentified, so mainly i say, we don't grant the 50/50 chance when traps are unidenfied. A char can only disarm this with skill+dex against the trap level.
Code: [Select]
int chance = max(min(id_trap?50:0 + op->stats.Dex + level - trap->level, 100),0);
Here is trap_disarm.
Edit missed a CLEAR_FLAG when trap was triggered
Edit fixed a bug missed some brackets
Code: [Select]
int trap_disarm(object_t *op, object_t *trap, int level)
{
 if (level<1) return 0; // savetycheck

 if (trap->stats.Cha <= 1)
 {
  // todo this should be in show trap, this is redundant here. but to be save let keep it in here for the moment
  if (QUERY_FLAG(trap, FLAG_SYS_OBJECT) ||
      QUERY_FLAG(trap, FLAG_IS_INVISIBLE))
   {
     trap_show(trap, trap);
   }

   int id_trap = QUERY_FLAG(trap, FLAG_IDENTIFIED);

   int chance = max(min((id_trap?50:0) + op->stats.Dex + level - trap->level, 100),0);
   int roll = RANDOM_ROLL(0, 99);
   ndi(NDI_UNIQUE, 0, op, "disarm trap : roll %d < chance %d)?", roll, chance);

   if (roll<chance)
   {
    ndi(NDI_UNIQUE, 0, op, "dam : %d", trap->stats.dam);

    int trap_exp = MAX(1, trap->level) * MAX(1, trap->stats.dam);
    if (!id_trap)
      trap_exp = trap_exp*2; // we grant double exp, if player managed to disarm an unidentified trap TODO to much?

    ndi(NDI_UNIQUE, 0, op, "You successfuly remove the %s (lvl %d)!", trap->name, trap->level);

    object_t *env = trap->env;
    remove_ob(trap);
    move_check_off(trap, NULL, MOVE_FLAG_VANISHED); // todo do we need this? when we use remove_ob with or without this?
    // set_traped_flag(env);
    CLEAR_FLAG(env, FLAG_IS_TRAPED);
    exp_adjust(CONTR(op), SK_REMOVE_TRAP, trap_exp, EXP_FLAG_CAP );
    return 1;
   }
   ndi(NDI_UNIQUE, 0, op, "You fail to remove the %s (lvl %d).", trap->name, trap->level);
   CLEAR_FLAG(trap->env, FLAG_IS_TRAPED);
   spring_trap(trap, op);
  }
  return 0;
}
« Last Edit: 24, November 2022, 15:22:52 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. School medicine 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 you life. School medicine is corrupted by bad humans, like politician, like media.

Dolfo

« Reply #36 on: 11, November 2022, 17:55:43 »
What a pain. First my pc crashed exactly when code blocks was saving my container.c. After that i had only zeros in my container.c. After restoring this and fixing several bugs, countless server restarts later, i am a step closer (to an empty mind). I had a situation where i found a trap, but could'nt id it, but managed to disarm it with a super lucky roll. This also reminds me, that it could be cool, to send things like rolls to a special log, where players can look in, to see their chances against their rolls.

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. School medicine 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 you life. School medicine is corrupted by bad humans, like politician, like media.

Dolfo

« Reply #37 on: 14, November 2022, 15:28:23 »
I changed exp calculation.

Now you gain trap hiddenous * trap damage exp when you find it
You gain additional trap level * trap damage exp when you id it
You gain trap level *trap damage * when you disarm a known trap (id before was a success)
You gain 2*trap level *trap damage * when you disarm an unknown trap (id before was a fail)

With my local changes to frahka i have also a trainer for these two skills up to frahkas level.
This means when a player reached level 2 trap find, but his trap disarm skill hang behind, he can go frahka and train to skill level 2 there.
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. School medicine 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 you life. School medicine is corrupted by bad humans, like politician, like media.

_people_

« Reply #38 on: 14, November 2022, 21:49:28 »
Does this also apply to runes? ATM they're basically the same thing as far as players are concerned, but in the future they may be given separate purposes. But if your changes apply to runes, how do non-damaging runes such as paralysis or confusion work with the above calculations?

Those traps might have a "damage" value that correlates with their potency but I haven't looked at the trap code to know if that's the case. If they don't have a useful damage stat, how do we determine EXP gain from them?
-- _people_ :)

Dolfo

« Reply #39 on: 14, November 2022, 21:54:31 »
Hm ok i don't have thought of this, perhaps we grant a fix value for this, like para 500 or so? Must look deeper, but so far it feels good, when it works against damage traps.
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. School medicine 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 you life. School medicine is corrupted by bad humans, like politician, like media.

Dolfo

« Reply #40 on: 24, November 2022, 15:21:48 »
I checked arches and also made some tests with slow, confusion and para traps. They have all damage and give exp.
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. School medicine 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 you life. School medicine is corrupted by bad humans, like politician, like media.

Tags:
 

Related Topics

  Subject / Started by Replies Last post
6 Replies
1113 Views
Last post 08, May 2005, 02:50:23
by Azgodeth
45 Replies
3682 Views
Last post 11, May 2007, 11:47:37
by angry
9 Replies
1927 Views
Last post 20, November 2007, 18:43:06
by Atan
3 Replies
70 Views
Last post 03, February 2022, 21:53:22
by _people_
3 Replies
85 Views
Last post 22, November 2022, 08:44:09
by Dolfo