Sign in to follow this  
Anvilsmith

An AI based on ideals

Recommended Posts

[note: I wrote a huge document this morning, and managed to save only a quarter of it. When I was about to post, my whole computer froze, leaving me grumbling for half an hour. I thus wrote a much smaller description of my system, along with pasting what I did manage to save, and have posted it here with the hope that it's still enough to comment on. I'll describe the details later, after I'm done bashing my skull against the keyboard.] I'm making a serious effort to create a simple yet comprehensive AI as part of my efforts to design an interactive city, which uses a purely literary engine. I don't think any sort of graphics, even ascii graphics, are suitable for this kind of game. This is because the city is one big schroedinger's cat (or a whole litter of them, if you will) in that none of its details exist before the player is in a position to suitably interact with them. What I mean is, a city district might have a few properties, but a "random location generator" can work with these properties to instantaneously render parts of this district available for the player to explore, based on the properties mentioned. When one of the NPCs visits a room of his house, none of the objects in that room are rendered unless the player (represented by a "daimon", or spirit who can manipulate the thoughts of others) steps in to create them, or allow them to be built by algorythmic design engines. So, too, will the city include people (most of them "virtual", in that they only exist statistically), which include both a detailed biological engine (which I've already designed for the most part), and a psychological engine, which aims to involve as few concepts as possible while offering a wide range of behavior to take shape. I believe that, through heavy abstraction and by developing the overall world according to these psychological principles, this challenging goal can be accomplished. To give an example of the biological system, every organ has its own "bulk", "temporary damage" and "permanent damage". Bulk minus damage equals basic efficiency; the more damaged the organ, the less it can succeed at its appointed task. Despite this, the vegetative nervous system will typically require organs to work at strict efficiency levels. In order to compensate for damage, these organs increase the "intensity" of their efforts, and prolonged labor at increased intensity levels causes an organ additional temporary damage. In the end, organs which haven't been completely damaged may still slowly die off. A great excess of toxins in the liver can cause it to work too hard, eventually weakening to the point where it can no longer keep up with them despite being at maximum intensity (1/2 * efficiency), and letting said toxins work their way to the other organs. Not only can toxins act as immediate poisons, they can also subtly weaken the body over time, making alcoholics, junk-food addicts and those foolish farmers who use NPK fertilizers die of various contagions simply because their bad habits have cleared the way to disease. Each food item contains a mix of various substances. I'm aiming for 100 in total - 10 toxins, 10 poisons, 10 waste products (the differences between these three varieties are subtle, but they do exist), 20 nutrients, 10 hormones, 10 antitoxins and some fundamentals like CO2, CO, O2, glucose and H2O (which shows the "excess" of water in a cell, as opposed to the ammount required for it to stay barely alive), though it's worth noting that some of these substances behave differently in different creatures, and all of them have a toxicity level - including water - to reflect what happens when the organism gets too much of them. Some substances can be "adulterated" - they lose all of their properties, except for their toxicity, which goes up by 10. Psychologically, the game uses 8 major ideals as drives. For each character, each range has a specific "sweet spot" that the character will struggle to achieve. Both too much and too little will be seen as harmful for his fundamental goals. Note, however, that the character (I'll refer to him as an NPC, since characters can only be "possessed" occasionally by the player) may define secondary objectives, which are states of being in the world that have resulted in the state of being he naturally aspires for. By nature, he will attempt to impose his ideals everywhere. However, if he notices himself getting closer to his overall goal when other characters have plunged to an abysmal level of ideal X, he'll try to keep them that way. More interesting things happen if he notices ~himself~ getting closer to his fundamental ideals when they haven't been fulfilled at all; he might begin to crave defeat, and actually work against his own objectives subconsciously, because he knows the only path towards success is utter, devastating failure. I believe this is one of the things that prompts some people to commit suicide. Also, the character's memory works in such a way that he records his physical as well as mental state for every "tick" (minute of game time), so if he finds that he's always been doing well when he was ill or under stress, his mind will form a correlation and force illness to exist in order to meet his objectives. This correlation must persist after the pains, stress and illness repeatedly prove harmful to his goals... And I'm not quite sure how to go about estabilishing it. However, I believe it to be a key element in regards to such concepts as PTSD (without which war would be a trifle, as inane as RTS games make it), self-conflicting attitudes (regarded as a cherished way to build up character complexity) and harmful habits such as liquor and other assorted drugs. Perhaps drugs can establish a direct link between ideals and reality, allowing the NPC to hallucinate that he's actually achieving his goals, hence making drugs an illusory road towards success. To derail this subject further before I go on to describe the eight ideals... What I need to emphasize is the concept of trauma, of "stuck behavior", and of the way one's feelings can persist within one's body long after the incidents that set them forth have faded, materializing as chronic pains or muscle tension (the body's covert habit of cringing or preparing for a clash). Perhaps I could introduce the concept of "physical memories", where a traumatic memory can, by itself, generate physical reactions when it soars into subconscious or conscious experience (I'll explain the concept of memories later in this post). Perhaps pleasant memories could do the same, averting the damage caused by their painful counterparts. In any case, I need to list the eight ideals. These are: Greed - the desire to hoard material items, on one's person and inside one's stomach when possible. Ownership is a crucial element for greedy characters. Force - The maintainance of health, fitness and strength. A character that yearns for force will strive to build up his physique and test it against supposedly powerful rivals. Creation - Creators enjoy building things, whether poems, statues or entire buildings. Bulk isn't relevant to them, however - at least not as relevant as rendering their own perceptions and emotions through their work. Renown - The recognition of one's peers, either through fear, love or jealousy. The more they care about the NPC (one way or another), the better. Note that overt scorn lowers one's renown, whereas overt cheers, hails or signs of dread support it. Even ordinary greetings from acquaintainces help keep renown at reasonable levels. Influence - The ability to persuade others to do as one desires. Ordering around slaves, aides, wives, children and the like, or simply making someone fall in love with them, boosts this ideal. Romance - The expression of love, both his own and that of others, will support an NPC's romance ideal. Physical love obviously plays an important role in this, but so does the perception of intellectual love. Comprehension - The more valued this ideal, the more an NPC will seek to persistently improve his state of knowledge, constantly developing new ways to build upon it. Note that when new concepts appear and tamper with the NPC's present state of knowledge, they temporarily lower his comprehension; some NPCs can be more strict in their beliefs, and this is reflected by a strong unwillingness to lose their comprehension. These will make poor philosophers, but fairly competent scholars and bureaucrats, so long as their beliefs are never threatened. They will naturally seek to discover new things that don't override what they already know - in other words, gossip and religious propaganda. Survival - this urge will hardly ever go unsatisfied within the city; however, when it drops too far, the character will make a conscious effort to eat, drink, heal themselves, fetch a competent medic or keep themselves far, far away from anything that threatens their survival (which may include the very soldier they're fighting). Naturally, charcters will value actions that accomplish ~all~ of their ideals at once, bringing them as close to their sweet spots as possible. Someone who prefers gaining high influence, creation and renown will probably become a bard. Others, who focus on force and creation, will tend to make good carpenters and smiths. Greed and influence might lead one to a mercantile activity, while survival, force and influence makes good adventurers and military leaders (as well as barbaric thugs). Also, characters will often create secondary objectives when it seems that their completion would lead to their fundamental goals being fulfilled. Such secondary objectives do, at times, get in the way of the very ideals that spawned them. Now, let me try to cram a summary of everything else I've written, using a small pair of paragraphs. I'll elaborate on everything in due time, once my frustration wears off. All NPCs have an impression of every object or object type they encountered; these impressions are reliant on the sum of the NPCs' memories, both those consciously present and those lingering in their subconscious minds (memories can also go dormant if their "intensity" drops far enough - in other words, if the NPC's present circumstances don't match those of the memory itself). A memory is an alliance of facts, reflecting everything the NPC perceived during a tick, as well as a number to determine its chronology (though not necessarily the time of day), the ownership of all objects perceived at the time (including their location) and their actions. Crucial to the memory is that it records how much the NPC's ideals were being satisfied at a specific point. If they were, then the NPC's affinity towards the objects present in that memory rises, particularly if greater "relevance" was assigned to certain objects. The sum of all the "affinities" presented by non-dormant memories at a certain point in an NPC's existence constitute his impression of the object. Therefore, this impression is quite often prone to change. "Ownership" can mean inclusion in any number of things: social constructs, locations and object types. Such social constructs are, as all things in this game, dynamically generated via algorythms. Most irrelevant memories eventually become "compressed" into a list of the day's changes in affinity, as well as a series of references to ownership. Objects can be imbued with "styles", which are nothing more than percentile values associated with the 8 ideals (whose sum is no greater than 100%). For instance, an object built in "pagan style" may have 20% survival, 15% force and 5% creation. The presence of styles boosts NPCs' attitudes towards these items, as well as bringing them closer to their ideals. styles can also be applied to conversation, altering an individual's tone to reflect his audience. The general principle, here, is that everything is judged based on how it helps the NPC reach his goals, directly or indirectly; the NPC remembers strings of simple situations rather than complex events, unconsciously recognizes the role of each object in each memory, and chooses how to act based on that. This system serves as the foundation for all social interactions and decision-making processes, but isn't quite effective at establishing long-term goals (at least not in its present form).

Share this post


Link to post
Share on other sites
I fear my reply will look very short under your mammoth post :P

i like the idea on a whole :)

i love the biological engine idea.

and i would like to be informed of how it goes.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster



Your 'on the fly' world creation may have to dwarf your AI project if its not to only provide generic/random non-cohesive situations. You will find that automatic generation is NOT as simple as providing a few seed values/abstract coefficients to produce a complex system of interacting props and inhabitants.

You will need ALOT of persistant information so that newly created areas will integrate into the other areas adjacent to them and entire areas need to be 'developed'/'grown' together instead of piecemeal. Otherwise you will wind up with a mish-mosh of disjoint situations with no macropatterns of any complexity.

Share this post


Link to post
Share on other sites
The biological engine sounds awesome, but keeping track of all organs, chemicals, etc for each person, even one at a time, would make it fairly large. Question, would the person be able to be re-possesed? I bring this up because if so, then you would have to keep track of all of those stats for each person that the player has been. This could quickly become problamatic.

I love the idea of the city as a Schroedinger's cat. I have been toying around with that idea myself, just don't have any concreate methods yet. Since the city and population will not exist as long as the player is away, then my above problem with the biological system is void.

The reason that the AI hasn't been able to solve long term goal's is that these aren't any. The ideals you list are more or less a "tick by tick", to use your terminology, way of living. One day at a time sort of thing. In many cases people can be generalized down to these ideal's, but realilistically this only holds true for stereotypical cases.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this