question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Proper way to restart a game

See original GitHub issue

Hi 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:closed
  • Created 7 years ago
  • Comments:19 (18 by maintainers)

github_iconTop GitHub Comments

2reactions
trumpetscommented, Mar 1, 2017

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 😃

2reactions
sschmidcommented, Mar 1, 2017

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() and systems.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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found