Algorithm for ONE Harvesting Pull: (based on numerous Official posts about how harvesting works)
1. given the node.name (ie: corrupted arbor)
2. determine this is T1, Wood, using Foresting skill
3. get toon's current and maximum Foresting skill (these are modified skills that include any buffs (or debuffs))
4. for each Harvesting Tier there is a row in a table (db or memory) that states:
- the base skill needed to harvest a node
- the skill that the node trivializes at
- the skill that you need for a chance at a rare
5. if your skills aren't maxed AND your currentSkill < node.trivial, you get a chance at a fail or a skillup (obviously can't get skillup if you fail)
- if Fail, then exit algorithm
6. if your current skill >= node.bonus, generate random(node.base .. toon.currentSkill)
- if this number >= node.bonus, then you get a pull from the bonus table, otherwise, you get a pull from the base table
7. for each Tier + Node Type there are 2 table rows (base and bonus) in a Pull Type table. This table has columns "1 common", "3 common", "5 common", "1 imbue", "1 rare", "10 common + 1 rare" with the chance for each pull type.
8. generate random(1 .. 1000) allowing for 100% with 1 decimal place. Get the pull type column.
9. (not coded in .js yet) decide the item to be returned. If it's a common, there may be up to 4 choices. If it's an imbue, there's one choice per tier. If it's a rare, there's 0, 1, or 2 choices.
10. return item(s) harvested and decrement node.harvestsRemaining. If harvestsRemaining == 0, delete node.
Notes:
As of the Thu, June 17, 2010, I hadn't gone through our database so I was just making up what I needed for harvesting. I've spent the last couple of days trying to reconcile my algorithm with what we currently have.
1. My node.name is currently spawn.name. I'm just using node as an internal object to store the attributes that I need for harvesting a node.
2. This node.name uniquely identifies the tier of the node, the node type. Each node.name may appear in several zones, ie:
bush nodes.
3. As far as I know, harvesting skills only get buffs from items (
tools and the gear from Mara). I'm sure there's no harvesting debuffs, but if we allow "modified skill" to include them, like it does for defense for instance, that opens up some nice mean and nasty options.
4. The table I'm using atm is:
Code: Select all
base = 0, 20, 90, 140, 190, 240, 290, 340, 390
bonus = 39, 89, 139, 189, 239, 289, 339, 389, 439
trivial = 45, 95, 145, 195, 245, 295, 400, 450, 550
I am fairly sure it's coded on live and not DB based. However, if it were DB based, changes would be easier to check and not have to wait for a "hotfix" recompile.
5. Fails: Various official quotes state that you can only get a fail if your skill isn't maxed AND your current skill is under the trivial level.
Zcoretri wrote:Code: Select all
One, Three ... Many?
Harvesting changes hit the live servers with LU24 (June 14)... on any harvest where your current skill is above the maximum skill raise cap for the area, you will not fail on a harvest.
6. This is your chance at getting a pull from the bonus table based on how much over the node.bonus level your skills are. Previously, this was at the (T+1)1 level, but now is at the T8 level.
7. I really tried to make it only for each Tier OR only for each Node Type, but reading over Domino's posts has convinced me it must be for each Tier + Node Type.
Using Domino's sample data for T4 root nodes base table, I made a bonus table with slightly higher chances for everything but "1 common". From there, I made another table for Fish, Ore, and Rock nodes because they have 0, 2, 2 rares. Then you have to add an exception for T9 Ore as loam is gone the way of the dodo. Then there's exceptions for T1 as there's no imbue and that 1% has to go somewhere. I ended up with: (255 is default)
Code: Select all
var PullTable = [
// Type Tier Table a b c d e f
new _PullTable("fish", 1, "base", [ 70.7, 20.2, 9.1, 0.0, 0.0, 0.0 ]),
new _PullTable("fish", 1, "bonus", [ 56.1, 30.3, 13.6, 0.0, 0.0, 0.0 ]),
new _PullTable("bush", 1, "base", [ 70.0, 20.0, 8.0, 0.0, 1.2, 0.8 ]),
new _PullTable("bush", 1, "bonus", [ 55.0, 30.0, 12.0, 0.0, 1.7, 1.3 ]),
new _PullTable("root", 1, "base", [ 70.0, 20.0, 8.0, 0.0, 1.2, 0.8 ]),
new _PullTable("root", 1, "bonus", [ 55.0, 30.0, 12.0, 0.0, 1.7, 1.3 ]),
new _PullTable("wood", 1, "base", [ 70.0, 20.0, 8.0, 0.0, 1.2, 0.8 ]),
new _PullTable("wood", 1, "bonus", [ 55.0, 30.0, 12.0, 0.0, 1.7, 1.3 ]),
new _PullTable("den", 1, "base", [ 70.0, 20.0, 8.0, 0.0, 1.2, 0.8 ]),
new _PullTable("den", 1, "bonus", [ 55.0, 30.0, 12.0, 0.0, 1.7, 1.3 ]),
new _PullTable("ore", 1, "base", [ 69.0, 20.0, 8.0, 0.0, 1.9, 1.1 ]),
new _PullTable("ore", 1, "bonus", [ 54.9, 30.0, 12.0, 0.0, 1.8, 1.3 ]),
new _PullTable("rock", 1, "base", [ 69.0, 20.0, 8.0, 0.0, 1.9, 1.1 ]),
new _PullTable("rock", 1, "bonus", [ 54.9, 30.0, 12.0, 0.0, 1.8, 1.3 ]),
new _PullTable("ore", 9, "base", [ 70.0, 20.0, 8.0, 1.0, 0.7, 0.3 ]),
new _PullTable("ore", 9, "bonus", [ 54.9, 30.0, 12.0, 1.5, 1.1, 0.5 ]),
new _PullTable("fish", 255, "base", [ 70.7, 20.2, 8.1, 1.0, 0.0, 0.0 ]),
new _PullTable("fish", 255, "bonus", [ 56.1, 30.3, 12.1, 1.5, 0.0, 0.0 ]),
new _PullTable("ore", 255, "base", [ 69.0, 20.0, 8.0, 1.0, 1.4, 0.6 ]),
new _PullTable("ore", 255, "bonus", [ 53.5, 30.0, 12.0, 1.5, 2.1, 0.9 ]),
new _PullTable("rock", 255, "base", [ 69.0, 20.0, 8.0, 1.0, 1.4, 0.6 ]),
new _PullTable("rock", 255, "bonus", [ 53.5, 30.0, 12.0, 1.5, 2.1, 0.9 ]),
new _PullTable(255, 255, "base", [ 70.0, 20.0, 8.0, 1.0, 0.7, 0.3 ]), // domino's example data
new _PullTable(255, 255, "bonus", [ 54.9, 30.0, 12.0, 1.5, 1.1, 0.5 ])
];
where column a = 1 common, b = 3 common, c = 5 common, d = 1 imbue, e = 1 rare, f = 10 common + 1 rare.
Now we know that T1 has a high rare drop rate and as you increase in tier, the rare drop rate goes down. I haven't done anything with making this adjustment yet, but I did write a small program to take the above data and make rows for every Type + Tier + Table, leading to 126 rows.
As to where this data is stored: DB or internal - I believe that this table is included at compile time as one time when Domino was very new, she made a "tiny" error that cause T2 (at least) rares to be more common than commons and this change could not be fixed for a month till the next update cycle.
The one idea I've had recently, is making a DB table with 6 rows only: T1 + (0, 1, 2 rares) + Table (base, bonus). This could be converted, at run time, to an internal table with a declining rare drop rate based on a formula. One consequence of this, I'm fairly sure, is that 1 decimal place won't be enough. Somewhere, I saw Domino state that rare drop rates would increase by no more than 0.22%. I'm sure she isn't confused and meaning 22%.
8. Data given in an official example for T4 root nodes base table:
1 common = 700, 3 common = 200, 5 common = 80, 1 imbue = 10, 1 rare = 7, 10 common + 1 rare = 3
9. We now have Node Type, Tier, and 1 of columnName[a..f] (above). We need to translate that into the actual item that's returned. I've hesitated making any code for this yet as I wanted to see how loot tables were implemented here. What I'd been thinking is column d is easy as there's only one imbue for the whole tier, column a..c would need some loot table with chance for that common, column e is basically the same kind of loot table. Column f would need to get a common from the loot table and then get the rare for that node type, except in the case of ore and rocks, where iron goes with blackened iron and not alkaline loam.
Then, there's this disturbing quote from Domino "if you get a single item harvest from a trapping node, you have twice the chance of it being a pelt than a meat. For 3 and 5 item harvests they're equal chances". This implies that each pull type column has it's own loot table for 7(type) * 9(tier) * 6(columns) = 378 loot tables, each having a possible 4 entries. IDK but this seems like "customizable overkill" to me.