Bouncing an idea for determining bot behavior

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
Gunroar:Cannon()
Party member
Posts: 1085
Joined: Thu Dec 10, 2020 1:57 am

Re: Bouncing an idea for determining bot behavior

Post by Gunroar:Cannon() »

What of a state where there needs wood to be gathered but there is no wood currently :huh: ? I guess maybe it would ditch that action? GOAP is good for this kind of thing, though is harder to implement and manage and is not always the best. :P
togFox wrote: Fri Aug 20, 2021 9:13 am
How would I hard-code an activation function into the node so that it turns a boolean when traversing nodes in ipairs and recursively?
Maybe you need your tree to know of the bot.

Code: Select all

tree[1].activate = function(bot)
    if bot.fullness <2 then --or whatever :P
        return true
    else
        return false
    end
end
And maybe don't hardcode them like that in the future and instead put them in a table(but that might be what you wanted to do)

Code: Select all

tree = {
    {
        goal = ...
        activate = function ...
        ...
    },

    {
        ...
    },
    ...
}
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 49 guests