The Binding of Isaac: Rebirth

The Binding of Isaac: Rebirth

Nazemec Aug 25, 2016 @ 2:02pm
About item generation: item pools and itempools.xml.
IMPORTANT:
This thread is only for people who like to know how the game actually works. Therefore, potential readers may be modders or people who like to know things. Occasional players who don't care about hose things, you do not have to read more than that. Have a nice day. :D

IMPORTANT2:
All of this is taken from personal tests using Afterbirth. I didn't read anything anywhere else, and did not test anything on Rebirth only. However, reading the Rebirth files shouldn't be hard. I'll check those if people want me to.

IMPORTANT3:
I'm not talking here about "forced generation" items, such as Steam Sale from killing Greed. Those ones actually do not care about item pools, which is the main topic here.

Somewhat less important, I guess:
I apologize for any syntax/grammar error, if there are any. English isn't my native language.

______________
THREAD START:
Hello everyone. Well, those who read this at least. :P

There is a saying about item generation in this game. "You can see the same item only once from a specific item pool". i was absolutely convinced it was true.
...
I'll be blunt.
...
This is wrong.

Earlier today, I posted in a topic some info about item generation, based from personal experience and things I was reading in the .xml files themselves.

For those who don't know, tons of info are actually stored in .xml files (text files, basically), from starting item for each character to details about challenge generation, how to animate things, name of mini bosses, items name and descriptions, where to find the sprites, which sound files to play... Tons of stuff.

Back to the point.
I was reading the itempools.xml file, and something looked... strange to me. More precisely, the syntax.

