Hello dear AI folks,
now that I finished my Research Project, it is time to tackle the Bachelor thesis. Again I would like some feedback, as it worked out pretty damn well the last time. So here is what I want to do:
0. EDIT - Too Long; Didn't Read
It was brought to my attention, that the first few paragraphs are mostly rambling. Sections 1 gives only vague background to the motivation. Feel free to skip. Here is a shorter description of the project:
Dominus (working title) is a Sandbox game all about the player teaching multiple AI agents, one at a time, to perform better at gathering resources, building a town and getting happier.
The player does so by briefly taking control (dominating) over an AI agent, showing the agent how to act by example. When control is released, the influence of the player’s behavior should be noticeable in the agent’s behavior henceforth.
1. Repetetive Tasks in Sandbox Games
I don't know how much time exactly I spent in Minecraft, shoveling through dirt and punching trees. I do know, however, that I spent over a year (online time > 400 days) in World of Warcraft mindlessly grinding for better gear. Hell, even now that Season 14 in Diablo3 began, I spend more time flinging colorful pixels over the screen to see some counters go up (gold, xp). But I am oh-so-lazy. Can't the game do that for me please?
Also, I miss my friends. I guess, I just hit that time of my life, when everybody is busy doing something new with their life in far away places. Alas, the Internet! We can game online, building something together in Terraria, Factorio, Space Engineers or 7 Days to Die. But not long after the server is set up and I am pretty much alone again. There is that one friend, that (as soon as he finds a shovel) sticks his head in the ground, only to be seen hours later with precious minerals. Another one is building a base camp on his own. Yet another friend is off screen fighting monsters. I am typically the one fiddleing around with redstone.
I know, I know. It is a cooperation-thing. Everyone assumes a role and wants to shine in that role. But in DnD we do those things together, in the same place. We have direct impact on each other, rather than doing the same thing on our own for hours and hours to complete some greater goal.
Maybe this is just the wrong kind of game for us. If we want action, why not just stick to action games? Well, after a great quest we want to return to something that is ours, that we made ourselves, home. If there is an action game with that sandbox element, like player created towns as in Ultima Online, we would probably play that. To be honest though, UO does not satisfy my friends visual needs anymore.
2. Bringing the band back together
The dream of my Sandbox experience is to, at some point, reap the spoils of the mindless tasks all of us did before. This harvest of action packed Ender Dragon slaying is often days in the future, if happening at all (no, i haven't even seen the Minecraft endboss yet). I would wish for some automated process, that I can set up in a way to my liking, as in Factorio, and let it do its thing, while I take out my friends having fun storming the castle. In my case, I prefer NPCs over conveyer tubes. I want "Hey, there is the blond guy with that yellow shirt. I shall name him Bob, and I will build him a house now!" But differently from Dwarf Fortress, I also do want direct control over what Bob is doing. I couldn't stand seeing him eaten by a Wear-Mammoth, while he is crying in the woods over his dead cat. Also, I would like to be able to show him, that he can actually carry more than one log of wood. So when he is out there lumbering away, he can bring some for his NPC-friends. He does not have to do it in the perfect way, but in my way.
And while Bob is getting firewood, and some Charlie (NPC) is baking bread, Darla (NPC) is forging armor, I can take Anna (NPC) out to a trip to the dungeon, together with a friend of mine, who took a liking to Fenya(NPC). The repetetive tasks is left to the common town folk, while my friends and I are out there having fun.
3. Games, that do the job not quite as I want them to
I already mentioned Minecraft, the origin of the problem. Everyone is doing something somewhere else.
Then there is Factorio, which tries to fix that problem with conveyer belts and automated workshops. Still, you spend the most time building more of the same. A direct cooperative effort can lead to chaos in the clockwork.
In Dwarf Fortress you can see NPCs with unique character, goals and needs. There are short-, mid- and long-term goals keeping you, as the player, busy until the inevitable Dwarfocalypse. But those Dorfs can be pretty frustrating at times.
The creature from Black and White was, at times, equally frustrating. But given enough blood, sweat and tears you were able to teach it to help you out quite a bit. And while it was doing its thing, I had fun throwing rocks the size of a beluga whale at my enemy.
In Dungeon Keeper you were able to dominate a creature, enabling direct control, turning the strategy game into an action game for a while.
4. Occam's Razor - The holy grail is carved out of wood
This is just a Bachelors degree. I actually have to remind myself of the fact multiple times. I will simply not be able to create the one Game of games. On my own I will probably not even be able to do more than a prototype.
I looked at the Maslow Pyramid and thought "I want all of that!".
I looked at the Dwarf Fortress wiki about the production chain and though "I want all of that!"
Well, no. Just no. For the purpose of a prototype, there will be an apple-tree, a wooden hut, an axe and three or four characters that want to sleep and eat. That makes them happy, which in turn makes them pick apples, chop trees and build houses faster.
The prototype should be able to add more content later on, though. Ideally, this would happen with a wizard in the editor.
5. Technical stuff - The road so far
With the requirements seen above, a Goal-oriented Behavior-approach seems rather fitting: Give the AI system some goal and some action and it figures out how to use them on its own. One could even argue that I probably read the book Behavioral Mathematics for Game AI first, and only then decided to build a game for that. Well, okay, you got me. For me it was like seeing some cool Magic - The Gathering-card and deciding to build a deck around it. I know that, at this point, a simpler AI structure would suffice, but I am stubborn in applying what I learned in the book.
So, as Ian Millington suggests in Artificial Intelligence for Games (p403), actions are "generated by objects in the world" using a Command pattern.
As I am most comfortable with Unity3D, Coroutines are already built in the system, so I can spread out the computation of action scores over several frames.
I have sensor to determine the distance to objects. I will have sensors to determine the satisfaction of needs and for how much satisfaction an action provides.
My utility functions are eagerly waiting to have more than a Linear Interpolation.
All actions are already in the game: you can eat, sleep, pick up and drop.
There is already a pig running about, eating the closest apple it can find (including the ones in your inventory)
6. My Problem - Suggestions welcome
The working title for the game is Dominus. You do not have a player avatar, that can directly interact with the environment. Instead, you have something like a mindcontrolling Blob, that can sit on someones head and dominate a NPC, giving you direct control over the NPC and thus allowing you direct interaction. What is supposed to happen is this:
While dominating a NPC, the AI system is supposed to record what you are doing, as long as the NPC is still happy (fed and rested). When released from domination, the NPC is supposed to recreate that behavior in a similar fashion without neglecting their needs.
Example:
The base AI set up by the developer is not perfect, not even close. So, Bob is hungry and moves for 20 seconds to get an apple from a tree. He eats the apple. Bob is now sleepy. He walks 15 seconds to a hut, then goes sleeping. He is now hungry again.
What the player knows, is that it would probably have been smarter for Bob to collect some more apples, to later consume them from the inventory. So the player dominates Bob, walks to the tree, collects apples until Bob's inventory is full, walks back to the house and goes sleeping, then releases Bob.
When Bob wakes up, he will of course eat apples from his inventory. But the next time he goes apple picking, he fills the inventory to a degree, similar to what the player has shown him to do.
My Concerns:
I see no way of implementing this with Utility-based AI. It would probably need some system that automatically changes weights or functions on runtime. But how should it know, why the player did what he did? I heard that the author of Behavioral Mathematics for Game AI pretty much loathes Machine Learning, so I am interested in alternatives to the following:
Imitiation Learning seems to be capable of doing what I want. My idea would be to create the Utility-based AI first, then let the Imitation Learning algorithm imitate that behavior to not being able to distinguish one from the other. Then the Imitation Learning algorithm takes into account what the player does.
My professor is absolutly hyped about Machine Learning and wants me to do it that way. But I am sceptical. In my Research Project I even wrote (shamelessly citing myself now ...)
QuoteAs fads come and go, there is great temptation to just pick the most popular model at the time. But it might be ill-fitted for the needs of a particular soon-to-be game.
I don't want to make the mistake, which I warn beginners about. So what do you guys think?
Imitation Learning? "Enhanced" Utility-based AI? Something else?
To me this sounds a bit like a discussion around the AI Wish List. Maybe there are some other resources for me to look into?
I am interested in your oppinion!
Cheers,
Rockroot
P.S. If you are interested, here is the git repository. I have to update/commit soonest. Warning: bug infestation!
Some pictures are attached.