Jump to content


Feature probability is invalid


29 replies to this topic

#1 Miloch

    Barbarian

  • Modders
  • 4704 posts
  • Gender:Male
  • Location:At Large

Posted 20 August 2009 - 07:59 PM

If I set an effect on an item with what I would think to be a 1% chance - the probability from, say 40 to 40 (it triggers on a 40 rolled on a d100), DLTCEP gives me the above message. Is it really the case? Because if I wanted to have 100 different 1% effects, either there aren't enough numbers to go around or I'd have to overlap (40 to 41, 41 to 42 etc.).
Mod Contributions
Aurora (new release!) * BG1 NPC * Gnomes * Haiass * Level 1 NPCs * Lost Items * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * In Progress: Adjusted Portraits * DSotSC (Tutu)
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * PSPad Highlighters * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Wherefore do ye toil; is it not that ye may live and be happy? And if ye toil only that ye may toil more,
when shall happiness find you?" -H.P. Lovecraft, The Quest of Iranon

#2 Avenger

  • Modders
  • 3364 posts
  • Gender:Male
  • Location:Hungary

Posted 20 August 2009 - 11:40 PM

0-100 is 100%
0-1 is 1%
-->
1-100 is 99%
reiterate.

Edited by Avenger, 20 August 2009 - 11:41 PM.


#3 Miloch

    Barbarian

  • Modders
  • 4704 posts
  • Gender:Male
  • Location:At Large

Posted 21 August 2009 - 01:07 AM

Ok, so I would have to overlap numbers? I always thought it'd be 0-24, 25-49, 50-74, 75-100 if I wanted a 1 in 4 chance for different effects.
Mod Contributions
Aurora (new release!) * BG1 NPC * Gnomes * Haiass * Level 1 NPCs * Lost Items * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * In Progress: Adjusted Portraits * DSotSC (Tutu)
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * PSPad Highlighters * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Wherefore do ye toil; is it not that ye may live and be happy? And if ye toil only that ye may toil more,
when shall happiness find you?" -H.P. Lovecraft, The Quest of Iranon

#4 Avenger

  • Modders
  • 3364 posts
  • Gender:Male
  • Location:Hungary

Posted 21 August 2009 - 01:23 AM

Well, think of the high value as 1d100 values go (1-100) and subtract one for the low values (0-99).

0-1 and 1-2 don't overlap.

0-1 is 1%
1-2 is another 1%
no room for overlap.
0-2 would be 2% entirely covering the previous 2.

0-0 is not happening
1-1 is not happening
You could fill your effect block with 0-0, 1-1, ... 100-100, and you wouldn't see a damn effect happening.

I know it is difficult to comprehend 0 based counting, but computers are like that.

#5 Miloch

    Barbarian

  • Modders
  • 4704 posts
  • Gender:Male
  • Location:At Large

Posted 31 August 2009 - 09:18 AM

View PostAvenger, on Aug 21 2009, 05:23 AM, said:

Well, think of the high value as 1d100 values go (1-100) and subtract one for the low values (0-99).

0-1 and 1-2 don't overlap.
Well I did some pretty extensive testing and that doesn't seem to be the way it works, unless I'm still not understanding something.

I made an item that has a bunch of different effects and set them all up this way. So for example, from probability 26-32, it inflicts disease. From 32-39 it inflicts blindness. According to your definition, there should not be an overlapping chance to get both - but I've managed to do it, presumably on a roll of 32. And since all the effects were set up this way, I've managed to get an overlap where I get hit with 2 effects fairly frequently.

Edit:
Moreover, I made a test item that stacked a bunch of effects with 0-0, 1-1, 2-2 probability etc. I got some of them to fire, disproving this:

Quote

0-0 is not happening
1-1 is not happening
You could fill your effect block with 0-0, 1-1, ... 100-100, and you wouldn't see a damn effect happening.
So maybe you need to disable this error message :party:.

Edited by Miloch, 31 August 2009 - 10:23 AM.

