Exact Devil Room spawn mechanics

#1ForteGSOmegaPosted 1/14/2012 4:47:19 PM
Although there was a helpful message from the devs explaining how to increase your odds, I was a bit more interested in the specific mechanics of the Devil Room, so, after some work, I took a look at the actionscript source code:

The basics:
The Devil Room can spawn once you clear the level's Boss Room based on your accumulated probability.
It cannot spawn in Basement 1 and Sheol.

base probability = 1%

Add the following percentages:
Have one Pentagramm: +20%
Have a second Pentagramm (is that even possible?): +10%
Have Book of Revelations: +35%
Have Book of Belial: +25%
Killed 1 or more beggars in current level: +35%
Took no damage in current level: +35%

The beggars in casinos don't seem to count; only the "normal" ones. Killing more than one has no effect.
Self-inflicted damage doesn't seem to count. (e.g. Razor, Kamikaze)

The strange/unimportant rules:
You just came out of the Devil Room: +99%
You entered the Devil Room two times on the current level OR the room didn't appear once you killed the boss: probability = 0%

Only one of these applies:
Met the devil in the current level or the level before: probability * 0.25
Met the devil two levels ago: probability * 0.5
Met the devil three or more levels ago: no change

Other stuff:
If I interpret the code correctly, Telepills seems currently to be bugged and can't transport to you the devil, only to the "I am Error" room (1/15 probability). I can't tell if this applies to the Teleporter item as well.
The Devil Room also has some special properties if accessed by teleport, assuming it's possible. (basically, it's ignored in the above calculations and Krampus can't spawn there)

Once you spawn a Devil Room, there is a 10% chance that Krampus is there instead (only once per playthrough)
---
"Naturally, I knows the hacker" - Kid, Ever17
#2Danzorz88Posted 1/14/2012 7:11:50 PM
Nice to know- Good job!
---
My PC: http://www.sysprofile.de/id150256
#3WOCPosted 1/14/2012 7:21:36 PM
Awesome.
---
"I killed him... with a SPOON!!!!"
#4Perfect SierraPosted 1/15/2012 3:15:51 AM
Nice one! I was hoping somebody would figure this stuff out one of these days.
---
...All of which makes me anxious.
At times, unbearably so.
#5Shigmiya64Posted 1/15/2012 6:27:01 AM
According to the post from Edmund McMillen, taking no damage from the boss is also supposed to increase your chances, but I don't see it there on your list.
---
"Remember to believe in magic, or I'll kill you."
#6ForteGSOmega(Topic Creator)Posted 1/15/2012 7:55:36 AM
As far as I see, bosses don't have any special consideration. The only suspicious thing is that the variable that has to do with the no damage part is called "bossdmg", but it's only manipulated twice per level (either set to "true" at the start of each level to indicate that no damage has been taken or set to "false" after you take ANY non-self-inflicted damage).

However, now that you mentioned it, there's another peculiarity: You don't get the percentage bonus if you take any HP damage. Losing soul hearts is ok.

I thought it worked like the "no damage" achievements which are lost even when you take soul heart damage, but it doesn't.

Also, it looks like the probability of Krampus appearing increases from 10% to 40% if you've made at least one deal with the devil in the current game.
---
"Naturally, I knows the hacker" - Kid, Ever17
#7Perfect SierraPosted 1/15/2012 8:41:10 AM
Also, it looks like the probability of Krampus appearing increases from 10% to 40% if you've made at least one deal with the devil in the current game.

Now I just hate Krampus even more. At least it's good for a free Devil Room item with Isaac's D6. With any other character, Krampus can take his (fairly) useless coal, cram it, and give me back my Devil Room! D:<
---
...All of which makes me anxious.
At times, unbearably so.
#8jpofgs_JPPosted 1/15/2012 10:55:59 AM
What code was it written it? How did you access it?
---
http://img190.imageshack.us/img190/7492/symbolks.jpg
White: 2064 8439 2270. Pearl: 3481 3456 6491
#9Shigmiya64Posted 1/15/2012 12:03:02 PM
Also according to McMillen, having "Devil items" increases the chance of seeing a Devil room. I'm guessing that whatever you took to mean the Pentagram item actually meant any qualifying item, which would explain why there's a condition for having more than one.
---
"Remember to believe in magic, or I'll kill you."
#10ForteGSOmega(Topic Creator)Posted 1/15/2012 1:33:22 PM(edited)
http://www.formspring.me/EdmundM/q/274309229433594889

The actual wording is "satanic item", which I interpret to mean Book of Revelations/Belial as well as the Pentagram. I'm 99% sure it's only Pentagram for the first step.

What code was it written it? How did you access it?

Actionscript.
Since the game is just Flash, you can extract the swf by dumping it from main memory and then decompile it using a Flash decompiler (there are dozens of those).

PM me if you want more info.

By the way, if there are any other game mechanics questions, feel free to ask, although I don't really understand most parts (like the exact mechanics of Lucky Foot).
---
"Naturally, I knows the hacker" - Kid, Ever17