I was wondering when diablo 3 generates loot in the game. I was arguing with a friend who said that all the loot is generated when you start/resume a game. In other words, everything is predetermined when you start a game.
This came about when a friend of mine commented that I am potentially missing out on legendaries by not breaking vases and destructible objects (pre patch 1.03) or when I ignore difficult elites. I said that the drops/loot are determined whenever you kill a mob or break an object. He said that it would be impossible from a programing stand point for the game to "roll" on an item after you are in it.
We ended the argument that he was correct, because he is extremely computer savvy.
How could this be true? When does Magic Find come into play? If his answer is correct, why don't we create games with our magic find gear on?
Is there no blue post confirming how loot is generated? I've done some simple google searches on this and I have not found anything.
I'm just curious enough to ask the public about this.
Your friend is not that computer savvy if he really thinks that it is impossible for the game to roll on loot when a monster is killed.
Why would MF gear swapping before kill work if the loot was already determined?
Tell your friend that he is an idiot.
It's really easy to give proof that rolling on loot on kill is possible. For example here is a pseudo-code algorithm that could work.
# = comment block does not interfere with code
#monster dead, time to roll the loot
# array:items is a list with all the base item ids
# array:quality is a list with all the possible qualities (in integer format)
# array:prefix is a list with all the possible prefix ids (those determine some of the item affixes)
# array:suffix is a lsit with all the possible suffix ids (those also determine some of the item affixes)
# int:monster is an integer containing the monster id (determines if the monster is white or not)
# DropLoot(int:item, int:quality, int:prefix, int:suffix, int:monster) is a function that determines what loot to drop and then drops it, this function also removes the monster from the list of spawned monsters so that the loot doesn't continue to drop each frame.
# Count(array) is a function that counts how many items/variables or whatever there is in an array or list.
# rnd(int:min, int:max, int:MF) is a function that picks a random number between the chosen numbers.
# int:MF is the magic find value, which affects the rnd function.
# Each item quality, monster and MF determines the drop
DropLoot(rnd(1, items, MF), rnd(1, quality, MF), rnd(1, prefix, MF), rnd(1, suffix, MF), rnd(1, monster, MF)
Smallest pseudo-code ever, all the comments are there for those that wouldn't understand what this long line meant otherwise.
I won't bother to write pseudo-code for a droploot function because really, that is just the code that spits out the item on the ground.
The function monster_Died(int:monster) is triggered when a monster dies, and I won't write pseudo-code for the code that triggers this function either because that is just the code that looks at the currently spawned monsters and when one of them is < 0 hp the code triggers this function. 0="" hp="" the="" code="" triggers="" this=""> 0 hp the code triggers this function.>