petak, 8. ožujka 2013.

Vega Person architecture blueprint





No dice please!


It is custom in RPG game AI to rely more or less on random number generator's. Probably down this road I'll resort to that too. At this point I envision interaction of individual with world - both persons and all non-living elements (collective unconscious  heritage, customs, location etc.) and gained experience as key driving element of person vivid personality. Modeling dynamics of interactions of above and placing it "in head" of Vega Person is what this project is all about.
I'm perfectly aware of enormous complexity which can easily be constructed.
Let me just point simple argument for "No dice" and complexity approach - chess.
You don't have dice for chess and yet many people find it fascinating and some spend life dedicated to researching this game.
All rules for chess can fit on one short sheet of paper. How about that?
Of course on the other hand a lot of people hate playing chess just because of that. They like things predictable, simple and easy to cheat.
Hence game AI developers are not stupid but usual mainstream commercial game AI have to balance speed, performance and game learning curve.
They have to sell it and not make piece of art and that is completely different approach.

Now it's time to put foothold in more concrete blueprint of all this abstract visions in very first Vega person architecture blueprint.

Emotions


In Vega world person is ruled by emotions or more poetically said "sea of emotions".
In real world we are ruled by emotions. We are emotional beings. Even in criminal justice woman that just had baby is ruled out as not guilty for some severe crime based on emotional upheaval.
Furthermore you could be righteously upset and commit some crime and it will be taken as benefit in your trial.
History teaches us that incentive speeches of charismatic leaders made people do irrational heroics etc.
So we agree that emotions run our world. But what kind of emotions we have?
At the moment I'll create only one distinction - persistence.
Each emotion has calculated influence or strength value in certain time moment.

Lower emotions L.E.


Every human being as part of animal heritage has basic survival instincts (defend body, hunger etc.) and satisfying higher body needs (reproduction, fatigue, poverty, discomfort etc.)
Let's call them lower emotions (L.E.). They are common to every person and always exist. In simplest (and incorrect) way mathematically we can describe them as constant in time. Value of this constant for each of them and for different person can vary. One person will more care about fatigue then about poverty and another one about reproduction etc.
Yes, we could make difference between basic instinct for survival and for example need for warm clothing but let's for know stick with various constant values.

Higher emotions H.E


Motivations, beliefs, virtues or flaws all fall to this category. It is what drives us apart from L.E. True, some people are rarely driven by H.E. at all. That represents modeling challenge for me. We know that even a worst no-good of man may at some point in life conduct bravely or honorably.
Maybe using word "high" is too strong. They denote all emotions that relate to world or non-body interaction of individual. Examples vary from self-gain materialistic toward most noble and selfless like self-sacrifice  It is obvious that they don't belong in same bag. At the moment their only important denominator is uncertainty  Unlike L.E. one does not have to have them at all. Furthermore their strength dynamics through time are puzzling. Currently their behavior and things that affect them through time are very core of "to be" or not to be of Vega AI.

Psyche


Psyche will denote space in which emotions fight for rule. Idea is that in Vega AI Psyche on demand determines power balance of emotions. It determines strength of each one of them. Lastly it makes ordered list of them by their strength.
Final outcome is that at each moment Psyche can provide list of ruling emotions.

Goal


In real life our life goals, both short and long run, are colored with emotion.
As youngsters we are explained that we need to go to school (goal) to fulfill our duty. So we have goal - attending school class and ruling goal emotion - duty.
In middle ages noble knights were rented by their King in battle for their duty and/or reward. So goal - winning battle is defined by ruling emotion -duty or self-gain (this depends of person).
In sinking boat captain has goal to save his crew and passengers by staying on boat.
Hence goal (saving lives) with ruling emotion - self sacrifice.
One can remember scenes from "Titanic" where some sailors conduct bravely and help passengers save themselves while other sailors save their life.
To conclude, goal in Vega AI must be at least clearly identifiable and have one ruling emotion (R.E.).

Goal must be comparable 


Prototyping means that it is possible to meaningfully (pragmatically) determine that goal X and goal Y are similar and how much similar.
Goal definition is complex stuff. It is wide open to anything you can imagine as a goal in world. Hence it does not get wider than that :).
But bottom line is that anything I'll develop out of it must provide way to compare it to other goal in simple manner.

Pool of completed goals (PCG)


