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

Utility AI inclusion #97

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Utility AI inclusion #97

wants to merge 7 commits into from

Conversation

felixvolz
Copy link

@felixvolz felixvolz commented Nov 8, 2017

This UtilityAI is based on the https://github.com/igiagkiozis/CrystalAI (released under the GPL v3 license)

There is a Sample app in UtilityTest app: gdx-ai\tests\src\com\badlogic\gdx\ai\tests\UtilityTest.java

If you find this of use, I can tidy up to conform to gdx-ai requirements

See Class Diagram below

utility UML

I've updated RandomSelector to set in a known state each time it
starts(). Pre this fix I was finding it could attempt to run in a state
of runningChild = null and currentChildIndex = children.size.
A flawed, first attempt at implementing  a pathfinder that will
terminate upon the location of an active item type rather than a
specific node.

TerminationCondition will set the endNode. I havent got this working
properly.

One then needs to override Node equals operator

IndexedAStarPathFinderWithTerminationCondition<Node> pathFinder = new
IndexedAStarPathFinderWithTerminationCondition<Node>(graph){
@OverRide
public boolean isTerminationConditionSatisfied(Node current, Node
target) {
if (current.extraInfo != null) {
if (current.extraInfo instanceof Trigger_Food) {
Trigger_Food<MyActor> trig = (Trigger_Food<MyActor>) current.extraInfo;
if(trig.isTriggerActive()){

//clone, dont like but it works
target.pos = current.pos;
target.index = current.index;
return true;
}
}
}
return false;

}
};
A flawed, first attempt at implementing  a pathfinder that will
terminate upon the location of an active item type rather than a
specific node.

TerminationCondition will set the endNode. I havent got this working
properly.

One will then need to override Node equals operator.
Example usage:

IndexedAStarPathFinderWithTerminationCondition<Node> pathFinder = new
IndexedAStarPathFinderWithTerminationCondition<Node>(graph){
@OverRide
public boolean isTerminationConditionSatisfied(Node current, Node
target) {
if (current.extraInfo != null) {
if (current.extraInfo instanceof Trigger_Food) {
Trigger_Food<MyActor> trig = (Trigger_Food<MyActor>) current.extraInfo;
if(trig.isTriggerActive()){

//clone, dont like but it works
target.pos = current.pos;
target.index = current.index;
return true;
}
}
}
return false;

}
};
@Genhis
Copy link
Contributor

Genhis commented Jul 25, 2019

@felixvolz Is there any progress with this type of AI and guidance how to use it?

@felixvolz
Copy link
Author

I think this gdxai project is dead? Feel free to do what you will with the utility ai code

@tommyettinger
Copy link
Member

Project certainly seems dead. I don't think it could use GPL code even if it was alive, though, since all of the gdx projects are permissively licensed under Apache 2.0, and including any GPL code would make the project GPL as I understand it. I think most commercial projects avoid including GPL code like the plague...

@tommyettinger
Copy link
Member

I was about to close this, but then I noticed that the project this is based on (CrystalAI) changed its license to MIT about 4 months ago. I think that would enable us to use this code now. There are some problems, though -- much of the docs use C#-style /// XML docstrings, naming is inconsistent (C#-style PascalCase in some places), there's an unused deprecated-from-the-start empty interface that should just be deleted, and the big one: I don't know what this does. If someone can provide a use case for why this should be included, I'm all ears.

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.

None yet

3 participants