This toolset simplifies building your game into a single HTML file. All you need is to invoke a single command: gulp.
In fact, it’s a script for the Gulp build system, which:
Downloads bob.jar and uses it to build the project for the HTML5 platform.
Combines, compresses (Zstd), encodes (base64), minifies all resources into a single HTML file. Currently, it includes the only Asm.js version of a game for that (not WASM).
Open the build result online to see that it’s a single HTML file, and it doesn’t use any external resources as required. And it fits into the 2MB size.
A playable ad is an interactive advertisement, mostly used to promote mobile games. A playable ad acts as a demo of the game (or product), allowing users to quickly play the game directly in the ad before downloading it.
Accepted sizes for HTML5 playable ad vary between ad networks (overview table). Usually, the main requirement for your ad is to be a single HTML file, 2-5MB in size.
One question - is it possible to pass parameters to Bob? At the very least, it would be useful to pass the --settings option, so I can override the default main_collection in [bootstrap].
I think the SDK of an ad network loads and initializes a playable ad in the background, and then Web View appears in front of your app. Maybe WebGL context is not available till that appearance… My colleagues, who use vanilla JS and WebGL for playables, said that they don’t follow this tip and everything runs well.
By the way, the index.html does contain the fbPlayable callback:
// FB requires to implement the call `FbPlayableAd.onCTAClick` in the JS code. Use it from the Defold like `html5.run("FbPlayableAd_onCTAClick()")`.
function FbPlayableAd_onCTAClick() {
try {
FbPlayableAd.onCTAClick();
} catch (e) {
console.error(e);
}
}
The game works fine when self-hosting it. It even passes the AppLovin preview tool.
OK after some investigation, it appears the Ad preview tool is broken when it comes to ZIP archive.
The preview tool works when using the Ads Manager though. But here are the problems that I have:
I can add an option to the script to build a two-file game: index.html + plus .js file with all game resources. Theoretically, this should help you to pass this check.