Viewing Issue Simple Details Jump to Notes ] Wiki ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004226 [DCSS] Implementables minor have not tried 2011-07-06 23:44 2011-10-21 03:22
Reporter dpeg View Status public  
Assigned To KiloByte
Priority normal Resolution done  
Status closed   Product Branch 0.10 ancient branch
Summary 0004226: Food reform
Description A request to implement Vintermann's food reform:
https://crawl.develz.org/wiki/doku.php?id=dcss:brainstorm:misc:eating#the_proposal [^]

That page has a lot of reasoning and explains matters very well. At the bottom is a rather detailed proposal how to go about it. Testing and tweaking will be necessary, but changing the food system like this is a large step in the right direction.
Additional Information
Tags No tags attached.
Attached Files ? file icon 0001-0004226-Food-reform.patch [^] (25,470 bytes) 2011-07-17 08:50 [Show Content]
? file icon 0002-0004226-Food-reform.patch [^] (834 bytes) 2011-07-17 09:05 [Show Content]
? file icon 0001-Applied-Ryak-s-patch-and-fixed-the-rejected-bits.patch [^] (25,559 bytes) 2011-09-06 22:08 [Show Content]
c file icon nutri.c [^] (4,460 bytes) 2011-09-06 22:31
? file icon 0001-0004226-Food-reform-v2.patch [^] (26,670 bytes) 2011-09-30 05:11 [Show Content]
? file icon 0001-0004226-Food-reform_v3.patch [^] (27,987 bytes) 2011-10-01 07:05 [Show Content]
? file icon 0001-0004226-Food-reform_v4.patch [^] (27,448 bytes) 2011-10-02 22:28 [Show Content]
? file icon 0001-0004226-Food-reform_v5.patch [^] (26,986 bytes) 2011-10-03 05:09 [Show Content]
? file icon 0001-Food-reform_v6.patch [^] (36,759 bytes) 2011-10-03 17:24 [Show Content]

- Relationships
parent of 0004712resolvedKiloByte Rotten contam chunks {edible when starving} inedible 
parent of 0004709closedKiloByte Option for food edibility labelling 
parent of 0004707resolvedKiloByte Ghouls can't eat hcl chunks under the new food rules. 
parent of 0004692resolvedKiloByte Crashing in Labyrinth 

-  Notes
(0013841)
Ryak (reporter)
2011-07-17 07:43

I've got this implemented. It probably needs some balancing. I'm going to run a few test games and see if i can at least make the balance reasonable before posting a patch.
(0013842)
Ryak (reporter)
2011-07-17 08:55