Here's the basic syntax of this file:
<ItemPools> <Pool Name="PoolName1"> <Item DecreaseBy="1" Id="5" RemoveOn="0.1" Weight="1" /> <Item DecreaseBy="1" Id="6" RemoveOn="0.1" Weight="1" /> <Item DecreaseBy="1" Id="7" RemoveOn="0.1" Weight="1" /> [...] </Pool> <Pool Name="PoolName2"> [...] </Pool> [...] </ItemPools>
(Note: this isn't actually from the file, but follows the exact same syntax.)

See that "decrease by" thing? That's what bothered me. So, I tried things.

Setup for the tests:
I changed the treasure item pool. I basically removed everything, and left only 3 items. I didn't change any other item pool.
Here's what it became:
<Pool Name="treasure"> <Item DecreaseBy="1" Id="5" RemoveOn="0.1" Weight="1" /> <Item DecreaseBy="1" Id="6" RemoveOn="0.1" Weight="1" /> <Item DecreaseBy="0.5" Id="7" RemoveOn="0.1" Weight="1" /> </Pool>
(Note: corresponding items are "My Reflection", "Number One", and "Blood of the Martyr", in that order.)

I also changed the charge of the D6, from 6 to 0 (in the items.xml file), making it effectively infinitely charged. That way, i can use it repeatedly in the same treasure room without batteries.


Then? I found an treasure room, starting with Isaac and his D6, noted which item I found, and then rerolled it again and again until the item pool was empty (= generates only Breakfast, default item). Here's what I saw on the first try:
Number One.
Blood of the Martyr.
My Relfection.
Blood of the Martry.
Breakfast. (End.)

Further tests gave similar results.

Yeah, great thread and all. What's the point?
We can now explain how the game can (or can't) generate the same item multiple times from the same pool.

Explanation:
Every item here starts with a weight of 1 (in this scenario), and there are 3 items. They all have 1/3 chance to be generated. Once one is generated, its weight loses the "decrease by" amount, and if it falls below the "remove on" value, then it can't be generated again.
In this scenario, "Blood of the Martyr" got generated once and resulted in a weight of 0.5. It was still above 0.1, so it was generated again later.


Ok, well, that's cool. But what's the point? I mean, this is only some test thing, it isn't in the actual game right?
Yeah sure. I'm writing all of this because I'm fatasying about something cool.
...
Let's see some lines from itempools.xml. :P

I'm not posting the whole file, only some lines from different item pools as examples with some comments if needed.
<Pool Name="treasure"> <Item DecreaseBy="1" Id="15" RemoveOn="0.1" Weight="1" /> //Every item in this pool has the same weight and "decrease by". Same values for Boss item pool, and some others. </Pool> <Pool Name="devil"> <Item DecreaseBy="1" Id="81" RemoveOn="0.1" Weight="1" /> //Same as the treasure pool, except for one item... <Item DecreaseBy="0.2" Id="441" RemoveOn="0.1" Weight="0.2" /> //According to its weight, this one is 5 times rarer than any other item from its pool. Won't spoil its name, but it's the only item with 12 charges. Those who unlocked it know what it is. </Pool> <Pool Name="shop"> <Item DecreaseBy="0.5" Id="63" RemoveOn="0.1" Weight="1" /> //Same numbers for every item in this pool. But their weight decreases by 0.5, not 1! It is possible to see those items twice in shops, in the same run! Same values for the Challenge pool and beggars amongst others. </Pool> <Pool Name="goldenChest"> <Item DecreaseBy="0.4" Id="38" RemoveOn="0.1" Weight="1" /> //Again, same values for every item in this pool. Each can appear 3 times in the same run (at 1, 0.6, and 0.2)! Same values for the Red Chest pool.

CONCLUSION:
In most items pools, the most common ones (treasure, boss, devil, angel), items can only be found once.
In some item pools, items can be found twice, or even thrice! But as they are found, their weight decreases and are therefore less likely to be generated compared to not-yet-seen items. In small item pools, because of their size, it's easier to get the same item again (if it is possible).


If you have any other theory, or want to comment, feel free to do so.
Have a nice day/night/anyting/meh. :P
< >
Showing 1-15 of 24 comments
Quokka Aug 25, 2016 @ 2:34pm 
Awesome :)

I want to ask, would you know the details on the weight of the Bible? I have seen that item appear more than 4 times in one playthrough. Is it coded with a high weight, or possibly appears so many times due to being found in multiple item pools?

Does finding an item via one item pool decrease its weight as calculated in a different item pool?

"<Pool Name="shop">
<Item DecreaseBy="0.5" Id="63" RemoveOn="0.1" Weight="1" />
//Same numbers for every item in this pool. But their weight decreases by 0.5, not 1! It is possible to <<<<see>>>> those items twice in shops, in the same run! Same values for the Challenge pool and beggars amongst others."

Is the weight reduced again when you pick an item up as opposed to just seeing it. Or rather, with regards to the coding, how are items made unable to appear after being picked up? Is it through the same weight reduction mechanic?
Nazemec Aug 25, 2016 @ 2:46pm 
The Bible is in 3 different item pools, each time with a wieght of 1:
Shop. Can appear twice.
Angel. Can appear once.
Library. Can appear... 10 times?!
<Item DecreaseBy="0.1" Id="33" RemoveOn="0.1" Weight="1" />
Same values for every book in this item pool! 10 times each, woooo! :D

I'll check right away if item pools are effectively considered separately or not (testing with the treasure and boss pools). I'll edit this post with the result. Results down there.
(I always thought they are separated. But yeah, I can check that, just to be sure.)

Seeing the item is enough. I didn't pck any in my tests and the pool got depleted.
And yeah, I think that's how the game prevents generation. When the actual weight becomes lower than the "remove on" value, this specific item won't be generated anymore from that pool. And this occurs as soon as the item is generated (= when you see it).
Last edited by Nazemec; Aug 25, 2016 @ 3:23pm
Phaper Aug 25, 2016 @ 2:48pm 
Originally posted by googee11:
Is the weight reduced again when you pick an item up as opposed to just seeing it.

I am also curious about this.

The Isaac conventional wisdom is 'pick up an item so it won't show up again', so I'd like to know if that's true.


@googlee: The Bible shows up in three (Treasure, Angel, Shop) item pools. Shops have a lower weight decrease, and libraries have more total items + a smaller total pool, so it's not surprising.

There's also the forced spawn of Pandora's Box on Womb II.
Nazemec Aug 25, 2016 @ 2:49pm 
Originally posted by Phaper:
Originally posted by googee11:
Is the weight reduced again when you pick an item up as opposed to just seeing it.

I am also curious about this.
Oh, I didn't read the "again" word. Will check that too. x)
Quokka Aug 25, 2016 @ 2:53pm 
Originally posted by Nazemec:

Seeing the item is enough. I didn't pck any in my tests and the pool got depleted.
And yeah, I think that's how the game prevents generation. When the actual weight becomes lower than the "remove on" value, this specific item won't be generated anymore from that pool. And this occurs as soon as the item is generated (= when you see it).

<Edit: just saw your follow up post :)>

