Thread: Rock and tree respawn time algorithm

Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1 Rock and tree respawn time algorithm 
    Banned

    Join Date
    Dec 2008
    Posts
    2,097
    Thanks given
    1,419
    Thanks received
    732
    Rep Power
    0
    Okay, so I've written this based on these charts:

    Mining - RuneScape Guide - RuneHQ
    Woodcutting - RuneScape Guide - RuneHQ

    Code:
    	private static double getRockRespawnTime(Rock rock) {
    		double baseTime = rock.getRespawnTimer();
    		if(rock == Rock.CLAY)
    			return 2;
    		int max = Constants.MAX_PLAYERS;
    		int playersOnline = World.getWorld().getPlayers().size();
    		if(playersOnline >= max-100)
    			return rock.getRespawnTimer();
    		int factor =  8 - (playersOnline/250 == 0 ? 1 : playersOnline/250);
    		double timeInS = (rock.getRespawnTimer()*600)/1000;
    		double secondFactor = Math.sqrt(baseTime);
    		double ticks;
    		for(int i = 0; i < factor; i++)
    			timeInS += secondFactor;
    		ticks = (timeInS * 1000)/600;
    		return ticks;
    	}
    The same formula is used for both woodcutting and mining, and this will return the amount of ticks it takes for the rock or tree to respawn.

    Also Here are the base respawn times..

    Mining:
    Code:
    CLAY 2	always 2 ticks no matter the amount of players
    COPPER 3.33
    TIN 3.33
    IRON 8.33
    SILVER 100
    GOLD 100
    COAL 46.66, 3
    MITHRIL 203.33
    ADAMANTITE 416.66
    RUNE 1000
    Woodcutting:
    Code:
    NORMAL 50  will always be between 50-100 ticks no matter the amount of player.
    WILLOW 13.6
    OAK 13.6
    MAGIC 120
    MAPLE 58.3
    MAHOGANY 100
    TEAK 100
    ACHEY 50
    YEW 100
    Reply With Quote  
     

  2. #2  
    Chemist

    Advocatus's Avatar
    Join Date
    Dec 2009
    Posts
    2,622
    Thanks given
    201
    Thanks received
    813
    Rep Power
    1462
    Wow. Pretty damn nice. Beats what I was using, mine didn't account for the amount of players on the world (which is pretty trivial).
    Quote Originally Posted by blakeman8192 View Post
    Quitting is the only true failure.
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Dec 2008
    Posts
    2,097
    Thanks given
    1,419
    Thanks received
    732
    Rep Power
    0
    Quote Originally Posted by Advocatus Diaboli View Post
    Wow. Pretty damn nice. Beats what I was using, mine didn't account for the amount of players on the world (which is pretty trivial).
    Yea it didn't take me too long to figure it out, all I need now is a decent algorithm for the chance of obtaining a log or ore
    Reply With Quote  
     

  4. #4  
    Hi.

    'Mystic Flow's Avatar
    Join Date
    Nov 2007
    Posts
    7,146
    Thanks given
    256
    Thanks received
    1,252
    Rep Power
    3714
    I'm pretty sure the factor that has to do with players is affected by how many players are in the tree's area but hey this beats anything we have atm, good job !



    Reply With Quote  
     

  5. #5  
    Banned

    Join Date
    Dec 2008
    Posts
    2,097
    Thanks given
    1,419
    Thanks received
    732
    Rep Power
    0
    Quote Originally Posted by 'Mystic Flow View Post
    I'm pretty sure the factor that has to do with players is affected by how many players are in the tree's area but hey this beats anything we have atm, good job !
    I've always known it to be based on the amount of players in the world.
    Reply With Quote  
     


  6. #6  
    Registered Member
    Join Date
    Apr 2011
    Posts
    62
    Thanks given
    5
    Thanks received
    0
    Rep Power
    1
    Thanks babe!
    http://img5.uploadhouse.com/fileuplo...8e48463471.png
    Reply With Quote  
     

  7. #7  
    Rock and tree respawn time algorithm



    Scu11's Avatar
    Join Date
    Aug 2007
    Age
    30
    Posts
    16,307
    Thanks given
    7,215
    Thanks received
    12,308
    Rep Power
    5000
    Quote Originally Posted by 'Mystic Flow View Post
    I'm pretty sure the factor that has to do with players is affected by how many players are in the tree's area but hey this beats anything we have atm, good job !
    Lol where are you pullin this crap from?

    Attached image
    Reply With Quote  
     

  8. Thankful users:


  9. #8  
    Hi.

    'Mystic Flow's Avatar
    Join Date
    Nov 2007
    Posts
    7,146
    Thanks given
    256
    Thanks received
    1,252
    Rep Power
    3714
    Quote Originally Posted by Scu11 View Post
    Lol where are you pullin this crap from?
    While training woodcutting to 94 I noticed that trees restore faster when there are no players around it, I really don't know if that's how it works or not but I'm probably blind



    Reply With Quote  
     

  10. #9  
    Banned

    Join Date
    Dec 2008
    Posts
    2,097
    Thanks given
    1,419
    Thanks received
    732
    Rep Power
    0
    Quote Originally Posted by 'Mystic Flow View Post
    While training woodcutting to 94 I noticed that trees restore faster when there are no players around it, I really don't know if that's how it works or not but I'm probably blind
    All spawns, whether it be npcs, objects, items are dependent on the amount of players in the world.
    Reply With Quote  
     

  11. #10  
    Donator


    Join Date
    Mar 2008
    Posts
    1,945
    Thanks given
    118
    Thanks received
    201
    Rep Power
    2104
    @'Mystic Flow:
    time is affected by the amount of players in the world not area
    Attached image
    Reply With Quote  
     

Page 1 of 2 12 LastLast

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. NPC respawn time
    By addinol in forum Help
    Replies: 1
    Last Post: 04-03-2010, 07:47 AM
  2. Npc Respawn Time
    By cookies219 in forum Help
    Replies: 3
    Last Post: 01-27-2010, 12:45 AM
  3. dag kings respawn time.
    By Balla in forum Requests
    Replies: 1
    Last Post: 01-17-2010, 10:41 AM
  4. How to change Corporal Beast Respawn Time
    By batherson in forum Requests
    Replies: 8
    Last Post: 12-18-2009, 12:50 AM
  5. NPC Respawn Time
    By Fr33b1e in forum Tutorials
    Replies: 3
    Last Post: 08-13-2007, 06:26 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
  •