(1) New criteria for eating:
Instead of two seperate scales as it was proposed (which would be messy and hard to implement cleanly, i used a single scale while providing a bonus to permafood to give similar results as the original proposal.
(a)Start at 0
+2 for permafood
+1 for royal jelly
+1 for gourmand (on chunks only)
+-1 for each level of carnivore/herbivore for (in)appropriate food
pref nutrition max satiation example
-3 Can't eat.... Can't eat.... herbivore 2 + dirty chunk
-2 1/3 nutrition near starving herbivore 1 + dirty chunk
-1 2/3 nutrition very hungry.. no mutations + dirty chunk
0. 1 nutrition.. hungry....... no mutations + clean chunk
1. 1 nutrition.. satiated..... herbivore 1 + meat ration
2. 6/5 nutrition full......... no mutations + choko
3. 7/5 nutrition no limit..... carnivore 3 + clean chunk
4 8/5 nutrition. no limit..... carnivore 2 + meat ration
5 9/5 nutrition no limit herbivore 3 + bread ration
(b) still can't eat meat at herbivore 3 or plants at carnivore 3 ever
(2) Amount of nutrition different
(a)Permafood base nutrition reduced by 20% - this works out to a 4% net loss of nutrition except for royal jelly which got a slight buff in nutrition
(b)chunks base nutrition reduced by 25% - origional proposal suggested reducing the number of chunks, but i think this is a better solution because it has less of an impact on the other uses of chunks.
(3) All chunks give nutrition. This provides interesting decisions if you are hungry and only have bad chunks.
(0013843)
Ryak (reporter)
2011-07-17 09:07

Second patch is a 1 line fix to an obvious oversight. Despite the fact that i added a comment saying gourmand only worked on chunks, i forgot to actually limit it to chunks.
(0013844)
KiloByte (manager)
2011-07-17 12:32

Uhm no, requiring hunger levels below Hungry would bring back the nasty micromanagement we mostly got rid of for berserk. That's a damn bad idea.
(0013858)
Ryak (reporter)
2011-07-17 16:22

Huh? thats pretty much straight from the proposal.

In my playtesting as a centaur its not really any more micro-managey than before, either. Did you try it?
(0013880)
galehar (administrator)
2011-07-18 12:16

I don't see the problem with the very hungry restrictions. Currently, you rarely eat contaminated chunks before very hungry anyway. And if it makes herbivore 1 and 2 rely more often on permafood, well, I guess that's the point. Definitely worth testing it IMHO.

However, I'm not sure about shoving permafood and chunks in a single scale. I like dpeg's original design. Your scale is a bit hard to read, so I'm not sure how it compares.
Also, reducing nutrition instead of number of chunks doesn't sound like a good idea because it means you'll have to eat more often. Having less source for sublimation of blood is certainly not a problem, and twisted resurrection can be easily boosted to compensate. Anything else?
(0013952)
Ryak (reporter)
2011-07-22 03:38

Yeah unfortunately mantis doesnt really let you do formatted text. I made a google doc so its more readable. The effective result is pretty much the same as dpeg's 2 scale proposal, only easier to implement.

https://spreadsheets.google.com/spreadsheet/ccc?key=0AnMbfunDtqPCdHlFSmZzQVd1bE82ZnBPZnRoOGdHSkE&hl=en_US [^]
(0014033)
dpeg (administrator)
2011-07-31 18:27

Thanks for the patch!

I am adding Ryak's version to the wiki page, for easier comparison. (Ryak, please check if I got it right.)

Kilobyte: I doubt there will be micromanagement. We should really give it a try -- currently the food system wastes a lot of potential (the meaning of poisonous chunks is trivial, depending on your rP; similar for contaminated chunks; Gourmand trivialises everything; the mutations are binary) -- using a gradient has the potential to make everything a lot better.

Ryak: Reducing the number of chunks is a very good step in itself. It already comes up in Vinterman's original proposal. The abuse potential of many-chunk corpses is in principle also around for other corpse uses. (Yes, Twisted Resurrection will need a second look.)
(0014049)
dpeg (administrator)
2011-08-01 22:00

I have turned the original proposals into tables as well (wiki), now you can easily compare the proposals. Examples are still missing.
(0014206)
dpeg (administrator)
2011-08-16 22:10

I have looked at the two tables for quite some time.

ryak's system is a lot simpler. On the other hand, it does not even try to reduce the amount of (chunk) food available, which is not good. I am also not sure what it does with Saprovore and poisonous/mutagenice (which should really work like in the original proposal).

That said, I am fine with testing the patch.
(0014307)
galehar (administrator)
2011-08-24 17:59

I have started to look into it, but the patch doesn't compile:

food.cc:1154: error: ‘CE_HCL’ was not declared in this scope
food.cc:1148: warning: enumeration value ‘CE_ROT’ not handled in switch
(0014308)
Kate (developer)
2011-08-24 18:38
edited on: 2011-08-24 18:47

I think CE_HCL was renamed to CE_ROT since this patch was made (commit 3758c0c064).

(0014552)
vintermann (reporter)
2011-09-06 20:56

This is absolutely wonderful!

I actually had worked out in C code how I wanted (my version of) the proposal to work, but I didn't manage/didn't have time to get it integrated properly into food.cc without breaking all sorts of related stuff.

If Ryak's done the heavy work of that, it will hopefully be much easier to tweak it as well.

Can we have a proper git branch for this, MarvinPA? I have trouble applying the patches attached to this issue, and I'd like to start testing it out as soon as possible.
(0014553)
vintermann (reporter)
2011-09-06 22:33

OK, at galehar's suggestion I uploaded my bit of executable pseudocode to illustrate how my messy two-scale system could be implemented :) It's in nutri.c
(0014630)
galehar (administrator)
2011-09-13 11:42

I've reviewed Ryak's patch and I'm afraid the code isn't good enough to go in. It has duplications (in determine_maximum_satiation), too many static casts, useless type conversions (calculation in floats, return a double) a variable named food_type (which is a type name) and it doesn't even implement the original design.
Some variation in the scales compared to the design is perfectly acceptable, but I really think reducing chunk number is better than reducing nutrition value.

So the issue is still open for contribution. Whether to clean up Ryak's code or to come up with a new implementation.
(0014853)
Mental Mouse (reporter)
2011-09-25 23:22

If you want to cut chunk numbers, you could eliminate chunks from bats and/or rats (that is, small but numerous). Of course, that can make the starting game difficult for heavy eaters....
(0014948)
Ryak (reporter)
2011-09-30 03:19

I had meant to go back to this and modify it a bit based on your feedback. I'm pretty sure with a few tweaks we should have a better patch.

A couple of your comments were things i wanted to go back and change too.
(0014949)
Ryak (reporter)
2011-09-30 04:08

Also in my defense with the variable food_type, there was already an existing function which also used a variable by that name.

Anyway, i'm renaming it plant_content which is more descriptive anyway.
(0014950)
Ryak (reporter)
2011-09-30 05:09

Ok changes from before:
(1) removed unnecessary static_casts
(2) replaced hunger level magic numbers with defined constants
(3) renamed food_type variables to plant_content
(4) returned chunk nutrition to normal and reduced chunk number as per the proposal
(5) determine_satiation_multiplier returns with the same precision it calculates at (geez a little picky there)

Patch Uploaded
(0014952)
ghallberg (reporter)
2011-09-30 08:28

I'm not a dev team member but I'm really happy to see things happening here again, looks like you fixed up most of the stuff galehar was worried about too so now I can hopefully get thius in 0.10 :)
(0014955)
galehar (administrator)
2011-09-30 15:35

Ryak: I'm sorry that you feel like you have to defend yourself. I was just trying to provide objective feedback about what was in need of improvement. Please, don't take critiques personally.

Anyway, you've delivered, the new patch does bring improvements. However, your implementation does bring significant changes to the original design. I've set up a spreadsheet for easy comparison. I filled values based on reading your code and what you've put on the wiki, so there might be mistakes. Let me know if you spot any.

https://docs.google.com/spreadsheet/ccc?key=0AqvhLOPFHpiMdGlkWFpybUc5X3VNbmdwQmhNWm9MMkE&hl=en_US [^]

This table show that Ryak's simplified scale does not always give results similar to the original. I won't go into a detailed analysis, I think the numbers speak for themselves.

I'm not saying the original design is perfect. There might be some simplification and/or improvement.

Anyway, the new patch provided by Ryak does 90% of the work. Implementing the original scales should be quite easy.
(0014956)
dpeg (administrator)
2011-09-30 16:13

ryak: thanks for keeping the patch alive.
galehar: thanks for the spreadsheet.

I am worried about the bad performance of plant food under herbivore regime with the new patch. There is a reason why the original proposal is so generous to herbivores: they have a much harder time than carnivores.

Flavourwise, I like how Herbivore 2 would make sausages emergency food (a contrast to the patch).
(0014967)
Ryak (reporter)
2011-10-01 02:04

You make a good point. Some of the numbers are quite different. i'll give you the benefit of the doubt that you correctly calculated everything.

