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

Behavior tree updates and readme file. #1

Merged
merged 2 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
TODO: Write README.
# Custom-er NPCs
A from scratch recreation of the CustomNPCs mod for Minecraft, but more custom.

Nowhere near ready for release.

## Table of contents
- [Table of contents](#table-of-contents) (You are here.)
- [Features](#features)
- [Installation](#installation)
- [Contributions](#contributions)
- [Current tasks.](#current-tasks)

## Features
- Custom NPCs (obviously)
- Customizable stats for the NPCs
- Customizable models for the NPCs
- And even customizable stats!
- Behavior tree based AI system.
- Based on a visual editor.
- Scriptable events for those NPCs to act upon.
- (Soon™)

## Installation
Not yet available.

## Contributions
If you want to contribute, feel free to fork the repository and submit a pull request. I'll be happy to review it.

## Current tasks.
- [ ] Implement the behavior tree system. (In progress)
- [ ] Implement models for the NPCs.
- [ ] Implement the stats for the NPCs.
- [ ] Implement the NPC system beyond just having an entity.
- [ ] Test the system.
- [ ] Initial public release to Modrinth and Curseforge.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
* The tick method is called every entity tick for the entity making use of it.
*
* We provide a "create" method in order to create the behavior after its added to the registry.
* However, all the data passed into create is in the form of strings in an array. This is because
* the system gets its creation data from a minecraft gui and I do not want to have to serialize.
*/

public abstract class AbstractBehavior {
public abstract AbstractBehavior create(Object... args);
public abstract AbstractBehavior create(String... args);
final ArrayList<AbstractBehavior> children = new ArrayList<>();
// Ticks only care about the blackboard
public BehaviorStatus tick(Map<String, Object> blackboard ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@

import java.lang.reflect.InvocationTargetException;

/**
* Behaviors are unused for now. V1 will operate on mob goals with a simple editor.
*/
public class BehaviorManager {
public static AbstractBehavior createFromRegistry(ResourceLocation location, Object... args) {
public static AbstractBehavior createFromRegistry(ResourceLocation location, String... args) {
Class<? extends AbstractBehavior> behaviorClass = CustomerNPCs.BEHAVIORS.getRegistry()
.get()
.getOptional(location)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
public class ChoiceBehavior extends AbstractBehavior {
@Override
public AbstractBehavior create(Object... args) {
public AbstractBehavior create(String... args) {
return new ChoiceBehavior();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
public class FallbackBehavior extends AbstractBehavior {

@Override
public AbstractBehavior create(Object... args) {
public AbstractBehavior create(String... args) {
return new FallbackBehavior();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
public class SequenceBehavior extends AbstractBehavior {

@Override
public AbstractBehavior create(Object... args) {
public AbstractBehavior create(String... args) {
return new SequenceBehavior();
}

Expand Down
Loading