I'm trying to build a smart object system like The Sims, wherein which each object advertises various plans, and each plan is a set of steps to be executed in order. I have all that working, but some plans have preconditions that NPCs may or may not satisfy. As a goofy example, let's say a Cook A Meal plan has four basic steps: place ingredients on counter, prepare ingredients, cook ingredients, place meal on table. Critically, the prepare ingredients step requires cooking utensils: a knife or spatula or something. If the NPC is carrying a utensil, it can execute that step the instant it reaches it, and if no knife is available it needs to fail out of the plan, but if there's a knife nearby, the plan needs to update its action queue and add some new pick up knife action. So, what is the actual design pattern I should be building this around? Right now every plan is just a linear set of actions that I write in a CSV, but the sims obviously had some degree of flexibility I'm not accounting for since their agents were capable of improvising a fair bit to satisfy the preconditions of each prescribed action. My own description sounds kinda-sorta like an action planner but that feels like overkill, and I'm reluctant to build an entire GOAP system because of how hard they are to debug, and how easily they can lead to bizarre behavior.