Open czyzby opened 8 years ago
GWT uses a source generator to create a file with all assets listed in it. Since Dragome does not have similar functionality (or does it?), I think we should rely on native JS XMLHttpRequest
functionalities or simulate assets file generation with a Gradle task. If we don't generate assets file, we might have problems with directory listing operations, exists
and simulating sync API with async operations.
@fpetrola The way I see it, there are two ways we can handle files:
XMLHttpRequests
to the selected resources. This will make it pretty much impossible to create responsive loading screens, unless we "override" AssetManager
to make it use asynchronous requests instead and force the users to manage their assets this way (which they should be doing anyway). This will considerably lower the initial pre-loading time of the game and limit unnecessary HTTP requests, as opposed to GWT which seems to load all files at once (even the unnecessary ones). We will not be able to list files, though.FileHandle
API. This seems to be working fine, but considering we have to load all the files we don't need (even if the user does not want to start the game at all), I think the other approach should be considered at the very least.I think second approach should be enough good for a first implementation. A third approach could be to make use of statistical analysis, we can pre-load all assets in a first execution attempt and store assets usage statistics in order to determine which ones are required to be loaded together, creating more specific pre-loading blocks as each successive execution gives more info about assets usage.
java.io.File
. Support for determining names of extensions, directories, etc. based solely of file path.dist
folder and inspects all jars, copying all classpath resources.