Return to “[Archived] Daily Dev Logs, 2012 - 2015”

Post

Week of December 15, 2013

#1
Sunday, December 15, 2013

Working on AI two days in a row has, historically, proven to be a bit of a mental health hazard, so I didn't want to take that risk again today :D Back to the working on that lovely interface!

One nice thing that I implemented today is categorical filtering for all nodes. For example, if I'm looking at the system map, I can now cycle through the object types (the ones that are present, that is), and the nodes will be hidden / revealed according to their respective categories. It strikes me as a really neat feature, not so much because of what it allows you to do...but more because it's one of the numerous examples of stuff that you get "for free" with this kind of unified interface. Any nodes that want to expose their "category" are instantly filterable, with no extra work required! This makes it entirely too easy to automatically have a filterable system map, inventory, market, etc. All for free! That, of course, makes me very happy as a developer. But at the same time, as a user, I also love the simplicity of knowing that any interface that contains categorical data can be filtered in the same way. No ad hoc, disparate mechanism for each type of data. It's all the same, every time! :thumbup:

Also!!! I had a very strange and exciting moment with the AI just an hour or so ago. When I left it yesterday, there was still an issue or two to resolve before the recent advancements would allow the NPCs to start working again (get back to mining those rocks, that is :) ). You can imagine my surprise when an NPC started mining during one of my interface tests :shock: :shock: Wow....well done sir, well done! This may be the first time I've been pleasantly-surprised with something "just working" in AI. In general it's not that kind of a field..you know...it's more like, if you aren't 100% positive that your algorithm is correct, it probably won't work. Even then it's usually still a shot in the dark :lol: But this time...well, maybe it's finally a sign that I'm doing something right :D

Tomorrow I head back home again for the holidays :) Too much driving lately for my taste :| But I'm really pleased with how this month has shaped up so far, and hopeful that a change of scenery will only contribute to the productivity streak :D

PS ~ Yes, I'm in a very odd habit of writing the weekly summaries...a week later. I'm trying to break it :crazy: :oops:
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of December 15, 2013

#2
Monday, December 16, 2013

No sleep last night + 10 hour drive today = understandably exhausted!!!

Please excuse me while I go indulge in a sleep coma. Thanks :)

:wave: :wave:

PS ~ On the bright side, I'm back to regular work times thanks to the sleep deprivation, so maybe devlog times will be a bit more tractable in the coming weeks ;)

PPS ~ I also brought my desktop with me this time, so I'm prepared for some serious work :cool: :thumbup:
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of December 15, 2013

#3
Tuesday, December 17, 2013

Back to that AI and loving every minute of it :cool:

I'm working on finalizing an efficient implementation of parallelism (and, by extension, delegation). A few weeks ago, I implemented it with a rather cute mechanism: introducing a "multitask" action, and then performing a normal search in action space, as if the multitask action were just like any other. However, I've since come to realize that it's too expensive to take that approach. The probability of finding effective parallel plans drop exponentially with the number of parallel items involved, which doesn't really suffice. Today I've developed a nice way of hierarchically solving a plan, and then parallelizing it in an ex-post-facto manner, if it's possible to do so. It's very efficient and should allow the AI to consistently recognize opportunities to delegate and multitask, since it greedily parallelizes anything it can :) As you might suspect, it's also not without limitation :|

The biggest problem that I'm left with, which really appears to be the last thing standing in the way of fully-parallel AI, is interleaved parallelism. There's a very easy and practical situation to describe what I mean: consider if an NPC wants to produce a given item with his production unit. To do so he will naturally give himself the goals of acquiring all the required raw materials. Suppose that there are two such items. Noticing that one of the items is up for sale at a nearby market, he decides to solve one of the prerequisites with the plan "go to the market on X and buy it." The other part yields no simple solution, so he decides to delegate by placing a listing for the item at a different market. That bit of delegation is, of course, "in parallel" with the first piece of the plan. However, at the end of that parallel block of actions, the NPC does not have both prerequisite items. He has one of them (the one he went and bought), but the other is (presumably) in his storage locker at another station. To fully solve these goals, the NPC will need to go pick up the goods for which he posted a listing. This must be performed after the parallel component of the plan in order to "finish up."

Once again, this is a deeply-difficult theoretical problem that looks all too trivial for us humans :) I am working to develop a comprehensive solution for interleaved parallel planning, but I fear that it may require the full-blown "POP" (partial-order planning) algorithm, which is notoriously expensive compared to so-called state-space algorithms like the one I'm employing at present. POP would solve all of our problems in the optimal way, allowing NPCs to produce incredibly-complex plans that optimally interleave parallel (+delegative) and serial actions. However, just having primed myself by reading the papers on it, I can clearly see why this algorithm is expensive, and fear that it may be orders of magnitude slower than the present solution :( I'm trying to look for a middle-of-the-road solution that would be able to solve "simple" interleaved plans, without the cost of a full POP solve.

