{"action":"created","issue":{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/13729","labels_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/13729/labels{/name}","comments_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/13729/comments","events_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/13729/events","html_url":"https://github.com/CleverRaven/Cataclysm-DDA/issues/13729","id":110338340,"number":13729,"title":"Nutrition values depending on hunger of character are not continuous","user":{"login":"BevapDin","id":5095435,"avatar_url":"https://avatars.githubusercontent.com/u/5095435?v=3","gravatar_id":"","url":"https://api.github.com/users/BevapDin","html_url":"https://github.com/BevapDin","followers_url":"https://api.github.com/users/BevapDin/followers","following_url":"https://api.github.com/users/BevapDin/following{/other_user}","gists_url":"https://api.github.com/users/BevapDin/gists{/gist_id}","starred_url":"https://api.github.com/users/BevapDin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BevapDin/subscriptions","organizations_url":"https://api.github.com/users/BevapDin/orgs","repos_url":"https://api.github.com/users/BevapDin/repos","events_url":"https://api.github.com/users/BevapDin/events{/privacy}","received_events_url":"https://api.github.com/users/BevapDin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/labels/Suggestion%20(Discuss)","name":"Suggestion (Discuss)","color":"FF3399"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-07T23:18:07Z","updated_at":"2015-10-08T01:49:01Z","closed_at":null,"body":"The effective nutrition of food is altered based on the hunger of the character (see `player::nutrition_for`). However, the formula used there produces non-continuous values as shown in this table:\r\n\r\nhunger | nutrition\r\n-------|------\r\n0      | 10 (value from JSON)\r\n99     | 10\r\n100    | 6.7\r\n150    | 10\r\n300    | 20\r\n301    | 8.6\r\n2800   | 60\r\n2801   | 46.7\r\n\r\nThat means if the hunger increases by one point from 99 to 100 or from 300 to 301, the nutrition that will be extracted from the food is actually *decreased*. This seems very wrong. In the range 100 to 149, the character gets less nutrition as when they would be not hunger at all.\r\n\r\nFor reference, this is the current code (slightly reformatted, hunger >40 is hungry, >100 is very hungry, >300 famished):\r\n```C++\r\nif( hunger < 100 ) {\r\n    return nutrition;\r\n} else if( hunger <= 300 ) {\r\n    return hunger / 300.0 * 2 * nutrition;\r\n} else if( hunger <= 1400 ) {\r\n    return hunger / 1400.0 * 4 * nutrition;\r\n} else if( hunger <= 2800 ) {\r\n    return hunger / 2800.0 * 6 * nutrition;\r\n} else {\r\n    return hunger / 6000.0 * 10 * nutrition;\r\n}\r\n```\r\n\r\nBtw. the item info shows the hunger-dependent values, not the plain value, is that intended?\r\n\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/27245435-nutrition-values-depending-on-hunger-of-character-are-not-continuous?utm_campaign=plugin&utm_content=tracker%2F146201&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F146201&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/comments/146390878","html_url":"https://github.com/CleverRaven/Cataclysm-DDA/issues/13729#issuecomment-146390878","issue_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/13729","id":146390878,"user":{"login":"kevingranade","id":860276,"avatar_url":"https://avatars.githubusercontent.com/u/860276?v=3","gravatar_id":"","url":"https://api.github.com/users/kevingranade","html_url":"https://github.com/kevingranade","followers_url":"https://api.github.com/users/kevingranade/followers","following_url":"https://api.github.com/users/kevingranade/following{/other_user}","gists_url":"https://api.github.com/users/kevingranade/gists{/gist_id}","starred_url":"https://api.github.com/users/kevingranade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevingranade/subscriptions","organizations_url":"https://api.github.com/users/kevingranade/orgs","repos_url":"https://api.github.com/users/kevingranade/repos","events_url":"https://api.github.com/users/kevingranade/events{/privacy}","received_events_url":"https://api.github.com/users/kevingranade/received_events","type":"User","site_admin":false},"created_at":"2015-10-08T01:49:00Z","updated_at":"2015-10-08T01:49:00Z","body":"So many things wrong here...\nOne, it shouldn't be adjusted by the food at all, *if* there's an\nadjustment it should happen when the nutrition is applied to the player, in\nthe player (or character) class.\nTwo, it is definitely intended to be a steady increase, not a discontinuous\none.\nThree, I'm sceptical of the whole concept of nutrition increasing based on\nhow hungry you are. (Acknowledging that hunger isn't what we normally call\nhunger, it's more like starvation level at the point when this stuff is\nkicking in).\nFour, (a side effect of 'one'), the post-adjustment values definitely\nshould not be used.\n\nPersonally I'm for nixing the whole thing.\n"}}