Comments (6)
This is what I have thought of, and in a way this is solved by using the ResourceLoader
. Consider a game which has a large sized resources, and it needs one large file in one level. Now in case we are going to keep a preloader, then we have to keep all these files in the memory, which is not the developer of the game wants. This is the reason I went with the callback approach like JavaScript.
And I said that ResourceLoader
can solve this issue, it is like a pre-loader that you are talking, you tell it which files to preload, and once the loading is done, you can get the files content directly because they are already loaded into the memory.
My question is, why to use the ResourceLoader
directly in the engine when it is designed to be used by the users?
from silenceengine.
When loading asset files, the developer would almost always want to keep them in memory. While larger files would be the rare exception. It would make much more sense to preload things by default, and have defined ways of dealing with the exceptions.
As for your question, I don't really understand what you're asking. Specifically the used by the users
part.
from silenceengine.
What other engines actually do is they use BrowserFS. I should have searched for it in the beginning, it is awesome and it do really have support for synchronous IO like preloaders do, but once loaded it also caches the data in either LocalStorage, or HTML5 FileSystem or IndexedDB or whatever the browser supports, making it the best choice that we had to have.
I think this can bring us a new synchronous API, even large files means that they need to be loaded only once. This also removes the synchronization issues we have in Android, because we no longer need threads and hence the apps can properly quit without some hacks in AndroidWindow
.
I'll start by writing GWT bindings to this API.
from silenceengine.
It is time for about a release. This is post-poned for now, but in future version, we will have a synchronous API along with the current asynchronous API.
from silenceengine.
The solution for this is to have the renderers pre created and let the user use the ResourceLoader
for the purpose of loading the files. This is even more simpler if you use the ResourceLoadingState
.
To make your files loaded in before the game starts, use the on-init callbacks.
from silenceengine.
Now that the renderers and programs are precreated once in the engine and are cached, I think this is resolved. Regarding access to synchronous IO, that is not possible without increasing memory consumption, and may pose as an issue on HTML5 backend for larger games. So closing this stating that it is now solved.
from silenceengine.
Related Issues (20)
- Wav file playing incorrect in desktop backend HOT 1
- Use DrawElement with a IntBuffer (transformed in ByteBuffer) for Indexes of element HOT 3
- Streams support HOT 3
- AMD shouts on Pre GL3 shaders in Core profile HOT 1
- Implement model loading API HOT 1
- Issue with parsing APK HOT 13
- Re-Evaluate iOS support HOT 2
- Modularity for non essential features HOT 3
- Source and Javadocs not available HOT 1
- There are any screen of the game editor? HOT 2
- Add error callbacks to all asynchronous methods
- Fix performance issue on DynamicTree2D and DynamicTree3D HOT 1
- Add a dialog system for modal dialogs `prompt`, `alert` and `confirm` in the JS style. HOT 1
- Implement a `FileWriter` for writing to files on Android and LWJGL backends
- Android backend crashes on relaunch
- Implement Preferences API for persistent storage of Key-Value pair objects.
- Creating polygon convex hull from image HOT 1
- Clean SceneGraph and Entity Component API
- Forum is not working HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from silenceengine.