Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hot reloading method ?

A topic by sunfayeso@gmail.com created Feb 10, 2022 Views: 1,690 Replies: 3
Viewing posts 1 to 4
(1 edit) (+2)

I am pretty new in the rust and rust game engines. So far  I could not find, or noticed any  rust game engine demo  that hot reloads the code.
Does the engine supports hot reloading method to loading scripts?

(2 edits)

This engine reloads scripts (systems) every time the queried variable changes.

You don’t have to control the scripts reload, you just have to add them to the app (you can control the order on startup: https://bevy-cheatbook.github.io/programming/system-order.html )

Also you should rather ask for help in the Discorrd.

Submitted(+1)

So most commonly you don’t use a scripting runtime with bevy (I don’t even know if there are any), you write the game logic in actual rust code. As far as I know, the game has to be recompiled in that case, forcing you to restart the game. Luckily, it’s usually pretty quick to restart a bevy game, though.

I usually develop with the game launched through cargo-watch, so each time I save code, the game is automatically restarted.

cargo watch -i assets -cx run

Also, for non-code assets (and also shaders), hot reloading is usually supported (but has to be enabled), so changes are immediately visible. This is even supported by a lot of plugins (for instance bevy_ecs_ldtk can update the level when you save .ldtk files).