pub struct FlowTheoryConfig {
pub skill_window_size: usize,
pub adaptation_rate: f32,
pub boredom_threshold: f32,
pub anxiety_threshold: f32,
pub target_win_rate: f32,
}Expand description
Flow Theory parameters for Dynamic Difficulty Adjustment.
Based on Csikszentmihalyi’s three-channel model:
- Boredom: Challenge too low for skill level
- Flow: Challenge matches skill (optimal engagement)
- Anxiety: Challenge too high for skill level
Reference: Think Game Design
Fields§
§skill_window_size: usizeNumber of recent points to consider for skill estimation
adaptation_rate: f32Rate at which AI adapts difficulty (0.0-1.0)
boredom_threshold: f32Win rate threshold above which player is “bored” (e.g., 0.7)
anxiety_threshold: f32Win rate threshold below which player is “anxious” (e.g., 0.3)
target_win_rate: f32Target win rate for optimal flow (typically 0.5)
Trait Implementations§
Source§impl Clone for FlowTheoryConfig
impl Clone for FlowTheoryConfig
Source§fn clone(&self) -> FlowTheoryConfig
fn clone(&self) -> FlowTheoryConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FlowTheoryConfig
impl Debug for FlowTheoryConfig
Source§impl Default for FlowTheoryConfig
impl Default for FlowTheoryConfig
Source§impl<'de> Deserialize<'de> for FlowTheoryConfig
impl<'de> Deserialize<'de> for FlowTheoryConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FlowTheoryConfig
impl RefUnwindSafe for FlowTheoryConfig
impl Send for FlowTheoryConfig
impl Sync for FlowTheoryConfig
impl Unpin for FlowTheoryConfig
impl UnwindSafe for FlowTheoryConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more