Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Quick Reply
Search this Thread
Scholar
Original Poster
#1 Old 14th Jun 2014 at 3:17 AM
Default Is It Possible
This question is for modders and hackers and purely in the spec realm, but another thread about play style got me to wondering something. Is an AI that learns from my or I should say an individual player playstyle possible. Like in some future sims game would it be impossiblly hard to have an AI that saved information about my play choices and then used that to run a story progression to make choices similar to the kind I would make?

Check out my simblr https://www.tumblr.com/blog/tbssimblr

Click the link, you know you want to. ;)
Advertisement
*shrugs*
retired moderator
#2 Old 14th Jun 2014 at 6:18 AM Last edited by maybesomethingdunno : 14th Jun 2014 at 6:29 AM.
Sure, it's possible! Though it can be quite difficult to implement efficiently and effectively....

Hopefully I will be both correct without being overly technical in my answer. (It's late so if I make a mistake, feel free to correct me.)

The best AI design for this would probably be a neural network., which in some ways models a person's nervous system. You may recall from school what nerves look like. They receive input on one end, the signals are processed over the neuron, and an output is given on the other end. Of course, you have more than one neuron in your body. When you stump your toe, for example, that signal is passed from neuron to neuron from your foot up to your brain and you cry out in pain. The neural network works in a similar fashion. You have a node (a "neuron") that accepts input, does some calculations internally, and then outputs a value, most likely to a subsequent node. An initial input (forceful impact of toe on a hard surface) is accepted, processed, and sent all the way to an eventual final result (you cry out in pain). The more nuerons/nodes, the more complex the decision making.

So why this result? Why might you have laughed when you stumped your toe instead crying out? Would you cry out if you kicked a soft, fluffy pillow? Well, each node has a value or weight that it uses in its internal processing to determine its output given some input. When a final output is given, the neural network is able to learn and make adjustments to these values/weights in the neurons. You may have heard the term "muscle memory." It's kinda like that. Practice makes perfect. The muscles of someone who plays basketball often are going to be far better at throwing a basketball into the hoop than someone who only rarely plays. It will seem to come naturally for them. Allow me to switch metaphors....

Suppose you have an RPG game with monsters. Whether they are a Level 1 enemy or a Level 1000 enemy, every NPC monster is controlled by the neural network as sort of collective brain (for now, let's avoid comparisons to the Borg from Star Trek). Let's say you encounter a level X enemy. The first neural node assess the situation, for example it might take as input your skill level, the monster's skill level, and the number of monsters.

Node 1: "I have a Level X A.G.Doren and a lone Level X monster. Eh, let's battle!"
You kill it easily. The neural network thinks "Okay, Level X A.G.Doren has fought and defeated one Level X monster" and it updates its node's weighted values (i.e. conditions it will consider when given an input).

When you encounter another lone Level X monster...
Node 1: "Okay, I have a Level X A.G.Doren and one Level X monster. She has defeated a lone Level X monster out of 1 battle(s). Perhaps it was only just a fluke. Let's battle!"
Again, you easily defeat the Level X monster and the game updates the node again.

If you do this enough times, it becomes obvious a Level X A.G.Doren against a single Level X monster is a monster massacre. So you might find that when you encounter a single Level X monster, it runs away instead of fighting you. Why might be this be?

When you encounter a lone Level X monster...
Node 1: "Okay, here we have a Level X A.G.Doren and one Level X monster. She has defeated [a significant number of ] Level X monsters out of 10000 battles. The odds are in her quite favor...Let's NOT battle and flee instead!"

So, now the game has learned from past experiences (i.e. your play style) and can propose new approaches. Maybe it will try multiple Level X monsters at a single time. Maybe it will see how well you do against a Level Y monster. Maybe you are performing badly and the game should offer you weaker monsters instead of stronger ones. Every scenario presents the neural network inputs to be processed and its nodes updated based upon the output. Over time the nodes are calibrated as needed as you play.

Remember how I said you have more than one neuron? The same would go for this situation. More neurons = more complexity. In that example, there was only a one neuron/node layer that made the fight-or-flight decision. You might have one layer of nodes for handling player numbers: Is A.G.Doren playing alone or with a group of friends? If alone, send the resulting data to the Single Player nodes. If in a group, send the data to the Multi-player nodes (which might go through each player in the group and analyze their strengths/weakness). Another layer of nodes for looking what buffs/moodlets you have and their strengths and powers. Another layer for what weapons you have and what their strengths are. Another layer for elemental types (e.g. Is a fire type weak to a water type?) And so forth, all leading up to a final "Should I fight, or should I flee?" response.

So, that's (kinda) why you might cry out when you stumped your toe when kicking a hard surface versus being indifferent if you hit a soft pillow with the same force. Different inputs lead to different processing which lead to different outcomes. From there you also learn what's going to hurt and what isn't.

I'll leave it your imagination how this might could apply to a Sims game.

I don't mind if you call me "MSD" or something for short.
Tumblr
Perhaps someday I'll have leisure time back...
Scholar
Original Poster
#3 Old 14th Jun 2014 at 8:17 PM
wow! Thanks for taking the time to write all this out. I had to read it through a few times to really have opinion.

With the RPG game that is a somewhat simple decision or at least it seems like it. Just one node knowing that AGDoren slaughters level X monsters, so the smart choice is to flee. But for more complex open-ended scenarios where the player makes different choices everytime wouldn't that require different nodes. Like just because a simmer chose try for baby with one newly wed couple, doesn't mean they would chose it for the next. How many layers of nodes is reasonable? Like in a sims 2 configuration (I know sims 2 better than sims 3 sorry) how many factors might the game consider. Could there be enough nodes for the AI to know that if the couple is older, unemployed and one has a romance aspiration or hates kids trait to not try for baby. And then there is human perversity where the simmer purposefully creates those situations and gets the couple pregnant, because of the circumstances.

I guess what I'm wondering about is how many scenarios could an AI possibly learn about? Or more important how many could fit into a game and run on our computers without lots of lagging and crashing?

Check out my simblr https://www.tumblr.com/blog/tbssimblr

Click the link, you know you want to. ;)
*shrugs*
retired moderator
#4 Old 14th Jun 2014 at 11:02 PM
My example isn't perfect, but I (hope) gives a sufficient presentation of how (Neural Networks) NNs work and could be used.

Quote:
Just one node knowing that AGDoren slaughters level X monsters, so the smart choice is to flee. But for more complex open-ended scenarios where the player makes different choices everytime wouldn't that require different nodes.

Yes. More complexity in simulation or decision making would mean more layers of nodes. In some cases, you might consider having a layer of nodes for every component of a particular decision; in other cases, you might could consolidate and have fewer layers of nodes.

Quote:
Like just because a simmer chose try for baby with one newly wed couple, doesn't mean they would chose it for the next.

True. So you might wonder if simply one NN isn't enough. Perhaps you could you have a NN entirely devoted to learning how your hood populates. We might consider this a singular module of a larger learning structure, not too unlike how the brain could be divided into lobes, each of which is associated with different a function. We may have just exponentially increased the game's developers' workload.

Quote:
How many layers of nodes is reasonable? Like in a sims 2 configuration (I know sims 2 better than sims 3 sorry) how many factors might the game consider.

Off hand, I honestly have no idea how many layers of nodes would be a reasonable number for a Sims game. The number of factors would be limited to the capabilities of the developers and how complex the decision making process. Recall the RPG example; I detailed a fight-or-flight decision that could work simply based upon experience before introducing further factors like what weapons you had or who you were with at the time. Ultimately, it's a design choice that would be affected by the business realm: time, resources, and company goals (e.g. intended market release timetables). Sometimes features must be dropped or delayed.

Quote:
Could there be enough nodes for the AI to know that if the couple is older, unemployed and one has a romance aspiration or hates kids trait to not try for baby. And then there is human perversity where the simmer purposefully creates those situations and gets the couple pregnant, because of the circumstances.

Yes, there could be enough nodes (see above). Each of those could be a factor that could be considered by however many nodes necessary.

As for perversity, yes, there will be exceptions or outliers and the NN will learn accordingly. Ideally, a good NN would work in such a way that calibration is relatively gentle. Just because you might have lost to a Level 1 monster (perhaps your game lagged, you forgot to press "pause", the random generator wasn't being your friend today, or whatever the reason), doesn't mean that all your past experiences/work are discarded and that the game is going to start treating you like a noob. It would be when it starts to become the norm that drastic changes would be made. Let's say Don Lothario fails at wooing a girl on night. He's disappointed, sure, but he's not completely crushed and second-guessing his attractiveness and seductive skills. It would be when its happens again and again with other girls.


Quote:
I guess what I'm wondering about is how many scenarios could an AI possibly learn about? Or more important how many could fit into a game and run on our computers without lots of lagging and crashing?

How many scenarios an AI could possibly learn about probably depends upon resources, the design/scope of the project, the complexity of the game and AI engine(s) and so forth. It would be a very hard thing to really quantify to an exact number. (And since we really want you to buy our game, our PR person will most likely tell you the possibilities are endless or something. ) It would also depend upon what you define as a scenario. Some events may seem different to the player but are in effect the same scenario from the perspective of the game. Suppose you sometimes put a hat on your character when you go out to kill monsters. You might think those are two separate scenarios: 1) with hat 2) without hat. But if the player's appearance has no effect on the outcome on the battle, all other things being equal, that would only really be one scenario. The presence of the hat is irrelevant.

As for running on a computers without lagging and crashing, well, that again depends upon the developers' capabilities, resources, and the constraints placed on them from the business realm. You have such factors as how the software is designed/planned (i.e. think like the blueprints to the structure of a house, whether the house is going to be built on an active volcano versus a suburban environment where the land is flat and its ground can support a good foundation), the quality of programming, how much testing can be done, and so forth...

I don't mind if you call me "MSD" or something for short.
Tumblr
Perhaps someday I'll have leisure time back...
Back to top