Thread: How to get accurate skill success chances for your server.

Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16
  1. #11  
    Renown Programmer

    Bartvh's Avatar
    Join Date
    May 2017
    Posts
    371
    Thanks given
    86
    Thanks received
    203
    Discord
    View profile
    Rep Power
    480
    It's easier to just append ?action=raw to the url then you get something like [Only registered and activated users can see links. ].
    This also allows for easy parsing/dumping data.
    [Only registered and activated users can see links. ] Open Source Emulation Framework
    Reply With Quote  
     

  2. Thankful users:


  3. #12  
    Banned

    Join Date
    Jun 2010
    Age
    23
    Posts
    4,836
    Thanks given
    1,676
    Thanks received
    1,563
    Discord
    View profile
    Rep Power
    0
    Quote Originally Posted by George View Post
    What was done previously? I guess the difference is that this is the confirmed method that JaGex uses, and the low/high chances are the most accurate numbers you're gonna get as its been crowdsourced from thousands of people using runelite.
    Nice, was reading the code at like 3AM at night trying to remember how I wrote fishing lol. Good stuff
    Reply With Quote  
     

  4. #13  




    Scu11's Avatar
    Join Date
    Aug 2007
    Age
    27
    Posts
    16,200
    Thanks given
    7,190
    Thanks received
    12,174
    Discord
    View profile
    Rep Power
    5000
    Quote Originally Posted by Kris View Post
    Include the cascade function found on wikia as well please.
    where is this on the wiki?

    edit: nvm its [Only registered and activated users can see links. ]

    [Only registered and activated users can see links. ]



    Reply With Quote  
     

  5. #14  
    Contributor
    Kris's Avatar
    Join Date
    Jun 2016
    Age
    23
    Posts
    3,536
    Thanks given
    703
    Thanks received
    2,322
    Discord
    View profile
    Rep Power
    5000
    Since George hasn't done it yet, I'll add the cascade function as a reply to this thread as well, converted from lua to kotlin for those who might struggle with it.

    Code:
        fun interpolate(low: Int, high: Int, level: Int) : Double {
            val value = floor(low * (99 - level) / 98.0) + floor(high * (level - 1) / 98.0) + 1
            return min(max((value / 256), 0.0), 1.0)
        }
    
        fun cascadeInterpolate(elements: Array<Element>, level: Int, index: Int) : Double {
            assert(elements contentEquals elements.copyOf().sortedByDescending { it.req }.toTypedArray()) { "Elements array is not sorted." }
            var rate = 1.0
            for (i in elements.indices) {
                val v = elements[i]
                if (i == index) {
                    rate *= interpolate(v.low, v.high, level)
                    return rate
                }
                if (level >= v.req) {
                    rate *= 1 - interpolate(v.low, v.high, level)
                }
            }
            throw IllegalStateException("Index out of bounds")
        }
    
        data class Element(val low: Int, val high: Int, val req: Int)
    Example usage:
    Code:
    val successProbability = cascadeInterpolate(elements, playerLevel, indexOfElementInArray)//returns a double from 0 to 1, giving the probability of the given action succeeding.
    Note: When the array of elements is passed to the cascade function, the array must have been sorted in descending order, starting with the highest level element. If they're out of order, you will receive invalid probabilities. All the examples in Wikia I could find had them in descending order, starting with the highest level one. Thus the assertion at the top of the cascade function.

    The formula is, as Scu11 mentioned above, from [Only registered and activated users can see links. ].
    Reply With Quote  
     

  6. Thankful users:


  7. #15  
    Registered Member

    Join Date
    Sep 2016
    Posts
    161
    Thanks given
    76
    Thanks received
    70
    Discord
    View profile
    Rep Power
    404
    Nice. The way fishing works is it rolls for the highest level fish and gices that if success else repeat for the next fish. So salmon is prioritized over trout, anchovies over shrimp.
    Reply With Quote  
     

  8. #16  
    → 1StopServiceShop ←

    Wells Fargo's Avatar
    Join Date
    May 2016
    Age
    52
    Posts
    1,100
    Thanks given
    543
    Thanks received
    554
    Discord
    View profile
    Rep Power
    5000
    Will use this when I rewrite my skills on my project thanks!
    Reply With Quote  
     

Page 2 of 2 FirstFirst 12

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 3
    Last Post: 03-22-2013, 11:38 PM
  2. Replies: 7
    Last Post: 09-14-2011, 05:19 PM
  3. [GUIDE] How to get SMS+PBP PIN-s for free [5$]
    By Rune-Exclusion in forum Selling
    Replies: 2
    Last Post: 01-13-2011, 07:03 PM
  4. How to get the most performance out of your code
    By thiefmn6092 in forum RS 503+ Client & Server
    Replies: 26
    Last Post: 02-08-2009, 10:51 AM
  5. How to get the numbers you need for item coloring
    By Codyd536 in forum Tutorials
    Replies: 24
    Last Post: 09-15-2007, 04:32 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •