Proper way to restart a game
See original GitHub issueHi Simon et all,
I just finished a 4 hour long migration from Entitas 0.26.1 to 0.37.0 and it wasn’t half as bad as I thought.
Loving the new features and improvements, but something that I’ve noticed is that I’ve lost the old way of restarting a game. I used to be able to call the following snippet:
Pools.pool.ClearGroups();
systems.DeactivateReactiveSystems();
Pools.pool.DestroyAllEntities();
Pools.pool.ResetCreationIndex();
Right now it seems to me that I have to do the same for all contexts but that seems kind of error prone, I might be able to forget some.
I also don’t know how to handle the generated indices and blueprints.
Any insight on this?
Thanks 😃
Issue Analytics
- State:
- Created 7 years ago
- Comments:19 (18 by maintainers)
Top Results From Across the Web
How do I reinstall/restart the game? (Android)
To restart a game, simply force quit the application and launch it again. Reinstalling a game may be trickier. Please follow these steps...
Read more >How to Restart a Game on iPhone and Clear App Data
How to restart a game on your iPhone ; 1. First, delete the app from your phone. ; 2. Once the app is...
Read more >How To Restart A Game On Your IPhone
Another way is to go to the Settings app, then to General, then to Reset, and then select Reset All Settings. This will...
Read more >How To Restart A Game On IPhone?
There are a few ways to reset a game on your phone. One way is to go to the settings menu and find...
Read more >How can I restart an app game from the beginning [duplicate]
Tap on the games you want to reset. Tap Edit at the top right. Tap Delete All to delete the saved games data....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thanks for the info @sschmid 😃 I’ll do a PR removing the ClearGroups() from Reset() and also adding Contexts.Reset() in the next day or so 😃
When you’re systems are written correctly, you can even reuse the systems. With written correctly I mean, in case you cache any state within a system, that you do that within the Initialize method. So all you need to do is call
systems.Initialize()andsystems.ActivateReactiveSystems()again, but you can reuse the contexts and systems.But of course, it’s also alright to just create everything from scratch again, depends on the use case. Personally I try to reuse the objects.