Grasp of the Fallen
Grasp of the Fallen / Engines / Conversation /

world system / node movement / relationships

Updated: 4/9/2006

// create lots of nodes
// set their start location & goals
// send all node data to their parent nodes
// re-calculate all parent nodes - start at deepest level and work up.  don't do recursive, just work with levels!  Number of level should be small like 3-5

aiNode{
 aiNode(){};
 update(){
  checkEnvironment();
  getPriorityNode();
 
 
 };
 checkEnvironment(){
  // look within viewing distance for other nodes

  // loop found nodes (up to 20)
   // loop knowledgeNodeTypes[foundNode->nodeType]  // loop only the knowledge that is related to nodes.
    
    if(knowledgeNodes->event->isRelatedNode(foundNode){ // up to 5100 times? ouch! how to speed this up?
     knowledgeNode->event->foundNode(this, foundNode);
    }
   }
  }

 }
 getPriorityNode(){
  // loop knowledgeNodes
   // update priority
   knowledgeNodes->actualPriority=knowledgeNodes->event->getNodePriority(this);
  // sort knowledge on actualPriority
  sort(knowledgeNode.begin() end(), customSortFunctionOnActualPriority);
  priorityNode=back();
  knowledgeNodes.pop_back();
  return priorityNode;
 }
}

nodeTypes
characters
 types of characters?

inanimateObjects

knowledgeNodeTypes (types of events/knowledge)
nodeCapture
nodeAvoid
nodeKill
nodeFind
nodeProtect
nodeInjure
nodeFollow
nodeTrade
nodeTalk

magicLearned
eachSkillLearned
history
startNewAllegiance (makes this node the founder of the new allegiance)
growAllegiance (specifies which one internally)

Attacking your own kind is much faster way of losing allegiance then any other thing you can do. A mistake is allowed.  But consequtive attacks or murders results in negative allegiance and they become your enemy.

for the game world to be saved quickly, i'll need to queue sql statements.  and only process as many will fit into the frame time...  nodes that are far away will need to be generalized.   They might fight 10 times, have multiple conversation, complete a quest all within a minute. 
I have to have a set of functions that operate based on simulated-time instead of real-time
simulateBattle(count) // use encounter rate with random modifier  - determine relative difficulty - adjust items and stats based on total number of battles within specified time.  Estimate if character died and if their corpse was looted.  Every corpse could remain and decay until its gone, taken or buried.
simulateTalk(time, node, node2)
simulateTrade(node, node2)
simulatePathfinding(node)

each group of people have a leader -  the leader's influence is the sum of just that group.
Every node in the system belongs to their own group , but we're trying to determine what is the primary group of each node.

example: the 50 people i'm closest with.  put them all next to me.

the sum of cohesion to every node is influence.  cohesion is not as strong with nodes of different allegiances.
the strong the cohesion, the more influence you have over someone.
the sum of all cohesion is your total influence worldwide.
the sum of all cohesion within just your parent nodes is the local influence.

your influence is based on how many people are in an allegiance you belong to and how well you rank in the allegiance.

Everything you do for an allegiance adds to it total influence.  When you do things against the allegiance, it subtracts from the total influence.  Once you reach zero or negative for the allegiance, you can no longer effect the influence of that allegiance.
Senority takes over when allegiance values are equal.  allegiance values are updated for the current parent nodes at the same time.

when a node enters or leave region, the allegiance values of parent nodes are updated for the previous region and the new region. 

Working for the enemy of the allegiance doesn't subtract for the allegiance until you're caught. (you can become a spy)
You can get caught by other spies working for the other side.  Communication delay is in effect.  So you could always kill this guy before he spreads the info.

To have influence over an individual node it is the same.  Everyone gives allegiance to individuals.  When you give allegiance to an individual, you become the friend or lover. Some personalities will be picky about your friends or insist on being your only lover. Its difficult to love more then one individual or allegiance, but it is possible.  All you have to do is devote a high percentage of your influence to these nodes.   You can buy them things, talk with them or do quests for them.  Eventually they will realize your commitment and might become your lover.   Lovers can produce children which allows you to evolve your character.  Your children also add to your influence if you take care of them.  Your lover will not be able to travel with you while they are pregnant.  If you are the female yourself,  you'll lose control of that character while they are taking care of the baby.  So you have to provide income and shelter for the family during this time.  The father can be an AI character.  so selecting the right father is important.  You can also influence him to do a better job.   Each node keeps a record of their allegiance to all other individual nodes they share time with. 

So AI randomly finds or intentionally looks for other compatible nodes to share time with.  The details of conversation aren't important offscreen.  Onscreen, conversations are shown based on the nature of the relationship.  In general, all conversations are either neutral or changing your allegience to groups and individuals.  Always based on emotions and personalities. 

each race has their own conversation personalities -  The player types keywords which build a sentance -  there is word auto-complete that helps you with spelling.  This lets you have a realistic conversation with the computer  you should be able to bring up previous questions for other characters as well.

It seems like everyone should be considered an ally of themselves and the people that follow them increase their own allegiances.
bob and mary are following george
joe is following mary which means joe is also following george 
when george does business his ally that is an enemy of mary, bob or joe, they all decide whether to continue following or start a conflict with george.  Initially, they may just disagree or warn you.  But if you follow through, they will leave or attack you based on emotional reactions and personality and other stats.


each peice of knowledge should have a size that it takes up, not all the same.  So taking on a new job, takes a huge amount of knowledge, you'd have to abandon the old job eventually.  To be able to remember more, you can focus on developing the knowledge stat higher.  this is done by converting short term memory to long term with repetition. Always better at some things then others

hold down R2 and select one of the 8 directions to choose the menu item - this can have multiple levels too..  then list view? or use the spiral code...


eventNode{ // this is generic object for events - each event would have their own class with the actual calculations.  they must inherit from this class so they share the same interface
 refCount
 vector<node> parcipatingNodes
 eventNode(){};
 getNodePriority(node aNode){
  // get emotion

  // get personality

  // get relevant stats to current objective

  // calculate and set the priority
  aNode->actualPriority
 }
 bool isRelatedNode(node aNode){
  if(related){
   return true;
  }
  return false;
 }

 foundNode(){
  //
 }
}




©2004-2022 GraspoftheFallen.com - All Rights Reserved. An RPG game under development by Bruce Kirkpatrick | Jetendo CMS | Web Design | Have comments? Email Me