Jump to content
MakeWebGames

Good crime success rate-formulas?


dnenb

Recommended Posts

  • 4 weeks later...

Thanks, I'll take a look at that. Right now the formula I'm using is similar to that of mccode v1:

((WILL*n)/5)+(LEVEL/5)

where n is a number starting at 1 and decreasing a bit per crime.. It works ok, but I'm thinking it should also include IQ and maybe other stats as well.

Link to comment
Share on other sites

Sorry, but i'm a New Bee, and i am clueless about mccode.

What's `will`: Integer, real ?

Level looks like a integer i think. So level = 0 , success = 0% ?

And `n`, number of attempts ?

Please give more info if you want to have a formula designed.

Btw: This one is always liniar. And you also can devide the endresult by 5.

Example non liniar:

Level = [0 -> 1] (Next level is for example = +10%, so: .1 + (10% of .9) = 0.19 and not 0.2)

And 1 is NOT included. You can get some infinite, and 0 is difficult, so 0.00001 also does the trick.

Otherwise you have to check for 'divide by zero' the whole time. Extreme small value is mutch code friendly.

Then you can give it some scale:

ScaledLevel = Level ^ Scale

Example:

Expert user that has a level of: 0.75

ScaledLevel = [Level = 75%, Scale = 1.0] = 75.0% <- Liniar

ScaledLevel = [Level = 75%, Scale = 1.5] = 64.9%

ScaledLevel = [Level = 75%, Scale = 0.5] = 86.6%

Beginner user that has a level of: 0.25

ScaledLevel = [Level = 25%, Scale = 1.0] = 0.25% <- Liniar

ScaledLevel = [Level = 25%, Scale = 1.5] = 12.5%

ScaledLevel = [Level = 25%, Scale = 0.5] = 50%

So: Scale = 0 > Beginner > 1 > Expert > 2.

Thus: if it doesn't matter, if your a beginner or a expert, Scale = 0.00001 would do fine. 1% ^ 0.00001 = 0.999953...

And otherway around also works: 99.9% ^2 = 99.8% and 11.1% ^2 = 1.23%

 

Happy Hacking..

Ps: please post what all the parameters are and what range or set there in.

Link to comment
Share on other sites

Posting in "MCCode Development & Support" I assume those who answer will have used mccode enough to know it :P

Will is integer, level is integer and n is a decimal starting at 1.00. So that the first and easiest crime has this formula:

((WILL*1.0)/5)+(LEVEL/5)

and the next one (a bit more difficult):

((WILL*0.95)/5)+(LEVEL/5)

I'd like the chance of success to be non-linear, but be like a second degree polynomial - it should take a lot longer to master crime number 8 than to master crime number 2.

Link to comment
Share on other sites

Btw: ((WILL*n)/5)+(LEVEL/5)

Found a `bug`.. WILL = 0 can give a result... Like: "My will to do this is 0, but +LEVEL make me want to do it ?"

 

Here are some wiki's about a good math function and distibution to use:

http://en.wikipedia.org/wiki/Sigmoid_function

http://en.wikipedia.org/wiki/Normal_distribution

 

Happy Hacking

Edited by Lucifer.iix
Link to comment
Share on other sites

Btw: ((WILL*n)/5)+(LEVEL/5)

Found a `bug`.. WILL = 0 can give a result... Like: "My will to do this is 0, but +LEVEL make me want to do it ?"

 

Here are some wiki's about a good math function and distibution to use:

http://en.wikipedia.org/wiki/Sigmoid_function

http://en.wikipedia.org/wiki/Normal_distribution

 

Happy Hacking

Will is never 0 and level is never 0. Also, n is not the number of attempts. It's just a decimal number <=1. But thanks:)

Link to comment
Share on other sites

Ok, got it, i think.....

((WILL*n)/5)+(LEVEL/5) -> n is difficulty from 1 -> 0 than:

n^1.2 will make it more harder for 0.1 -> 0.1^1.2 = 0,063 -> 37% less than normal

So scale it with a number above 1. Maybe like: N = (n^1.5)

- - - Updated - - -

Yeah, sorry. Didn't understand the labels so i just guesst it.

I think just changing the n^1 to: n^1.5 or so would do the trick.

Link to comment
Share on other sites

Btw: Maybe a idea.

I'm going to make a financial game so maybe it doesn't work for you.

Some one who is `fresh` starting the game is, `level` => 0 (Normal situation)

The maximum level you can get is the limit to 1.

The worst level you can get is the limit to -1.

So i have a `normal` middle and two bounderies that are limit's that can not be reached. (in normal situations and 64 bit floats)

But because all my params have the same scale [0->1, 0->-1], i can multiply and devide them without side effects.

Thus my result is also in that range. And on the end i'm going to use a *amplitude and +offset, to create the number to be used.

 

Happy Hacking and good luck with the game: Roger.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...