Implement discrete event simulation and wake queue #115

Open
opened 2025-12-17 03:26:55 +00:00 by siennathesane · 0 comments
siennathesane commented 2025-12-17 03:26:55 +00:00 (Migrated from github.com)

Description

Background entities only update when something changes (wake events).

Acceptance Criteria

Scenario: Discrete event simulation works
  Given entity is in Background tier
  When using discrete event simulation
  Then entity only updates at scheduled events
  And wake events include: schedule block transition, need threshold, relationship interaction
  And between events, state is interpolated
  And discrete events reduce background entity cost to <5% of frame budget

Technical Notes

  • Wake queue: priority queue of (timestamp, entity, event)
  • Event types: schedule transition, need threshold, condition change, relationship event
  • Event processing: wake entity, update state, schedule next event
  • Interpolation: position, needs, mood linearly interpolated between events
  • Performance: background entities should be nearly free
  • Event prediction: estimate next event time from current state

Size: S (3 points)
Priority: P1
Phase: 11 - Performance Architecture

## Description Background entities only update when something changes (wake events). ## Acceptance Criteria ```gherkin Scenario: Discrete event simulation works Given entity is in Background tier When using discrete event simulation Then entity only updates at scheduled events And wake events include: schedule block transition, need threshold, relationship interaction And between events, state is interpolated And discrete events reduce background entity cost to <5% of frame budget ``` ## Technical Notes - Wake queue: priority queue of (timestamp, entity, event) - Event types: schedule transition, need threshold, condition change, relationship event - Event processing: wake entity, update state, schedule next event - Interpolation: position, needs, mood linearly interpolated between events - Performance: background entities should be nearly free - Event prediction: estimate next event time from current state **Size:** S (3 points) **Priority:** P1 **Phase:** 11 - Performance Architecture
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: studio/marathon#115