When goal is completed it is archived in PCG. IsBeneficial value is assigned.
This means that Vega person, upon completion, based on yet unknown logic determine how beneficiary was that goal for her.
So for example goal X with R.E.12 was not beneficial.
PCG purpose is to serve as person memory or experience database.
Catch is that we will have collective PCG. As modern psychology states there is something called collective unconscious or heritage, legends, stories of nations, ethnic groups, history of mankind etc.
As in real life individual takes his wisdom from both collective and personal PCG.
Now sweet part is modeling Vega person abilities to access both of these pools.
We know that some guys don't learn even from their life mistakes while wise one use wisdom of mankind, nation, state, community etc.
Issue is how to define R.E. in collective PCG?
Collective PCG, as last resort for determining R.E. for Vega Person, must cover all possible emotions.

Goal R.E. lifespan and dynamic


Goals can be defined during Vega world lifespan.
Only initial set of goals exists in collective.
Something has to determine subset of goals that are viable for given Vega Person from collective PCG.
At that moment it becomes part of pool of person goals PPG.
But not before Vega Person (VP) assigns it some initial R.E. value.
PPG represent stuff that is possible for us to do.
VP can try finding match in either his PCG or in collective PCG.
When match is found R.E. value is assigned to goal and it becomes valid member of PPG.
In real life this is process of connecting with our memory in order to determine likeness of goals we encounter. True, many people don't bother with their own memory and tend to either accept other people suggestion or resort to their people's belief's or mass religion values. So this is another sweet future modeling field.
Once goal from PPG is accepted it gets one Psyche working cycle. This means that it does not get finished in one iteration but multiple.
Important thing to grasp is that something can change R.E. during goal lifetime making it more or less acceptable for future Psyche working cycle.
Example would be farmers conscripted to battle with promise of reward. So VP has goal of battle with self-gain R.E. But after conscripted farmer understand he was tricked and if he desert he will be killed. Hence R.E. for his goal changes to fear for existence or basic instinct.


Psyche working cycle


All above elements can be comprised in one algorithm depicting one working iteration or cycle of Psyche.

  1. PPG must be initialized
  2. Psyche determines VP emotions strength based on various params
  3. Psyche orders VP emotions in R.E. ordered list by strength REOL
  4. For each element in REOL
  5. Can you find R.E. match in PPG ?
  6. Loop REOL
  7. When found (must be found!) it is winning goal WG
  8. Execute WG
  9. Is  WG completed?
  10. If no loop to 2.
  11. If yes save WG to PCG













četvrtak, 28. veljače 2013.

Vision

Artifical emotion


My goal is to take a journey to explore modeling of AI of living being.
Yes, there is already a lot of work done in this area primary in game development and specifically in RPG.
My effort is not targeting inventing new "shortest path algorithm" or original battle tactics.
I'm naively targeting field which eludes us humans for as far as we know in history - emotions, virtues and shortcomings of human being.
It is one thing to create AI to play chess and completely other to model emotions.
Of course this is unclear and misty path.
This field is realm of culture - theater, literature, poetry, philosophy.
It penetrates much deeply in very essence of human civilization.

Actually I'm taking with modern tools upon myself same task as did any writer or poet.
How to describe or explain what drives us toward inspiration, anguish, love or bravery?

Ideally Vega AI will provide model of persons whom dwell in collective unconscious web as described by some philosophers. 
So apart from, not easy, task of modeling human emotions I'll try to model human as being connected with other humans on sup-tile levels. 

Inspirations in real world


Some of my goals are inspired by games. One of the earliest is Sid Meyer's "Civilization I" where nation leaders act based on some basic emotions of fear or boldness.

Very successful example and mine shiniest model is "Mound & Blade" game single player. Building trust, leadership qualities and even courting ladies for wedding is nicely implemented.

In world of literature it is definitively Robert C.C. Martin's "Game of Thrones" with endless rainbow of human emotions and interactions that on the end determine the faith of whole realms.
One of characters Sandor Clegane, ruthless child killer, layer and in whole brutal person influenced by two little girls Arya & Sansa grows some small elements of kind person and acts in protective manner.
Same goes for character Jamie, also child killer that gets inspired by Briene to no matter what practice his chivalry - again change of personality.
Then Tyrion - dwarf, womanizer, cunning opportunist then at right moment chooses to do what its right and to protect the city and lead defense.  

Another my favorite masterpiece is blockbuster "Gladiator" with Russel Crowe. Lowest level of people, killers are inspired to learn about honer and to be willing not to live but to die for something.

Target simulation/game types 




Other inspirations and visions describe inspiration on type of game Vega AI could be used.
Movie "Crimson Tide" depicts extremely critical situation - faith of whole world  reside in hands of few man.
These people use leadership skills and convincing of their team to achieve their goals.

