Jump to content

  • Curse Sites
Become a Premium Member! Help
Latest News Article

Idea to Process Plant Growth in Dormant Chunks with Minimal Resource Usage


  • Please log in to reply
9 replies to this topic

#1

corinanth

Posted 13 November 2012 - 03:03 AM

I came up with a simple idea to handle crops in dormant chunks without relying on resource consuming server ticks. the idea revolves around saving date and time stamps with the chunk data when a chunk goes offline. i dont really know java that well so i am basically writing this in shorthand english with a c like syntax but it should be enough to get the idea.


IF (chunk goes dormant)
{get current date and time and save it as Timestamp in chunk data
Else Process ticks normally
}
IF (Chunk Loads)
{
systemtime = Current system date and time
Get Timestamp

//X is the ammount of time to wait on a dormant chunk before growing plants.
if systemtime >= (Timestamp+X)
{
Replace blockid of all plants with Mature Blockid.
}
else Process ticks normally
}


basically on a chunk load the Timestamp will be compared with the current system time. and if a set ammount of time has passed since the chunk goes dormant the server will assume that the plants have all grown and will replace the blockid of all plants with their mature counterpart. this allows the plants to grow offline with only a slight use of resources on chunk load.
Every time a mod author makes a new "TOOL" God Kills a Kitten. Think of the Kittens, ADD Omniwrench Support To Your Mods !!!
Posted Image

Register or log in to remove.

#2

Badprenup
    Badprenup

    Retired Staff

  • Retired Staff
  • 10969 posts
  • Minecraft: Badprenup

Posted 13 November 2012 - 03:06 AM

I think this has been suggested before, but that was a very long time ago and I couldn't find it. So I'll re add my support to this thread.
Looks like my free time is going to be divided equally between Minecraft suggestions and Starbound suggestions from now on.

#3

Mulan15262

Posted 13 November 2012 - 03:41 AM

I like this idea, although it would be better to simulate the natural random growth speed. Every 82 seconds, the wheat should have a 30% chance to grow under ideal conditions.

At 20 minutes, that would mean a 25% chance of it being fully grown. At 80 minutes, that would mean that it is fully grown.
Posted ImageHere is the dragon I am raising now. In the spoiler are my grown dragons.
Spoiler:

#4

Scum
    Scum

    Diamond Miner

  • Members
  • 889 posts
  • Location: Antarctica

Posted 13 November 2012 - 03:59 AM

Support. I found a good place to put my farm but it's too far away from my base for it to be practical.
XP Guide
Regardless of what change you do, no matter how small, someone will complain. - Jens Bergensten
If you want me to see your reply, make sure to quote my post in your reply.

#5

Zukaro
    Zukaro

    Redstone Miner

  • Members
  • 509 posts
  • Location: Canada
  • Minecraft: Zukaro

Posted 13 November 2012 - 05:03 AM

It would be nice and very useful if this was added.

Zukaro Travon

Robotic Fox

Posted Image


#6

SgtRalph
    SgtRalph

    Zombie Killer

  • Members
  • 155 posts

Posted 13 November 2012 - 05:10 AM

This has my support but I do have a question; for multi-stage plants like wheat and netherwart, would it check the time passed to see if they should move up stage, or just time to full maturity?

#7

corinanth

Posted 13 November 2012 - 05:15 AM

View PostMulan15262, on 13 November 2012 - 03:41 AM, said:

I like this idea, although it would be better to simulate the natural random growth speed. Every 82 seconds, the wheat should have a 30% chance to grow under ideal conditions.

At 20 minutes, that would mean a 25% chance of it being fully grown. At 80 minutes, that would mean that it is fully grown.
that kinda defeats the purpose the more tests you add to chunk initialization the longer it takes for chunks to load and the more strain on the server. this entire concept is to be as fast and simple as possible.
also the more complicated you make this the more server time it takes on chunk load so the simple comparison timer is the best way to go because it requires less tests see the quote below it is easier to just take the longest or average time for wheat to grow and use that as the trigger.

View PostSgtRalph, on 13 November 2012 - 05:10 AM, said:

This has my support but I do have a question; for multi-stage plants like wheat and netherwart, would it check the time passed to see if they should move up stage, or just time to full maturity?
the timer for x would be the maximum time it can take for wheat to mature fully so basically if enough time passed it would grow to full maturity.
Every time a mod author makes a new "TOOL" God Kills a Kitten. Think of the Kittens, ADD Omniwrench Support To Your Mods !!!
Posted Image

#8

SgtRalph
    SgtRalph

    Zombie Killer

  • Members
  • 155 posts

Posted 13 November 2012 - 07:50 AM

Okay, I think I get it, but for maximum clarity can you run through a quick example?

Lets say wheat at any stage takes at maximum 5 minutes to progress to the next stage.  On our wheat farm we have wheat plants in stages 1 through 3, (stage 4 being fully grown).  We leave our farm to go about our other business and the chunk is now unloaded.  6 minutes pass until our return.  Does this scenario play out as:

A. All wheat moves up a stage, stage 1 wheat is now stage 2, stage 2 to stage 3, and stage 3 wheat plants are now fully grown or...

B. Only stage 3 wheat grows, and is now fully grown, but all the stage 1 and stage 2 wheat remain in the same stage or...

C. None of the wheat is grown because the timer needs to reach 15 minutes, the time to go from stage 1 wheat to full maturity

#9

Lightning_CRAFT

Posted 13 November 2012 - 09:35 AM

View PostSgtRalph, on 13 November 2012 - 07:50 AM, said:

Okay, I think I get it, but for maximum clarity can you run through a quick example?

Lets say wheat at any stage takes at maximum 5 minutes to progress to the next stage.  On our wheat farm we have wheat plants in stages 1 through 3, (stage 4 being fully grown).  We leave our farm to go about our other business and the chunk is now unloaded.  6 minutes pass until our return.  Does this scenario play out as:

A. All wheat moves up a stage, stage 1 wheat is now stage 2, stage 2 to stage 3, and stage 3 wheat plants are now fully grown or...

B. Only stage 3 wheat grows, and is now fully grown, but all the stage 1 and stage 2 wheat remain in the same stage or...

C. None of the wheat is grown because the timer needs to reach 15 minutes, the time to go from stage 1 wheat to full maturity
Cool, AGREED and you have my support
Lightning flashes bright, then fades away. It never heals, only destroys.

#10

Forexal
    Forexal

    Zombie Killer

  • Members
  • 248 posts
  • Location: Gold Coast, Australia
  • Minecraft: Forexal

Posted 13 November 2012 - 09:40 AM

Why do you guys support the idea, but not rep the OP?

Posted Image