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

Best practice for removing entites based on some system logic? #76

Open
joeblubaugh opened this issue Aug 17, 2018 · 6 comments
Open

Best practice for removing entites based on some system logic? #76

joeblubaugh opened this issue Aug 17, 2018 · 6 comments

Comments

@joeblubaugh
Copy link

I have a system that processes some entities, and then I would like to remove these entities once they have been processed.

Should I pass the engine as a parameter to my system so it can call engine.removeEntity, or should I use some other approach to removal? I think it's interesting that entities can deactivate themselves, but cannot remove themselves from the engine.

@Nukesor
Copy link
Member

Nukesor commented Aug 18, 2018

I think that's a good point.
We always developed games with the engine as a global variable for easy access.

Maybe we could introduce a flag on the entity, which marks it as toBeDeleted on the next tick by the entity manager. Hm, But this could lead to annoying side effects on the next tick.

The thing is that we followed the paradigm that entities should be as stupid as possible. A simple class which is only designed to hold data (Components) and should implement as few logic as possible.

I'll talk with @raffomania, since the entity then needs a reference to the engine, which is something we is something we tried to strictly avoid. But it's a point that it's really inconvenient, if the engine is not a global variable.

@code0wl
Copy link

code0wl commented Dec 16, 2019

Hi @Nukesor, any progress on this?

Just adopted this library, its amazing!

@Nukesor
Copy link
Member

Nukesor commented Jan 7, 2020

To be honest, development has stalled quite a bit.
Both of us moved to other languages/technologies and we haven't properly worked on this library for a really long time.
I'm not sure if this feature will be added by us.
However, we would be happy to review and accept PR's or maybe even add new people to the organization!

@code0wl
Copy link

code0wl commented Jan 8, 2020

@Nukesor Thanks for the reply. I think I am happy with my solution using the features already implemented in your lib.

I share your sentiment greatly. I really like Lua, but it's on a steady decline for a long time now. Once this game is done and is distributed on steam. I will most likely move to either Rust or C# for game development.

@raffomania
Copy link
Member

If you're looking for more full-fledged alternatives to love, I can greatly recommend godot :) It also supports C# if that's your thing

@code0wl
Copy link

code0wl commented Jan 8, 2020

@raffomania Yeah I've had a brief look at it and followed this course on it on Udemy. https://www.udemy.com/course/godot/

Sadly the C# part was not mature enough to be finished in the course, so they left it opened on "todo".

This made me decide to switch to Monogame at the end.

Thanks for the suggestion. From what I have learned and used in Godot. Its really awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants