Sunday, November 17, 2013
Another full day of AI. Wanted to have this whole shebang working by now, but...guess it was too much to hope to solve the rest of AI in a week
I'm coming along nicely - in my little test scenario, the NPCs are getting as far as docking, buying a transfer unit, equipping, undocking, and heading out to an asteroid. Pretty good! But they won't mine yet. I'm investigating the issue right now, but I'm sure it's just another small issue somewhere in the algorithm that I'll need to hammer out.
It's taken a whole lot of work to get it to this state - not because the underlying algorithm is complicated, just because...thinking through the consequences of every change is very difficult. Debugging AI is notoriously hard But...what doesn't kill you..
An interesting question that I had to face today is the value of time. At first, my stance was to attempt to maximize value gain per unit time. At first glance that seems like the sensible thing to do. As seductive as it is, it's not correct. Consider if someone offers you the opportunity to make $100 in a second or $200 in ten. You'll obviously take the $200, despite the sub-optimal value gain per unit time. Ultimately, the only reason for this is that you have a built-in belief about the value of your time. Internally, when you think about this situation, you realize that there's very little chance that you'd be able to make another $100 in the 9 seconds that you save by taking the first option. Hence, by taking the second, you're actually maximizing your gain over the longer period.
I cannot escape the fact that we explicitly value time, and the NPCs need to do the same. At first, the idea made me uncomfortable because it introduces what appears to be an arbitrary constant into the equation. How do you decide what your time is worth? Set the constant too low and the AI will be too willing to spend large amounts of time on sub-optimal actions. Set the constant too high and the AI will fail to consider more global situations like the aforementioned. But then, I realized - this constant is a self-balancing one!! It's based only on previous experience, nothing more and nothing less! Your concept of your time's worth must be based on a smoothed average of the value that you've gained per unit time previously. Of course! Elegant, easy, and no balancing of an arbitrary constant required
I think most of the remaining failures left in the AI are not due to the reasoning algorithm, but rather the "creativity" algorithm that puts objects, items, and actions together into ideas for reasoning to deal with. It's a bit lacking right now, and sometimes it doesn't even occur to my NPCs to dock with a station when it's right in front of them Come on! I think the key here is to prioritize ideas that are likely to lead to a functional solution. No need to spend time thinking about the numerous asteroids floating around that are just props But..I'd like to do this in a way so as not to require me to write arbitrary hinting routines. How about, instead, the ideas are self-reinforcing, in the sense that the AI thinks of a station, and realizes "hey, I could do a lot of things there," then the station gains more weight as an item of creative suggestion? Yep, that makes sense...let's try it
[ You can visit devtime.ltheory.com for more detailed information on today's work. ]
Post
Mon Nov 18, 2013 3:25 am
#1
Week of November 17, 2013
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford