RulesEngine is a tool that allows the dynamic creation and execution of rules at event-driven execution (gameplay events, AI state changes, quest progression, interactions, etc.), making work easier on projects that require changes in logic, conditions, and consequences. Obtaining a result with all the changes (objects and context that is modified, created or removed)
This rules has a simple condition and a simple consequence and works with a input data with the context and objects.
Include a demo with several use cases to learn how to use
Include a lab to test your rules and input data before implementing it
Create and modify rules in runtime
Execute with data and compare the result with the input data to make easier the change tracking in a short time
Repeat the process all times you need, changing rules and/or data
Error control by individual rule, before execution and during the execution
One instance for multiples rule sets
Include a demo with several use cases
Include a lab to test your rules and inputData before implementing it
Built on top of the proven NRules engine, with a Unity-focused and simplified workflow, runtime integration, serialization support, tooling, and examples designed specifically for game development.
AI Disclaimer
AI-generated content is used exclusively for marketing and promotional images displayed on the Asset Store page. No AI-generated code, assets, or runtime functionality are included in this package.
Asset uses Nrules under MIT license; see Third-Party Notices.txt file in docs folder in package for details
Asset uses Roslyn under MIT license; see Third-Party Notices.txt file in docs folder in package for details
-Rules that go over their limits are now really stopped, including infinite loops and infinite recursion, instead of being left running in the background. Their changes are undone and they are reported in rulesTimeout
-Rules can only use an allowed set of APIs: rule data types, basic types, common collections and CustomMethods. Anything else is rejected when the rule is added
-Everything public in CustomMethods can be called from a rule, including the types of the developer in its signatures. To use anything else from a rule, wrap it in a method of CustomMethods
-New limits, set with SetLimits: time of rules with timeoutMs 0 (1000 ms by default), steps per rule (10000000 by default) and time of a whole ruleSet (5000 ms by default, it also limits rules with a higher timeoutMs)
-Rules always run on the thread that calls ExecuteRuleSet, so CustomMethods can use the Unity API with any timeoutMs if that is the main thread
-ExecuteRuleSet can be called from several threads: different ruleSets run in parallel and the executions of the same ruleSet run one at a time
-AddRule and ModifyRule store a copy of the rule, so changing the object passed afterwards has no effect. To change a rule, call ModifyRule
-CustomMethods with long loops can call RuleGuard.Tick() so that the limits of the rule also apply to them
-The generated code of the rules is no longer logged by default, use SetLogGeneratedCode to log it