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

Make Some Resources Hot-Reloadable #26

Open
3 tasks
craftablescience opened this issue Aug 13, 2022 · 1 comment
Open
3 tasks

Make Some Resources Hot-Reloadable #26

craftablescience opened this issue Aug 13, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@craftablescience
Copy link
Owner

Component to Improve

Core Engine

Describe Your Suggestion

Resources like Font cannot be reloaded, but textures, strings, and most other resources can.

  • Make a method on Resource, virtual bool isReloadable() const = 0; and implement it for every Resource
  • Make another method on Resource, virtual void reload() {} and implement it for reloadable Resources
  • Add a console command in Resource to reload all cached resources (res_reload_cached)
@craftablescience craftablescience added the enhancement New feature or request label Aug 13, 2022
@craftablescience craftablescience mentioned this issue Aug 14, 2022
2 tasks
@craftablescience craftablescience self-assigned this Aug 14, 2022
@ashifolfi
Copy link
Collaborator

ashifolfi commented Jan 2, 2023

On the topic of this. Scripts might not be able to be hot reloadable. C# doesn't support this due to being compiled into assemblies. there's 2 ways we could do this that maintain consistency between the operating of the 2

  1. allow this and just try and reload the entire assembly for C#
  • we'd have to make sure nothing else is going to need it when we go to do this which is difficult/impossible when you most likely will have an entire game in one assembly. This is a common practice as it makes it easier to have your whole game inside one single C# assembly instead of spreading it out across multiple assemblies which can get complicated.
  1. Not allow this at all
  • removes the added complexity of determining whether it's uncompiled AS or compiled C#/AS and if it's an assembly that can be reloaded, etc. with side by side operation of both langs but forces a full game restart to reflect even small script changes

Now if you don't care about maintaining consistency

  1. Allow one but not the other
  • this is just confusing for the end user and kinda dumb imo. allowing one but not the other makes it look like you favor one over the other to those who don't understand that one might be more complicated to do hot reloading with than the other and also just makes it frustrating to people who might be used to one then trying to move to the other.

I don't recommend 3 because it's something I find very annoying.

@craftablescience craftablescience added this to the 0.1.0 milestone May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

2 participants