Sharing save/load tricks (DRY, WASM)
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 20/100
- issue の種類
- ドキュメント
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- rust, wasm
調査の方向性
この issue は、特定の変更を要求するのではなく、外部の WASM セーブ/ロード実装を共有しています。調査する場合は、まずリンクされている rktrl_macros/src/lib.rs のマクロと src/systems/saveload.rs での使用箇所を確認し、その後、言及されている Cargo.toml の依存関係 feature の変更を確認してください。この issue では、完了がどのような状態になるのかは定義されていません。
索引モデルが issue の本文から書いたものです。
説明
Hey @thebracket! Thank you for the amazing library and book, I'm having a blast following along. This is not so much an "issue", but rather sharing what I learned in case you want to use it in the book at some point. I'll do it tl;dr style to respect your time:
- I've added saving / loading under WASM in https://github.com/abesto/rktrl/commit/b0da9c00125ba9bc2335f0403576b28e56c063f5. Basically it uses local storage (base64 encoded, because I GZip the saved file on the cross-platform code path).
- FWIW, the sentence "Supporting saving via LocalStorage (a browser/JavaScript feature) is planned for a future version of RLTK." confused me for a second - RLTK doesn't explicitly support saving / loading outside the browser either, it's all
serdeandspecs(AFAICT at least).
- FWIW, the sentence "Supporting saving via LocalStorage (a browser/JavaScript feature) is planned for a future version of RLTK." confused me for a second - RLTK doesn't explicitly support saving / loading outside the browser either, it's all
- Reaching for increasingly big hammers, I managed to set up a procedural macro so that for the save / load systems there is zero repetition of the components (check out the macro and its usage). The big idea here is using the macro to split the tuple of components into chunks of at most 16, so that we can then rely on the the
specs_derive-provided implementations for those.- I'm toying with the idea of creating a similar macro to cut down on the boilerplate involved with creating system data structs (but that's less relevant as currently the tutorial doesn't use them)
- Getting things to compile for WASM in the first place was a bit tricky as dependencies pulled in parallel Specs features in their
default-features, which trigger threading. Had to disable them incargo.toml(see https://github.com/abesto/rktrl/commit/72a7a119385ca6ae5c6871dd31d281ba842d0ffe). I guess there might be a better way of doing this (maybe controlling whether a parallel dispatcher is used from code).
Finally, I wanted to add that I know how overwhelming input about big huge changes to writing projects can be, so wanted to explicitly say: no pressure, take these when and if they're useful. Even until then, maybe this will in itself be useful for someone else. Thank you again!
- 主要言語
- Rust
- スター
- 967
- フォーク
- 165
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
amethyst/rustrogueliketutorial のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
-
難易度 1/5 1〜3時間 初心者へのやさしさ 45/100
amethyst/rustrogueliketutorial の issue をすべて見る
似ている issue
-
documentation P2
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
bug good first issue priority:high
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
Konfirm-xyz/konfirm-contracts#163 ·
メンテナーはふだん 1 日以内に返信
-
area:gc-repack-output bug factory:dogfood factory:triaged priority:p3 type:bug type:ux
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
gitbutlerapp/grit#1161 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
feature performance
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
lance-format/lance#10137 ·
メンテナーはふだん 2 日以内に返信