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

Preliminary API for 'new' brains AI system for mobs #10462

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pontaoski
Copy link
Contributor

Would fix #10443 if done.

This is a rough proposal for abstracting over the brains AI system for mobs for plugins to make use of, similar to the Goals API. I don't think it's feasible to attempt to make the new AI conform to the old interfaces.

At the moment I understand the rough skeleton and arteries of the system, though I'm still trying to piece together what does what in user-facing terms. 'get the mob to walk somewhere' has been unsuccessful so far.

As far as API stability concerns, as long as the exposed set of tasks isn't too 1:1 with what Mojang has, then we should be fine (until the next Big Rewrite:tm: whenever that is) considering the general stability of the system across versions since its introductions.

There are still some unanswered questions in the API design:

  • do events make sense to have here? I'd say no considering the amount of lambdas in the Minecraft implementation that make any real introspection API unfeasible.
  • do we care to expose sensors/make them modifiable? It could probably be done in a followup PR to make custom tasks & sensors a thing, as I'm mostly concerned about exposing what exists in Vanilla at the moment.
  • is the arrangement of the entrypoints to the new API sensical?

Test plugin is included in PR to ease testing of the new API until it's ready to ship.

@Owen1212055
Copy link
Member

Feel free to reference #6968

This should support creating own sensors/memories via the bootstrap api.

@pontaoski pontaoski force-pushed the work/jblackquill/brains branch 7 times, most recently from e101945 to 8b44e8a Compare April 28, 2024 00:49
@pontaoski
Copy link
Contributor Author

how does the way tasks are exposed look?

@pontaoski pontaoski force-pushed the work/jblackquill/brains branch 5 times, most recently from cf13e06 to ba28ca2 Compare May 10, 2024 23:24
@pontaoski
Copy link
Contributor Author

need to figure out generating the SensorTypeKeys in a more type-safe manner

Would fix PaperMC#10443 if done.

This is a rough proposal for abstracting over the brains AI system for mobs
for plugins to make use of, similar to the Goals API. I don't think it's feasible
to attempt to make the new AI conform to the old interfaces.

At the moment I understand the rough skeleton and arteries of the system, though I'm
still trying to piece together what does what in user-facing terms.
'get the mob to walk somewhere' has been unsuccessful so far.

As far as API stability concerns, as long as the exposed set of tasks isn't too 1:1 with what
Mojang has, then we should be fine (until the next Big Rewrite:tm: whenever that is) considering
the general stability of the system across versions since its introductions.

There are still some unanswered questions in the API design:
- do events make sense to have here? I'd say no considering the amount of lambdas in the Minecraft implementation
  that make any real introspection API unfeasible.
- do we care to expose sensors/make them modifiable? It could probably be done in a followup PR to make custom
  tasks & sensors a thing, as I'm mostly concerned about exposing what exists in Vanilla at the moment.
- is the arrangement of the entrypoints to the new API sensical?

Test plugin is included in PR to ease testing of the new API until it's ready to ship.
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

Successfully merging this pull request may close these issues.

API for controlling new mob behaviours
4 participants