Tabletop-Mirror / Issues-and-Tasks

0 stars 0 forks source link

Better Handle Cyclic Evaluator Dependencies #122

Open VarunS1997 opened 1 week ago

VarunS1997 commented 1 week ago

Generally, the evaluators are non-cyclical. And actually, they have to be non-cyclical on a per-key basis (or you'd never get a stable calculation).

HOWEVER, because evaluators are hierarchical and inherit from parents, you can have situations where parent evaluators are dependent on the child evaluators.

For example, level evaluators depend on their class evaluators to get them final class fields. Similarly, character evaluators depend on item evaluators to get total item weight.

All such cases, naturally, have to use functional evaluation overrides. Which is fine, but it means that an update to the child evaluator's result won't trigger a cascade evaluation by default. As in, updating the item weight with a bonus or something wouldn't cause the total inventory weight to be updated. Similarly, we have to specifically call for an update of evaluators when child evaluators are updated. This is error-prone for sure.

Technically, developer diligence makes this a non-concern, but it's still bad idea. We need to better think through how to handle this.