Page 1 of 1

GetHarvestDifficulty

Posted: Sun Aug 30, 2009 12:09 am
by Yukiko
I have never gotten a good answer to this one. How exactly is the harvest difficulty determined when the GetHarvestDifficulty function is called? There appears to be no explanation in the documentation.
Explanation
Determines the difficulty of harvesting a resource from location (x,y).
Notes: tiletype will typically be .objtype from TargetCoordinates() Checks the location for an object of type 'tiletype'. This tiletype may be a landtile or an object tile.
"resource" is something like "ore" "wood" "fish", etc. see regions/resource.cfg, regions/ore.cfg, etc.
I cannot find anyplace to enter a difficulty value for a particular resource.

I need a bit of help here.

Thanks.

Re: GetHarvestDifficulty

Posted: Sun Aug 30, 2009 4:39 am
by Pierce
I tested that a long time ago and if i remember it right, the
difficulty is simply calculated from the currently existing amount
of the ressource against the initial amount of the ressource.
So the difficulty increases when the amount of the ressource
decreases.

E.g. there is an initial 10 iron ore on a landtile (ore.cfg UnitsPerArea)
and noone has mined there yet. The difficulty will raise with each
ore you get on this spot (9/10, 8/10 ....).
I surely don't know the exact formula. Did you mean that?

Re: GetHarvestDifficulty

Posted: Sun Aug 30, 2009 3:41 pm
by Yukiko
It would be nice to know the formula but I wasn't specifically asking for that. I was working on the fishing skill and was getting some strange, or what I thought were strange, harvest difficulty results. I just wondered where the function eas getting those results. It's curious that there isn't any documentation explaining this.

Anyway, thanks Pierce for the info. Maybe Austin or one of the developers can offer some clarification on how it's calculated.

Re: GetHarvestDifficulty

Posted: Sun Aug 30, 2009 5:43 pm
by MuadDib

Code: Select all

	unsigned long base_difficulty = 90 - (units * 80 / units_per_area_);
	unsigned long this_difficulty = random_int( base_difficulty * 2 );
	return new BLong( this_difficulty );
Now bug turley to update the docs for that, lol

Re: GetHarvestDifficulty

Posted: Sun Aug 30, 2009 6:08 pm
by Yukiko
Thanks MaudDib.

*shouts*
HEY TURLEY!

Re: GetHarvestDifficulty

Posted: Mon Aug 31, 2009 4:39 am
by Turley
pol98 & 99 updated

Re: GetHarvestDifficulty

Posted: Mon Aug 31, 2009 5:07 am
by Yukiko
Thanks again Turley!