i think i can match the numbers much more closely. I was mainly focusing on the food levels, which generally match the proposal as you can see. I should get a chance to work on this further this weekend and we should have something we can work with.
(0014968)
Ryak (reporter)
2011-10-01 02:08

Also, no need to apologize. I took no offense. Your comments were pretty much completely justified.

I'll assume you're more used to talking on the tavern where people take offense alot easier ;)
(0014970)
Ryak (reporter)
2011-10-01 03:40

I made one small change to get_preference_for_food_type and some different numbers in determine_satiation_multiplier. I used your spreadsheet to make sure everything lined up nicely with vintermann's numbers and they do quite well. I put it in sheet 2 of my above spreadsheet.
(0014972)
Ryak (reporter)
2011-10-01 07:04
edited on: 2011-10-01 07:05

Patch uploaded.

Numbers can be seen on sheet 2 of my spreadsheet above.

(0014999)
Ryak (reporter)
2011-10-02 22:27
edited on: 2011-10-02 22:35

talking to dpeg, he suggested penalizing incompatible foods even harder, so i made it a -2 penalty (implemented by not giving the +2 permafood bonus). Patch uploaded. Numbers are on sheet 3 of my spreadsheet above.

(0015000)
dpeg (administrator)
2011-10-02 23:20

galehar: Would you have a look? If you think the numbers are okay and if the code quality is good (I cannot judge), it's ready to go in by my assessment.

Is it worth to have the table of former/new nutrition values in the commit message? (I'd think so...)
(0015001)
galehar (administrator)
2011-10-03 00:14

Those numbers look spot on. Maybe even better than vintermann's. Will look at the code ASAP.
(0015002)
galehar (administrator)
2011-10-03 00:40

a quick look at the code doesn't reveal anything terrifing.
I'm a bit worried about changing nutrition value of permafood. It's what we use for spell and abilities food cost and we are used to them. Is this really necessary?
(also use spaces instead of tabs)
(and why do you insist on moving the #include food.h line?)

appart from those details, it's almost good to go. Will have a more thorough look tomorrow.
(0015004)
Ryak (reporter)
2011-10-03 01:55
edited on: 2011-10-03 01:59

i moved the #include because it uses corpse_effect_type in one of the method signatures now where it didn't used to.

Let me see if i can refactor it a bit to keep the base values where they were but still get the same results.

Re: spaces vs tabs. I'm used to my IDE at work autoconverting tabs to spaces. I'll change that too.

(0015005)
Ryak (reporter)
2011-10-03 05:09
edited on: 2011-10-03 05:18

Ok, the updated info is on the spreadsheet. Pretty much everything is close to what it was before.

Patch uploaded.

Changes:
(1) Revert base values to what they were before
(2) Seperate scales for satiation_multiplier for permafood and chunks (consequence of 1)
(3) fix a bug where it wasn't taking into account rotted status of chunks
(4) Convert tabs to spaces

(0015016)
galehar (administrator)
2011-10-03 17:31

I've started cleaning up and testing the code. I'm almost finished, but there's still some issues.
As per design, I've allowed non saprovorous to eat rotten chunk (at greatly reduced nutrition and with systematic sickness), but they don't get sorted properly when prompted (offered before contaminated meat).
Due to how _determine_chunk_effect works, contaminated meat gets reduced nutrition only when you actually get the sickness effect (should be always). Also, contaminated and rotten chunks are not cumulative, so they're not worse than white rotten chunk like they should be.
This probably needs some refactoring but I don't have the time do it right now. Uploading my current version in case Ryak wants to give it a try.
(0015024)
galehar (administrator)
2011-10-04 00:40

It's in. Thanks Ryak!
(0015113)
KiloByte (manager)
2011-10-09 20:25

After some testing, the food reform turned out to be a disaster.

Especially its stated purpose: "My overall vision: Reduce player hassle, without breaking food clock." has spectacularly failed. Players keep complaining about mad micromanagement required all the time now.

Looks like even most ardent proponents seem to have turned back. Galehar for example, the very person who did most of the integration, is said to talk about removing variable thresholds, the main part of the "reform".

I say: let's not waste any more time and just revert it outright. The code to do so is on a git branch.
(0015114)
ion_frigate (reporter)
2011-10-10 00:57

Might I suggest some more limited reforms, to address the original things (I gather) this reform was trying to get at:

* Brown chunks: For a non-saprovore, 3/4 nutrition, sickness 1/9 of the time instead of 1/3. This keeps the expected nutrition gain the same, while reducing the frequency of sickness, which is a really common early-game annoyance that has little gameplay value there. Saprovores stay the same.

* Poisonous chunks: give 1/2 nutrition to those without rpois, while obviously poisoning them. Meant as a desperation option, where you have potions of healing but no food. Also makes the cure poison spell have a little more of a point, at least until getting rpois.

Basically I don't think the idea of variable nutrition is one that requires micromanagement. Thresholds are horrible, but variable nutrition is fairly intuitive and passive.
(0015159)
Ryak (reporter)
2011-10-11 01:29

so now we're stuck back with the original problems of gourmand and carnivore 1 being overpowered and the completely illogical rule that you get no food for chunks which sicken you.

We could easily have addressed people's concerns which basically entirely revolved around being able to eat contaminated chunks at very hungry instead of hungry without throwing out the baby with the bathwater.
(0015162)
KiloByte (manager)
2011-10-11 01:31

Reverted.
(0015163)
dpeg (administrator)
2011-10-11 01:40

Ryak: folks had no patience. I just played another game with your system, and I found it bearable. But if you read the forum entries, players seem to disagree. :(

Carnivore 1 is weaker than before (only goes to Full).

Nutrition for brown chunks will come.

Sorry for this, it surely hurts. We have to live and learn.
(0015172)
Kyrris (reporter)
2011-10-12 02:03

It's not illogical, Ryak. You don't get any actual nutrition when you vomit up your dinner.
(0015174)
KiloByte (manager)
2011-10-12 12:39

Kyrris: I fully agree with you, and have picked that part only because dpeg insisted.

Getting no nutrition when sickened, and the whole amount otherwise, is better than always getting partial amounts: it is less reliable, yet works the same on the average.

And there's the increased theme as you point out.
(0015384)
dpeg (administrator)
2011-10-21 03:22

The targets are in, using a different approach. Thanks to all who helped!

- Issue History
Date Modified Username Field Change
2011-07-06 23:44 dpeg New Issue
2011-07-17 07:43 Ryak Note Added: 0013841
2011-07-17 08:50 Ryak File Added: 0001-0004226-Food-reform.patch
2011-07-17 08:55 Ryak Note Added: 0013842
2011-07-17 09:05 Ryak File Added: 0002-0004226-Food-reform.patch
2011-07-17 09:07 Ryak Note Added: 0013843
2011-07-17 12:32 KiloByte Note Added: 0013844
2011-07-17 16:22 Ryak Note Added: 0013858
2011-07-18 12:16 galehar Note Added: 0013880
2011-07-22 03:38 Ryak Note Added: 0013952
2011-07-31 18:27 dpeg Note Added: 0014033
2011-08-01 22:00 dpeg Note Added: 0014049
2011-08-16 22:10 dpeg Note Added: 0014206
2011-08-24 17:59 galehar Note Added: 0014307
2011-08-24 18:38 Kate Note Added: 0014308
2011-08-24 18:47 Kate Note Edited: 0014308
2011-09-06 20:56 vintermann Note Added: 0014552
2011-09-06 22:08 vintermann File Added: 0001-Applied-Ryak-s-patch-and-fixed-the-rejected-bits.patch
2011-09-06 22:31 vintermann File Added: nutri.c
2011-09-06 22:33 vintermann Note Added: 0014553
2011-09-13 11:42 galehar Note Added: 0014630
2011-09-25 23:22 Mental Mouse Note Added: 0014853
2011-09-25 23:26 Mental Mouse Issue Monitored: Mental Mouse
2011-09-30 03:19 Ryak Note Added: 0014948
2011-09-30 04:08 Ryak Note Added: 0014949
2011-09-30 05:09 Ryak Note Added: 0014950
2011-09-30 05:11 Ryak File Added: 0001-0004226-Food-reform-v2.patch
2011-09-30 08:28 ghallberg Note Added: 0014952
2011-09-30 15:35 galehar Note Added: 0014955
2011-09-30 16:13 dpeg Note Added: 0014956
2011-10-01 02:04 Ryak Note Added: 0014967
2011-10-01 02:08 Ryak Note Added: 0014968
2011-10-01 02:12 Ryak Note Added: 0014969
2011-10-01 03:31 Ryak Note Deleted: 0014969
2011-10-01 03:40 Ryak Note Added: 0014970
2011-10-01 07:04 Ryak Note Added: 0014972
2011-10-01 07:05 Ryak File Added: 0001-0004226-Food-reform_v3.patch
2011-10-01 07:05 Ryak Note Edited: 0014972
2011-10-02 22:27 Ryak Note Added: 0014999
2011-10-02 22:28 Ryak File Added: 0001-0004226-Food-reform_v4.patch
2011-10-02 22:34 Ryak Note Edited: 0014999
2011-10-02 22:35 Ryak Note Edited: 0014999
2011-10-02 23:19 dpeg Assigned To => galehar
2011-10-02 23:20 dpeg Note Added: 0015000
2011-10-03 00:14 galehar Note Added: 0015001
2011-10-03 00:40 galehar Note Added: 0015002
2011-10-03 01:55 Ryak Note Added: 0015004
2011-10-03 01:59 Ryak Note Edited: 0015004
2011-10-03 05:09 Ryak Note Added: 0015005
2011-10-03 05:09 Ryak File Added: 0001-0004226-Food-reform_v5.patch
2011-10-03 05:18 Ryak Note Edited: 0015005
2011-10-03 17:24 galehar File Added: 0001-Food-reform_v6.patch
2011-10-03 17:31 galehar Note Added: 0015016
2011-10-04 00:40 galehar Note Added: 0015024
2011-10-04 00:40 galehar Status new => resolved
2011-10-04 00:40 galehar Fixed in Branch => 0.10 development branch
2011-10-04 00:40 galehar Resolution open => done
2011-10-09 20:25 KiloByte Assigned To galehar =>
2011-10-09 20:25 KiloByte Note Added: 0015113
2011-10-09 20:25 KiloByte Status resolved => feedback
2011-10-09 20:25 KiloByte Resolution done => reopened
2011-10-10 00:57 ion_frigate Note Added: 0015114
2011-10-10 11:29 KiloByte Relationship added parent of 0004712
2011-10-10 11:30 KiloByte Relationship added parent of 0004709
2011-10-10 11:30 KiloByte Relationship added parent of 0004707
2011-10-10 14:10 KiloByte Relationship added parent of 0004692
2011-10-11 01:29 Ryak Note Added: 0015159
2011-10-11 01:31 KiloByte Note Added: 0015162
2011-10-11 01:31 KiloByte Status feedback => resolved
2011-10-11 01:31 KiloByte Resolution reopened => done
2011-10-11 01:31 KiloByte Assigned To => KiloByte
2011-10-11 01:40 dpeg Note Added: 0015163
2011-10-12 02:03 Kyrris Note Added: 0015172
2011-10-12 12:39 KiloByte Note Added: 0015174
2011-10-21 03:22 dpeg Note Added: 0015384
2011-10-21 03:22 dpeg Status resolved => closed


Mantis 1.1.8[^]
Copyright © 2000 - 2009 Mantis Group
Powered by Mantis Bugtracker