After 30,000 Wish spell casts, we can finally answer this 18 years old question
Myrag
Member Posts: 328
Don't ask me why. I don't know why, I just did it.
Question:
Answer:
Below are my findings.
If you are interested here is showcase of bot in action.
So first of all
So the conculsions from this table are.
Question:
Answer:
Question:
Answer:
So additionaly let's check how many good/bad options do you get on average in each cast.
So the conculsions from this table are.
Question:
Answer:
So how many good and bad results did we get.
So the conculsions from this table are.
Question:
Answer:
Did you dcoument the results?
Answer:
Yes. They are here https://docs.google.com/spreadsheets/d/1PwVY3Cyk5JwqCmIjzd6YM1Qu0pW_BlrJRPWrGTAKCuo/edit?usp=sharing
Question:
How long did it take you to do this?
Answer:
Script ran for 30 hours in total.
Question:
What tool did you use?
Answer:
AutoHotKey
Now we can finally invest those wisdom points into divine casters for extra casts.
Thank you for reading.
TL;DR
Question:
Does wisdom above 18 increase probability of good wish results
Answer:
No
Long Version
I wrote a bot program which did run the regular game (2.5.16 version) with no mods installed and used sorcerer casting wish spells under improved alacrity. Bot then read results from the game screen and saved output to the file. File later was simply processed to calculate results. 10,000 casts per three wisdom values 18, 21 and 25 for total of 30,000 casts and 150,000 wish options scanned.Below are my findings.
If you are interested here is showcase of bot in action.
So first of all
18 Wisdom | 21 Wisdom | 25 Wisdom | |||||
---|---|---|---|---|---|---|---|
Wish | Good Bad ? | Count | Chance% | Count | Chance% | Count | Chance% |
Abi-Dalzim's horrid wilting on everyone in the area, including the party. | BAD | 1927 | 19.3% | 1966 | 19.7% | 2022 | 20.2% |
All party members gain the temporary ability Greater Deathblow. | GOOD | 1983 | 19.8% | 1965 | 19.7% | 1916 | 19.2% |
All party members gain the temporary ability Hardiness. | GOOD | 1980 | 19.8% | 2050 | 20.5% | 2038 | 20.4% |
Breach on all enemies in the area. | GOOD | 2028 | 20.3% | 1979 | 19.8% | 2010 | 20.1% |
Bring a "meteor swarm" down upon the caster. | BAD | 2025 | 20.3% | 2049 | 20.5% | 2022 | 20.2% |
Cast a double-length time stop and improved alacrity on the caster. | GOOD | 2052 | 20.5% | 1960 | 19.6% | 2046 | 20.5% |
Create a random potion in the caster's inventory. | GOOD | 2001 | 20.0% | 1941 | 19.4% | 1987 | 19.9% |
Create a random wand in the caster's inventory. | GOOD | 2070 | 20.7% | 2046 | 20.5% | 2020 | 20.2% |
Everyone in the area, both party members and enemies, become intoxicated. | BAD | 1955 | 19.6% | 1976 | 19.8% | 1987 | 19.9% |
Haste everyone in the area, including enemies. | BAD | 1909 | 19.1% | 2012 | 20.1% | 2005 | 20.1% |
Heal everyone, party members and enemies included. | BAD | 2029 | 20.3% | 1910 | 19.1% | 1960 | 19.6% |
Improved haste on all enemies in the area. | BAD | 2036 | 20.4% | 2049 | 20.5% | 1954 | 19.5% |
Improved haste on all party members. | GOOD | 1991 | 19.9% | 1981 | 19.8% | 2028 | 20.3% |
Incur bad luck on everyone in the area, including party members. | BAD | 2016 | 20.2% | 2025 | 20.3% | 1992 | 19.9% |
Level drain two levels from each party member. | BAD | 2036 | 20.4% | 2002 | 20.0% | 1992 | 19.9% |
Magic resistance on everyone in the area, including enemies. | BAD | 1950 | 19.5% | 1966 | 19.7% | 2064 | 20.6% |
Make it as if the entire party has just rested a full night and rememorized all their spells. | GOOD | 2008 | 20.1% | 2073 | 20.7% | 1981 | 19.8% |
Miscast magic on everyone in the area, including party members. | BAD | 2064 | 20.6% | 2049 | 20.5% | 1979 | 19.8% |
Party loses 10,000 gp. | BAD | 2038 | 20.4% | 1995 | 20.0% | 2024 | 20.2% |
Raise all party members' characteristics to 25 for 4 rounds. | GOOD | 1956 | 19.6% | 1939 | 19.4% | 2033 | 20.3% |
Restoration on all party members. | GOOD | 1982 | 19.8% | 1984 | 19.8% | 1978 | 19.8% |
Resurrection on all dead party members. | GOOD | 2028 | 20.3% | 2027 | 20.3% | 2018 | 20.2% |
Temporarily reduce the Wisdom of all party members to 3. | BAD | 1932 | 19.3% | 2053 | 20.5% | 1954 | 19.5% |
Temporarily remove half of the caster's HP. | BAD | 1989 | 19.9% | 1984 | 19.8% | 1982 | 19.8% |
Temporarily set Strength to 18 for everyone in the area, including enemies. | BAD | 2015 | 20.2% | 2019 | 20.2% | 2008 | 20.1% |
So the conculsions from this table are.
Question:
Are all options of equal chance?
Answer:
Yes. Around 20% to get each option during single cast, this is because there are exactly 25 options and you choose 5 of them.
Question:
Does wisom increase the chances of any option?
Answer:
No
So additionaly let's check how many good/bad options do you get on average in each cast.
18 Wisdom | 21 Wisdom | 25 Wisdom | ||||
---|---|---|---|---|---|---|
Good Results | Count | Chance% | Count | Chance% | Count | Chance% |
0 | 377 | 3.8% | 402 | 4.0% | 351 | 3.5% |
1 | 2040 | 20.4% | 2107 | 21.1% | 2096 | 21.0% |
2 | 3778 | 37.8% | 3748 | 37.5% | 3778 | 37.8% |
3 | 2821 | 28.2% | 2720 | 27.2% | 2807 | 28.1% |
4 | 900 | 9.0% | 933 | 9.3% | 858 | 8.6% |
5 | 84 | 0.8% | 90 | 0.9% | 110 | 1.1% |
So the conculsions from this table are.
Question:
What is the chance to get zero good options?
Answer:
Only ataround 3.5-4% casts you won't get any option which can be considered always good.
So how many good and bad results did we get.
18 Wisdom | 21 Wisdom | 25 Wisdom | ||||||
---|---|---|---|---|---|---|---|---|
Result | Count | Chance% | Count | Chance% | Count | Chance% | Wishes | Chance% |
BAD | 27921 | 55.8% | 28055 | 56.1% | 27945 | 55.9% | 14 | 56.0% |
GOOD | 22079 | 44.2% | 21945 | 43.9% | 22055 | 44.1% | 11 | 44.0% |
So the conculsions from this table are.
Question:
Are good/bad options happening more often?
Answer:
Because there are 14 bad options and 11 good options they will appear in 56% to 44% spread.
FAQ
Question:Did you dcoument the results?
Answer:
Yes. They are here https://docs.google.com/spreadsheets/d/1PwVY3Cyk5JwqCmIjzd6YM1Qu0pW_BlrJRPWrGTAKCuo/edit?usp=sharing
Question:
How long did it take you to do this?
Answer:
Script ran for 30 hours in total.
Question:
What tool did you use?
Answer:
AutoHotKey
Now we can finally invest those wisdom points into divine casters for extra casts.
Thank you for reading.
Post edited by Myrag on
40
Comments
so we now know for sure that wis over 18 is not helping, thing that was a common knowledge, but was never proved true.
but now we also know that each possible outcome has the same 20% probability, thing that before your experiment was quite uncertain. this is something i almost ever do with a charname sorcerer.
but sometimes i use mod sorcerers, tashia and kelsey, that don't meet the requirement, and other times i use the mage npcs, even if a mage is less suited to make the best use of wish.
anyway with charname, mod sorcerers or npc mages i think that the wish spell is best used trough a PI clone for a couple of reasons.
you multiply your wish casts by the number of PI you have memorized, and you avoid the effects of some bad choices:
"Party loses 10,000 gp." if you kill the PI or if it kills himself with spells, but not if is dispelled, must use skull traps or other damaging ones, you can collect the money on the ground, same is true for the potions and wands you can get from other choices.
"Temporarily remove half of the caster's HP." is a PI who cares?
and as long as a PI is used, at least in vanilla, a potion in quick slot fixes a low wis without spending the potion.
about the trick to collect items from a dead clone i did not know it as i don't upgrade the game, as i don't like those tricks fixed imo freedom should be left to the player if to use them or not.
still in the original game, that i find myself playing more often than the EE and also other players still use it works and is pretty useful.
That being said, I think @Myrag's bot program is a rather brilliant idea. I find it very cool, the concept of rigging a program to do these sort of automatic tasks. I think these types of programs are very underused, and it's really only because most people don't know how to program them. On many occasions, I've noticed that there's a simple and repetitive task that I had to do, which a computer could do more easily, but I didn't know how to set up a program like that.
@Myrag
I gave you an "insightful" but really think you deserve a special "impressive and ingenious" icon.
Essentially, SetupWish tells the game to go start rolling through a specific column in wish.2da, e.g. casters with >= 18 wisdom use the fourth column. The entries in the column are numbers, corresponding to setting the global WishPowerXX to 1, in turn enabling a dialogue reply. Now, the IESDP claims that the column gets parsed, top-to-bottom, with a 50% chance for each entry to be selected. If this was the case, then the first entry should have a 50% chance to always be a selection and we'd see a steady progression downward in the probabilities as we proceed down the list. This is not reflected in @Myrag 's testing, suggesting the IESDP is in error.
It seems that, instead, five entries are selected with equal weight from the (in case of >= 18 wisdom) 25 available, resulting in the roughly equal 20% chance we see in the actual field testing.
Thank you for your service.
One thing that I thought that wasn't conclusive is that this wouldn't be the first case where some parts of spell are hardcoded in the game itself (I'm looking at you stoneskin color change).
You are 100% correct and I did check dialog files before. I assumed I will get above results anyway but I thought it will be a fun little project and opportunity for me to learn new scripting language, and it was.
Very often on forums I see people debating things and doing manual tests to prove theory so I thought this could come handy in future to test things.
Anyway, thanks a ton for solving the issue.
Clearly it would, if people can learn your method. To that end, would you mind sharing your AutoKey source code and setup, if it is not too time consuming ?
I will share the code after I clean it up. It's super messy since it was my first time writing using this scripting language. It is 100 liner written in 2 hours so.
Well this is a major coincidence as our timing is synced down to the day. I kind of like these things because we're never completely independent from one another. Maybe someone posting somewhere else sparked your will to do this test by talking about Wish, and that someone actually was talking about it because he stumbled on the wiki yesterday (and so on). Whether pure coincidence or indirect dependence, that came RIGHT on spot to end my questioning, so thank you
That is, unless it works differently on BG2:TOB non-EE...
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. global counter := 0 Esc:: BreakLoop = 1 return ^j:: counter := 1 Loop, { if (BreakLoop = 1) break ; Reload Game Send, R Sleep, 1500 ; Wish CastWish() CastWish() CastWish() CastWish() CastWish() ; Wait 3 seconds for genies to spawn Sleep, 3000 ; Genie #1 TestGenie() TestGenie() TestGenie() TestGenie() TestGenie() } BreakLoop = 0 return CastWish() { Sleep, 200 Send, M Sleep, 200 Send, {Space} } CheckScreen(image) { CoordMode Pixel, Window ImageSearch, FoundX, FoundY, 100, 630, 800, 800, *20 *TransBlack %image%.png if ErrorLevel = 2 FileAppend, %counter% Could not conduct the search.`n, test.txt else if ErrorLevel = 1 ; Didn't find option Sleep, 1 else FileAppend, %counter% %image%`n, test.txt } TestGenie() { Sleep, 1000 Send, 1 Sleep, 200 Send, {Space} Sleep, 200 Send, {Space} Sleep, 200 CheckScreen("adhw") CheckScreen("death") CheckScreen("hard") CheckScreen("breach") CheckScreen("swarm") CheckScreen("ia") CheckScreen("potion") CheckScreen("wand") CheckScreen("toxic") CheckScreen("haste") CheckScreen("healall") CheckScreen("ihe") CheckScreen("ihpm") CheckScreen("badluck") CheckScreen("drain") CheckScreen("magic") CheckScreen("rest") CheckScreen("miscast") CheckScreen("money") CheckScreen("stats") CheckScreen("resto") CheckScreen("ress") CheckScreen("wisdom") CheckScreen("half") CheckScreen("strength") Sleep, 200 Send, 1 counter++ Sleep, 200 return var }
Then I simply have folder with all 25 screenshots of the answers like those.
What script does is probably very unoptimzied way to do this but
Again here is the video how it works.
https://www.youtube.com/watch?v=iiHOSeYmm60
Also, I checked EE autoroller which appearently is written also in AutoHotKey that there is much more clever way to do this by reading values from game memory rather than simplistic way from the screen. Which without right conditions is very error prone. In my case I specifically positioned my sorc in watchers keep so that dialogue spawns with entire black background so it's wasy to match screens. My current script won't work without special setup (i.e. it assumes sorcerer can cast 5 wish spells, that cast time i 0 from vecna and aop, game is saved with improved alacrity buff on, background of dialogue is black).
Net net, I would read results from the memory next time but it was still a fun project.
I actually like that CheckScreen function. Using memory would have been my first idea, reading from screen data sounds complicated. Yet look at how simple it is with ImageSearch. Reading from memory is faster, but not as interesting as text recognition, if it really is what's going on.
(Edit: Oooh, it's not text recognition, you're using a template image of the dialog line and checking if it exists on screen ? Crafty.)
You could improve your process next time you need it, by creating custom items and creatures with NearInfinity: In the current case, that would have erased the whole "reload the game" part and increased Wish chain casting beyond 5 at a time, while avoiding crippling consequences for the character. Both techniques combined should make things way more convenient, and reduce that 30 hours duration. I'll post a couple files soon if you want to "get a grasp" with actively using NearInfinity (instead of just reading from it), like you did for me with AutoHotKey.
Here they are, just skip the stupidly long wall of text till the first link, and read a bit around it to see what it does and what's the point. You should quickly find whether you can make use of this approach to answer BG2 oddity questions with a better quality of life and reduced time loss. Can't beat automation, but can combine well and probably comes in handy in more cases.
I have an unknown though. Is it fine to share this type of file, can you even make use of them on BG2:EE ? I can only test on vanilla.