Export Game To HTML5

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ismaelgame7
:warning: Old Version Published before Godot 3 was released.

Godot 3.0 will be able to export HTML5 natively?
Because when I export my games to html5 it just gets loaded and does not get out.

I really want to create game for web using Godot, why?
Because GDscript is very easy! (Depending on what you want to do)
I just hope I can develop some game in html like godot without having to install something else.
And also have a good performance. :slight_smile:

:bust_in_silhouette: Reply From: sparks

Exporting to html works fine for me in Godot 2.1.2.

Because when I export my games to html5 it just gets loaded and does not get out.

Do you mean you are stuck in loading?
If so, do you use Chrome ?
If so, the problem you describe is documented:

Chromium-derived browsers will not load exported projects when opened locally

Just use Firefox and you should be fine!

So the problem is that godot games only work with firefox browser.
But most people use google chrome?

ismaelgame7 | 2017-04-11 21:23

Please read carefully:

Chrome works fine when you actually upload your html game (I tried this already with my website)!

However launching your html game from your disk - localhost - does not work out of the box for Chrome (due to security measures.

Use Firefox to test your html game on your computer (local) or do some extra work getting Chrome run it (see documentation or eons post).

sparks | 2017-04-12 09:25

:bust_in_silhouette: Reply From: eons

I can run fine most games on Chromium or Firefox (with a server, of course), I know many people that have problems though.

Not everything works (like shaders using texscreen or looping sounds, limitations on input too) but for simple things is enough.

Chrome needs an extra flag when running --allow-file-access-from-files to load local html5 programs

Try running a simple scene with that.

This is Tanks of Freedom on browser if you want to test your browser:
http://tof.p1x.in/html5/


I don’t know what do you mean with “native” when talking of HTML5, Godot 3 has the WebAssembly option that works really good (I have tested a pair of demos, can’t compile anything yet), and chrome will fail on this too for local files.

Try this (godot 2???):
https://godot.eska.me/pub/godot2-wasm/

And this (godot 3 for sure):
http://godot.eska.me/pub/wasm-platformer/


Search for python web server, is really simple to use for local tests.

Eons I know this is a bit late but I am having a lot of problems with the exporter. When I export using the 3.0 alpha template I get some output to the console, but nothing appears in the actual window. I get a number of errors as well. I also get this error recurrently: ERROR: At: core/bind/core_bind.cpp:1534:get_as_text() - Condition ’ !f ’ is true. returned: String().

Do you have any idea what is going on?

stubbsy345 | 2017-09-15 09:46

No idea, I have many problems with alpha web export too and can’t find a way to make custom ones (dealing with emscripten is not funny).

You should check issues and fixes on github because there were many since alpha.

eons | 2017-09-16 14:14