-
Notifications
You must be signed in to change notification settings - Fork 845
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make games launch faster by loading resources in the background #5572
Conversation
7b95a54
to
16dbc93
Compare
b5d4bda
to
f3a5bc6
Compare
7108051
to
fc86020
Compare
a8e8c2a
to
e0c1b40
Compare
715d45d
to
36fc56d
Compare
0c7cdf9
to
f3c8295
Compare
ebbc09e
to
8ab2be1
Compare
_("Preload scene"), | ||
_("Preload a scene assets as soon as possible in background."), | ||
_("Preload scene _PARAM1_ in background"), | ||
"", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shuld we move these into a "Loading" group?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is only one action, it would look odd, unless if it's for hiding it, but it would make an extra click for users without saving any space in the list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could explain in the description that most games don't need to worry about it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes please. Use a Hint in newIDE/app/src/Hints/index.js to do so. Thanks!
"For most games, the default, automatic loading of resources will be sufficient. You can use this action to ensure you start loading a specific scene. This is helpful if you want to use the expressions related to loading to display a progress/loading bar."
* | ||
* \ingroup IDE | ||
*/ | ||
class UsedResourcesFinder : private gd::ArbitraryResourceWorker { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't use use ResourcesInUseHelper
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean moving the features in this class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure but I had the impression that we already had a class that was made to list the resources, so I was wondering if this new class could indeed be merged with the existing one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ResourcesInUseHelper
search resources by type on the whole project when the new one is searching resources per scene no matter the type. It's very likely that we will want to cross these searches at some point, but we should leave it for later.
I should rename the new class SceneResourcesFinder
and move it in the same folder as ResourcesInUseHelper
.
/** | ||
* @return The progress of assets loading in background for a scene (between 0 and 1). | ||
*/ | ||
export const getSceneLoadingProgress = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For GDevelop users, would it be simpler to return a percentage?
export const getSceneLoadingProgress = ( | |
export const getSceneLoadingProgressPercent = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A percentage is a format not a value 0.1
can be formatted "10%"
. Values for 0 to 1 is easier to use because you don't have to divided by 100 every time you use it, for instance to calculate the position of the right side of the bar.
It would lead to aberration like "10,000.0%"
if users use an extension to format the number.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, fine to keep it then, even if we have percentages in other part of the app (sounds volume, etc...).
|
||
/** | ||
* Load all assets needed to display the 1st scene, displaying progress in | ||
* renderer. | ||
*/ | ||
loadAllAssets( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The naming is a bit outdated but let's keep it for compatibility
Let's go! |
Blocked by
Changes
Documentation