-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
Next Generation Assets #432
Conversation
Ok, did a quick docs fixup (although the page needs a real pass). I think this is ready for review. |
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.
This feels super noisy, since the defining assets at module import time is what was pitched as the "right way". It also only seems to get printed when the system stops. Tested on mac, going to give it a shot from windows.
UserWarning: Using SDL2 binaries from pysdl2-dll 2.0.10
2020-04-22 18:15:50.419 Python[27769:4631736] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to (null)
Waited on <Sound name='shooter/resources/sound/pickup.wav' loaded> before the engine began
Waited on <Sound name='shooter/resources/sound/laser.wav' loaded> before the engine began
Waited on <Sound name='shooter/resources/sound/laser2.wav' loaded> before the engine began
Waited on <Sound name='shooter/resources/sound/hit.wav' loaded> before the engine began
Waited on <Sound name='shooter/resources/sound/life-lost.wav' loaded> before the engine began
Waited on <Sound name='shooter/resources/sound/shield_down.wav' loaded> before the engine began
Waited on <Image name='shooter/resources/bullet.png' loaded> before the engine began
Waited on <Image name='shooter/resources/enemies/message.png' loaded> before the engine began
Waited on <Image name='shooter/resources/enemies/beacon.png' loaded> before the engine began
Waited on <Image name='shooter/resources/enemies/patrol.png' loaded> before the engine began
Waited on <Image name='shooter/resources/enemies/cargo.png' loaded> before the engine began
Waited on <Image name='shooter/resources/enemies/escort.png' loaded> before the engine began
Waited on <Image name='shooter/resources/enemies/zero.png' loaded> before the engine began
Waited on <Image name='shooter/resources/enemies/superiority.png' loaded> before the engine began
Waited on <Image name='shooter/resources/shield.png' loaded> before the engine began
Waited on <Sound name='shooter/resources/sound/enemy-alerted.wav' loaded> before the engine began
Waited on <Image name='shooter/resources/start.png' loaded> before the engine began
Waited on <Image name='shooter/resources/powerup/gun/7.png' loaded> before the engine began
Waited on <Image name='shooter/resources/powerup/gun/6.png' loaded> before the engine began
Waited on <Image name='shooter/resources/powerup/gun/5.png' loaded> before the engine began
Waited on <Image name='shooter/resources/powerup/gun/4.png' loaded> before the engine began
Waited on <Image name='shooter/resources/powerup/gun/3.png' loaded> before the engine began
Waited on <Image name='shooter/resources/powerup/gun/2.png' loaded> before the engine began
Waited on <Image name='shooter/resources/powerup/gun/1.png' loaded> before the engine began
Waited on <Image name='shooter/resources/powerup/gun/0.png' loaded> before the engine began
Waited on <Image name='shooter/resources/powerup/shield/sprite_7.png' loaded> before the engine began
Waited on <Image name='shooter/resources/powerup/shield/sprite_6.png' loaded> before the engine began
Waited on <Image name='shooter/resources/powerup/shield/sprite_5.png' loaded> before the engine began
Waited on <Image name='shooter/resources/powerup/shield/sprite_4.png' loaded> before the engine began
Waited on <Image name='shooter/resources/powerup/shield/sprite_3.png' loaded> before the engine began
Waited on <Image name='shooter/resources/powerup/shield/sprite_2.png' loaded> before the engine began
Waited on <Image name='shooter/resources/powerup/shield/sprite_1.png' loaded> before the engine began
Waited on <Image name='shooter/resources/powerup/shield/sprite_0.png' loaded> before the engine began
Waited on <Image name='shooter/resources/powerup/engine/sprite_7.png' loaded> before the engine began
Waited on <Image name='shooter/resources/powerup/engine/sprite_6.png' loaded> before the engine began
Waited on <Image name='shooter/resources/powerup/engine/sprite_5.png' loaded> before the engine began
Waited on <Image name='shooter/resources/powerup/engine/sprite_4.png' loaded> before the engine began
Waited on <Image name='shooter/resources/powerup/engine/sprite_3.png' loaded> before the engine began
Waited on <Image name='shooter/resources/powerup/engine/sprite_2.png' loaded> before the engine began
Waited on <Image name='shooter/resources/powerup/engine/sprite_1.png' loaded> before the engine began
Waited on <Image name='shooter/resources/powerup/engine/sprite_0.png' loaded> before the engine began
Waited on <Image name='shooter/resources/font/0.png' loaded> before the engine began
Waited on <Image name='shooter/resources/ship/g0e0.png' loaded> before the engine began
Waited on <Image name='shooter/resources/explosions/player/sprite_7.png' loaded> before the engine began
Waited on <Image name='shooter/resources/explosions/player/sprite_6.png' loaded> before the engine began
Waited on <Image name='shooter/resources/explosions/player/sprite_5.png' loaded> before the engine began
Waited on <Image name='shooter/resources/explosions/player/sprite_4.png' loaded> before the engine began
Waited on <Image name='shooter/resources/explosions/player/sprite_3.png' loaded> before the engine began
Waited on <Image name='shooter/resources/explosions/player/sprite_2.png' loaded> before the engine began
Waited on <Image name='shooter/resources/explosions/player/sprite_1.png' loaded> before the engine began
Waited on <Image name='shooter/resources/font/9.png' loaded> before the engine began
Waited on <Image name='shooter/resources/font/8.png' loaded> before the engine began
Waited on <Image name='shooter/resources/font/7.png' loaded> before the engine began
Waited on <Image name='shooter/resources/font/6.png' loaded> before the engine began
Waited on <Image name='shooter/resources/font/5.png' loaded> before the engine began
Waited on <Image name='shooter/resources/font/4.png' loaded> before the engine began
Waited on <Image name='shooter/resources/font/3.png' loaded> before the engine began
Waited on <Image name='shooter/resources/font/2.png' loaded> before the engine began
Waited on <Image name='shooter/resources/font/1.png' loaded> before the engine began
Waited on <Image name='shooter/resources/ship/g3e3.png' loaded> before the engine began
Waited on <Image name='shooter/resources/ship/g3e2.png' loaded> before the engine began
Waited on <Image name='shooter/resources/ship/g3e1.png' loaded> before the engine began
Waited on <Image name='shooter/resources/ship/g3e0.png' loaded> before the engine began
Waited on <Image name='shooter/resources/ship/g2e3.png' loaded> before the engine began
Waited on <Image name='shooter/resources/ship/g2e2.png' loaded> before the engine began
Waited on <Image name='shooter/resources/ship/g2e1.png' loaded> before the engine began
Waited on <Image name='shooter/resources/ship/g2e0.png' loaded> before the engine began
Waited on <Image name='shooter/resources/ship/g1e3.png' loaded> before the engine began
Waited on <Image name='shooter/resources/ship/g1e2.png' loaded> before the engine began
Waited on <Image name='shooter/resources/ship/g1e1.png' loaded> before the engine began
Waited on <Image name='shooter/resources/ship/g1e0.png' loaded> before the engine began
Waited on <Image name='shooter/resources/ship/g0e3.png' loaded> before the engine began
Waited on <Image name='shooter/resources/ship/g0e2.png' loaded> before the engine began
Waited on <Image name='shooter/resources/ship/g0e1.png' loaded> before the engine began
(.venv) ~/src/pathunstrom/shootergame$ ```
@@ -26,7 +106,7 @@ class AbstractAsset(abc.ABC): | |||
real/file assets. | |||
""" | |||
@abc.abstractmethod | |||
def load(self): | |||
def load(self, timeout: float = None): |
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 like this change. Going to be good when we move to externally fetched assets.
Umm... it really shouldn't be that noisy. That warning that covers cases like #419, where someone tries to call Given that the lifespan of the executor should match the lifespan of the system, I'm not certain how this happened. (I could, of course, refine the conditions in which the warning is given, but i'm still extremely puzzled as to why it happened.) |
My guess is that I define most of my assets at either the module level or the class attribute level, so when I import the first scene, it chains in basically everything else, and that happens before the engine starts? |
The warnings came from Fixed by shushing if the asset is already loaded. |
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.
This looks good now.
bors r+
Or: If assetlib is so good, why isn't there assetlib 2?
This refactors/rewrites many aspects of assetlib to simplify implementations and better enable future asset features. (#373)