Author Topic: [FF7]Snowboard minigame and Emscripten  (Read 301 times)

ergonomy_joe

  • *
  • Posts: 30
    • View Profile
[FF7]Snowboard minigame and Emscripten
« on: 2025-09-30 08:39:36 »
I'm trying to port one of the mini-game from FF7, the snowboard "simulator", to Emscripten. For those who do not know what it is, it is a compiler that translates C or C++ source code to javascript, so that the resulting code can be executed directly in your, or my, favorite browser.

I had some hard time with OpenGL ES. There is no sound yet. The framerate is a little low but ... here it is :


I seem to have a problem with the Z-order, I am trying to fix that for now.
I hope I can make a playable demo soon.

(edit: fixed the image link)
« Last Edit: 2025-10-01 01:31:10 by ergonomy_joe »

ergonomy_joe

  • *
  • Posts: 30
    • View Profile
Re: [FF7]Snowboard minigame and Emscripten
« Reply #1 on: 2025-10-01 01:29:53 »
I made some progress:
.texturing works (sort of)
.depth test
.speed up (I just had to remove my debug calls to glGetError)
.some control (keyboard only for now)



there is no sound and music yet.

If someone wants to run it in her/his browser, I could release the binary somewhere.
Any idea where I could upload that ? All you will need after that is the "snowboard-us.lgp" from the original FF7 windows version.

The best would be to setup a little HTTP server, but there will be a problem with the "lgp" file that cannot be hosted without copyright issues.
« Last Edit: 2025-10-01 01:31:37 by ergonomy_joe »

mav

  • *
  • Posts: 277
  • The Sauce team
    • View Profile
Re: [FF7]Snowboard minigame and Emscripten
« Reply #2 on: 2025-10-01 07:15:05 »
I would go with https://www.netlify.com - it's super easy to upload a website there and have it hosted under a static URL by just dragging & dropping a zip file that contains an index.html and all your assets, you can even update the deployment later if you have a new version.

As for the LGP file you could have a file picker so people could upload the lgp file on their own. Similarly how Diablo Web works: https://d07riv.github.io/diabloweb/

Great work btw!
« Last Edit: 2025-10-01 07:17:00 by mav »

ergonomy_joe

  • *
  • Posts: 30
    • View Profile
Re: [FF7]Snowboard minigame and Emscripten
« Reply #3 on: 2025-10-01 23:11:32 »
@mav thank you for the information.
The filepicker would be the best I guess. The problem, so far, is that I could not find any good (by that I mean extra-easy to implement) example as how to do that with Emscripten. Emscripten seems to be very closed when it comes to access the local filesystem. I'll try to check the Diablo Web source code anyway, if available.

edit:
Actualy, I found some examples to implement THE LAZIEST FILEPICKER ever. And it sortof works.
I also found that github allows some projcet hosting so I created this url:

https://ergonomy-joe.github.io/ff7snobo.github.io/test.html

The program should start by itself; though it is in a loop waiting for you the user to pick "snowboard-us.lgp" from the local filesystem. Once the file "picked" execution should resume automatically and starts the game.
There is only keyboard support for now:
    key from A to L and the directional keypad
    (G is jump, L the pause/resume, + some other keys too)
The fullscreen buton doesn't work,
There is no sound or music,
There is a clipping problem on some sprites,
the opening fade from white doesn't work properly,
The game is locked to the Story mode with Cloud,
    I will try to allow the player to choose the character and the game mode for a next release... maybe.

anyway ... Have Fun !
« Last Edit: Yesterday at 01:46:29 by ergonomy_joe »

Kuraudo.

  • *
  • Posts: 385
    • View Profile
    • Behemoth Productions
Re: [FF7]Snowboard minigame and Emscripten
« Reply #4 on: Yesterday at 08:10:40 »
Just FYI you can also play the 2005 Snowboarding mobile game through DoJa SDK Emulator.

ergonomy_joe

  • *
  • Posts: 30
    • View Profile
Re: [FF7]Snowboard minigame and Emscripten
« Reply #5 on: Today at 02:30:42 »
Allright, I made a small adjustement can you spot it:


That's it, a little selector at the top of the HTML page, which allows you to chose the game mode and the character to play with.

The URL is the same:
https://ergonomy-joe.github.io/ff7snobo.github.io/test.html

I also rebuild the code with the latest version of Emscripten, but that didn't make any visible difference.

edit: Fullscreen seems fixed too
« Last Edit: Today at 04:56:32 by ergonomy_joe »

mav

  • *
  • Posts: 277
  • The Sauce team
    • View Profile
Re: [FF7]Snowboard minigame and Emscripten
« Reply #6 on: Today at 07:14:09 »
Nice, it works for me! There were some minor graphical glitches (mostly in the tree section of "Event") but it's awesome that you've got it working!

ergonomy_joe

  • *
  • Posts: 30
    • View Profile
Re: [FF7]Snowboard minigame and Emscripten
« Reply #7 on: Today at 07:36:30 »
@mav thank you for the feedback. BTW, could you tell me which browser you were using for testing ?

I just uploaded a new version. It fixes the white-fading at the beginning and adds a very simple joystick support. (when a joypad is connected to the system, the input from the keyboard will be ignored; that is a bad design, I'll try to fix that later). Only the DPAD and buttons 1~12 are used.