HTML game - how to split files on the server

My question is:
I need to separate the index.html file from all other game files.
I have no problem adding a path to the logo or to the files in the archive directory. The only problem I have is with the files :
xxx_asmjs.js
xxx_wasm.js
xxx.wasm

All the time the script looks for these files in the location where the index.html file is located.
How and where can I set the path to these files ?

My first question is, why do they need to be located elsewhere?
The second question is, is it possible to put the game in a subfolder (index.html, js, wasm archives etc) and instead create another index.html that redirects to that game index file?

1 Like

This is the requirement of the structure of the site on which this game will be.
As for the second question, I don’t know - I’ll ask

THere’s of course the possibility for you to modify the engine_template.html and/or dmloader.js files in your project. That will give you complete control.

1 Like

I can’t redirect.

See below in these places I can easily set the path for the logo file, loader and archive.
Not knowing where I could do the same for the :
xxx_asmjs.js
xxx_wasm.js
xxx.wasm

    background-image: url("../game/files/logo.png");
	<script id='engine-loader' type='text/javascript' src="../game/files/dmloader.js"></script>

	var extra_params = {
		archive_location_filter: function( path ) {
			return ("../game/files/archive" + path + "");
		},
	}

The paths are hardcoded in dmloader.js:

But as you can see the exeName is an argument sent to EngineLoader.load() from index.html. So you should actually be able to modify this single line to load from something other than the same folder:

Example:

EngineLoader.load("canvas", "../path/to/my/{{exe-name}}");
2 Likes

Many thanks !

1 Like