K4thos Posted August 6, 2018 Share Posted August 6, 2018 (edited) I don't think I understand how to use probability1 and probability2 correctly despite messing with this engine for so long. In game example SPWI620 (Conjure Fire Elemental) There is a 60% chance that a 12-Hit-Dice elemental appears, a 35% chance that a 16-Hit-Dice elemental appears, and a 5% chance that a 24-Hit-Dice elemental appears. This spell implements above quoted chance like this: 1. probability1 = 60, probability2 = 0 2. probability1 = 95, probability2 = 61 3. probability1 = 100, parobability2 = 96 How exactly those values have been calculated? (mathematical formula would be useful) I have far more complicated probabilities to implement (simulating dice roll for opcode 67, which doesn't support rolls, on top of already 3 different chances to start summoning in the first place). I don't think I can do it when I'm struggling to understand such easy example. Thanks in advance. edit: wait a second don't tell me it's a matter of using this formula: % chance = probability1 - probability2 + 1 Edited August 6, 2018 by K4thos Quote Link to comment
CamDawg Posted August 6, 2018 Share Posted August 6, 2018 Probabilities are a straight d100 percentile dice roll, with the only twist being that values are 0-99 instead of 1-100. When a spell or ability is applied, the engine rolls for a value of 0-99 and then uses that for every effect in the spell. In your example: 1. probability1 = 60, probability2 = 0 - a d100 roll of 0-60, which is technically a 61% chance 2. probability1 = 95, probability2 = 61 - a d100 roll of 61-95, a 35% chance 3. probability1 = 100, probability2 = 96 - a d100 roll of 96-99, technically a 4% chance The 61/35/4 split (instead of the intended 60/35/5) is an error that's everywhere in the game--the current Fixpack beta fixes it and it's on the to-do list for future EE patches, but not 2.5. Quote Link to comment
CamDawg Posted August 6, 2018 Share Posted August 6, 2018 edit: wait a second don't tell me it's a matter of using this formula: % chance = probability1 - probability2 + 1 Ninja'd yourself while I was typing. Only bit I'd add is that the percentages are 0-99, not 1-100, and this causes a lot of small percentages to be off throughout the game. Quote Link to comment
K4thos Posted August 6, 2018 Author Share Posted August 6, 2018 thanks for additional information. I feel quite embarrassed that I didn't noticed it sooner Will take the error present in games into account. Quote Link to comment
K4thos Posted August 7, 2018 Author Share Posted August 7, 2018 one more question to not waste time testing if it's already known: If I use spell that has Cast Spell effect (opcode 146) with type = Cast Instantly, does the instant spell roll new probability values or does it retain the probability roll from the parent spell? Quote Link to comment
kjeron Posted August 7, 2018 Share Posted August 7, 2018 one more question to not waste time testing if it's already known: If I use spell that has Cast Spell effect (opcode 146) with type = Cast Instantly, does the instant spell roll new probability values or does it retain the probability roll from the parent spell?Only if the projectile used by the subspell's effects is instant-hit (uses projectile 0, 1, or a similar custom projectile). Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.