Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create and destroy entities at runtime #29

Open
randomPoison opened this issue Oct 20, 2018 · 3 comments
Open

Create and destroy entities at runtime #29

randomPoison opened this issue Oct 20, 2018 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@randomPoison
Copy link
Member

randomPoison commented Oct 20, 2018

Add support for allowing the editor to request that a new entity be added to the game world.

  • Add a new variant to IncomingMessage called CreateEntities for requesting that an entity be created. The variant should carry a field specifying how many entities should be created.
  • Add a new field to outgoing messages "created_entities" that is a list of any entities that were just created at the request of the editor.
  • The list of new entities should be sent as soon as the entities are created, ideally on the same frame.
  • The list of new entities should only be sent once.

Similarly, to support destroying entities at runtime we'll need to add a variant to IncomingMessage called DestroyEntities that takes a list of entities to be destroyed. The list of destroyed entities does not need to be sent back to the editor, though.

@randomPoison randomPoison added enhancement New feature or request help wanted Extra attention is needed labels Oct 20, 2018
@randomPoison randomPoison added this to To do in Runtime editing support via automation Oct 20, 2018
@randomPoison randomPoison added good first issue Good for newcomers and removed help wanted Extra attention is needed labels Oct 20, 2018
@randomPoison randomPoison changed the title Create entities at runtime Create and destroy entities at runtime Oct 20, 2018
@mh84
Copy link
Contributor

mh84 commented Oct 29, 2018

As this is less or more needed by or blocking https://github.com/randomPoison/amethyst-editor/issues/38, i can take care of this too.

@randomPoison
Copy link
Member Author

Yup, you'll need to do both! The core functionality is implemented in amethyst-editor-sync, and then you only need to add the corresponding UI elements to the Electron editor and have them send the right messages back to the game.

@randomPoison randomPoison moved this from To do to In progress in Runtime editing support Oct 29, 2018
@mh84
Copy link
Contributor

mh84 commented Nov 22, 2018

I made some progress in refactoring a lot of the code (after a lack in spare time to work on this) in general to do something like:

Receive editor input -> Update states -> read new states -> send updated data back to the editor

I will do some refactoring of the code base now too, and then add the few lines for entity creation/deleting too. I will make an PR this weekend regarding the first part for review, maybe the second too. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Runtime editing support
  
In progress
Development

No branches or pull requests

2 participants