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

Future Packages #86

Open
hmans opened this issue Jun 8, 2022 · 2 comments
Open

Future Packages #86

hmans opened this issue Jun 8, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@hmans
Copy link
Owner

hmans commented Jun 8, 2022

Drafting ideas for future packages we could provide.

miniplex-kit

Provides a collection of components and systems that are useful in many projects:

  • Entity age
  • Cooldowns/Timeouts
  • Auto destroy entities
  • Intervals

miniplex-fiber

Provides extra glue for use in react-three-fiber:

  • World Inspector UI
  • System Runner that integrates with r3f's upcoming useUpdate and provides some debugging UI
@hmans hmans self-assigned this Jun 8, 2022
@hmans hmans added the enhancement New feature or request label Jun 8, 2022
@itsdouges
Copy link

How do you see miniplex-kit working? I'm interested in understanding how entity age/cooldowns/intervals would work in an ECS (miniplex is the first I've used so I don't have all the context around them). If I wanted to implement them in miniplex today I suppose I'd store delta every tick and then act on it when appropriate. What are you thinking?

@hmans
Copy link
Owner Author

hmans commented Oct 12, 2022

I typically build my systems as functions that receive a deltatime as their argument, and mount them in a react-three-fiber useFrame somewhere, passing on the deltatime argument the callback receives to the system. One thing I've done a bunch of times is to give entities optional age: number and maxAge: number properties, and implementing a LifetimeSystem that accumulates the received deltatime values on age, and queues the entity for destruction if age >= maxAge.

Things like these could be packaged into separate libraries (like eg. miniplex-kit.) The challenge here is that the more generic you want to make these implementations, the harder it is to "get them right". A library like this that targets R3F games specifically will probably look and feel entirely different from one that tries to be usable in "any" project.

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

No branches or pull requests

2 participants