craftablescience / ChiraEngine

A customizable MIT-licensed game engine.
https://craftablescience.info/ChiraEngine/
MIT License
34 stars 6 forks source link

Make Some Resources Hot-Reloadable #26

Open craftablescience opened 1 year ago

craftablescience commented 1 year ago

Component to Improve

Core Engine

Describe Your Suggestion

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

ashifolfi commented 1 year ago

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.
  2. 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.