Skip to content
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

Reduced load times. Customer resources are now loaded in a thread. #65

Merged
merged 1 commit into from
Mar 29, 2020

Conversation

Poobslag
Copy link
Owner

Customer resources are handled by the new CustomerLoader class. This
class loads resources in a background thread so the game launches
in less than a second. However, customers don't show up until the
textures are loaded. This is acceptable as thematically, they're living
beings who need to sit down. It's not like having a lamp randomly appear.

Seat.tscn no longer has a customer visible by default. This is because
having a customer visible slowed down the game was loading, since that
customer's resources would need to be loaded just to be thrown away.
Customer.gd includes a 'customer_preset' property which can be toggled
to load or unload a default customer. This requires the 'tool' keyword
to enabled for the customer class, which can cause the editor to go
crazy or crash. So, this functionality is disabled by default.

Added a benchmark tool.

Removed some unnecessary print statements when creating boxes, kicking
pieces. The 'piece kick' messages seemed helpful so they can be enabled
with a 'debug' field.

Moved some customer-related constants from Global into the new CustomerLoader
class.

scenes/Global.gd Outdated Show resolved Hide resolved
scenes/Global.gd Outdated Show resolved Hide resolved
Copy link
Owner Author

@Poobslag Poobslag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor things to clean up before it's merged.

@Poobslag
Copy link
Owner Author

Your commit comment should mention that you moved all the eat-anim resources to a new folder.

@Poobslag Poobslag force-pushed the reduce-restaurant-load-time2 branch from ec52904 to f5e3005 Compare March 29, 2020 20:19
Customer resources are handled by the new CustomerLoader class. This
class loads resources in a background thread so the game launches
in less than a second. However, customers don't show up until the
textures are loaded. This is acceptable as thematically, they're living
beings who need to sit down. It's not like having a lamp randomly appear.

Seat.tscn no longer has a customer visible by default. This is because
having a customer visible slowed down the game was loading, since that
customer's resources would need to be loaded just to be thrown away.
Customer.gd includes a 'customer_preset' property which can be toggled
to load or unload a default customer. This requires the 'tool' keyword
to enabled for the customer class, which can cause the editor to go
crazy or crash. So, this functionality is disabled by default.

Added a benchmark tool.

Removed some unnecessary print statements when creating boxes, kicking
pieces. The 'piece kick' messages seemed helpful so they can be enabled
with a 'debug' field.

Moved some customer-related constants from Global into the new CustomerLoader
class.

Merged /art/eat-anim folder into /art/customer.

Added some missing type hints for various methods.
@Poobslag Poobslag force-pushed the reduce-restaurant-load-time2 branch from f5e3005 to 6904d84 Compare March 29, 2020 20:34
@Poobslag Poobslag merged commit fe58703 into master Mar 29, 2020
@Poobslag Poobslag linked an issue Mar 29, 2020 that may be closed by this pull request
@Poobslag Poobslag deleted the reduce-restaurant-load-time2 branch March 31, 2020 23:22
Poobslag added a commit that referenced this pull request Jul 18, 2020
Reduced load times. Customer resources are now loaded in a thread.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Game pauses for ~4 seconds when selecting mode
1 participant