PlaneShift

Gameplay => General Discussion => Topic started by: Madoring on February 17, 2009, 09:57:21 pm

Title: Mining
Post by: Madoring on February 17, 2009, 09:57:21 pm
So, what is the deal with mining here are a few things i have heard.  Maybe a GM can tell me if they are right or wrong... :-X

1. There are Veins of ores...
2.  There are circular deposits of ores...
3. Platinum is completely random and is decided by many factors including how many people are at the mine...

Thank you
Title: Re: Mining
Post by: Caarrie on February 17, 2009, 10:21:13 pm
all mining is random it has no relation to how many people are there, please dont post things about the game in the hydlaa plaza forum post it in the general discussion board.

yes there are veins, maybe they are circular depends
Title: Re: Mining
Post by: Mythryndel on February 17, 2009, 10:49:11 pm
The issue I have with mining gold/plat is... I have fairly high skill in mining (on laanx)... I can go to the appropriate mines... and use spots that are pulling right and left for others... and get nothing. I usually pull less plat on laanx with my > 20 mining skill... than characters that have low single-digit mining skill... This is very frustrating and makes me question the use of the mining skill at all.

Now, for the record, mining skill works as expected for Iron... the higher level I get, the less frequently I mine without getting an ore. But either the random chance is so incredibly high for gold/plat (and even coal) that the mining skill simply doesn't make much difference... or it is ignored completely.

I could be wrong... but this is my observation over the last year playing PS.
Title: Re: Mining
Post by: verden on February 17, 2009, 10:56:35 pm
Its kind of like, if you throw a quarter and it lands head-down 100 times in a row. What is the chance of it landing heads down the next time? Only 50-50. Its more impressive in game if you didn't get an ore 50 times in a row, than it is to read it on the forum.
Title: Re: Mining
Post by: Caarrie on February 17, 2009, 11:10:49 pm
http://planeshift.svn.sourceforge.net/viewvc/planeshift/trunk/src/server/workmanager.cpp?revision=2947&view=markup

a few lines from the source file linked above
Code: [Select]
calc_mining_chance = script_engine->FindScript("Calculate Mining Odds");

[and a few lines futher down]

   if (!calc_mining_chance)
   {
        Error1("Could not find mathscript 'Calculate Mining Odds' in rpgrules");
   }
 else
  {
       var_mining_distance = calc_mining_chance->GetOrCreateVar("Distance");
       var_mining_probability = calc_mining_chance->GetOrCreateVar("Probability");
       var_mining_quality = calc_mining_chance->GetOrCreateVar("Quality");
       var_mining_skill = calc_mining_chance->GetOrCreateVar("Skill");
       var_mining_total = calc_mining_chance->GetVar("Total");
   }

    Initialize();
 };


   var_mining_distance->SetValue(f3);
   var_mining_probability->SetValue(workEvent->nr->probability);
   var_mining_quality->SetValue(f2);
   var_mining_skill->SetValue(f1);
 
   calc_mining_chance->Execute();
 
   float total = var_mining_total->GetValue();

I dont know if the script "Calculate Mining Odds" is on laanx or not and if it has ever been changed since it was made.
Title: Re: Mining
Post by: verden on February 17, 2009, 11:17:29 pm
Caarrie, what does the quality value in the script mean? Any idea?
Title: Re: Mining
Post by: Prolix on February 17, 2009, 11:18:19 pm
quality of the tool
the script appears to be elsewhere in the tree
Title: Re: Mining
Post by: verden on February 17, 2009, 11:21:56 pm
Ah, right that spiffy pick... thanks.
Title: Re: Mining
Post by: Caarrie on February 17, 2009, 11:23:45 pm
quality of the tool
the script appears to be elsewhere in the tree


In SVN the script is "VALUES( "Calculate Mining Odds", "Total = Distance * Probability * Quality * Skill + 0.1");" although it may or may not be the same script on laanx.
Title: Re: Mining
Post by: GlassZephyr on February 18, 2009, 06:24:20 am
then the mining rate for most things have changed since I joined the game?

either way, I got max mining at a gm event on christmas, went from 4 to 50 and noticed a decline in my overall platinum yeild.
The "spiffy pick" is much worse, I have never gotten a single platinum ore with it. I have a regular pick exclusively for platinum.
That code thing probably says that what I just said is a lie, but that's just what I've noticed playing the game.
anyway, my 2 tria. I don't bother mining anymore unless it's iron and coal for crafting.
Title: Re: Mining
Post by: citizen on February 18, 2009, 10:08:00 am
I also had the feeling that my level 15 character gets platinum easier that the other with level 37.
Maybe just bad luck :)
Title: Re: Mining
Post by: Gravemind on February 18, 2009, 12:30:12 pm
I found a minor improvement with the  master crafted rock pick, but not that much. The thing is, platinum is varied, at low times I get around 1/20 digs, at high times I get 1/3, usually 2 or 3 in a row. Most of the people are of the opinion that the GM's randomly set one of the variables
Title: Re: Mining
Post by: weltall on February 18, 2009, 12:37:43 pm
I found a minor improvement with the  master crafted rock pick, but not that much. The thing is, platinum is varied, at low times I get around 1/20 digs, at high times I get 1/3, usually 2 or 3 in a row. Most of the people are of the opinion that the GM's randomly set one of the variables

