Hello!
My first post on the Defold forum, about my first game with Defold
So I made a very simple and very interesting game with Unity3D, but then I decided that I wanted it to be playable as a Facebook instant game. Thus I found Defold
I just made a 2d rudimentary clone of my original game in Defold in about 2 days.
I made it as an android game, it works fine when I build it and I can test it on the PC, I can even build it into an APK and install it on my phone and it works⦠But see, as I said I would like it to be a facebook instant game⦠and I cant build it to html5. I bet I missed a simple thing or something, but could someone help me? I have no idea what to do, when I try to build the HTML5 it opens a window in my browser, gives me the offer for fullscreen but the game isnāt thereā¦
Thanks for the help
It would help if you provided a bit more information. What OS are you running? What browser are you using? If you open the browser developer console, are there any helpful logs?
If you bundle to HTML5 and access the game via a local web server from the bundle catalog instead of doing ābuild html5 and launchā, does the same thing happen?
Hey @britzl
I went ahead and increased it from 0 to 256.
The result is the same. Still, it loads but then no game.
The log seems a bit different thoughā¦
Is that the only atlas you have? Thatās nothing to worry about then. The build report checkbox is in the bundle dialog. Did you get the project to run with a larger heap size?
The size of 4992x3648 will result in a texture that is 8192x4096 pixels, which equals 134Mb of memory (excluding mipmaps). You need to reduce this texture in size quite a bit. Your game.project specifies a screen size of 640x1136 so you should aim for a size closer to the screen dimensions.
If you take a look at the build report (which you get from checking the Generate build report checkbox:
You should also consider using a texture profile to apply texture compression to your images to further reduce bundle and runtime memory requirements. Read more about this here: Texture Management in Defold
Holy C⦠ok, thanks for that I will look into it⦠But the reason I have the picture so big is because I am rotating it on runtime to make it look like a moving universe, but I guess that is not the right solution.
But OK, I will fix that and come back to this post with Facebook instant games questions tomorrow if I still have problems.
Is this using the bundled version? How did you start the file server? And whatās the address you use in your browser? It should be for instance http://localhost:8000
Iād recommend having python to start a file server:
> cd my_bundle_dir
> python -m SimpleHTTPServer
Serving HTTP on 0.0.0.0 port 8000 ...
(If you use āBuild and Runā, the editor starts a file server for you)
I have never made a game in HTML so I honestly didnāt know a server is needed to run itā¦
But I tried to upload it to itch.io and⦠still, it didnāt playā¦
A Defold HTML5 game consists of an html page, some javascript files and some binary files with game assets. If you open the html file from disk in your browser it will try to load the javascript and the assets but the browser will prevent this for security reasons. In order to run it you need to either upload it to something like itch.io or run a local web server like Mathias suggests. If you select Build HTML5 and run Defold will start a webserver for you. Did this work when you tried it?