Encouragement, convincing, moral speech and devising meaningful plan to solve situation are key elements.

I'm also great SF fan. Hence "Star Gate" and "Star Trek" tv shows are very inspirational.

I guess that bottom line in defining game genre is RPG adventure with heavy emphasis on emotions, virtues, moral qualities and shortcomings in achieving goal.

Game examples


I'll try to paint some game ideas to more vigorously depict targets of Vega AI project.

#1 Sub commander


Game plays in real time.
It can be successfully completed by achieving goal(s) in given time. So time is equally important.
All AI players act in same real time and can win before player.

Briefing


First required game part is briefing.
Player(s) are in real time briefed about submarine and crew they are assigned to.
For replay-ability of game this info should be always different to avoid remembering
and cheating.

Scenario & goals


After briefing game starts by explaining game scenario.
One of example is that ship is in some kind of jeopardy - fire, under attack, malfunction etc. Also situation must be handled in known time limits.
It is possible that player(s) actions change this time limit beneficial or on worse.
This kind of scenarios are frequently used in action TV shows.

Interaction with game


Player(s) interaction with game goes primary through interaction with crew members.
In old adventure games like Sierra's "Leisure Suit Larry" you had to type in your commands and by guessing come up with correct command or question.
That was one of main tricks in those games - to figure out who and what to ask.
It was fun and part of game addiction. I love it and i want same concept.
Maybe typing commands is not anymore acceptable but definitely a clickable list of all possible commands should not be provided.



Ways to win


So you basically talk to people and gather intel. If you failed in brifing part you'll have to do a lot catch up asking and anoying your crew memeber.
They on the other hand maybe want be always so pleased to answer.

You can reaassign your crew memebers to different task as you please or as they please. Some of them may reject your ideas or fail to perform new duites.

On of keys to success is to build your leadership and charisma. If you can impress right crew memebers that you have what it takes or simply impress them with your knowledge about ship they will be more willing to propose solutions and help.

The perfect example of situation in which I want to put player(s) is depicted in movie "Crimson tide". First you do estimation of situation and make a choice what should be done. Your choice is chalenged by others and people in your crew.
Can you take the pressure? Will you change your mind?
Or you will enforce your way and make sure that others accept it.
For some you'll have to impress it through fear, others ratio and third through patriotisam and etc.

So finding or choosing solution is only smaller and less important part.
As history teaches us as a leader you can achieve only as much as you can impress on community nothing more. People under inspirational leadership can immensly outperform any rational expectations. Also under poor command and divided among themselves they wan't even function as collective no matter how briliant plan you have.

My bottom line is that game should encourage player(s) to get to know their crew and inspire them to follow their lead or even come up with solution themselves.
People do that in real life. Hence that would be real chalenge of my Vega AI.
So even if you have poor solution but you manage to pull it of in a limited time span is better then devising briliant plan and not implementing it.

Other approach is to try with bribery and Roman saying "divide and conquer". So diplomacy is also important.
Fun part is to play with virtues and shortcomings of your members.

Third approach is birocratic and liest effective. It resides on player's ability to get very well aquinted with both ship and crew memeber and by reassigning them to proper tasks and asking specific questions achiving goals.
This is time consuming since no one does not birocrats and to be treated as tool.

One game scenario and solutions


Let's paint some scenario and possible solutions.
For example there is a fire on ship. The catch is that fire distinguish system is down. Person that can repair it is hospitalized and goes through its own personal trauma. He tried suicide. One solution to scenario is to try calming crew members and investigate reasons for this person behavior and try directly or through others help him overcome his personal problem and help in solving current fire situation.
If player manages this situation will be quickly solved.
Alternative is to try finding and inspiring other memeber(s) to repair system.
Catch is that missuse of fire distinguish system inflicts security protocol to block system for long period. This of course puts everyone in jepardy. Hence it is crucial to secure that this memeber is both encouraged to give it a try in repairing and rest asured that he is protected from others if he fails and risks all of their lives.
Third possible solution is slowest and organizational. It is basically issuing commands and inspecting results. Assembling a team and leading it personally in reparing system. Team members will exert fear and ocasionally give up their task. They must be repeatedly monitored, briefed, helped and pushed to acheive goal.

Vega world


As one can see it this game scenario requires one important game engine - scenario world. It would be used to describe game winning and loosing conditions.
Character that "lives" in Vega AI must be able to easily interact with Scenario world.
This is very chalenging task by itself but still bellow Vega AI requirements.