MonoGame.Extended icon indicating copy to clipboard operation
MonoGame.Extended copied to clipboard

[Content] Hot-reloading Content at run-time

Open craftworkgames opened this issue 5 years ago • 5 comments

A while back I experimented with the idea of hot-reloading game content while the game is running. This is could be a pretty cool feature of Extended if we get it right.

The idea of hot loading isn't new. It's quite common in front-end web development these days. If you've used it I'm sure you'll know how awesome it can be. For those that haven't, the main advantage is that you can make changes to your game while playing it. It can really boost development time because you can rapidly iterate and change things until they look right.

Here are some references:

  • https://vue-loader.vuejs.org/guide/hot-reload.html
  • https://stackoverflow.com/questions/41428954/what-is-the-difference-between-hot-reloading-and-live-reloading-in-react-native
  • https://facebook.github.io/react-native/blog/2016/03/24/introducing-hot-reloading.html
  • https://www.quora.com/Whats-hot-loading-in-Webpack-and-how-does-it-work

More importantly I've got this gist with some of the code I used to experiment with this idea a while back. I'm pretty sure I got a little further than this at the time, but I must've lost that code somehow. Anyways, it will still make a good starting point.

https://gist.github.com/craftworkgames/98a9eee11be1399915fd7d6f1e20818d

craftworkgames avatar Oct 10 '18 10:10 craftworkgames

This is really cool. I think the lua language may also do this, we can try the lua language

http://nlua.org/

esengine avatar Oct 10 '18 10:10 esengine

I'll be keeping an eye on this. This feature would be awesome!

Apostolique avatar Oct 11 '18 01:10 Apostolique

@craftworkgames You might be interested in some code I quickly wrote when thinking of handling assets. I wish I had more time to work on getting the project going 😞. In essence, an "asset cache" would have the responsibility for hot swapping. The "asset loader" is responsible for getting the asset into CPU memory, whether that would be via reading from disk or via a network.

lithiumtoast avatar Oct 12 '18 06:10 lithiumtoast

@LithiumToast yeah thanks mate. I remember when you started that project. It's a shame you've not had time to work on it but I get it. We've all got our lives to live.

craftworkgames avatar Oct 12 '18 11:10 craftworkgames

https://github.com/jackmott/monogame-hotload

https://www.reddit.com/r/monogame/comments/9rnqv0/a_hotloading_system_for_monogame_projects/

Looks like this will be useful.

Apostolique avatar Oct 26 '18 23:10 Apostolique