On the other hand, we might consider nudging the rules of gameplay into a more "convenient" form for the AI. I've considered, for example, that stations might provide a delivery service, which would allow NPCs to have goods in storage transferred to their ship via some kind of cargo drone for a small fee. This would effectively eliminate the particular aforementioned problem, because the plan would be fully-parallel if the NPC leveraged a delivery service. However, I'm sure there are going to be cases where it's not possible to effectively parallelize plans without some kind of pre- or post- serial action, even if we introduce hacky mechanics.

The good news is that the current architecture already supports "easy" parallelism in an efficient way :thumbup: I am determined to have the AI post a contract by the end of this month!!

PS ~ I was obviously wrong about having repaired my sleep schedule :roll: :lol:
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of December 15, 2013

#4
Wednesday, December 18, 2013

We're mining again! :D Yes indeed, I broke the rules and sprung for a two-day AI streak. Yesterday's talk of the latest-and-greatest hybrid planning algorithm was mostly theoretical, but today it's a working reality.

At some point, I'll probably increase the power of this algorithm even further by allowing planning-space mutations, which would allow the AI to "refine" existing plans, much like the previous gradient AI was able to perform rigorous optimization of value gain.

I'm not sure exactly how I want to proceed now...I need to start introducing some new gameplay elements to the AI's repertoire so that we can start to build more complex interactions. It's all so tangled in a web of dependencies though, it's hard to decide where to go (mining's a pretty easy one :D). Perhaps research is the next step. Getting some intellectual NPCs that create a small set of weapons / shields / ships / etc. for the local region would be a great start. Then again, research requires a fairly large ship or a station, since research units are industrial hardpoints, which are pretty large. Well, at least it's a fun thing to figure out :)

For fun, and so that you can understand why I've been working so much on AI, I've mapped out a "brief history of the Limit Theory AI" below :)

Phase I: Goal-Based, Backwards-Planning AI (September)
+ Capable of making long plans to achieve a goal
+ Capable of explaining exactly why it has chosen a sequence of actions
- Incapable of understanding the interactions between plan elements, causing a need for frequently "fixing" plans
- Incapable of reacting quickly to new situations
- Incapable of numerically optimizing plans
- Incapable of understanding parallelism

Phase II: Gradient Optimization AI (November)
+ Capable of making implicit plans of moderate length
- Incapable of explaining exactly why it's doing something (everything is implicit)
~ Capable of roughly understanding interactions between plan elements
+ Capable of reacting extremely quickly to new situations
+ Capable of numerically optimizing short-term plans to a high degree, at the expense of long-term capabilities
~ Incapable of efficiently understanding parallelism

Phase III: Bidirectional Planning AI (December)
+ Capable of making long plans to achieve a goal
+ Capable of explaining exactly why it has chosen a sequence of actions
+ Capable of precisely understanding interactions between plan elements, causing plans to generally require no maintenance
+ Capable of reacting quickly to new situations
~ Capable of moderate numeric optimization of plans of any length
+ Capable of understanding parallelism in a highly-efficient manner

Phase IV: Evolutionary Bidirectional Planning AI (December / January?)
(Same as III, except)
+ Capable of rigorous numeric optimization of all plans

Phase IV has yet to occur, but it isn't really a big jump, just further optimization of III using evolutionary techniques.

I'm soooooo tremendously excited (and relieved) to finally be on the downward slope of this bad boy! :clap: :thumbup:
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of December 15, 2013

#5
Thursday, December 19, 2013

Three AI days in a row. This is unhealthy :crazy: Luckily today's work wasn't too mentally demanding...in fact it was rather fun!

Today I implemented NPC personalities "for real." They already had personality profiles, but those profiles didn't actually tie into reasoning in any way. Now they do! In fact, I've developed a pretty elegant system today for allowing that to happen.

Previously, I viewed personalities as a valuation of the state of the world - "greed," for example, would be a coefficient that would influence how much the state "how many credits do I have" would influence an NPC's perceived value of the world. Today I make a subtle but powerful change to this idea, and introduce the idea of "personal statistics." I redefine personality to be valuation not of arbitrary game states, but rather, of these personal statistics.

In many games you'll have some stats that the game keeps track of - kills, wealth, friends, enemies, discoveries, etc. So it will be in LT. However, in LT, the stats are more than just stats. For the AI, they are the driving force behind all activity. Every personal statistic will have a corresponding axis in the personality vector. For example, an "aggressive" NPC values the "kills" statistic, and will favor actions that increase it (e.g., conflict). A "sociable" NPC values "friends" (or perhaps "total reputation"). An "explorative" NPC values "systems discovered," and so on. A personality is then just a normalized vector in this space, e.g., a linear combination of these values. Some NPCs may be well-balanced, while other NPCs may be heavily-skewed towards a certain personality trait. Very clear and elegant :)

But, allow me to go one step further with something beautiful that I realized about this system: it offers an incredibly-simple way of estimating the player's own personality! Now that I said it, you can probably already see it :D If "personality" is defined as the desire to increase certain personal statistics, then personality can be estimated by simply taking a weighted, normalized vector of the personal statistics! Almost too obvious, right? :) In other words, if we look at a certain statistics vector (for example, the player's), and see that "kills" is very high compared to other statistics, we will infer an "aggressive" personality profile! Now, naturally, there will need to be some weighting, because not all stats are equally-easy to change. But that weighting actually already needs to exist, because it will need to be applied in the AI's valuation of the world. So we get the ability to infer the player's personality for free!

Loads of cool opportunities follow. I mentioned a few months ago the idea of "factional personality" being implemented simply by faction leaders only hiring relatively-like-minded subordinates. The question of how the player's personality could be assessed was naturally a problem. But not anymore! So it makes total sense that if, for example, you've done a lot of trading and acquired a lot of wealth but never been in battle, a war-inclined faction will probably infer a pacifist personality just by looking at your personal record (stats), and say "sorry kid, try joining the Buttercup Pansygirl League across the street, we're only looking for real men." 8-)

Funny story about personalities. Immediately after implementing stat valuation, I noticed some interesting behavior. As I opened a sandbox with a single NPC in it, I didn't see the usual "to the rocks!" behavior of the classic mining NPCs. No, this guy stood still. I opened up his brain and saw, much to my surprise, that he was desperately trying to figure out how he was going to blow up the central station :lol: Indeed, checking his personality profile, I saw that he was strongly aggressive. It would make this guy very happy to see the station - a large and valuable target - go down in flames. Of course, piloting a small fighter and, more importantly, not having access to any weapons made this a...rather fleeting line of reasoning for the poor fella. I'm guessing that if I put some weapons up for sale at that station he would probably dock, grab them, and then head on out to try to blow the place up :lol: I should probably go try that just to see.... :think: :roll:

Anyway, that pretty much shows me that I need to implement some concept of morality / lawfulness ASAP, otherwise this universe may be lighting up with fireworks a bit too quickly :lol: :ghost: :ghost:

I wanted to talk about a lot of other stuff today too related to how cool the newest planning AI is, and some of the amazing possibilities that it opens up...but it seems I've gone on long enough already! :monkey:
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of December 15, 2013

#6
Friday, December 20, 2013

Think I've written extensively enough lately to justify a bit of a brief-devlog day :) To be honest, I shouldn't have tried 4 AI days in a row...the cortex just can't take that kind of a prolonged beating. It didn't yield as much as I wanted it to today :|

I've implemented the creativity mechanics required for the AI to be able to understand research now, and today I briefly had an NPC doing some research on sensor technologies! To be fair, there's not too much to get excited about yet...I believe it cheated a bit :oops: He shouldn't have been able to equip the research unit :eh: But I didn't put hardpoint constraints yet into the equip action, so I guess that's my next step :)

I'd like to get back to the interface for a day or so; I really need to get some layouts ready for the market and contract board!

Let's try a non-AI day tomorrow ;) :ghost:
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of December 15, 2013

#7
Saturday, December 21, 2013

Terribly sorry, but I'm afraid I'm going to have to disappoint again on the devlog today! :( It's not that I didn't do any work...it's just that, due to family festivities, I'm currently running on 30+ hours of no sleep and am literally about to lay my face down on the keyboard of this laptop and die :D

Total focus on the interface today, and in terms of accomplishments, the biggest was hammering out all the precision issues. Previously, I noticed some jittering of nodes as early as 5 to 6 levels deep, due to FP precision problems (even though the interface has been double-precision since the beginning). Today I investigated and squashed all the sources of imprecision. The result is that I can now dig 16 or so levels deep without any jittering! Pretty cool :) Not that you would ever need to go that deep for a UI (hopefully!), but I think 5 to 6 might not cut it in some scenarios.

Anyway, a lot more than just that done but I reallyyyyy need to sleep! :D :wave:
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford
Post

Re: Week of December 15, 2013

#8
Week Summary

(Written 1 week later...)

To be honest, not a stunning week. A day lost to driving and another day lost to family activities made it a rather short week, but even still, the accomplishments were more limited than I would have liked. Still, the newest implementation of NPC personalities is a nice step forward :)

Accomplishments
  • Implemented category filtering for nodes
  • Implemented personal statistics + "real" NPC personalities
  • Finished latest AI implementation :monkey:
  • Fixed double precision for node-based interface
“Whether you think you can, or you think you can't--you're right.” ~ Henry Ford

Online Now

Users browsing this forum: No registered users and 6 guests

cron