It is currently Fri May 10, 2024 5:17 am


Post a new topic Post a reply Page 1 of 3   [ 37 posts ]
Go to page 1 2 3 Next
Author Message
PostPosted: Fri Sep 11, 2009 10:11 pm 
Site Admin
User avatar

Joined: Thu Nov 02, 2006 4:07 pm
Posts: 1760
Just a brief fyi, for those who hate math and/or don't realize how much work goes into this stuff.

Doing some work on the crafting patch. Right now i'm actually working on the skillgain subsystem, which is a lot more complex than the normal skillgains we use. This is because not only do we have the normal variable of how much chance do we give to gain on each skilluse, we also have two additional variables, the number of strokes it takes to finish an item, and the resources required to make the item.

In example: An item that takes a long time to make will have more chances to gain than an item that takes a small amount of time to make.
Likewise, an item that is made of expensive materials will have a better chance of gaining(and be more difficult to make) than one of less expensive materials.

So, now we have 3 variables that all get adjusted as your skill goes up and different items are made.

Now, at a given skill X, you will produce Y(x) units of work on your given crafting attempt, per stroke.
A stroke is 5 seconds time, so actually Y=(work/5) to get work/sec.
We also have the total time T in seconds that it should take to gain from 0.0 skill to 100.0 skill.
With this info, we want to make a function F(X) to determine how much work to require to gain 0.1 skill and have a total time to GM of T.
If we produce the same amount of work at all skill levels, and didn't mind if hte time between gains was the same for all skill levels, the function would be simple.
F(x)=(T/1000)*(Y(x)/5)
with Y(x)=constant
The graph of the functions would looksomething like Figure 1, attached at bottom

However it's not this simple. First we have to consider that you the amount of work you do each stroke goes up. But since the work in our function is as function of skill as well, that is easy to adjust as we just change Y(x) to be a variable function of X, such as Y(x) = x/10, which would mean that you do your skill level in work each stroke. So 20.0 skill would do 20 work, 50.0 skill would do 50 work.
So now we have:
F(x)=(T/1000)*(Y(x)/5) with Y(x)= x/10 which turns into F(x)=(T/1000)*((x/10)/5) => F(x)=(T/1000)*(x/50)
The graph of the functions would look something like Figure 2, attached at the bottom.

But this still has the time between gains the same. Normally people want faster gains at low skill and slower gains at high skills. Well we could do that by Adjusting T so that at 50 skill it does average gains, and does faster below 50 and slower above 50, in relation, so 90 would be as slow as 10.0 is fast.
So we could do something like ((150-X)/100), which will equal 1.5 at x=0, and 0.5 at X=100
So if we replace T with (((50+X)/100)T), that'll change T to between 50% and 150% of it's original values. You'll gain approx 3 times faster at 0 than at 99.9.

F(x)=(((50+X)/100) * T )/1000)*(Y(x)/5) with Y(x) = x/10
The graph of the functions would look something like Figure 3, attached at the bottom.

However this is a linear gain, and what we normally do for skillgain is a exponential gain. An easy way to do this is to make our function sort of a reverse half-life. Meaning that everytime we get a certain amount of skill up, the time required doubles. A good division is 33.3, or one third of our total skills.
That means from 0-33.3 will take a period of time P, 33.3-66.6 will take 2P, and 66.6-100.0 will take 4P. Meaning the total time to GM is 7P, so T=7P, or P=T/7.
f(x)= P * 2^(x/33.3) => (T/7) * 2^(x/33.3)
So now we substitute this into our original equation F(x)=(T/1000)*(Y(x)/5) with Y(x)= x/10
F(x)=(T/1000) * (Y(x)/5) with Y(x) = x/10 and T = (T/7) * 2^(x/33.3)
F(x)=( (T/7) * 2^(x/33.3) ) / 1000 * ( Y(x) / 5 )
F(x)=( (T/7000) * 2^(x/33.3) )*(Y(x)/5) with Y(x) = x / 10

The graph of the functions would look something like Figure 4, attached at the bottom.

So now we have an approximate function F(x) that will give us the amount of work that should be completed between each skill gain.
So lets say we're at 10.0 skill, and say our time to GM is 10 hours ( 3600 seconds * 10 = 36,000 ).
That would mean we would do y(x)=x/10, or 10 work per stroke
Which turns our formula into F(x)=( ( 36,000/7000) * 2^(10.0/33.3) ) * (10/5)
Doing some number crunching here we get: (5.14) * 2^(0.300) * 2 = > (5.14) * (1.23) * 2 = approximately 12.6.
So we'd do approximately 1-2 strokes worth of crafting between gains at 10.0 skill.

While at 90.0 skill, we would do y(x)=x/10, or 90 work per stroke.
Which turns our formula into F(x)=( ( 36,000/7000) * 2^(90/33.3) ) * (90/5)
Doing some number crunching here we get: (5.14) * 2^(2.70) * 18 = > (5.14) * (6.50) * 18 = approximately 601 work.
So we'd do approximately 6-7 strokes worth of crafting between gains at 90.0 skill.


Anyway I hope this helped guide you all through kinda the thought process and insane amount of mathwork that it takes to do these scripts. Keep in mind these are FAKE values, and not the same formulas i'm using. I'm just guiding you through the process i used to create rough outlines that i then refine into the actual formulas.

Also keep in mind, ALL This work is just figuring out the SKILLGAIN formula of the crafting patch. So yeah, i wasn't bluffing when i said stuff like this takes a lot of work.


BONUS POINTS:

I deliberately made an error in the math in this post. While the reasoning is sound, one of the parts of it doesn't act how it's supposed to in the description. The reason i made this specific error on purpose is because this error actually existed in one of obsidian's skillgain codes written by another staffmember for around 3 years. It didn't hurt anything, but it made gains a little harder(30%) than they shoulda been for that particular skill.

This is to show you how easily bugs can appear, or how easily a function can act different than how it's supposed to, and why all the doublechecking that i mention in this thread is neccessary to ensure things work the way they are supposed to.

Anyway yeah, if anyone cares to be the smart one and find the error, you'll get a prize.


Top
 Offline   
PostPosted: Sat Sep 12, 2009 12:08 am 
User avatar

Joined: Thu Jul 23, 2009 12:25 am
Posts: 378
Bot Check: GAMER
Website: http://www.myspace.com/euroromanian
Location: Oregon
um im not even going to take the FULL time to read this, but from what i did happen
to read it does seem like the crafting patch is gonna be worth the wait. especially now
that the skill will be based on the material and the skill at which one crafts it. better
than sitting there crafting one thing to GM....

also does this also involve the economy, by that i mean, if i make something with expensive
cloth, will it sell for more in the shops? just wondering

well keep up the great work Bob....much appreciated :shock:


Top
 Offline   
PostPosted: Sat Sep 12, 2009 9:24 am 
User avatar

Joined: Mon Mar 12, 2007 6:50 pm
Posts: 5732
Bot Check: GAMER
Yahoo Messenger: chipsll
ill read the rest later, i read the first 1/4th of it, and it doesnt seem that bad!,
lol givin the old TI-83 plus a spin eh? xD

good job bob! , it was hard to get me to do that for school, so the fact that your doing it for a game is either 1) ur a nerd and love doing it 2) you have hella commitment.. or both

so ty! ill read the rest later . cwazzy, and i hate doing those F of X function shits UGGGGG

_________________
king of the run on sentence.


Top
 Offline   
PostPosted: Sat Sep 12, 2009 11:25 am 

Joined: Sun Feb 17, 2008 9:50 am
Posts: 588
high school math...

_________________
Judas [Cult] The Traitor
Doro [Cult] The Zealot

Image

'And if you gaze for long into an abyss, the abyss gazes also into you.' - Friedrich Nietzsche


Top
 Offline   
PostPosted: Sat Sep 12, 2009 11:47 am 
Site Admin
User avatar

Joined: Thu Nov 02, 2006 4:07 pm
Posts: 1760
Judas,
#1, you've been a real downer on the forums lately. You need some cake.
#2. yes it is high school math, it's algebra and a little algebra 2 thrown in. I was hoping someone would point it out.
The reason i left out the actual calculus is because those who CAN do it, should know where to go from here.

