# First game problems

**URL:** <https://forum.defold.com/t/first-game-problems/18605>\
**Category:** Questions\
**Created:** [April 4, 2018, 12:24pm UTC](https://forum.defold.com/t/first-game-problems/18605 "2018-04-04T12:24:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![greaneagle](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/g/8e8cbc/32.png) [@greaneagle](https://forum.defold.com/u/greaneagle)\
**Post date:** [April 4, 2018, 12:24pm UTC](https://forum.defold.com/t/first-game-problems/18605/1 "2018-04-04T12:24:48Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![Johan\_Beck-Noren](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/johan_beck-noren/32/2622_2.png) [@Johan\_Beck-Noren](https://forum.defold.com/u/Johan_Beck-Noren)\
**Post date:** [April 4, 2018, 12:53pm UTC](https://forum.defold.com/t/first-game-problems/18605/2 "2018-04-04T12:53:58Z")

</div>

Hello and welcome to Defold!

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?

---

<div class="post-metadata">

**Author:** ![greaneagle](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/g/8e8cbc/32.png) [@greaneagle](https://forum.defold.com/u/greaneagle)\
**Post date:** [April 4, 2018, 1:09pm UTC](https://forum.defold.com/t/first-game-problems/18605/3 "2018-04-04T13:09:07Z")

</div>

Hey @Johan_Beck-Noren thanks for the reply.  
I will try to provide more info, but I’m quite new to this so bare with me please 🙂

OS: Windows 10 64bit  
Browser: Edge (automatic), also tried it in Chrome and it was the same result.

Here are the logs from Chrome:

 ![image](https://forum-defold.b-cdn.net/uploads/default/original/2X/4/4e9cd0b17091a15e2f2c3167d4fc6964bbed8da5.png)

And for the last one, I don’t know how to do that… Sorry.

If it would be helpful I can even send you the project.

Thanks for the help!

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [April 4, 2018, 1:16pm UTC](https://forum.defold.com/t/first-game-problems/18605/4 "2018-04-04T13:16:51Z")

</div>

It looks like you’re running out of memory. What if you open game.project, scroll down to the HTML5 section and increase the heap size value?

---

<div class="post-metadata">

**Author:** ![greaneagle](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/g/8e8cbc/32.png) [@greaneagle](https://forum.defold.com/u/greaneagle)\
**Post date:** [April 4, 2018, 1:22pm UTC](https://forum.defold.com/t/first-game-problems/18605/5 "2018-04-04T13:22:18Z")

</div>

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…

 ![image](https://forum-defold.b-cdn.net/uploads/default/original/2X/c/c641742647d590f99277754d7a35f7705e7fcc3e.png)

---

<div class="post-metadata">

**Author:** ![greaneagle](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/g/8e8cbc/32.png) [@greaneagle](https://forum.defold.com/u/greaneagle)\
**Post date:** [April 4, 2018, 1:27pm UTC](https://forum.defold.com/t/first-game-problems/18605/6 "2018-04-04T13:27:24Z")

</div>

Wait… my bad, it’s not the same, I forgot to check Set Custom Heap Size 🙂

 ![image](https://forum-defold.b-cdn.net/uploads/default/original/2X/5/53dc0b9f31e043a9abba0e323ddff5ba81840c5f.png)

And now, the screen isn’t black, but it’s just the blank Defold screen…  
Here is the console:

 ![image](https://forum-defold.b-cdn.net/uploads/default/original/2X/b/b993d98c61a68373fe2176100398a121816108f3.png)

And here is the screen:

 ![image](https://forum-defold.b-cdn.net/uploads/default/original/2X/2/2ea759222bf3763f6ffb17ea4217e1d41385c773.png)

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [April 4, 2018, 1:32pm UTC](https://forum.defold.com/t/first-game-problems/18605/7 "2018-04-04T13:32:32Z")

</div>

I believe the value is in bytes. Increase it above the value mentioned in the Chrome console.

BUT you should probably look into the size of your assets. How many atlases do you have and what are their sizes? Do you have a lot of sounds?

---

<div class="post-metadata">

**Author:** ![greaneagle](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/g/8e8cbc/32.png) [@greaneagle](https://forum.defold.com/u/greaneagle)\
**Post date:** [April 4, 2018, 1:35pm UTC](https://forum.defold.com/t/first-game-problems/18605/8 "2018-04-04T13:35:32Z")

</div>

No sounds at all… I do have one picture with 11.9 MB though…

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [April 4, 2018, 1:42pm UTC](https://forum.defold.com/t/first-game-problems/18605/9 "2018-04-04T13:42:34Z")

</div>

Yes, but what pixel dimensions of the atlas files? Open your atlas and check properties to see the size.

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [April 4, 2018, 1:43pm UTC](https://forum.defold.com/t/first-game-problems/18605/10 "2018-04-04T13:43:02Z")

</div>

You can also check the Generate Build Report checkbox when bundling.

---

<div class="post-metadata">

**Author:** ![greaneagle](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/g/8e8cbc/32.png) [@greaneagle](https://forum.defold.com/u/greaneagle)\
**Post date:** [April 4, 2018, 1:46pm UTC](https://forum.defold.com/t/first-game-problems/18605/11 "2018-04-04T13:46:59Z")

</div>

Atlas is here:

 ![image](https://forum-defold.b-cdn.net/uploads/default/original/2X/8/85608ee0b27171ef1c8277a9003623a8bf013b4f.png)  
So 2048 \* 1024

But I cant find Generate Build Report Checkbox in game.project

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [April 4, 2018, 1:52pm UTC](https://forum.defold.com/t/first-game-problems/18605/12 "2018-04-04T13:52:30Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![greaneagle](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/g/8e8cbc/32.png) [@greaneagle](https://forum.defold.com/u/greaneagle)\
**Post date:** [April 4, 2018, 1:59pm UTC](https://forum.defold.com/t/first-game-problems/18605/13 "2018-04-04T13:59:44Z")

</div>

Nope… did not get it to run… I sent you a message with my project files perhaps that could help?

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [April 4, 2018, 2:17pm UTC](https://forum.defold.com/t/first-game-problems/18605/14 "2018-04-04T14:17:45Z")

</div>

Ok, so I took a look at your project. You have one tilesource with a background image that is waaaaay to large:

 ![05](https://forum-defold.b-cdn.net/uploads/default/original/2X/d/d7dcd113ac28e8e316a15cf2c96be41c350c595e.jpg)

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:

 ![45](https://forum-defold.b-cdn.net/uploads/default/original/2X/e/e916ebdc5c3ec188991ad15476e522816da9f770.png)

You see that almost the entire bundle consists of this single texture. Nothing else comes close:

 ![58](https://forum-defold.b-cdn.net/uploads/default/original/2X/4/46aece9a3a17b8efa844406d75eab42604e627b2.png)

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](https://forum.defold.com/t/texture-management-in-defold/8921)

---

<div class="post-metadata">

**Author:** ![greaneagle](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/g/8e8cbc/32.png) [@greaneagle](https://forum.defold.com/u/greaneagle)\
**Post date:** [April 4, 2018, 2:22pm UTC](https://forum.defold.com/t/first-game-problems/18605/15 "2018-04-04T14:22:01Z")

</div>

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.

Thanks a lot @britzl

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [April 4, 2018, 2:24pm UTC](https://forum.defold.com/t/first-game-problems/18605/16 "2018-04-04T14:24:46Z")

</div>

You could perhaps use a shader for the background instead? Perhaps [this](https://www.shadertoy.com/view/MlSfzz). We even have a [tutorial](https://www.defold.com/tutorials/shadertoy/) on how to add such a shader.

---

<div class="post-metadata">

**Author:** ![greaneagle](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/g/8e8cbc/32.png) [@greaneagle](https://forum.defold.com/u/greaneagle)\
**Post date:** [April 4, 2018, 2:40pm UTC](https://forum.defold.com/t/first-game-problems/18605/17 "2018-04-04T14:40:28Z")

</div>

So I reduced it just a simple background image… still can’t get the HTML 5 build to run…

 ![image](https://forum-defold.b-cdn.net/uploads/default/original/2X/7/70f52f5ab85230ace1e87447db7875ca84935bf8.png)  
 ![image](https://forum-defold.b-cdn.net/uploads/default/original/2X/8/875bbc23434140cc24ff4ba4c24c1f8c88a7be52.png)

😖 😖 😖 😖 😖😖

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [April 4, 2018, 2:46pm UTC](https://forum.defold.com/t/first-game-problems/18605/18 "2018-04-04T14:46:13Z")

</div>

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:

```bash
> 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)

---

<div class="post-metadata">

**Author:** ![greaneagle](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/g/8e8cbc/32.png) [@greaneagle](https://forum.defold.com/u/greaneagle)\
**Post date:** [April 4, 2018, 9:14pm UTC](https://forum.defold.com/t/first-game-problems/18605/19 "2018-04-04T21:14:07Z")

</div>

So when I just click build the server is started by the Editor?

 ![image](https://forum-defold.b-cdn.net/uploads/default/original/2X/5/51d0a1b41406992379cccf4f80c1114dfd4fa090.png)

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](http://itch.io) and… still, it didn’t play…

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [April 5, 2018, 5:18am UTC](https://forum.defold.com/t/first-game-problems/18605/20 "2018-04-05T05:18:14Z")

</div>

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](http://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?

[Next page](https://forum.defold.com/t/first-game-problems/18605.md?page=2)
