Crop calculator ?

Started by Alenerel, October 14, 2016, 11:47:05 AM

Previous topic - Next topic

Alenerel

I was wondering if this exist... If it doesnt and someone wants to do it that would be nice...

It should include things like taking in account the temperature, how many colonists, calculate in hydroponics too, calculate hay for animals (they require different nutrition) and would be very nice if you could include handicaps like taking in account how many days of winter there are and be able to choose more handicaps like cold snaps, eclipses, etc. And with all of that tell the number of growing squares that you need of a crop.
Note: when I handicap I mean growing more than necessary for when you cant grow, idk if thats the word.

BTW a question. How can I calculate how much food an animal needs? Is it the hunger rate? If the wiki says hunger rate from chicken is 0.25, does that mean 0.25 nutrition a day needed to be fed?

Zhentar

Hunger rate is times 1.6 nutrition per day, so a chicken needs 0.4 nutrition per day.

Alenerel

Thanks. Where did you get that info?

Zhentar


Alenerel

Its just that... 1.6 seems a weird number, why isnt it directly the hunger rate? Or why isnt the 0.4 directly at the wiki?

Zhentar

I don't really know why things are the way they are... but I can speculate. The wiki uses the hunger rate pulled from the XML defs, presumably because that's easy and avoids potential misinformation if some numbers are pulled straight from the XML and others were converted to nutrition (and it may well mention the 1.6 somewhere). For the 1.6, that's balanced around colonists having a hunger rate of 1; I would guess initially the 1.6 was a round number but got adjusted somewhere along the line as Tynan tweaked game balance and adjusted day lengths (and editing the constant in the game code lets him just change one place without needing to update every animal, or affecting mod balance).

O Negative

Quote from: Alenerel on October 14, 2016, 11:47:05 AM
I was wondering if this exist... If it doesnt and someone wants to do it that would be nice...

It should include things like taking in account the temperature, how many colonists, calculate in hydroponics too, calculate hay for animals (they require different nutrition) and would be very nice if you could include handicaps like taking in account how many days of winter there are and be able to choose more handicaps like cold snaps, eclipses, etc. And with all of that tell the number of growing squares that you need of a crop.
Note: when I handicap I mean growing more than necessary for when you cant grow, idk if thats the word.

BTW a question. How can I calculate how much food an animal needs? Is it the hunger rate? If the wiki says hunger rate from chicken is 0.25, does that mean 0.25 nutrition a day needed to be fed?

There's a pretty decent equation given on the plants wiki. Although, I admit, I should probably go in there and account for the instant 5% growth plants receive once planted. Regardless, it works perfectly fine for greenhouses and hydroponic rooms, where temperature and light are more controlled than the harsh outdoors. It's a bit tricky to account for temperature extremes (summer;winter) and the average light/day, for outdoor growth, since the algorithms used to calculate those things are based on your latitude and day-of-year. It delves into more calculus than simple algebra, because these things follow a sort of sin() or cos() curve [with values capped at 100%]. Finding the average areas under those curves can be tedious, and even redundant, because you kind of have to have an idea of how many days it's going to take ahead of time to do these calculations correctly. It becomes more of a guess-and-check than a perfect calculator.

And then, there's handicaps, like you were saying... As far as handicaps/events go, that's even more random than the temperature/light variations. You kinda just need to plan for the worst. I'm sorry the answer isn't better than that :(

There's an equation in the .dll for hunger rates, but I don't really have time to put it in simple terms right now. I've got to go to work soon...

Alenerel

Quote from: Zhentar on October 14, 2016, 06:11:12 PM
I don't really know why things are the way they are... but I can speculate. The wiki uses the hunger rate pulled from the XML defs, presumably because that's easy and avoids potential misinformation if some numbers are pulled straight from the XML and others were converted to nutrition (and it may well mention the 1.6 somewhere). For the 1.6, that's balanced around colonists having a hunger rate of 1; I would guess initially the 1.6 was a round number but got adjusted somewhere along the line as Tynan tweaked game balance and adjusted day lengths (and editing the constant in the game code lets him just change one place without needing to update every animal, or affecting mod balance).

So then a colonist needs 1 nutrition a day to be full?

Im going to make that damn calculator cause Im tired of not know how much I have to plant.

Alenerel

#8
Well, Im working on it but I notice that i get different results than the wiki on this page.

To support one colonist, the wiki says:
Corn 10
Potato 11
Rice 12
Strawberry 13

I get:
Corn 7.7
Potato 16.55
Rice 13.07
Strawberry 14.17

I used the formulas supposing that all growth factors are 1 (normal temp, normal soil, normal light). Also the wiki says that corn grows in 10.52 days but I get 12.44 in excel. So Im confused now, am I wrong or is the wiki wrong?

I attach what I have done, its pretty ugly cause I like to make it pretty when I finished the math.

Alenerel

#9
I polished it a bit more and added haygrass for animals (medium size, small ones eat half, big ones eat double, approximately). The green cells are the ones that should be modified to change the conditions. Blue are the results, squares of soil per colonist. I added a compensation factor (over production) for those unpredictable things.

Note that in optimal conditions with 45 days of growing a year its just the double than the ideal value but if there are more or less than 45 days it changes.

Please tell me if you see a mistake somewhere.

Zhentar

Quote from: Alenerel on October 18, 2016, 05:10:19 PM
Quote from: Zhentar on October 14, 2016, 06:11:12 PM
I don't really know why things are the way they are... but I can speculate. The wiki uses the hunger rate pulled from the XML defs, presumably because that's easy and avoids potential misinformation if some numbers are pulled straight from the XML and others were converted to nutrition (and it may well mention the 1.6 somewhere). For the 1.6, that's balanced around colonists having a hunger rate of 1; I would guess initially the 1.6 was a round number but got adjusted somewhere along the line as Tynan tweaked game balance and adjusted day lengths (and editing the constant in the game code lets him just change one place without needing to update every animal, or affecting mod balance).

So then a colonist needs 1 nutrition a day to be full?

Im going to make that damn calculator cause Im tired of not know how much I have to plant.

No, a human needs 1.6 nutrition a day.

Alenerel

#11
Quote from: Zhentar on October 18, 2016, 08:59:31 PMNo, a human needs 1.6 nutrition a day.

Well then, now I get even bigger values... 21 squares of rice per pawn sounds ok or is totally off? And this is counting that they are processed in simple meals, cause if they arent it would be 36.

I get:
Corn 13
Potato 27
Rice 21

The formula is 1.6*GrowthDays / ( MinYield*0.05*1.7 )

= How much I need per colonist in the time the plant grows / the nutrition of the harvest

Where 1.7 comes from processing simple meals: 0.5 to 0.85
GrowthDays = GrowthTime / 0.55 (from wiki when all factors are 1)

O Negative

#12
Quote from: Alenerel on October 18, 2016, 06:26:38 PM
I used the formulas supposing that all growth factors are 1 (normal temp, normal soil, normal light). Also the wiki says that corn grows in 10.52 days but I get 12.44 in excel. So Im confused now, am I wrong or is the wiki wrong?

I attach what I have done, its pretty ugly cause I like to make it pretty when I finished the math.

I can only validate the equations up to Actual Growth Time. I still have to go in there and add that 0.95 coefficient :(

The wiki is still very flawed at the end of the page. I'm not sure how to change the values within those charts, because I don't really understand wiki code that well. I'd really like to get it fixed soon, but I don't have the time to learn how to do it. Maybe I'll get ahold of that Jimyoda guy, he seems to know what he's doing. Just gotta give him the values.

Hunger rate has its own calculation in the .dll, which I haven't looked at yet. When I get some time, I'll return to this forum (I have notifications turned on), and I'll attach a link to a google spreadsheet of my version of the calculator you're looking for. First, I need to make the calculator, though...

Edit: I've updated the wiki to include instantaneous plant growth when calculating how long the plant will actually take to grow. You'll find that the 5% difference is significant enough to account for.

Jimyoda

Sure, let me know what needs to be changed on the wiki. I feel obliged to mention PieTau who reconstructed those completely broken tables on the Plants page.

Also, it'd be easy to create a new parameter on the wiki to calculate and display a pawn's nutritional need based on the formula, hunger rate * 1.6. However, I need to do some testing because there are two stats to consider:
hunger rate - the speed at which a pawn's food meter drops
food capacity - the total nutrition of a full food meter (hunger rate * 1.6)

I'll follow up on this thread when I can fire up the game and check it out.
Quote from: Rahjital on July 09, 2015, 03:09:55 PM
"I don't like that farmers chop people up."

Obviously she has already played Rimworld :P

Read the wiki. Edit the wiki. Let the wiki be your guide.
http://rimworldwiki.com/

Zhentar

hungerRate * 1.6 per day is the rate the hunger meter falls. The size of the hunger meter is equal to body size.