Mod Contributions
Aurora (new release!) * BG1 NPC * Gnomes * Haiass * Level 1 NPCs * Lost Items * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * In Progress: Adjusted Portraits * DSotSC (Tutu)
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * PSPad Highlighters * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Wherefore do ye toil; is it not that ye may live and be happy? And if ye toil only that ye may toil more,
when shall happiness find you?" -H.P. Lovecraft, The Quest of Iranon

#6 Avenger

  • Modders
  • 3364 posts
  • Gender:Male
  • Location:Hungary

Posted 31 August 2009 - 10:22 AM

Interesting, but this means either a 1,1 is the same as 0,1, or 100,100 doesn't work.
Or 1,1 is not 1% but 1/101.

Edited by Avenger, 31 August 2009 - 10:24 AM.


#7 Miloch

    Barbarian

  • Modders
  • 4704 posts
  • Gender:Male
  • Location:At Large

Posted 31 August 2009 - 10:25 AM

Hmm, well it might take a while to prove whether 100-100 works. I guess I could script my guy to continuously use an item with unlimited charges...
Mod Contributions
Aurora (new release!) * BG1 NPC * Gnomes * Haiass * Level 1 NPCs * Lost Items * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * In Progress: Adjusted Portraits * DSotSC (Tutu)
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * PSPad Highlighters * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Wherefore do ye toil; is it not that ye may live and be happy? And if ye toil only that ye may toil more,
when shall happiness find you?" -H.P. Lovecraft, The Quest of Iranon

#8 Avenger

  • Modders
  • 3364 posts
  • Gender:Male
  • Location:Hungary

Posted 31 August 2009 - 10:49 AM

Maybe Taimon knows the answer

#9 Miloch

    Barbarian

  • Modders
  • 4704 posts
  • Gender:Male
  • Location:At Large

Posted 31 August 2009 - 12:41 PM

View PostMiloch, on Aug 31 2009, 02:25 PM, said:

Hmm, well it might take a while to prove whether 100-100 works. I guess I could script my guy to continuously use an item with unlimited charges...
So I did this and let it rip in the background for about an hour. I've gotten the 0-0 message 4 times, the 1-1 message 8 times and the 100-100 message a total of zero times. This strongly suggests that on a percentile basis, 0 = 1, 99 = 100 and 100 is not a valid value.

Incidentally, when you create an item with zero charges, it makes it unlimited charges for all practical purposes, but also creates an occasional bug that creates 65535 copies of the item in one stack (weighing several tonnes for a 1lb item). Is this a known issue? Maybe it's related to the bugs with "unlimited" stacking/bags of holding components (I don't have those installed, but folks have reported similar things).

Also, as long as I'm reporting weird random stuff I'm not completely sure of, is it just me or does UseItem only work for certain items, like potions? I tried making the test item a wand at first and it did nothing in scripting until I changed it to a potion.
Mod Contributions
Aurora (new release!) * BG1 NPC * Gnomes * Haiass * Level 1 NPCs * Lost Items * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * In Progress: Adjusted Portraits * DSotSC (Tutu)
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * PSPad Highlighters * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Wherefore do ye toil; is it not that ye may live and be happy? And if ye toil only that ye may toil more,
when shall happiness find you?" -H.P. Lovecraft, The Quest of Iranon

#10 Taimon

  • Members
  • 544 posts
  • Gender:Not Telling

Posted 31 August 2009 - 12:59 PM

The game checks for (rand <= prob1) && (rand >= prob2) with rand in range 0-99.

#11 Miloch

    Barbarian

  • Modders
  • 4704 posts
  • Gender:Male
  • Location:At Large

Posted 25 March 2012 - 11:50 PM

This should probably be fixed in DLTCEP so there isn't an "invalid probability" message when setting an effect from 0 - 0, 1 - 1 or whatever (because it will fire 1% of the time in such cases, unless you choose 100 - 100 as 100 is not a valid die roll).

However, we made an interesting discovery in BG1 (with and without TotSC). I'm not sure if this is known but it doesn't appear to be documented anywhere. The engine either pretty much ignores probabilities or it causes bugs at best. If, for example, you have an item with staggered effect probabilities from 0-33, 34-66, 67-99 or even 0-4, 5-9, 10-14, all three effects will fire regardless. I think I have seen only 2 fire, but never just 1 or 0. It is perhaps not surprising that there are no such items in the vanilla game (except slimed2.itm and sw1h99.itm, both unused).
Mod Contributions
Aurora (new release!) * BG1 NPC * Gnomes * Haiass * Level 1 NPCs * Lost Items * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * In Progress: Adjusted Portraits * DSotSC (Tutu)
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * PSPad Highlighters * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Wherefore do ye toil; is it not that ye may live and be happy? And if ye toil only that ye may toil more,
when shall happiness find you?" -H.P. Lovecraft, The Quest of Iranon

#12 Avenger

  • Modders
  • 3364 posts
  • Gender:Male
  • Location:Hungary

Posted 26 March 2012 - 02:11 AM

As far as I know, BG1 has only one probability field.

And back to the original issue, so, if i understand this correctly, 0-1 is 2%.
And 0-99 is exactly the same as 0-100.

Edited by Avenger, 26 March 2012 - 02:13 AM.


#13 Echon

    Planewanker

  • Members
  • 306 posts
  • Gender:Male
  • Location:Denmark

Posted 26 March 2012 - 02:13 AM

View PostMiloch, on 25 March 2012 - 11:50 PM, said:

However, we made an interesting discovery in BG1 (with and without TotSC). I'm not sure if this is known but it doesn't appear to be documented anywhere. The engine either pretty much ignores probabilities or it causes bugs at best. If, for example, you have an item with staggered effect probabilities from 0-33, 34-66, 67-99 or even 0-4, 5-9, 10-14, all three effects will fire regardless. I think I have seen only 2 fire, but never just 1 or 0. It is perhaps not surprising that there are no such items in the vanilla game (except slimed2.itm and sw1h99.itm, both unused).

I have been aware of the example you use since I began working on FotD. I think Ghreyfain explained to me a long time ago how it actually works. You cannot make the effects mutually exclusive because prob2 has to be 0 but you can still add some random element. . If you want a spell that improves AC by 1D4, make four AC +1 effects with probabilities 0-25, 0-50, 0-75 and 0-100.

#14 Miloch

    Barbarian

  • Modders
  • 4704 posts
  • Gender:Male
  • Location:At Large

Posted 26 March 2012 - 03:48 AM

View PostAvenger, on 26 March 2012 - 02:11 AM, said:

And back to the original issue, so, if i understand this correctly, 0-1 is 2%.
And 0-99 is exactly the same as 0-100.
Correct.

View PostEchon, on 26 March 2012 - 02:13 AM, said:

I think Ghreyfain explained to me a long time ago how it actually works. You cannot make the effects mutually exclusive because prob2 has to be 0 but you can still add some random element. . If you want a spell that improves AC by 1D4, make four AC +1 effects with probabilities 0-25, 0-50, 0-75 and 0-100.
Interesting... doesn't help much for what I wanted to do though, which was have separate random effects. I just worked around it using a sort of averaging that will have to suffice for the BG1 engine.
Mod Contributions
Aurora (new release!) * BG1 NPC * Gnomes * Haiass * Level 1 NPCs * Lost Items * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * In Progress: Adjusted Portraits * DSotSC (Tutu)
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * PSPad Highlighters * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Wherefore do ye toil; is it not that ye may live and be happy? And if ye toil only that ye may toil more,
when shall happiness find you?" -H.P. Lovecraft, The Quest of Iranon

#15 Avenger

  • Modders
  • 3364 posts
  • Gender:Male
  • Location:Hungary

Posted 26 March 2012 - 09:26 AM

Ok, it will allow equal min and max values from now.




Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users