Now that you have a function for work required to get a specific gain, you take the integral of that to figure out the total work to GM.
Then using that you can figure out if the total work required to gm still gm's in the appropriate time, using the integral of the equation for work to get the work per stroke at each skill level then multiplying that by the time function.
You then construct two different functions, basically a BigO and a littleO function of time complexity, one using a function representing someone crafting the hardest item they can constantly, and the other crafting the easiest item they can, and use those to compute the maximum and minimum time it could possibly take to GM the skill.

If ya want examples of this lemme know, i can make up some more graphs and function examples, but my point of the post was not to show off, it was to give people an insight into a bit of the math that goes into the balance of the shard. I tried to keep the math simple enough anyone with basic algebra could understand most of it. Few people care enough beyond that to actually care about the calculus portion

BONUS POINTS:

I deliberately made an error in the math in the first post. While the reasoning is sound, one of the parts of it doesn't act how it's supposed to in the description. The reason is because this error actually existed in one of obsidian's skillgain codes written by another staffmember for around 3 years. It didn't hurt anything, but it made gains a little harder(30%) than they shoulda been for that particular skill.

This is to show you how easily bugs can appear, or how easily a function can act different than how it's supposed to, and why all the doublechecking that i mention in this thread is neccessary to ensure things work the way they are supposed to.

Anyway yeah, if anyone cares to be the smart one and find the error, you'll get a prize.


Top
 Offline   
PostPosted: Sat Sep 12, 2009 5:33 pm 

Joined: Sun Apr 29, 2007 7:22 am
Posts: 421
Hmm...

I noticed a couple of things that just did not seem right in the equations, then read about the prize. I will reread it when I'm not so tired.

Anyway, post here or pm?

_________________
Nash - Warrior (LoV)
Nashmith - Blacksmith (StoneD)
Nashtamer - Tamer (TLC)
Nash Fisher - Fisherman
Image


Top
 Offline   
PostPosted: Sat Sep 12, 2009 5:35 pm 
Shard Supporter (Donated)
Shard Supporter (Donated)
User avatar

Joined: Thu Aug 05, 2004 4:21 pm
Posts: 1282
dude, why do we gotta be bums?


Top
 Offline   
PostPosted: Sat Sep 12, 2009 6:04 pm 
User avatar

Joined: Mon Mar 12, 2007 6:50 pm
Posts: 5732
Bot Check: GAMER
Yahoo Messenger: chipsll
A good division is 33.3, or one third of our total skills.
That means from 0-33.3 will take a period of time P, 33.3-66.6 will take 2P, and 66.6-100.0 will take 4P. Meaning the total time to GM is 7P, so T=7P, or P=T/7.
f(x)= P * 2^(x/33.3) => (T/7) * 2^(x/33.3)
So now we substitute this into our original equation F(x)=(T/1000)*(Y(x)/5) with Y(x)= x/10
F(x)=(T/1000) * (Y(x)/5) with Y(x) = x/10 and T = (T/7) * 2^(x/33.3)
F(x)=( (T/7) * 2^(x/33.3) ) / 1000 * ( Y(x) / 5 )
F(x)=( (T/7000) * 2^(x/33.3) )*(Y(x)/5) with Y(x) = x / 10


I think, this would make your last graph in the last section divide into 3 sectors /bar levels representing, the (1)P 2P and 4P

but I just skimmed, I have a test reviewing all this stuff on monday actually hehe
how odd...

_________________
king of the run on sentence.


Top
 Offline   
PostPosted: Sat Sep 12, 2009 8:39 pm 
User avatar

Joined: Sun Nov 18, 2007 7:48 pm
Posts: 106
Bot Check: GAMER
If Y(x) gives the number of units of work on one's given crafting attempt, per stroke...
...and one wants the number of units of work per stroke to equal the skill level, then Y(x) = x/10 is not correct. Y(20.0) equals 2 units of work per stroke. Y(90.0) = 9 units of work per stroke.

You said, "...such as Y(x) = x/10, which would mean that you do your skill level in work each stroke. So 20.0 skill would do 20 work, 50.0 skill would do 50 work."

_________________
I'm not crazy; I'm eccentric!


Top
 Offline   
PostPosted: Sat Sep 12, 2009 8:41 pm 
User avatar

Joined: Mon Mar 12, 2007 6:50 pm
Posts: 5732
Bot Check: GAMER
Yahoo Messenger: chipsll
llama r deh win

but um

you misspelled the . you put hte,

I get secondary prize right? :lol:

_________________
king of the run on sentence.


Top
 Offline   
PostPosted: Sun Sep 13, 2009 2:56 am 
User avatar

Joined: Tue Sep 11, 2007 2:18 pm
Posts: 306
Location: Vesper Bank & Trust, LLC
I thought there was an underlying reason for why I dropped trig in college :|

_________________
"I am a witness to your demise..." Anthrax, Black Lodge

Rob - GM bank sitter/self-preservationist[Restless]
Ichigo - GM miner/blacksmith/ider/philanthropist[StoneD]
Cedar - GM Lumberjack/Master Tailor/Master Carpenter [Crafters]:(


Top
 Offline   
PostPosted: Sun Sep 13, 2009 4:58 am 
User avatar

Joined: Sun Aug 27, 2006 8:33 am
Posts: 487
Bot Check: GAMER
Location: Sunderland, England
ZzzZZ ZZ ZZz ZzzZzz

_________________
Image

Jimmy[Cult]-Pvp Warrior
Tristan[SOS]-Pvm Mage
Cilit Bang-Alchemist
Bruno Novak-Tamer/Fisherman


Top
 Offline   
PostPosted: Sun Sep 13, 2009 8:36 am 
Site Admin
User avatar

Joined: Thu Nov 02, 2006 4:07 pm
Posts: 1760
Actually that's not the right answer, although it does appear correct at first galnce.
The reason it's not right is that the server doesn't comprehend decimal points.
It flat out doesn't understand them.

So 100.0 skill is actually 1000 skill. Hence we divide by 10 to get 100.
25.5 skill is actually 255, and /10 = 25

Good try though.

As for your thought chips, no, since the 1p, 2p, and 4p sections desribe different spans of skills, 0-33, 33-66, 66-100. what it is is that the total bars on each of those sections, if added up properly, would come to approximately 1p, 2p, 4p.

But you're on the right track, keep looking around that area of the formulas.


Top
 Offline   
PostPosted: Sun Sep 13, 2009 8:46 am 

Joined: Sun Apr 29, 2007 7:22 am
Posts: 421
OK. A couple of the things that I noticed.

First...
Quote:
Meaning the total time to GM is 7P, so T=7P, or P=T/7.
f(x)= P * 2^(x/33.3) => (T/7) * 2^(x/33.3)
If P=T/7, then both sides of this equation are equal.
P*2^(x/33.3) can never be greater than (T/7)*2^(x/33)

But that is not an issue, because 1=>1 is still accurate.


second...
Quote:
So if we replace T with (((50+X)/100)T), that'll change T to between 50% and 150% of it's original values. You'll gain approx 3 times faster at 0 than at 99.9.

F(x)=(((50+X)/100) * T )/1000)*(Y(x)/5) with Y(x) = x/10
The graph of the functions would look something like Figure 3, attached at the bottom.
We are substituting (((50+X)/100)T) for the value of T.
So why did it become (((50+X)/100)T)*T?

prolly not the issue because it ony appears here.


next...
Quote:
However this is a linear gain, and what we normally do for skillgain is a exponential gain. An easy way to do this is to make our function sort of a reverse half-life. Meaning that everytime we get a certain amount of skill up, the time required doubles. A good division is 33.3, or one third of our total skills.
That means from 0-33.3 will take a period of time P, 33.3-66.6 will take 2P, and 66.6-100.0 will take 4P. Meaning the total time to GM is 7P, so T=7P, or P=T/7.
f(x)= P * 2^(x/33.3) => (T/7) * 2^(x/33.3)
So now we substitute this into our original equation F(x)=(T/1000)*(Y(x)/5) with Y(x)= x/10
F(x)=(T/1000) * (Y(x)/5) with Y(x) = x/10 and T = (T/7) * 2^(x/33.3)
F(x)=( (T/7) * 2^(x/33.3) ) / 1000 * ( Y(x) / 5 )
F(x)=( (T/7000) * 2^(x/33.3) )*(Y(x)/5) with Y(x) = x / 10
FTW -
If we (T/7) * 2^(x/33.3) for T into the equation, then we must divide the whole value by 1000, not just T/7.

If 1 set of parenthesis is omitted, it changes the order of operations and the final output of the formula. This is an easy mistake to make and can be a bear to find when things don't work as they should.

*edit - I know that as listed in this post, it was caused by not fully applying the distributive property of division. But, depending on how the formulas are entered into the code, you can get a similar error from one errant keystroke or not closing a parenthesis.

_________________
Nash - Warrior (LoV)
Nashmith - Blacksmith (StoneD)
Nashtamer - Tamer (TLC)
Nash Fisher - Fisherman
Image


Top
 Offline   
PostPosted: Sun Sep 13, 2009 3:09 pm 
Site Admin
User avatar

Joined: Thu Nov 02, 2006 4:07 pm
Posts: 1760
Quote:
OK. A couple of the things that I noticed.

First...
Quote:
Meaning the total time to GM is 7P, so T=7P, or P=T/7.
f(x)= P * 2^(x/33.3) => (T/7) * 2^(x/33.3)
If P=T/7, then both sides of this equation are equal.
P*2^(x/33.3) can never be greater than (T/7)*2^(x/33)

But that is not an issue, because 1=>1 is still accurate.
=> is not a >= sign. => was just a graphical arrow showing that from one equation, you can get the other one. It's basically saying egg => chicken, dinosaur => oil, 2t*2t => 4t^2
Quote:
second...
Quote:
So if we replace T with (((50+X)/100)T), that'll change T to between 50% and 150% of it's original values. You'll gain approx 3 times faster at 0 than at 99.9.

F(x)=(((50+X)/100) * T )/1000)*(Y(x)/5) with Y(x) = x/10
The graph of the functions would look something like Figure 3, attached at the bottom.
We are substituting (((50+X)/100)T) for the value of T.
So why did it become (((50+X)/100)T)*T?

prolly not the issue because it ony appears here.
You're replacing T with (50+X)/100)T, not multiplying it, so you still only get one T.
Quote:
next...
Quote:
However this is a linear gain, and what we normally do for skillgain is a exponential gain. An easy way to do this is to make our function sort of a reverse half-life. Meaning that everytime we get a certain amount of skill up, the time required doubles. A good division is 33.3, or one third of our total skills.
That means from 0-33.3 will take a period of time P, 33.3-66.6 will take 2P, and 66.6-100.0 will take 4P. Meaning the total time to GM is 7P, so T=7P, or P=T/7.
f(x)= P * 2^(x/33.3) => (T/7) * 2^(x/33.3)
So now we substitute this into our original equation F(x)=(T/1000)*(Y(x)/5) with Y(x)= x/10
F(x)=(T/1000) * (Y(x)/5) with Y(x) = x/10 and T = (T/7) * 2^(x/33.3)
F(x)=( (T/7) * 2^(x/33.3) ) / 1000 * ( Y(x) / 5 )
F(x)=( (T/7000) * 2^(x/33.3) )*(Y(x)/5) with Y(x) = x / 10
FTW -
If we (T/7) * 2^(x/33.3) for T into the equation, then we must divide the whole value by 1000, not just T/7.
Nope. I coulda written it a little clearer, but we're actually doing two subtitutions.
We're actually doing the T = 7P substitution, then we're doing the T into the original equation substitution.

However great guess. You actually have the right part quoted in one of the above ones,and people have mentioned it. Close, but not quite. Everyone's getting what's around it but not the real one.
It's not an algebreic error(like 2^2 => 5 or t=p subs into (t+2) to equal (2p + 2) ), it's an error in an assumption of how it should work vs how it actually works.


Top
 Offline   
Display posts from previous:  Sort by  
Post a new topic Post a reply Page 1 of 3   [ 37 posts ]
Go to page 1 2 3 Next


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  


Powered by phpBB® Forum Software © phpBB Group
twilightBB Style by Daniel St. Jules of Gamexe.net