Author Topic: Compiling to html5?  (Read 2179 times)

Offline Bluepixel

  • Mc. Print
  • *
  • Posts: 26
  • www.bluepixel-studios.net
    • View Profile
    • Bluepixel Studios
Compiling to html5?
« on: 2019-Nov-26 »
Hi there, i am working on a small site and i was planning on releasing some games on there, so i was wondering if i could still export to html5, however, after i compiled the program i only got a dummy html file, and an empty distribute folder.

Is it still possible to export to html5 or am i doing something wrong?
www.bluepixel-studios.net

There are two ways to write error-free programs; only the third one works.
(Alan J. Perlis)

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10752
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Compiling to html5?
« Reply #1 on: 2019-Nov-28 »
V16 does a good job for me. GACK compiles and runs fine.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1736
    • View Profile
Re: Compiling to html5?
« Reply #2 on: 2019-Nov-28 »
I was curious and just extracted HTML.7z to platform folder and got an empty folder and message in compiler window

So I an assuming I missed some steps to install this emscripten thingy?


%EMSDK% is set, or SDK is not installed or can't be found at:
C:\Program Files\Emscripten
Get and install the (prebuilt) SDK from: https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html-----------------------------------------

'emsdk_env.bat' is not recognized as an internal or external command,
operable program or batch file.
'em++.bat' is not recognized as an internal or external command,
operable program or batch file.
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3928
    • View Profile
    • Space Fractal
Re: Compiling to html5?
« Reply #3 on: 2019-Nov-28 »
V16 does a good job for me. GACK compiles and runs fine.

its isent released. plan to release a beta. Steam has a beta labal to do it. Im wish how well its compile Greedy Mouse, which use a lots of Polyvectors in that game.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10752
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Compiling to html5?
« Reply #4 on: 2019-Nov-29 »
Oh. I should do that. I'm sorry.

Offline Qedo

  • Dr. Type
  • ****
  • Posts: 266
  • UNUS SED LEO
    • View Profile
Re: Compiling to html5?
« Reply #5 on: 2020-Jan-31 »
i'm getting error when compile in html5 with 16.252:

"%EMSDK% is set, or SDK is not installed or can't be found at:
C:\Program Files\Emscripten
Get and install the (prebuilt) SDK from: https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html"

I need to install SDK of  Emscripten?

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10752
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Compiling to html5?
« Reply #6 on: 2020-Feb-11 »
Yes. Do the installers still exist?

Offline Qedo

  • Dr. Type
  • ****
  • Posts: 266
  • UNUS SED LEO
    • View Profile
Re: Compiling to html5?
« Reply #7 on: 2020-Feb-12 »
I have to compile sdk and it's not easy. For now I have downloaded it and you have to understand how to proceed
But are you sure there is no easier way?

Offline dreamerman

  • Global Moderator
  • Dr. Type
  • *******
  • Posts: 365
    • View Profile
    • my personal website
Re: Compiling to html5?
« Reply #8 on: 2020-May-04 »
Which files I need to edit/configure to compile for html5 now, or any tool needs to be in specific path or something? I've installed latest versions of Git, Emscripten, Python (in some custom path to avail possible ProgramFiles and similar issues) they can be launched from system cmd and so on, but whole time I get some errors, either one or another tool isn't supposedly in proper path.. Does this target is configured to use current distributions of needed tools, as for example for emscripten it looks on some bat/exe in main emsdk directory but tools are in corresponding sub directories. ofc. I've tried to edit some *bat's in platform path to force proper working directories but neither of them has impact on result.
Beside that HTML5-WebGl target is working, or more precisely does it have some restrictions, as in previous versions of GLB it wasn't capable of compiling project that use RenderToTexture / PolyVectors stuff.

Check my source code editor for GLBasic - link Update: 20.04.2020

Offline dreamerman

  • Global Moderator
  • Dr. Type
  • *******
  • Posts: 365
    • View Profile
    • my personal website
