Results 1 to 4 of 4

Math Help - I need to make a formula but don't know what type

  1. #1
    Newbie
    Joined
    Jan 2013
    From
    Seattle, WA
    Posts
    2

    I need to make a formula but don't know what type

    It's been more than 10 years since I was in high school, and I'm struggling to make a formula for a game I'm making.


    I have a 2 variables, playerSkill and minimumSkillNeeded.

    playerSkill can be 0.0 - 100.0

    minimumSkillNeeded can be 0.0 - 100.0

    When the player tries to do an action, I need to take the playerSkill and the minimumSkillNeeded, and the higher the playerSkill, the more likely it will succeed. Maybe I take the playerSkill, subtract the minimumSkillNeeded, and use the difference as the modifier, while if it's a negative number it returns no chance of success.

    Right now I'm just rolling a random number 1-5, if 3 or below it succeeds, which is 3/5 odds.

    Another question is how to represent an arc in an equation? Like for skill gain in a game where you start at 0.0, and as you succeed in performing an action it increases based on the difficulty of the action. Right now it just awards the same amount of skill for any success no matter how difficult the task was.

    a = formula where a starts at 0.0 and can rise to 100.0

    Thanks for any pointers
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    Sep 2012
    From
    Australia
    Posts
    3,607
    Thanks
    591

    Re: I need to make a formula but don't know what type

    Hey lmbarns.

    In terms of your problem, do you should probably do a uniform random that returns values between 0 and 100 and use the appropriate cut-off point. This is handy for more resolution (doing 1-5 is too "blocky").

    As for the arc, you will need to tell us the behaviour of not only how things change with the difficulty of the action, but more importantly how things change with the nature of what the current score is.

    I would recommend something like a modified arc-tangent function:

    Inverse trigonometric functions - Wikipedia, the free encyclopedia
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Jan 2013
    From
    Seattle, WA
    Posts
    2

    Re: I need to make a formula but don't know what type

    Thanks for the reply Chiro.

    Maybe it's not an arc, but I need to take 2 variables and determine how much skill to give. Best way I can explain is:

    Example: Player level (PC) and monster level (mob)
    PC = 5 out of potential 100 level
    Mob = 8 out of potential 100

    If PC kills Mob, since it was more difficult, he should get more experience than if he was say rank 10. If he's rank 10, he should gain very little xp since it was a couple levels below. And at either end if he's too high level he shouldn't get any xp for killing it. So I need to taper the gain.

    Another scenario is taming. If a player has 50 taming skill, and an animal requires a minimum of 50 taming skill to tame, there should be say 1/3 chance of success, if the PC has 75 taming and animal requires 50, it should be say 66% chance of success, and with 100 taming 100% success rate....
    Follow Math Help Forum on Facebook and Google+

  4. #4
    MHF Contributor
    Joined
    Sep 2012
    From
    Australia
    Posts
    3,607
    Thanks
    591

    Re: I need to make a formula but don't know what type

    I think the use of an inverse tangent would suit you.

    Basically what you should look at is the behaviour of the function inverse_tan[player-level + tan(monster level/player-level)] where player level = PC and monster-level = mob.

    In other words look at and play around with the inverse tangent function.

    You can graph the function at Wolfram Alpha.

    z = arctan(x + e^(y-x)) - Wolfram|Alpha
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. How do I make R2 the subject of this formula?
    Posted in the Algebra Forum
    Replies: 3
    Last Post: March 22nd 2011, 02:20 PM
  2. Make e the subject of the formula
    Posted in the Algebra Forum
    Replies: 5
    Last Post: February 5th 2011, 11:43 AM
  3. S = 2X10^-36 make value of s in this formula 27S^4
    Posted in the Pre-Calculus Forum
    Replies: 4
    Last Post: May 28th 2010, 02:51 PM
  4. Make Y the subject of the formula
    Posted in the Algebra Forum
    Replies: 15
    Last Post: June 20th 2009, 09:37 PM
  5. [SOLVED] What type of math to learn to make billiard(pool) diamond systems
    Posted in the Advanced Math Topics Forum
    Replies: 2
    Last Post: November 16th 2005, 07:18 PM

Search Tags


/mathhelpforum @mathhelpforum