Skip to content

feat(game): AIML topic patterns, EDA event bus, ECS motion#157

Merged
cursor[bot] merged 2 commits intomainfrom
cursor/aiml-eda-ecs-f2d7
Apr 27, 2026
Merged

feat(game): AIML topic patterns, EDA event bus, ECS motion#157
cursor[bot] merged 2 commits intomainfrom
cursor/aiml-eda-ecs-f2d7

Conversation

@timfox
Copy link
Copy Markdown
Owner

@timfox timfox commented Apr 27, 2026

AIML

  • Restores a valid AIML_InnerGetResponse implementation (the previous file had a broken function body after the signature).
  • Compiles <topic> as a token pattern (like pattern/that), matches it against the user’s topic stack, fills topic_stars, and implements <topicstar/> with index like other stars.
  • XML loader now reads a <topic> child inside <category> (in addition to <topic name="..."> blocks and default topic from outer <topic>).
  • <srai> save/restore now includes topic star captures.
  • Fixes Q_strncpyz targets in AIML_TryMatch (use g_starBuf[row] for char (*)[256]).
  • When g_eda is enabled, successful AIML_GetResponse publishes a summary on channel aiml.response.

EDA (event bus)

  • New g_eda.c / g_eda.h: fixed-size queue, string channels + payloads, cvar g_eda (default 1) with startup log.
  • EDA_Init / EDA_Shutdown wired in cl_gameframe.c; EDA_Frame() called each client frame (hook for future coalescing).
  • Lua: Engine.Events.publish, pop, queueDepth, clear.

ECS

  • ECS_StepMotion(dt) integrates velocity into position for entities with both components (EnTT view).
  • Cvar g_ecsMotion (default 1) controls stepping in CL_GameFrame after physics when USE_ECS is on.
  • Lua: Engine.ECS.stepMotion(dt) for scripts that want explicit stepping.

Build: Vulkan client + ctest (19/19) passed locally.

Open in Web Open in Cursor 

cursoragent and others added 2 commits April 27, 2026 22:11
- Fix AIML_InnerGetResponse (was missing function header) and star capture
  Q_strncpyz targets; add compiled <topic> pattern matches with topic_stars
  and <topicstar/> output; include <topic> child in category XML; teach
  <srai> to save/restore topic stars; publish aiml.response on EDA when
  g_eda is enabled.
- Add g_eda.c/h string event queue, EDA_Init in game systems, EDA_Frame
  tick, and Engine.Events Lua (publish, pop, queueDepth, clear).
- Add ECS_StepMotion in EnTT layer, g_ecsMotion cvar and client frame
  integration; expose Engine.ECS.stepMotion to Lua.
- List g_eda.c in CMake client sources.

Co-authored-by: Tim Fox <timfox@outlook.com>
- Add EDA_Drain with edaEventRecord_t; Engine.Events.drain(max) returns
  table of {channel,payload} plus count; use Z_TagMalloc for large drains.
- Add ECS_CountWith(component) and Engine.ECS.countWith(name).
- g_aimlDebug cvar; g_eda cvar ref in AIML; publish aiml.nomatch; gate
  aiml.response on g_eda; console logs for no-match and winning category.
- Add examples/websocket (Node echo server, browser client, engine snippet).

Co-authored-by: Tim Fox <timfox@outlook.com>
@cursor cursor Bot merged commit 4e9f33f into main Apr 27, 2026
42 of 50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants