Web port
Hi,
I really like the game, so I've decided to port in in the browser:
https://midzer.de/wasm/rockbot/
Should work on mobile also!
Had to migrate the code base to SDL2 for it. Will share my changes if you like.
Is it okay to maintain a version on my website if no official web port is planned?
Have a nice week, midzer
WoW! I had no idea SDL2 had been ported to browser. This looks amazing. Please share the changes with me. I was planning to make the backend (SDL1/2) optional at compile time, this will help a lot. Sadly I am lacking time to work on the game lately, as my daily work is taking quite a bit of my brain, but once I get some vacations, I can go back and make those changes.
Checkout PR https://github.com/protoman/rockbot/pull/145 in build-wasm.sh
https://github.com/user-attachments/assets/78800d6a-5b2d-42e9-8307-61d938889c00
@midzer Have you converted .mod files to .ogg?
Error in soundLib::load_music::Mix_LoadMUS('/games/RockDroid1/music/intro_scene.mod': 'Unrecognized audio format'
@humbertodias Sorry, I did not push relevant changes to my fork yet.
Here's the command for the link step I've used:
em++ -flto -O3 -fno-exceptions -fno-rtti *.o */*.o */*/*.o -o index.html -sUSE_SDL=2 -sUSE_SDL_IMAGE=2 -sSDL2_IMAGE_FORMATS=png -sUSE_SDL_MIXER=2 -sSDL2_MIXER_FORMATS='["mod","wav"]' -sUSE_SDL_TTF=2 -sUSE_SDL_GFX=2 -sASYNCIFY -sASYNCIFY_IGNORE_INDIRECT [email protected] -sENVIRONMENT=web -sSTACK_SIZE=131072 -sTOTAL_MEMORY=128mb --preload-file build/fonts/@fonts/ --preload-file build/games/@games/ --preload-file build/shared/@shared/ --closure 1 -sEXPORTED_RUNTIME_METHODS=['allocate','ALLOC_NORMAL']
Thanks @midzer . Now it's working! Try out https://humbertodias.github.io/rockbot/
Awesome!
Here's my funcs.txt, so you can do -sASYNCIFY_IGNORE_INDIRECT [email protected]:
[
"main",
"draw::update_screen()",
"graphicsLib::updateScreen()",
"option_picker::pick(int)",
"inputLib::clean_and_wait_scape_time(int)",
"sceneShow::show_scene(int)",
"graphicsLib::draw_progressive_text(short, short, std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char>>, bool, int)",
"scenesLib::main_screen()",
"scenesLib::draw_main()",
"scenesLib::select_save(bool)",
"game_menu::show_main_config(short, bool)",
"game_menu::config_int_value(int, int, int, std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char>>)",
"game_menu::show_config_ask_restart()",
"game::initGame()",
"classPlayer::initFrames()",
"scenesLib::boss_intro(short)",
"scenesLib::pick_stage(int)",
"game::start_stage()",
"draw::fade_in_screen(int, int, int, int)",
"draw::fade_out_screen(int, int, int, int)",
"game::show_player_teleport(int, int)",
"game::show_game(bool, bool)",
"draw::draw_in_game_menu(graphicsLib_gSurface*, short)",
"classPlayer::execute()",
"character::charMove()",
"character::gravity(bool)",
"character::map_collision(float, short, st_float_position, int)",
"character::damage(unsigned int, bool)",
"classPlayer::death()",
"game::object_teleport_boss(st_position, unsigned char, unsigned char, bool)",
"game::restart_stage()",
"game::update_stage_scrolling()",
"stage::move_npcs()",
"classnpc::execute()",
"graphicsLib::blink_screen(unsigned char, unsigned char, unsigned char)",
"dialogs::show_dialog(std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char>>, bool, std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char>>*, bool)",
"game::draw_boss_explosion(st_position, bool)",
"game::leave_stage()",
"object::start()",
"game::show_door_animation(object*)",
"game::horizontal_screen_move(short, bool, short)",
"classPlayer::get_item(object_collision&)",
"game::showGotArmorDialog(e_ARMOR_PIECES)",
"fps_control::limit()",
"SDL_Delay",
"SDL_RenderPresent",
"GLES2_RenderPresent",
"Emscripten_GLES_SwapWindow",
"dynCall_v"
]
Looks like the issue's already fixed. Can we close it, @midzer?
Yes.
Did you incorporate the funcs.txt for optimization in the production build, @humbertodias?
I'm going to link your original WASM port in my https://midzer.de/games#rockbot so I don't need to maintain it any more :)
@midzer
I tried, but it kept failing, so I removed -s [email protected].
I suspect the issue is related to the latest emsdk. Which version are you using?
Please try the current version of build-wasm.sh and let me know if you notice anything that might be causing the issue.
https://github.com/protoman/rockbot/pull/146