Ground Spawns - Design

EQ2Emulator Development forum.

Moderator: Team Members

Post Reply
User avatar
ZexisStryfe
Posts: 1026
Joined: Thu Jul 26, 2007 6:39 am
EQ2Emu Server: Sytherian Legends
Location: Connecticut
Contact:

Post by ZexisStryfe » Wed Dec 03, 2008 4:29 pm

Just an FYI, here is a post made by Domino (the tradeskill dev) on the live forums regarding the way harvesting works on live-
DominoDev wrote:For those who don't know what I'm referring to with the bonus result tables, harvesting works as follows. (If you really don't care about details you can skip this bit.)
For each node in each zone, when you harvest it, there are different result tables set up that tell the game what to give you when you harvest. Your skill level determines which table you use.
For example, using entirely invented numbers, let's imagine that there is a root node in a level 30-40 zone and you go and harvest it with a gathering skill of 190.
The game sees that the root node points to two result tables. Let's call them:
T4_roots_base_result - required skill 140
T4_roots_bonus_result - required skill 189
The "base" table might tell you that you have a 70% chance of getting 1 root, a 20% chance of getting 3 roots, an 8% chance of getting 5 roots, a 1% chance of getting an imbue, a 0.7% chance of getting a rare root, and a 0.3% chance of getting a rare root + 10 common ones.
The "bonus" table might tell you that you have a 60% chance of getting 1 root, a 25% chance of getting 3 roots, an 10% chance of getting 5 roots, a 0.5% chance of getting an imbue, a 0.8% chance of getting a rare root, and a 0.7% chance of getting a rare root + 10 common ones.
<span style="font-size: xx-small">(Yes, the numbers probably don't add up to 100%, I just invented them on the spot.)
Now we know that if your skill is under 140, you can't harvest the node at all. And we know your skill is 190. So the RNG rolls a number between 140 and 190. If it gets 140-188, you use the "base" result table. If it gets 189+, you use the "bonus" result table. Clearly, as your gathering skill increases, your chance of using the "bonus" result table gets better. (This is where +harvesting skill items affect your results, they increase your chance of using the bonus table.)
As of GU37, you get to start using the "bonus" table at level _8 (so, 8, 18, 28, 38, etc.) You're still not guaranteed to use it, but you have a CHANCE to use it. Previous to GU37, the level at which you could start getting the bonus was much higher, so that you didn't even have a chance to get the bonus table until you had entirely outlevelled the tier. In T6 and T7 prior to GU37 we still couldn't even start using the bonus level at level 70 with 350 skill, so we've been harvesting off the "base" table all this time. Now we will begin to have a chance to use the "bonus" level, so yes, we'll get slightly better harvesting results in T6 and T7 than we were before, but it's actually about the same results as we would eventually have got as the level cap raised and we continued to level up.
Incidentally, all nodes within a level range (in this example, all nodes in level 30-40 zones) point to the same result tables, so it makes no difference whether you're harvesting in one zone or another.
It is also widely regarded that the percentage chance to pull a rare on the base table is in fact .3%.
The harvesting options Domino lists are also the only possible results of a harvest- 1, 3, or 5 common items, 1 imbue item, 1 rare item, or 1 rare + 10 common items.
I am not sure if that helps you LE.
~ EQ2 Emulator Project Manager

Image
Image
Image
"Zexis, from this day forth, you shall be known as... '3 of 6'" - John Adams

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Wed Dec 03, 2008 6:18 pm

Hmm yah that actually helps quite a bit and although we could probably implement something similar using loot tables, to properly do it like Live I think we will need to do it in separate tables made specifically for ground spawns.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Wed Dec 03, 2008 9:00 pm

Then I am sold. I'll wait to see what you conjure up before making any other noises. :)

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Sat Dec 06, 2008 7:50 am

OK, These are my revised tables:

Code: Select all

CREATE TABLE `groundspawn_items` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `groundspawn_entry_id` int(10) unsigned NOT NULL default '1',
  `item_id` int(10) unsigned NOT NULL default '0',
  `num_items` tinyint(3) unsigned NOT NULL default '1',
  `min_score` smallint(5) unsigned NOT NULL default '1',
  `min_rare_level` tinyint(3) unsigned NOT NULL default '0',
  `rare_item` tinyint(3) unsigned NOT NULL default '0',
  `triggers_bonus_check` tinyint(3) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `ItemIdx` (`groundspawn_entry_id`,`item_id`,`num_items`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `spawn_ground` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `spawn_id` int(10) unsigned NOT NULL default '0',
  `number_harvests` tinyint(3) unsigned NOT NULL default '3',
  `num_attempts_per_harvest` tinyint(3) unsigned NOT NULL default '1',
  `groundspawn_entry_id` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `SpawnIdx` (`spawn_id`),
  KEY `GroundIdx` (`groundspawn_entry_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `groundspawn_bonus` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `groundspawn_entry_id` int(10) unsigned NOT NULL default '1',
  `item_id` int(10) unsigned NOT NULL default '0',
  `num_items` tinyint(3) unsigned NOT NULL default '1',
  `percentage` tinyint(3) unsigned NOT NULL default '100',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `id` (`id`),
  UNIQUE KEY `GroundSpawnBonusIdx` (`item_id`,`num_items`,`groundspawn_entry_id`,`percentage`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Note the following changes:

Code: Select all

1.  I am using groundspawn_entry_id as the key between spawn_ground and groundspawn_items.  This allows multiple ground spawns to use the same groundspawn_entry_id instead of forcing the admin to duplicate all the entries.
2.  The groundspawn_items table is loosely based off of Live, but I think the player will get the same experience doing it this way.
3.  Entries in the groundspawn_items table should use the same groundspawn_entry_id for all the items that the groundspawn can give out.
4.  To add an entry into the table you give it:
    a. the groundspawn_entry_id you are going to use in your spawn_ground table.
    b. the item_id, num_items, and min_score required to receive the items (min_score explained below)
5.  If the entry is a rare item you would put a 1 in rare_item.  This will display the "You have found a rare item" popup.
6.  If you want to trigger the bonus check, you would put a 1 in triggers_bonus_check.
6.  min_score is the min_score from the random number generator. Ex if the players skill is 2 and the min_score in the table is 4, the player would only receive the items at a random 'roll' of 4-5 (the random range rounds to the next highest increment of 5 to prevent problems at low levels)
7.  If you use the same min_score for multiple item_ids for the same groundspawn_entry_id, only 1 item_id will be given to the player if they achieve the min_score value.  Which one will be randomly determined.  
8.  The groundspawn_bonus table is based on precentage NOT on the min_score above.  How the bonus works is a separate 'roll' is calculated and going from lowest percentage to highest World tries to find an item an entry in the table for that groundspawn.  Once it does it is done.  Only 1 bonus entry per trigger is given.
Examples:

Code: Select all

1. You want to give the player 3 harvest opportunities for a root node.  
    1a. In the spawn_ground table you would set number_harvests to 3.
    2a. Find a new groundspawn_entry_id that is unused and update the field with this. 
2. You also want to give them 1 root if they roll at least a 4 (note that the next highest increment of 5 is used as the max of their roll).
    2a. In the groundspawn_items table you use the groundspawn_entry_id from 1a.
    2b. You set: the item_id of the root, num_items of 1, min_score 4.
3. You want to give them a chance at getting 3 or 5 roots if they trigger the rare.
    3a. You add the entry to the groundspawn_items table and set both rare_item and triggers_bonus_check to 1.
    3b. You add two entries into the groundspawn_bonus table, 1 for the 3 roots and 1 for the 5 roots.  You specify the percentage that the given entry is triggered.  Note that it will only give a max of 1 item (sometimes none based on percentages) per trigger.
OK, That explains the new system. If you have questions please make sure that you thoroughly read the information above as I *think* I have anticipated your questions, however if I didn't please let me know ASAP so that I can start implementing this.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Sat Dec 06, 2008 10:51 am

LethalEncounter wrote:If you have questions please make sure that you thoroughly read the information above
I think this was for me. :) :D :p and I will do my best to remember to read before asking my first question!
Awesome work, man. It looks sound and makes sense. I will better understand it in practice, so soon as you have something for me to test I'm ready.
Btw, thank you for making InnoDB tables and Indexes that are not named NewIndex1. :D

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Sat Dec 06, 2008 1:15 pm

John Adams wrote: Btw, thank you for making InnoDB tables and Indexes that are not named NewIndex1. :D
So NewIndex is OK? :)

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Sat Dec 06, 2008 2:15 pm

Negative.
;)
where's mah code?

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Sat Dec 06, 2008 3:43 pm

I'm workin on it! :P Actually you going to be around later tonight? If so I'd like to test it on your server with all the spells and such setup. Do you have Mining, Fishing, Gathering, Trapping, and Foresting skills set up for every character? They will need those skills. Also do you have the basic spell information setup for the spells above? If not could you get them added in the next few hours if you have time? For the LUA scripts for those spells just call a function called Harvest(Caster, Target). The code will take care of the rest. I should have the code finished sometime in the next 2-3 hours unless I hit a snag.

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Post by Scatman » Sat Dec 06, 2008 3:47 pm

Woooo! I exciting! Nice work LE, as usual! John, if you need help preparing for testing let me know, I'm just getting something to eat then was going to pop on anyways so I'll talk to you at some point.

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Sat Dec 06, 2008 3:51 pm

If you want to start populating the tables here are the final ones I will be using:

Code: Select all

CREATE TABLE `spawn_ground` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `spawn_id` int(10) unsigned NOT NULL default '0',
  `number_harvests` tinyint(3) unsigned NOT NULL default '3',
  `num_attempts_per_harvest` tinyint(3) unsigned NOT NULL default '1',
  `groundspawn_entry_id` int(10) unsigned NOT NULL default '0',
  `collection_skill` enum('Unused','Mining','Gathering','Fishing','Trapping','Foresting') NOT NULL default 'Unused',
  PRIMARY KEY  (`id`),
  KEY `SpawnIdx` (`spawn_id`),
  KEY `GroundIdx` (`groundspawn_entry_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `groundspawn_items` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `groundspawn_entry_id` int(10) unsigned NOT NULL default '1',
  `item_id` int(10) unsigned NOT NULL default '0',
  `num_items` tinyint(3) unsigned NOT NULL default '1',
  `min_score` smallint(5) unsigned NOT NULL default '1',
  `min_rare_level` tinyint(3) unsigned NOT NULL default '0',
  `rare_item` tinyint(3) unsigned NOT NULL default '0',
  `triggers_bonus_check` tinyint(3) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `ItemIdx` (`groundspawn_entry_id`,`item_id`,`num_items`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `groundspawn_bonus` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `groundspawn_entry_id` int(10) unsigned NOT NULL default '1',
  `item_id` int(10) unsigned NOT NULL default '0',
  `num_items` tinyint(3) unsigned NOT NULL default '1',
  `percentage` float unsigned NOT NULL default '100',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `id` (`id`),
  UNIQUE KEY `GroundSpawnBonusIdx` (`item_id`,`num_items`,`groundspawn_entry_id`,`percentage`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
If you have any questions let me know.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Sat Dec 06, 2008 4:40 pm

LethalEncounter wrote:Do you have Mining, Fishing, Gathering, Trapping, and Foresting skills set up for every character? They will need those skills. Also do you have the basic spell information setup for the spells above? If not could you get them added in the next few hours if you have time? For the LUA scripts for those spells just call a function called Harvest(Caster, Target). The code will take care of the rest. I should have the code finished sometime in the next 2-3 hours unless I hit a snag.
Uh, I'll get right on that.
SCATMAN!!! ;)
Yes, give us a few hours to sort that out. I hadn't moved the harvesting spells from raw yet, but I will insert them and get them on all toons.

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Sat Dec 06, 2008 6:38 pm

If your server isn't setup yet I setup one on my server if you want to hop on and check it out.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Sat Dec 06, 2008 6:47 pm

LethalEncounter wrote:Do you have Mining, Fishing, Gathering, Trapping, and Foresting skills set up for every character? They will need those skills. Also do you have the basic spell information setup for the spells above? If not could you get them added in the next few hours if you have time? For the LUA scripts for those spells just call a function called Harvest(Caster, Target). The code will take care of the rest. I should have the code finished sometime in the next 2-3 hours unless I hit a snag.
Okie dokie, got fishing, foresting, gathering, mining and trapping skills in the Abilities page of the knowledgebook for all players. Basic `spells` data in place, along with 1 tier for the cast and recast times. spell_classes are ALL, level 1.
LUA is harvest.lua:

Code: Select all

--[[
	Script Name	: harvest.lua
	Script Purpose	: Fishing, Foresting, Gathering, Mining, Trapping
	Script Author	: John Adams
	Script Date	: 2008.12.05
	Script Notes	: 
--]]
function cast(Caster, Target)
	harvest(Caster, Target)
end
Looks kinda empty, so maybe I missed your point. Still a function cast() with just Harvest() inside?
Got the 3 new tables in the server DB but have not populated anything yet. Waiting for further orders, captain.

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Sat Dec 06, 2008 6:54 pm

Nope that spell looks good, just capitalize the H in Harvest(Caster, Target). You named the spells Gathering, Foresting, Trapping, Mining, and Fishing right? A tier of 0 is fine for each of these. I'll check my changes in if you want to throw them up on your server. I'll make a few changes to your db if you dont mind to get something populated.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Sat Dec 06, 2008 7:01 pm

Go for it. I did name the spells as you mentioned. you can check them (id's 9000-9005). I'll grab the code when it hits SVN.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests