You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/mettagrid/docs/observations.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -116,36 +116,36 @@ depend on your game configuration (number of resources, whether protocol details
116
116
|`cooldown_remaining`| Remaining cooldown time for objects | assembler, extractors | Value capped at 255 |
117
117
|`clipped`| Whether an assembler is clipped or not | extractors ||
118
118
|`remaining_uses`| Remaining uses for objects with use limits | extractors | Value capped at 255. Only emitted if `max_uses > 0`|
119
-
|`inv:{resource_name}`| Base inventory amount (amount % token_value_max) | agents, chests | One feature per resource. See [Inventory Encoding](#inventory-encoding) below. |
119
+
|`inv:{resource_name}`| Base inventory amount (amount % token_value_base)| agents, chests | One feature per resource. See [Inventory Encoding](#inventory-encoding) below. |
120
120
|`inv:{resource_name}:p1`| Power 1 component ((amount / B) % B) | agents, chests | Only emitted if amount >= B. See [Inventory Encoding](#inventory-encoding). |
121
121
|`inv:{resource_name}:p2`| Power 2 component ((amount / B²) % B) | agents, chests | Only emitted if amount >= B². See [Inventory Encoding](#inventory-encoding). |
122
122
|`protocol_input:{resource_name}`| Required input resource amount for current protocol | assembler, extractors | One feature per resource |
123
123
|`protocol_output:{resource_name}`| Output resource amount for current protocol | assembler, extractors | One feature per resource |
124
124
125
125
### Inventory Encoding
126
126
127
-
Inventory values are encoded using a multi-token scheme with a configurable base (`ObsConfig.token_value_max`, default
128
-
255). This allows representing large amounts while keeping individual token values bounded. The number of tokens is
127
+
Inventory values are encoded using a multi-token scheme with a configurable base (`ObsConfig.token_value_base`, default
128
+
256). This allows representing large amounts while keeping individual token values bounded. The number of tokens is
129
129
dynamically computed based on the maximum inventory value (uint16_t max = 65535).
130
130
131
131
-**`inv:{resource}`**: Base value = `amount % B` (always emitted if amount > 0)
132
132
-**`inv:{resource}:p1`**: Power 1 = `(amount / B) % B` (only emitted if amount >= B)
133
133
-**`inv:{resource}:p2`**: Power 2 = `(amount / B²) % B` (only emitted if amount >= B²)
134
134
- etc.
135
135
136
-
Where B = `token_value_max` (default 255).
136
+
Where B = `token_value_base` (default 256).
137
137
138
138
The full value is reconstructed as: `base + p1 * B + p2 * B² + ...`
0 commit comments