to: Someone who's good at math

Anything regarding UO or Age of Valor
Locked
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

to: Someone who's good at math

Post by Red Squirrel »

Ok I will be redesigning the loot system, at least, the part that generates the properties.

So I need to figure out some formulas, and I suck at math. So here's what I need.

A formula that returns a number from 1 to 100, and when given the value x, the chance of a higher number is higher. So for example, if x is 0, the chance of getting 1-10 is much higher, while if x is 1500 the chance of 90-100 is much higher (but can still get 1).

Basically, y is the loot intensity, and x is the luck.

Then I need another formula to take a value from 1 to 100 and turn it into a value from 1 to z, so if z is 15, 50 would translate to 7 (rounded).

So if anyone could post that, thanks! :P

Archived topic from AOV, old topic ID:755, old post ID:4590
Honk if you love Jesus, text if you want to meet Him!
dprantl
Posts: 1048
Joined: Wed Feb 07, 2007 11:41 pm

to: Someone who's good at math

Post by dprantl »

Red Squirrel wrote:Then I need another formula to take a value from 1 to 100 and turn it into a value from 1 to z, so if z is 15, 50 would translate to 7 (rounded).
That one is super easy: (value / 100) * z.

I'm still thinking about the first one...

Archived topic from AOV, old topic ID:755, old post ID:4599
dprantl
Posts: 1048
Joined: Wed Feb 07, 2007 11:41 pm

to: Someone who's good at math

Post by dprantl »

Ok, so it really depends on what you want your graph shape to look like. Assuming the luck cap is 1500, if you want the luck chance to be completely linear, then:

y = x / 15

To have a really sharp increase and make luck mutually degressive (from 0 - 200 luck gives a larger bump than from 1200 - 1400), then you can have something like this:

y = log(x^13.67)

That one above is *really* sharp. Maybe a compromise would be:

y = sqrt(x * 6.67)

With this last one, 200 luck gives a ~36% boost, 750 luck gives a ~70% boost, 1000 luck gives an 82% boost, and 1300 luck gives a ~93% boost.

Archived topic from AOV, old topic ID:755, old post ID:4607
Nosferatu
Posts: 797
Joined: Thu Mar 15, 2007 4:36 pm

to: Someone who's good at math

Post by Nosferatu »

nice

Archived topic from AOV, old topic ID:755, old post ID:4614
What?
Lymus
Posts: 737
Joined: Wed Dec 13, 2006 2:21 pm

to: Someone who's good at math

Post by Lymus »

slope m =Dy Dx=y2-y1 x2-x1=rise run
x =-b± ______
Öb2-4ac
2a



Nuf said....

Archived topic from AOV, old topic ID:755, old post ID:4617
If you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime.
Nosferatu
Posts: 797
Joined: Thu Mar 15, 2007 4:36 pm

to: Someone who's good at math

Post by Nosferatu »

*is lost*

Archived topic from AOV, old topic ID:755, old post ID:4618
What?
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

to: Someone who's good at math

Post by Red Squirrel »

Oh and I forgot to mention this is something that has to work programaticly using a random function I'll just call it Rand() here for simplicity. Rand(b+1) returns a number between 0 and b. That would be 0 to 15 for HCI for example, and at high luck it needs to have a better chance of hitting the 15, but still have a chance to hit 1.

I might just do it in steps too, like for each 100 points of luck, a loop runs, and the highest number gets picked. or something. Theres also a random for the loot bonus to happen in first place, I think.

Archived topic from AOV, old topic ID:755, old post ID:4625
Honk if you love Jesus, text if you want to meet Him!
User avatar
Gaiava Arkkaza
Posts: 834
Joined: Tue Dec 12, 2006 10:19 pm

to: Someone who's good at math

Post by Gaiava Arkkaza »

lol Those are times where I wish my math teacher was here.

Archived topic from AOV, old topic ID:755, old post ID:4635
Brunus
Lymus
Posts: 737
Joined: Wed Dec 13, 2006 2:21 pm

to: Someone who's good at math

Post by Lymus »

Sorry I missed the fun. Your first question doesn't make any sense . If x is 0, you get 0 in your "answer", which directly conflicts with one of the conditions you gave in the original question.

I mean... there's no "chance" of returning different numbers (unless you taught C a special square root where it will return 50/50 chance of the positive or negative root! :-P)

Archived topic from AOV, old topic ID:755, old post ID:4683
If you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime.
dprantl
Posts: 1048
Joined: Wed Feb 07, 2007 11:41 pm

to: Someone who's good at math

Post by dprantl »

Lymus wrote:Sorry I missed the fun. Your first question doesn't make any sense . If x is 0, you get 0 in your "answer", which directly conflicts with one of the conditions you gave in the original question.

I mean... there's no "chance" of returning different numbers (unless you taught C a special square root where it will return 50/50 chance of the positive or negative root! :-P)
Well, I assumed the graph would be used as a modifier with a randomizer function...

Archived topic from AOV, old topic ID:755, old post ID:4690
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

to: Someone who's good at math

Post by Red Squirrel »

yeah come to think of it don't think the random part can be done fully mathematicly. I'll come up with something for that.

Archived topic from AOV, old topic ID:755, old post ID:4691
Honk if you love Jesus, text if you want to meet Him!
User avatar
DOCTOR THUNDER
Posts: 1611
Joined: Sat Jan 06, 2007 8:34 am

to: Someone who's good at math

Post by DOCTOR THUNDER »

I worked really hard on this formula:

Loot = (cool factor + murder count)account age/[-1(forum posts)]

Cool Factor:
Thunder = 1000
Eby = 500
Red = Pi/-1 (he created the server)
Hector = 499
Brunus = 100
Nosferatu = .001

anyone else pick a number between 1 and 10, that will be your cool factor.

Archived topic from AOV, old topic ID:755, old post ID:4692
The polite PK.Image
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

to: Someone who's good at math

Post by Red Squirrel »

Hmm I could add some char serial # checks in there

if(player.Serial == 0x0032F)coolnessfactor+=10;

:P

Archived topic from AOV, old topic ID:755, old post ID:4694
Honk if you love Jesus, text if you want to meet Him!
Nosferatu
Posts: 797
Joined: Thu Mar 15, 2007 4:36 pm

to: Someone who's good at math

Post by Nosferatu »

Your formulas are a little off :P

Archived topic from AOV, old topic ID:755, old post ID:4699
What?
Lymus
Posts: 737
Joined: Wed Dec 13, 2006 2:21 pm

to: Someone who's good at math

Post by Lymus »

DOCTOR THUNDER wrote:I worked really hard on this formula:

Loot = (cool factor + murder count)account age/[-1(forum posts)]

Cool Factor:
Thunder = 1000
Eby = 500
Red = Pi/-1 (he created the server)
Hector = 499
Brunus = 100
Nosferatu = .001

anyone else pick a number between 1 and 10, that will be your cool factor.
Correction:

Loot= (cool factor + murder count)(account age[faction points+forum posts])

=P

Archived topic from AOV, old topic ID:755, old post ID:4709
If you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime.
dprantl
Posts: 1048
Joined: Wed Feb 07, 2007 11:41 pm

to: Someone who's good at math

Post by dprantl »

Ok back to being serious, I have some additional ideas now that you mentioned how the randomizer works. You could make a function that calls rand a certain number of times, then picks the highest value. The number of runs would be dependent on the value returned from my graph above which is based on luck. So:

randRunNum = Math.Round( (Math.Sqrt( luck * 6.67 ) ) / 10 );

So the maximum number of times rand could run is 10, and minimum would of course be 1. I just made 10 up, so some testing could be done to come up with a different max iteration number. The higher the number, the better your chances of getting a higher intensity value.

Archived topic from AOV, old topic ID:755, old post ID:4743
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

to: Someone who's good at math

Post by Red Squirrel »

The more I look at the loot code, the more I realize I should just leave it alone. :P Problem is, its tied in to so many things, if I change any of it, I have to change tons of other stuff too. So I'll just try to improve the current code values instead to force it to give better overall loot.

Archived topic from AOV, old topic ID:755, old post ID:4750
Honk if you love Jesus, text if you want to meet Him!
dprantl
Posts: 1048
Joined: Wed Feb 07, 2007 11:41 pm

to: Someone who's good at math

Post by dprantl »

Isn't it the case that luck only affects monster loot? If so, then you could just modify that part, leaving the rest alone.

Archived topic from AOV, old topic ID:755, old post ID:4755
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

to: Someone who's good at math

Post by Red Squirrel »

Actually, it looks like loot gets generated BEFORE the monster dies... I don't understand why this is, but I'm rather shocked. The luck is checked... but the luck of who?! Its not dead yet. I'm experimenting with stuff atm, and I was messing with numbers, might be able to fix the existing code.

Archived topic from AOV, old topic ID:755, old post ID:4756
Honk if you love Jesus, text if you want to meet Him!
User avatar
DOCTOR THUNDER
Posts: 1611
Joined: Sat Jan 06, 2007 8:34 am

to: Someone who's good at math

Post by DOCTOR THUNDER »

from how I understood it, there was different loot groups. higher luck bumps the loot up to the next group

Archived topic from AOV, old topic ID:755, old post ID:4757
The polite PK.Image
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

to: Someone who's good at math

Post by Red Squirrel »

yeah theres superboss and such, I bumped those numbers up, you can specify things like min max, and chance of that item dropping etc. most were already reasonable. I made a custom one and applied it to a custom mob, and none of the stuff is even dropping, so something is messed up somewhere else.

Archived topic from AOV, old topic ID:755, old post ID:4758
Honk if you love Jesus, text if you want to meet Him!
User avatar
Finlander
Posts: 619
Joined: Fri Feb 23, 2007 4:21 pm

to: Someone who's good at math

Post by Finlander »

i bet its related to talismans again, like 99% if the issues.

Talismans, the source of evil.

Archived topic from AOV, old topic ID:755, old post ID:4759
Image┬hẸ ςhadoШlordς ╒ac┬ion
Vai missä se oli?
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

to: Someone who's good at math

Post by Red Squirrel »

nah talismans have nothing to do with it. They actually have their own random property generator built in, and its 100 times better then the loot one because of its simplicity.

Archived topic from AOV, old topic ID:755, old post ID:4760
Honk if you love Jesus, text if you want to meet Him!
Locked