only devs can and it requires a server reboot just another rumor
Title: Re: Mining
Post by: Magmir on February 23, 2009, 06:11:22 pm
It feels very random to me. When I'm not getting anything in a specific spot, I'll just move a bit and tries there. It feels for me that it works better when I move around but it may just be a psycological thing.
Title: Re: Mining
Post by: Lanarel on February 23, 2009, 07:00:57 pm
Some more code, since Caarrie cut out the important parts :)
Code: [Select]
    // Calculate complexity factor for skill
    float f1 = cur_skill / workEvent->nr->skill_level;
    if (f1 > 1.0) f1 = 1.0; // Clamp value 0..1

    // Calculate factor for tool quality
    float f2 = tool->GetItemQuality() / workEvent->nr->item_quality;
    if (f2 > 1.0) f2 = 1.0; // Clamp value 0..1

    // Calculate factor for distance from center of resource
    csVector3 diff = workEvent->nr->loc - workEvent->position;
    float dist = diff.Norm();
    float f3 = 1 - (dist / workEvent->nr->radius);
    if (f3 < 0.0) f3 = 0.0f; // Clamp value 0..1
These are the three values passed to the script (which I think is similar to the svn one, but I am not sure). Important to notice is that all factors are limited to a range between 0 to 1, and scaled with a factor related to the resource.
So for skill:
If the skill defined for the resource is 10 and your skill is 5, that will reduce your chances by a factor 2. If your skill is higher than 10, it will stay 1. My guess is that the skills in the database are from when a skill of 10 was quite high.
Same for quality. If the required quality is lower than that of most picks, this does not affect things much.
The important thing that everyone did not address is location. Mining veins (as settings will probably describe them) are implemented as a number of locations with a radius. If you are exactly at the location of such a spot, your chance to find something will be maximum (f3=1). If you are halfway the defined radius, your chances are a factor 2 lower. If you are outside the radius they are 0. So if you are at a wrong spot in between locations, your chances may be really low. If you have a spot that you feel more lucky, try to remember it :)
There is a fourth parameter, Probabillity, which will determine how rich the vein is to begin with.

According to these formulas, skill should not have much effect, but certainly not a negative one. Maybe Weltall can check to see if there is something really wrong with the actual script that uses f1, f2 and f3 though.
Title: Re: Mining
Post by: Prolix on February 23, 2009, 07:15:18 pm
One thing about mining that seems odd to me is that the distance you have to move to defeat the 'you can't mine twice' message does not seem to be consistent. I wonder if there is some kind of grid where this location is in this box and that one is over there. This would mean that if , say, you were on the left side of the box you would have to move further to the right to get to the next viable spot than you would to the left. Is there such a grid system or something else?
Title: Re: Mining
Post by: Zontick on February 24, 2009, 04:09:00 am
First off - really happy with this discussion for a variety of reasons. Thank you.

One thing about mining that seems odd to me is that the distance you have to move to defeat the 'you can't mine twice' message does not seem to be consistent. I wonder if there is some kind of grid where this location is in this box and that one is over there. This would mean that if , say, you were on the left side of the box you would have to move further to the right to get to the next viable spot than you would to the left. Is there such a grid system or something else?

I've noted a similar inconsistency. I'm wondering if the terrain has something to do with this; if distance is calculated in 3 dimensions (why wouldn't it be?) this could account for the differential I have noticed.

Title: Re: Mining
Post by: khoridor on February 24, 2009, 08:35:09 am
It has always looked like a grid system to me.
Take one of the gems pools for example: I'd say it's 3x3.
Title: Re: Mining
Post by: Vornne on February 25, 2009, 01:20:24 am
The inconsistency is probably because the server doesn't keep track of your exact position, all the time; only every time the client sends an update message - and the server checks that the position has changed, in WorkManager::SameProductionPosition:
Code: [Select]
actor->GetPosition(pos, sector);
return ((startPos - pos).SquaredNorm() < 1);
csVector3::SquaredNorm:
Code: [Select]
return x * x + y * y + z * z;
In other words, if the sum of the squared distances moved in each dimension is greater than or equal to one unit, you can mine :)
Title: Re: Mining
Post by: Prolix on February 25, 2009, 02:02:28 am
What kind of operator is the dot in that first snippet? is it a decimal point? It looks like it is overloaded, a function call as well as a decimal point but what comes before it isn't a declared object so how do you define a method of an object that has no constructor? And why is the sector being passed to actor->GetPosition when it is being ignored? I suppose GetPosition actually checks that the sector is identical before breaking or something.

Very confusing. :(
Title: Re: Mining
Post by: Lanarel on February 26, 2009, 11:20:57 pm
What kind of operator is the dot in that first snippet? is it a decimal point?
startPos and pos are of class csVector3, which has an overloaded - operator, so that (startPos - pos) is a csVector3 too. And the .SquaredNorm() just calls a member function for the resulting vector just as pos.SquaredNorm() would.


Title: Re: Mining
Post by: Prolix on February 27, 2009, 12:13:22 am
Ah good, I wasn't too far off. So theoretically if I had a 1 unit box I could stand on I could dig in the same place repeatedly by stepping on and off it.

It seems that the z direction isn't or wasn't always included in the proximity calculation because you could mine coal on the ramp and down below under the temple, although I suppose the ore-field might not be flat. The big rocks in the gold fields are similar.