Calories/Metabolism

possum
20 Jun 2019, 01:23

Working on something of a simulator of sorts, but I'm in way over my head. I've only just started learning quest with no programming knowledge beyond "Hello world!". Have found Quest wonderful to use despite my lack of knowledge and the tutorial worked great for me.

However, I'm drawing blanks on how I should handle my next goal. I'm wanting to create a semi-realistic system regarding the player-character eating and metabolizing food. The player should be able to eat, for example, a sandwich. It would add calories and "fullness" to their respective attributes. I also would like calories to eventually process into a "health" or "weight" attribute. I'm hoping to have more calorie-dense foods to process into more "weight" or "health" than, say, a stalk of celery. I'm not wanting the calories to process immediately. I'm thinking it should process after a Rest command, perhaps.

Pardon my inexperience and for aiming way over my head. This is something I'm very excited for and would appreciate the help greatly.

Thanks!


DarkLizerd
20 Jun 2019, 02:07

That's a lot of detail that most, (all) games just ignore...
So, why???
Is this some game you are planning???
Or a diet aid?


possum
20 Jun 2019, 02:21

I guess you could call it a game? It's more just a simulator that takes place in a handful of rooms. I just want to get some interesting body systems. Hunger, thirst, sleep, unspeakables and the like.


The Pixie
20 Jun 2019, 07:17

I would have some attributes on the food: "energy" (or "calories") and "stomachvolume"

And on the player: "energyreserve", "stomachvolume", "stomachmax"," bowelvolume", "bowelmax" and "fat"

The EAT command would check if the player is full, if not increase player.stomachvolume.

Have a turnscript that tests various values (is the player starving, etc.), then reduces player.stomachvolume, increases player.energyreserve and player.bowelvolume. If player.energyreserve is very low, "fat" gets reduced, if it is very high, "fat" increases.

Then have an Exercise function that reduces player.energyreserve, and have that called by the GO command and others too when the player does something strenuous.

Those last two bits will need some careful tweaking to decide how much player.energyreserve and player.fat change and when, to make the game a challenge.


possum
22 Jun 2019, 05:21

Pixie, you're a blessing. I was having a hard time wrapping my mind around how to make it work, but you've done me a great service. Thanks!