-
Notifications
You must be signed in to change notification settings - Fork 48
Increase inventory capacity with base-100 encoding for values up to 25599 #4355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
b8320d7 to
3f47205
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
packages/mettagrid/cpp/include/mettagrid/systems/observation_encoder.hpp
Outdated
Show resolved
Hide resolved
3f47205 to
4aea879
Compare
4aea879 to
d0a68f9
Compare
d0a68f9 to
a5dbc90
Compare
0735eea to
80c1cf6
Compare
a5dbc90 to
ab4e5b9
Compare
1b1303c to
e02535f
Compare
3a053d9 to
659744a
Compare
e02535f to
f6a24b2
Compare
659744a to
b63adff
Compare
b63adff to
2ffd88e
Compare
f6a24b2 to
13f0211
Compare
2ffd88e to
f207eb2
Compare
13f0211 to
57f5cee
Compare
28bd91e to
6e533b4
Compare
57f5cee to
1f7cfef
Compare
6e533b4 to
befbdc9
Compare
1f7cfef to
5c7bc8a
Compare
befbdc9 to
d9199b5
Compare
5c7bc8a to
089772d
Compare
d9199b5 to
f4f2626
Compare
089772d to
803c303
Compare
|
I think this is no longer relevant? |

Increase Inventory Capacity with Base-100 Encoding
TL;DR
Increases the maximum inventory capacity from 255 to 65,535 and implements a base-100 encoding scheme for observation tokens to support larger inventory values.
What changed?
InventoryQuantityfromuint8_ttouint16_tto support values up to 65,535InventoryDeltafromint16_ttoint32_tto accommodate the full range of changesinv:{resource}contains the ones digit (value % 100, 0-99)inv:{resource}:toncontains the hundreds digit (value / 100, 0-255)How to test?
Run the new tests in
test_set_inventory.pywhich verify:Why make this change?
The previous 8-bit inventory limit of 255 was too restrictive for many gameplay scenarios. This change allows for much larger inventory quantities while maintaining backward compatibility with existing systems. The base-100 encoding scheme efficiently represents these larger values in the observation space without requiring additional tokens for most common inventory amounts.