Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hunger: Food prep mechanics overview #178

Open
caligari87 opened this issue Jan 13, 2022 · 1 comment
Open

Hunger: Food prep mechanics overview #178

caligari87 opened this issue Jan 13, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@caligari87
Copy link
Member

caligari87 commented Jan 13, 2022

Supersedes and closes #122

Some brief notes on food prep mechanics so I don't forget when I get back around to this (hopefully soonish). Note this will encompass any prep mechanic, not just cooking, so we're changing the terminology.

Prep rule data structures

Each consumable will have an array (similar to the message text arrays) which holds the steps required for preparing the consumable. When all the prep steps are complete, the consumable is automatically destroyed and actually if we revamp the consumable class to store things like Calories in the weaponstatus array, a lot of stuff can probably be done right in the consumable itself. Put out feelers on the Discord to see if this is viable, given there's lots of modded foods already and I don't want to break the.

rough idea for data class

class UaS_FoodPrepRule {
	string rule_name;
	int prep_tics;
	
	static UaS_FoodPrepRule Create(string n, int p = 175) {
		let r = new("UaS_FoodPrepRule");
		r.rule_name = n;
		r.prep_tics = p;
		return r;
	}
	
	static bool DoPrep() {
		if (prep_tics <=0) { return true; }
		prep_tics--;
		return false;
	}
}

Messkit

Basically the resurrection of the messkit. Use the trauma kit as a guide. The player will get a list of consumables on the left which have valid prep rules. On the right will be a dynamically-populated list of those rules, which the player can run.

Most rules will block the execution of other rules because you're assumed to be actively engaged in it, and will fail if you move. One exception might be passively heating items, but will cross that bridge later.

Messkits will probably start with only a basic "plate" function. Picking up more messkits will add random upgrades, making more prep options available for foods which define them.

Possible functions/tools. These don't define functionality by themselves, but rather can be required by a consumable to make a prep rule available:

  • Plate — Increases eating speed for a consumable, at cost of higher spoil rate.
  • Cup — Same for liquids?
  • Knife — Subdivide consumables into multiples.
  • Heater — Solid-fuel camp stove, electric heating element, etc.
  • Pot/Pan — For holding items that can't be heated directly.
  • Grill rack — Required for cooking meats?
  • Kettle — Heating liquids?
  • add more later....

Mixing?

NO PROMISES
If I create a global event handler with a "database" of food descriptions and stats, I can use that to populate consumable descriptions, and have new entries added to it by the messkit. This would conceivably solve the issue of item descriptions not being persistent across inventories.

WIP

This issue is a work-in-progress and will be edited as I have more thoughts.

@caligari87 caligari87 added the enhancement New feature or request label Jan 13, 2022
@caligari87 caligari87 self-assigned this Jan 13, 2022
@caligari87
Copy link
Member Author

(copied from Discord)

Prep example

Each food item can define prep steps, like a recipe, and those steps can require other consumables to complete. For a very simple pseudo-code example:

Food Item: UaS_Apple
  Prep rule: Caramel Apple
    Tools: Bowl
    Requires: UaS_CaramelSaucePacket
    Time: 10 seconds
    Output Actions:
      Calories += UaS_CaramelSaucePacket calories
      Bulk += UaS_CaramelSaucePacket bulk
      Update Description: "A caramel-covered apple"
      Update Name: "Caramel Apple"

If you activate this rule, it uses up the UaS_CaramelSaucePacket and changes the Apple's properties accordingly. If you don't have the appropriate tools or ingredients, the recipe/prep routine simply won't show up in the messkit, avoiding clutter and making "easter egg" combinations possible.

There will be some generic actions. Such as "slicing" will probably be called "portion" and will simply make two copies of the consumable with half the calories. So you can portion your apple and portion your caramel sauce, and essentially get caramel covered apple slices (though this won't be reflected in the name of the consumable most likely).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant