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

TaskAttributes do not appear to populate Tasks for included subtrees #121

Open
exertionriver opened this issue Mar 21, 2022 · 0 comments
Open

Comments

@exertionriver
Copy link

The following issue appears on gdx-ai v1.8.2, developing in Kotlin.

Summary in the title. Apologies in advance for all the code snippets below, it seems to be the best way to show what is going on.

Issue does not appear directly related to Kotlin/private field TaskAttribute issue since attributes populate in Kotlin for full root with @JvmField

first tree created from:

import isAwake?:"org.river.exertion.btree.v0_1.task_cond.IsAwakeCondition"

subtree name:"testSubTree"
    selector
        (isAwake? minAwake:0.2 maxAwake:0.7) isAwake? minAwake:0.2 maxAwake:0.3

root
    sequence
        $testSubTree

using:

    private fun initFullRoot() {
        val reader = FileReader(fullRootPath)
        val parser = BehaviorTreeParser<IBTCharacter>(BehaviorTreeParser.DEBUG_HIGH)
        character.tree = parser.parse(reader, character)
    }

second tree created from:

import notAbsorbedPlaceholder:"org.river.exertion.btree.v0_1.placeholder.NotAbsorbedPlaceholder"

root
    sequence
        notAbsorbedPlaceholder

and

import isAwake?:"org.river.exertion.btree.v0_1.task_cond.IsAwakeCondition"

root
    selector
        (isAwake? minAwake:0.2 maxAwake:0.7) isAwake? minAwake:0.2 maxAwake:0.3

using:

    private fun initFragRoot() {
        val reader = FileReader(fragRootPath)
        val parser = BehaviorTreeParser<IBTCharacter>(BehaviorTreeParser.DEBUG_HIGH)
        character.tree = parser.parse(reader, character)
    }

    private fun initFragSubtree() {
        fragRootLocation().addChild(Include<IBTCharacter?>().apply {
            this.subtree = fragSubtreePath; this.lazy = true
        })
    }

running:

    @Test
    fun testFullRoot() {
        initFullRoot()
        character.tree.step()
    }

yields:

<IsAwakeCondition> none-1013847396 true (0.2, 0.7)
<IsAwakeCondition> none-1013847396 false (0.2, 0.3)

while running:

    @Test
    fun testIncludeSubtree() {
        initFragRoot()
        initFragSubtree()
        character.tree.step()
    }

yields:

<IsAwakeCondition> none162781535 true (0.0, 1.0)
<IsAwakeCondition> none162781535 true (0.0, 1.0)

Are Included subtrees parsed differently than BehaviorTreeParser parsed subtrees..?

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

1 participant