design

You are currently browsing articles tagged design.

I had a thought today while walking outside about human-like ai. This is of course, in relation to the game idea I posted a few days ago, but the gist of my goal is to have npc’s that can successfully animate and control characters designed from popular animes.

The idea is pretty simple, the npc’s will derive their actions off objects, not off of themselves. In other words, they will look at the object to determine how to handle it, not depend on preprogrammed responses to objects that are a chair. The objects will store data that the npc can use to lets say, pick it up, throw it, eat it, ect. And the npc will use their MBTI to determine what should be done in the given circumstance.

Part two of the idea is that these objects will also hold ‘experience’ data that the ai will pick up and remember for certain lengths of time. This data can be pugged into their design making structure and called on during other circumstances to determine what to do or how to interact.

Heres a live example,

The npc walks up to a wooden chair
He sees that the chair can be picked up, sat on, broken, and burnt

Along with these verbs are tags that help the npc with the decision.
Example, ‘sit down’ is tagged for resting
‘burn’ is tagged for warmth

He thinks about it and determines that he needs a rest so he sits down
His fatigue goes down and the chair teaches him that sitting down makes him rested
After that he thinks again and determines that he is really cold, so he finds an object that will light the chair (oil and matches) and does so

This demonstrates another part of the idea, in which objects must interact with each other using the npc as a medium. The matches will be tagged as ‘makes fire’ the oil would be ‘spreads fire’ and the chair’s ‘burn’ tag will say that it needs something to start and spread the fire, in order to be used. Sort of like, requirements for an action. To discover the tools, the npc must be able to scan local tags.

The chair is lit and the chair teaches the npc that burning things will make him warmer
However this chair exists in a hay barn, and now that there is a giant fire in the room, all the hay ignites

This is can be accomplished by state broadcasting. In which objects changing state ( eg. Stable to ablaze ) will broadcast the change to all other objects and and objects listening to such a change will decide what to do. ( eg. burst into flames )

So now our npc is to hot and the hay teaches him that hay + fire is not good.
He leaves the barn because the environment outside is not on fire

This action causes a conflict in his code.
On one hand he learned that fire is warm and thus good when cold
On the other hand he learned that hay on fire is bad and makes him to hot
This is not exactly what should be learned here, but I never said this design was perfect

And so our npc lives to see another day, only slightly smarter then he was before. But he gained some valuable survival skills.

This design still needs some tweaking, but at least now we have a working model that I can start writing and testing.
One other thing I should mention though, as these npc’s collect environment data from these objects, certain ideas and concepts are going to collide and others will become useless. We should also account for the human’s ability to forget ideas as well. Some form of garbage collecting will have to be done to clear out bad data. Just keep that in mind.

Tags: , , ,

A little while ago I sat down with Ogre and started work on a game idea I had. The game started off as a simple harvest moon clone with a more dynamic, evolving AI. I had plans to include a growing city, very dynamic and alive npcs, and of course lots of farming fun. I worked on the game about 2 months, starting over at least two times during that time period while I got used to using Ogre. I finally hit a road block last month, after creating a basic framework to wrap Ogre I set out to write an object system. Which is where I am still sitting at.

During this lull of programming I stumbled across a new idea while thinking of character designs. I watch several different animes, some of my favorites are Bleach, Azumanga Daioh, Shakugan no Shana, and The Melancholy of Haruhi Suzumiya. It was while watching the last anime on that list that I had an idea, I really like Haruhi because she is such a character. Like Midna in Zelda, Haruhi just emanates personality. So the idea I had was to model the characters in the game after these anime characters, equipped with the same personality and actions.

Obviously this idea once again only added to my work load, making npc’s that can act on their own, maybe even talk on their own, according to nothing but personality data is no small feat. It has probably never been fully realized yet in any game. However after some research I found an interesting article about MBTI and I thought that a good way to accomplish this would be to program npc’s with functions that govern how they think about the world. Most games program reactions to simulate personalities. What I want to do is program npc’s to form personalities based on how they perceive the world.

For instance, if an npc is introverted, most of the time he will look to the introverted module for his next move. Npc’s will have a load out of percentages they are for each of the four types. The program will run both modules to figure out what to do, but weigh the options against their percentage for that type.

I will write more about this later when the idea is more developed, right now I want to also mention a video I saw talking about a special neural network.

This network operated as a pair of connected networks, one network is full of noise (random inputs), and the other network takes that noise as input and judges the good from the bad. The idea here is that in a real human brain we are subject to noise, random thoughts or just subliminal noise, which we then judge to be a good idea or not. I no longer have any link to this video, but I still remember how it was designed and implemented. I thought maybe this would be a good way to use the MBTI, have a global brain that produces ideas and have the MBTI modules think about how to handle them.

Of course I also worry about the playability of this game, and if I am expecting about a dozen or so npc’s on the screen at once, running 12 brains this way might be a bit over burdening. But of course I want to make a demo application some time in the future to see.

It is these two systems (objects and AI) that will be the main design goals in my project.

More on this later.

Tags: , , ,

Newer entries »

Charles Solar is Stephen Fry proof thanks to caching by WP Super Cache