• they/them

i am into accessibility and game design. i go by sysopod on other platforms as well


posts from @silasoftrees tagged #indie games

also: #indie game

silasoftrees
@silasoftrees

it's different, art is pretty good
i think the game might have glitched on me so i didnt beat it
even though it has good art, it's really weird and barely a game
yet i am still giving it positive because if you buy a $3 game about a naughty dog just to complain about it that's your problem not the game's problem



good news! i've figured out how to write wasm with rust and get it running in the browser, and i've got it playing nice with the html in the browser. neat!

bad news! wasm written in this way appears to be hugely bloated for a variety of reasons, and now i have to either figure out how to optimize, figure out how to do everything on a very low level- possibly both. suddenly i've got to pay a memory cost of many kb to send the word "pants" from js to wasm.

i guess it's not impossible to write all the game logic in my rust code to only use data types that map to wasm's data types, but it will be significantly less human readable. maybe the solution here is to write one version in a human readable format and then write some other program to pack that into wasm-friendly rust, but then i need to make sure that gets synchronized with the js and at that point i'm just recreating wasm-bindgen...



edit: thanks for the shares! i think i have figured out the way forward now

note up front for anyone who wants to give me advice (which i will appreciate!)- i am doing this as an exercise to learn how to use rust and web assembly (wasm), so any suggestions that it would be easier to just not use rust or wasm will not be viable, even if that is probably very accurate. just wanted to say that to save time and energy for any kind people offering their thoughts.

this is for the js13k submission i'm working on. i need to keep the current game state in memory (what floor the player is on, what items are haunted, how much progress has the player made, etc) and i need to do that while also taking input from the player via their interactions with the html.

i had previously created a demo of the game as a pure rust command line version. in that version of the game, this whole thing is handled by std::io::stdin and just passing around the game state as a struct in a loop in the main run() function. the problem is, i don't really know how to modify or recreate std::io::stdin to fit with taking input from html form data/JS functions through wasm, so i've been trying to just switch to passing the game state as an object to the js/browser to keep in memory there and then throw it back to rust whenever i need to modify it/run some logic on it. that's a lot of work, wasm_bindgen is not exactly easy to make work with custom structs or even standard composite data types like vectors, and the whole endeavour is probably wasteful in terms of making me write redundant code when i really don't need to be using the game struct at all in the js- which should just be asking the rust code for the result of input taken from the html/user interactions.

i could go down the rabbit hole of trying to create a web worker to handle messaging between the rust code and the js, so it keeps the game state in memory and then modifies and renews it as needed...? but that also seems really janky. i'm kinda at a loss for what the correct direction is, here. rust/wasm seems to be pretty under supported, given the main tutorial in the book is flatly broken due to dependency issues and the community seems pretty fractured (this might be a misconception, i'm just going off what i can find online), so it's not like i can find a ton of support or wealth of historical solutions to this stuff like i can with most other languages.