Conversation started Jul 6, 2015 at 13:12.
Pip
Pip
Jul 6, 2015 13:12
How does the Tallowmere AI work?
The typical enemies basically:
- Walk forward.
- Check to see if the hero is in view - if so, initiate their "hero spotted!" state. otherwise -
- Check to see if they're about to collide with a wall or fellow enemy, or
- Check to see if they'd fall off their current block if they walked too far.
- If can't walk further, about-face
Pip
Pip
Hm. Thanks
My AI has to be a little more complex than that... I'm looking into behavior trees and such
I imagine most enemy AI goes like, patrolling, enemy spotted, decide what to do
attack? flank? change position? retreat? alert allies?
use ability X or Y
Pip
Pip
Yeah
One idea I had for a "guard this area" AI (but I didn't check if it made sense yet, much less implemented it) would essentially try to "paint" the area with the cone of view. Keep a simplified version (say, a 2d grid) with values corresponding to when the part was last seen, when nothing to do, find the oldest one at some min distance and path there, "painting" everything on the way with your cone of view. Repeat.
Jul 6, 2015 13:18
ah yeah, that sounds pretty cool, rather than just following a set path
Pip
Pip
I need more like a:
 - Job
   - if requires materials
     - are materials present?
       - if yes, flag them as used
       - else request and wait
     - bring materials to area
       - get one material
       - bring it to location
   - build a thing or do a thing
annoying
Sounds like Dwarf Fortress AI, a bit.
Pip
Pip
I'll have to check it out
the more complex you want it, the more complex it gets, haha
no magic bullet I don't think
Only there is no "request and wait" there, just "pause the job", IIRC. But you could instead push it down the queue and grab the next one too (works best if there are multiple agents capable of doing the job).
Jul 6, 2015 13:21
a priority system
Pip
Pip
@MartinSojka oh that's a better idea
keep each Job in a List? reorder the list as needed depending on whatever
Pip
Pip
I have a task queue (basically a FIFO collection)
It has the downside that "reserved" materials for a job stay reserved (and unusable for anything else, even emergencies) until the job either completes or is cancelled.
Pip
Pip
yeah... hm. I'll have to think about it a bit
Jul 6, 2015 13:23
It's a downside, not a showstopper.
Pip
Pip
Yep
My current goal at the moment is to stick a bunch of cards in Trello then write a few basic tasks, maybe implementing a factory or something
just a basic MoveTo function for now I think
later pathfinding, etc
 
Conversation ended Jul 6, 2015 at 13:24.