Re: Compiling to html5?
« Reply #9 on: 2020-May-23 »
Those *.bat files in platform/HTML5 are either not used for build or are for building GLB lib itself or something if I understand correctly, proper build file is 'compile_html5.bat' that's generated during compilation in 'temp\glbasic', this can be edited to set proper path for emscripten and that will work.
But there are other issues, first is that 'OUTLINING_LIMIT' setting is deprecated and not used in current emscripten, second thing, prebuilt / included GLB/HTML5 libraries were made with older version of emscripten, if You will try to use them on latest public version an error 'machine type must be wasm32' will appear, and compilation will stop.
Still there are those warning about multi brackets (()) and using == comparison instead of ===, but those can be ignored with some compiler switches.
It would be great if those critical errors could be fixed so HTML5 would be available again.
Check my source code editor for GLBasic - link Update: 20.04.2020

Offline Qedo

  • Dr. Type
  • ****
  • Posts: 266
  • UNUS SED LEO
    • View Profile
Re: Compiling to html5?
« Reply #10 on: 2020-May-31 »
I use version 16, currently 16.508, but I also hold on to version 15.238 which compiles Android (without Android Studio) and Html5 without problems.
Ad maiora

Offline dreamerman

  • Global Moderator
  • Dr. Type
  • *******
  • Posts: 365
    • View Profile
    • my personal website
Re: Compiling to html5?
« Reply #11 on: 2020-Jun-07 »
Hey, Qedo but what version of Emscripten and Python are You using? That's the issue.
As I mentioned, html5 target in GLB was set to use old versions of those tools (from couple years ago), and it just won't work on their current versions. So in short - You have small chances to get it working on fresh machine, or do a lot of digging to found proper old binaries, and other thing, it would be beneficial to use newest versions with all possible fixes, optimizations and so on.. Do fresh installation of emscripten, latest python and all other tools that are needed and You will see that it just doesn't work, with all issues mentioned in previous my post. :/
I would really like to have this as it's much easier to show possible demos for wider audience.
Check my source code editor for GLBasic - link Update: 20.04.2020

Offline Qedo

  • Dr. Type
  • ****
  • Posts: 266
  • UNUS SED LEO
    • View Profile
Re: Compiling to html5?
« Reply #12 on: 2020-Jun-07 »
Hi dreamerman first of all thanks for the reply.
Forgive me, however, it is not clear what you write or it is I who do not understand.
Do you need the latest versions of Emscripten and Python to make Html5 work?
Or are previous versions needed?
However, when I installed Html5 for V15 of GLB I started by downloading the JavaScript.7z file from the download folder http://www.glbasic.com/platform/v15/ and there is also the whole installation of Emscripten inside.
I copied the unzipped files in the local \GLBasic_v15\Compiler\platform\ folder and that's all I did and it worked.

Instead for the GLB V16 it seems to me different because in download, at http://www.glbasic.com/platform/v16/, I find HTML5.7z that I unzipped and I inserted in \GLBasic_v16\Compiler\platform\ But there is no Emscripten files. Is this the problem and if so, how can this be remedied?
Is there any further procedure to do? Launch some batch files?
However, I do not find any informstion that helps to understand and it seems a big lack.
Thanks again.
Ad maiora

Offline dreamerman

  • Global Moderator
  • Dr. Type
  • *******
  • Posts: 365
    • View Profile
    • my personal website
Re: Compiling to html5?
« Reply #13 on: 2020-Jun-12 »
Yeah, I could be more precise and write some background for it as You did :-)
So generally in v15 everything for html5 target was in one package, just unpack, instal some Java SDK and it's ready to go.. emscripten was included, no separate tools.
But v16 package contains only few config and *bat files that from what I understand are configured to work with proper emscripten installation in system - that needs to have python, git and possible other tools installed. Didn't saw any special info about that html5 target so I assumed that now proper way to use that target is to have all those tools installed in normal way as they should be. And here fun begins, as mentioned in previous post various problems appear during that - config files set for older emscripten installations, and GLBasic lib itself built with old commands.
Maybe my assumption was wrong and I need to copying v15 Javascript.zip platform to current v16 directory
and do some reconfiguration or something, really I don't know as I didn't found any info about that, or I missed something :/
Check my source code editor for GLBasic - link Update: 20.04.2020

Offline Qedo

  • Dr. Type
  • ****
  • Posts: 266
  • UNUS SED LEO
    • View Profile
Re: Compiling to html5?
« Reply #14 on: 2020-Jun-13 »
thanks, but the question is: does html5 on v16 work?
and if someone works, how did he do it?
 :x