Port of IVAN 0.50 to WebAssembly

May 4, 2022, 8:29 pm
#1
Joined: Sep 8, 2010
Occupation: Petty Functionary
Location: Drinking pea soup in the world map
Interests: Mangoes
Posts: 1,225
You can play vanilla IVAN in your browser

I guess this is what I was really intending to do before I got side-tracked with the CVS-to-git thing.

The source repository is here: https://github.com/Attnam/ivan-050-wasm

Have fun!
Batman? wrote
its been so long since i had gotten that far i didnt think it through. arrrr!!!!!!
May 5, 2022, 12:44 am
#2
Joined: Apr 2, 2014
Occupation: Navastating
Location: Aslona
Posts: 836
That's so great!
May 5, 2022, 1:19 am
#3
Joined: Dec 3, 2007
Occupation: Chaos Weaver
Location: Standing between all life and death
Posts: 2,913
Awesome
Uchuudonge wrote
creating stable chaos
making patterns where there should be none
sewing order into the chaos
you spit in the face of random numbers, of chaos
May 7, 2022, 11:34 pm
#4
Joined: Dec 2, 2007
Location: New Attnam
Interests: bananas
Posts: 2,314
Sweet! The 'g'o command doesn't seem to work for me in Firefox
May 8, 2022, 11:33 pm
#5
Joined: Sep 8, 2010
Occupation: Petty Functionary
Location: Drinking pea soup in the world map
Interests: Mangoes
Posts: 1,225
capristo wrote
Sweet! The 'g'o command doesn't seem to work for me in Firefox

Hmm, works for me on Firefox, though I'm on Windows. You're on MacOS right? Could be an emscripten bug.

There are still a few little unported things, such as the fullscreen option.

You can also upload files to the browser's IDBFS database file system, although IVAN-wasm won't load savefiles from the original build of vanilla IVAN. I think this is because it was compiled so long ago with an older generation compiler, some of the data types might be assumed to be of a different size (in bytes). When these old data types are read into IVAN-wasm, there must be some sort of numerical under/overflow. I think it would take some serious CS expertise to patch it up.

There's also all the old bugs... 0.o All the same, it's progress towards porting Attnam/ivan to the web.

I think one of the potential possibilities would be to run this on node.js, and then the server could verify a playthrough and maintain a global scoreboard of "legit" hi-scores.
Batman? wrote
its been so long since i had gotten that far i didnt think it through. arrrr!!!!!!
May 9, 2022, 1:02 pm
#6
Joined: Dec 2, 2007
Location: New Attnam
Interests: bananas
Posts: 2,314
I was actually testing that on Windows, but the same thing happens in Firefox for macos.

Actually it works with my arrow keys, but not the numpad (tried with num lock both on and off)
Feb 19, 9:38 am
#7
Joined: Apr 2, 2014
Occupation: Navastating
Location: Aslona
Posts: 836
By the by, is it possible to have the latest IVAN in WebAssembly, too, or is there too much difference in codebase?
Yesterday, 5:17 am
#8
Joined: Sep 8, 2010
Occupation: Petty Functionary
Location: Drinking pea soup in the world map
Interests: Mangoes
Posts: 1,225
The port of 0.50 was relatively straightforward because there were fewer libraries. Had to port it to SDL2 first though, which wouldn't be needed with latest IVAN as that's already done. I never got up to porting latest IVAN because I ran out of free time. I don't know if it will be more or less complicated than 0.50, but in all likelihood there'll be more obstacles to code around. Maybe the sound and audio might give a little static, but on the whole the other additional features are just straight cpp, and it's still single-threaded SDL2 so should port to emscripten easily enough. We won't know what the danger level is until someone ventures into that dungeon.

Here's the diff: https://github.com/Attnam/ivan-050-wasm/compare/383ffef...ma...
Emscripten should build just fine on linux using pretty much the same steps.
Batman? wrote
its been so long since i had gotten that far i didnt think it through. arrrr!!!!!!
Jump to