Repository navigation
Behaviour blocks: conditions, effects, counters and Lua signals in the brain - #66
Merged
Merged
Conversation
…kboard, and 48 rules and own moves The contract the framework and mhfu_port build against: EM_RULE grows CONDS, EFFECTS and SIGNAL (0x40), EM_OP, EM_BOARD, the EM_COND and EM_EFFECT enums, the enraged and calmed monster events and MONSTER_WATCH.ENRAGED. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…aths in the behaviour graph New blocks (any_time, idle, on_signal, monster_hp, part_broken, rage, hunter_side, chance, counter_is, flag_is, counter_add, counter_set, flag_set) compile to a rule's conds, effects and signal, a path ending at an effect plays nothing, and the moves module gains vars and signals. The Zinogre gets the topple sequences, charge_up and the owner's example paths. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… paths Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
var and signal params are an editable combo over the names in use: a typed name must match behaviour.ID, else it goes back unheard. sides is a multi-select like mains. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The effect role has its own colour and palette group; name combos offer every name the graph uses; a new block gets a fresh name or a front side; a path that plays nothing ranks on its last block. README lines. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ombat flag Combat start sets the flag, combat end clears it, each idle path requires it, and the notice path scans before them. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ENTITY.FLAGS bit 0x20 rising and falling raise two more monster events, from the MONSTER_WATCH.ENRAGED byte, as the lua_host binds (mhfu.on_bigmonster_enraged, _calmed) and a brain rule's `on` takes them. The event list is the generated count, not a copy. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…he brain A brain rule takes conditions (HP percent, broken parts, enraged or calm, the hunter's side by dot products of ENTITY.ROTATION's rows, a chance rolled last, counters), effects on a counter (var_add saturating, var_set), a Lua signal in place of an event, and no_play: it applies its effects and the scan goes on, in every AI frame. Every fire path applies the effects, the flinch reaction's take too. The board (counters, signals, broken parts, the chance's generator) belongs to the monster: reset at its spawn and the quest, signals held during the tail cut's wait. 48 rules and 48 own moves, from the generated counts (the armed rules are a byte each, not a 32-bit mask); the partitions grow by 5056 bytes and log their sizes. mhfu.em_rule takes the new fields, mhfu.em_var and mhfu.em_signal read and raise the board; API version 4. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…fire _seam_rule hands conds, effects, signal and no_play to the seam, and a rule that plays nothing needs no play target. A port names its board's counters and signals in the moves module's `vars` and `signals`; port:var(name [, v]) and port:fire(name) resolve them and log an unknown name once. The rule and move caps and the new limits come from the generated counts. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… collected vars and signals number its result; it never raises. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rough the dock The studio's name collector is gone: the dock and add_block call behaviour.names. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…EADME on no-play order Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e brain runs them Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The hub's entry after a reaction sets SCRIPT_WAKE, and the script's next pair cut the carrier of a move started in that frame at 0 AI frames. start() quieted the wake only during the notice; it now quiets it for any move whose carrier is the hub (MHFU_MOVE_HUB_*, the default carrier). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rt's break is an event B1: each AI frame, the rules that play nothing all run first, wherever they sit, then the first rule that plays; a playing rule no longer starves a counter of the frame's events (a re-notice's combat_entered, a flinch that breaks a part), and it sees the counters as that frame left them. B3: a part's break is its FLINCH_PART.COUNT reaching its species' BREAK_TABLE row's, once per part, with the row's BREAK_ID bit as data; two parts sharing an id both raise it. The board latches, and part_broken rules test, the part that broke rather than every flinched part. A bit ENTITY.BROKEN gains that no row explains is still raised. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…part breaks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… dock says it Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Zinogre at its fitted zoom, and a named node zoomed out: the names that enter the graph change the options of every name combo. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
b26 (counter_is, 224 high) overlapped b30 on a 200 pitch. The rows from y=2600 move down by 40. The blocks keep their order, so every path keeps its priority and the compiled rules are the same. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The Behaviour panel held it as a literal RGBA; only ui/theme.py holds a colour. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
EM_BLOCK in addresses.toml places the board after the config block, so the brain's reader and writers no longer hard-code sizeof(tail_t). fire_signal sets one byte of the board's signals, as Lua's mhfu.em_signal does, and the rules on it fire in the monster's next AI frame. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…hat plays nothing matches a slot that plays nothing Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e brain Watch the game found Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…tus is empty Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ne has landed Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 3 of the moveset editor: the behaviour graph's blocks get conditions, effects, counters, flags and Lua signals, and the brain runs them. Stacked on #65.
enragedandcalmed.addresses.tomlis the one contract for C, Python and Lua.port:var(name [, v])andport:fire(name).#nbadges are the order the brain runs.part_broken.port:fire("roar")→ howl.in_combatflag gates the idle paths.Live, lane 3:
Tests: 2941 passed with game data on macOS; CI's test job passes on Linux 3.11 and 3.14 (2358 passed).
🤖 Generated with Claude Code