From c2eaf02fb258fee7c389e00cd3cbf61b5b1126fc Mon Sep 17 00:00:00 2001 From: Sofviic Date: Tue, 18 Jun 2024 13:52:13 +0300 Subject: game design document; 6 demand; psudocode for clarification --- specs/06.Demand.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'specs') diff --git a/specs/06.Demand.md b/specs/06.Demand.md index 30af805f..01424a27 100644 --- a/specs/06.Demand.md +++ b/specs/06.Demand.md @@ -13,6 +13,9 @@ demand = sin(3*sin((hour+offset)/2))+1 (always nonnegative below 2) every day the `offset` will be offset by `[-1,1]` multiplied by the [sway coefficent](#sway-coefficent). +```c +offset += rand(-1,1) * sway +``` ### The Demand Bias Demand scale starts at 0%. @@ -20,6 +23,9 @@ Demand scale starts at 0%. every day the `bias` will be offset by `[-10,10]` multiplied by the [sway coefficent](#sway-coefficent). (clamped to -50% & 50%). +```c +bias += rand(-10,10) * sway +``` ### Traffic Coefficent Usually 1% -- cgit v1.2.3-70-g09d2