So in your original post you said that Blood of the martyr got generated twice. If you were to pick it up the first time you saw it, would you then be able to see it in a future treasure room?

Does picking an item up automatically make it unable to appear from the same item pool again?
Last edited by Quokka; Aug 25, 2016 @ 2:53pm
Nazemec Aug 25, 2016 @ 3:22pm 
Completed the tests. I'm... surprised.

Questions:
Are item pools independant?
If you take an item, will it ever be generated again? In the same pool? Other pools?

___
Test setup 1:
Some passive items are left in the treasure pool. Only one spacebar item is kept there, its weight reduction changed to 0.2 (other items are kept at 1).
The boss pool is changed to be an exact copy of this one.

Test 1: is generation working as expected?
Action: item is rerolled until the pool is depleted. Done for both treasure and boss items.
Result: the spacebar item was generated 5 times (sometimes in a row, funny to see). Other items only once. Both times. As expected.

Test 2: what if you take the item, put it back on the pedestal, then reroll it again?
Action: as in the question. Then, rerolled until the pool is depleted. The boss item was immediately rerolled until breakfast.
Result: the spacebar item did not appear another time. From any pool.

___
Test setup 2:
Same, but with a passive item.

Tests: same as above.
Results: same as above.

___
Conclusions:
- Item pools are mostly independant. Items seen in one pool won't affect generation for other pools, they will only affect their own pool.
- An item can be generated multiple times from the same item pool as long as you don't pick it up (if its data doesn't prevent it of course).
- If you pick up an item (spacebar or passive), it will be removed from every item pool. Its remaining weight is irrelevant.
Quokka Aug 25, 2016 @ 3:28pm 
Originally posted by Nazemec:
Completed the tests. I'm... surprised.

Questions:
Are item pools independant?
If you take an item, will it ever be generated again? In the same pool? Other pools?

___
Test setup 1:
Some passive items are left in the treasure pool. Only one spacebar item is kept there, its weight reduction changed to 0.2 (other items are kept at 1).
The boss pool is changed to be an exact copy of this one.

Test 1: is generation working as expected?
Action: item is rerolled until the pool is depleted. Done for both treasure and boss items.
Result: the spacebar item was generated 5 times (sometimes in a row, funny to see). Other items only once. Both times. As expected.

Test 2: what if you take the item, put it back on the pedestal, then reroll it again?
Action: as in the question. Then, rerolled until the pool is depleted. The boss item was immediately rerolled until breakfast.
Result: the spacebar item did not appear another time. From any pool.

___
Test setup 2:
Same, but with a passive item.

Tests: same as above.
Results: same as above.

___
Conclusions:
- Item pools are mostly independant. Items seen in one pool won't affect generation for other pools, they will only affect their own pool.
- An item can be generated multiple times from the same item pool as long as you don't pick it up (if its data doesn't prevent it of course).
- If you pick up an item (spacebar or passive), it will be removed from every item pool. Its remaining weight is irrelevant.
Awesome work thanks :) This answers my questions completely. Although I will mention that the Bible can appear even after being picked up. Whenever I have chaos there are certain items that multiple times so I always pick them up to not see them again. The bible, even after being picked up can appear. Haven't noticed this with any other items aside from forced spawns like Krampus> lump of coal.

Not meaning to send you on a detective case :) just thought you might like the info

Thanks again
Pig Mugi Aug 25, 2016 @ 3:33pm 
playing as lost is much easier than THIS
Nazemec Aug 25, 2016 @ 3:35pm 
Originally posted by googee11:
Awesome work thanks :) This answers my questions completely. Although I will mention that the Bible can appear even after being picked up. Whenever I have chaos there are certain items that multiple times so I always pick them up to not see them again. The bible, even after being picked up can appear. Haven't noticed this with any other items aside from forced spawns like Krampus> lump of coal.

Not meaning to send you on a detective case :) just thought you might like the info

Thanks again
Strange indeed. Especially since the spacebar item I tested with was the Bible... :P
Theory: maybe the forced generations are considered as hard coded, one item pools? From what we know, Chaos first chooses a pool, and then an item within them. Could Chaos choose this "hidden pool", then generate its only item while not depleting it? Or maybe Chaos generation doesn't make the item disappear from other pools?
No idea. Chaos is a really special item, and the way we see it work may be different from the way it really works... I won't look any further about that one, haha. x)


Originally posted by Ярпиво Zer0:
playing as lost is much easier than THIS
Well, if you're not into coding, it makes sense. x)
Quokka Aug 25, 2016 @ 3:38pm 
haha I don't blame you :) thanks again
Phaper Aug 25, 2016 @ 3:42pm 
If you pick up an item (spacebar or passive), it will be removed from every item pool. Its remaining weight is irrelevant.

This only refers to items generated from an item pool, yes?


I have also noticed the Bible anomaly.

Since it does have a 'force drop', and it's likely that every other item with a forced drop has odd functions, it's possible that is the common element.

It would depend on whether the game considers 'pools' with only one item or mandatory drops as pools.
Nazemec Aug 25, 2016 @ 3:51pm 
Originally posted by Phaper:
If you pick up an item (spacebar or passive), it will be removed from every item pool. Its remaining weight is irrelevant.

This only refers to items generated from an item pool, yes?
I was only referring to those ones, indeed. ;-)

Forced drops are hard coded, so it's pretty hard to say anything precisely about them (except "this generates it" of course). :-/
It could be possible to test some things with them... It would require heavily modified pools, but it may be possible... Mmh... I won't do those tests until a few hours though (01:00 am here, brain isn't fully responding right now). xD


Originally posted by googee11:
haha I don't blame you :) thanks again
You're welcome. :P
Phaper Aug 25, 2016 @ 4:11pm 
Does the Womb II Bible spawn from Pandora's Box count as a forced drop, along with the Sin and Super Sin drops?
Nazemec Aug 25, 2016 @ 4:15pm 
Originally posted by Phaper:
Does the Womb II Bible spawn from Pandora's Box count as a forced drop, along with the Sin and Super Sin drops?
As far as I know, yes, it is a forced drop. It doesn't appear anywhere in .xml files, so I'm pretty sure it's hard coded.
Haetae_Soymilk Aug 26, 2016 @ 7:14am 
Hmmm, interesting. Here's questions:
1. How does Chaos work with the 'weight' of items? Especially the items that exsist in multiple item pools and items that were picked once.

2. Seeing and picking does affect item weight, but what if I didn't 'see' items during the run, by not going in Treasure rooms, Shops, Devil rooms, Angel rooms, Black market, Crawlspace, etc? Will skipping rooms with item affect future item appearances in further floors?

3. What I know from in-game experience is, the items that appear in a floor is fixed, basically. When you play the same floor over and over with same sequences, every item appears in the same place(including chests). If you change the sequence, the items are changed(for example, using Joker before/after the bossfight will show you different items in Devil/Angel room.) but another sequence will show another fixed items. I think the system 'rerolls' the item, but it seems not. What is happening?

4. What is the weight of Bob's Rotten Head? I think I see many of them in one run..

Actually, the third one is not related to this thread, so it's ok if you can't answer to that question.

Last edited by Haetae_Soymilk; Aug 26, 2016 @ 7:23am
< >
Showing 1-15 of 24 comments
Per page: 1530 50

Date Posted: Aug 25, 2016 @ 2:02pm
Posts: 24