Communication Mechanics, Interface and Engine

This page is a discussion of Communication Mechanics, Interface and Engine.

The Communication Mechanics, Interface and Engine is part of the larger Encounter Module, and is designed to handle all in-game ship-to-ship communications and conversations the player will have with alien lifeforms. As with the larger Encounter Module, the Communications Engine is similar to other modules within the game that handle basic data types (such as integers and strings) and hash tables / dictionaries. As mentioned, the Communications Engine is required by the Encounter Module, though there may be some other applications available in other modules (*such as the Lounge Starport sub-module*). Inter-species communication advances the plot, affects the player's reputation with other races, and provides the player with vital clues. The Communications Engine is therefore vitally important to the game (arguably, it is the **most** important piece of the entire game). All code for the Communications Engine is located with the Encounter Module in the encounter.py file.

## Summary Description

Communications are part of the Starship Module or Encounter Module, and utilize their Interfaces. Ship-to-ship communications are initiated during an encounter either when the player hails the lead ship of the encountered fleet or when they hail the player. After the initial hail, action continues until the other party involved responds, at which point communications are established. Communications halts all action within the encounter, puts an image of the other party in the MVS, and stops the internal game clock. The other party will be provided with information on the contents of the player's various cargo bays as well as the composition of their crew; this information may be used to trigger immediate effects (such as Elowan terminating communications immediately if the player has a Thrynn in their crew). The player may ask questions of varying categories, issue statements, and set their posture at will. Depending on how the player responds to questions from the encountered group and their posture, their reputation with the other group may improve or worsen (perhaps significantly depending on the circumstances). Either party may choose to end communications at almost any point, which will return game play to the current encounter. Any effects from communicating with an encountered group go into play immediately (so angering the other group may easily turn a previously peaceful encounter into a hostile one)

## Data Structure of the Comms\_Handler Object

The following list is an indication of the various variables and methods that will be included in a Comms\_Handler object. This list contains suggested methods and variables only. Comms\_Handler objects are meant to be used as children of the Encounter\_Handler object, loaded with the Encounter\_Handler object at the game's onset (thus, only one is meant to be used in the course of the game); the Comms\_Handler object has no child objects. Their data structure is as follows:

* Class: Comms\_Handler
	+ Hash/Dictionary: Comm\_Messages
		- *Key/String: Species Name*
		- Value/Dictionary: Specific Comms
			* Key/String: Categories
			* Value/Class: Comms
	+ Hash/Dictionary: Species\_Behaviors
		- *Key/String: Species Name*
		- Value/Class: Species\_behavior
	+ Integer: Temp\_Emo\_Index (emotional index counter)
	+ Integer: KNW\_Index (knowledge index; what this particular alien knows and does not know)
	+ Integer: End\_Counter (counts the number of messages displayed, to determine ending)
	+ Boolean: Surrendered? (Used if the other group has surrendered to the player)

## Data Structure of the Species\_behavior Object

The following list is an indication of the various variables and methods that will be included in a species\_behavior object. This list contains suggested variables included in the object. Species\_behavior objects are meant to be used as child objects of the Comms\_handler object and will have no child objects of their own. They will be used to hold information on the disposition of alien groups and set threshold conditions on communications in general. A species\_behavior object will be required for each starfaring species in the game; at the present time, this works out to about two dozen. They will be created and loaded when the Comms\_handler object is created at the game's onset. Their data structure is as follows:

* Class: species\_behavior
	+ String: Species (specifies the species involved)
	+ Integer: Base\_Emotion\_Index
	+ Float (2 decimals): Talkative\_Percentage
	+ List/Vector: Cat\_Thresholds
		- *Integer: Friendly to Neutral Threshold*
		- Integer: Neutral to Hostile Threshold
		- Integer: Hostile to End Threshold
	+ Float (2 decimals): Aggression\_Index (the ratio to where RSI changes the alien's behavior)
	+ Float (2 decimals): Surrender\_Percentage (the ratio of their TCSI to the player's at which the species will surrender).
	+ List/Vector: Forbidden\_Objects (a string list, contains objects that the player will be required to surrender to the alien or fight).
	+ List/Vector: Desired\_Objects (a string list, contains objects that the player may surrender to the alien or improve relations).
	+ Integer: Shield\_Up\_Reaction (the effect on base EI that having shields up around the aliens will impart).
	+ Integer: Weapons\_Armed\_Reaction (the effect on base EI that having weapons armed around the aliens will impart).

## Data Structure of the Comms Object

The following list is an indication of the various variables and methods that will be included in a comms object. This list contains suggested variables included in the object. Comms objects are meant to be used as direct child objects of the Comms\_handler object and will have no child objects of their own. They will be used to hold data relevant to a current communication, including information on what message to display next and how the display of that message will affect the other group's emotional index. A comm object will exist for every inter-ship communication possible in the game; they may be quite numerous. As currently intended, all comms objects will be created and loaded when the Comms\_handler object is created. Their data structure is as follows:

* Class: Comms
	+ Hass/Dictionary: Messages
		- *Key (Integer): ID Number*
		- Value (Tuple): Text Type, Posture, Lock Flag, Text of Message, Replies to Display, Next Message in Category, Effects

## Procedures and Notes

The following procedure originates from the original SF1 design document and incorporates notes from Zharous's design doc at starflt.com. SF3 will largely follow this same model (though for the sake of having it available to us and not necessarily having to repeat code, compatibility with the "Gossip" objects from the Lounge module will be included. In fact, the two may ultimately be incorporated into one another, given their similar in-game functions). The only major addition to the procedure from the original SF1 design will be a check for forbidden and desired items from the alien at the onset of communications; detection of these items will lead immediately to a question from the alien, either demanding or requesting the items detected. In a situation where both desired and forbidden items are detected, priority will be given to the forbidden item effects. Note that either lists may include races represented in the crew of the player's fleet. A procedure for the future playback of messages similar to that seen in SF2 will also be added to this procedure.

### Introduction

The function of this module is to simulate a conversation between the player and an alien for information gathering and entertainment.

### How Communications are Established

If the player wishes to establish communications he selects the the "HAIL/RESPOND" option on the Communications Officer Menu. Either the player or the computer-controlled alien may attempt to Hail, but communications are not established until the other party responds. When communications are established a picture of the alien appears in the main view screen and the game will check the keys of the Player object's Comm\_Playback dictionary; if there are six keys, the oldest is popped out. A new key is created for the current conversation based on the name of the species encountered and the current date. The game will keep a record of what both parties say during the subsequent conversation, formatting the player's statements and questions to appear in a different color than the aliens, and placing newlines at the end of each recorded statement.

### How Communications are Terminated

The player terminates communication by selecting the "TERMINATE" option on the Communication Menu. The alien will terminate communication for a variety of reasons. When communications are terminated, the message "-COMMUNICATION TERMINATED-" is displayed. Once communications have been terminated it cannot be re-established during the same alien encounter. The alien will either flee or attack after this point; no other actions will take place. If the player selects the "HAIL" option after communications are terminated the player's hailing message is sent but there will be no alien response. If after 1-3 alien hails are ignored, again the alien will either flee or attack.

When communications are terminated, the game will stop recording messages and store the current conversation in the Player object's Comm\_Playback dictionary under the pre-determined key.

### How the Personality of the Alien affects Communication

The Emotional Disposition Level (EDL) of the alien determines the posture the alien adopts when making a statement or asking a question. The EDL is a variable which fluctuates during the conversation and may have a value from 0 to 100, where 0 is most calm and 100 is most agitated.

The EDL range is divided into 4 posture regions demarcated by threshold markers A thru C. The posture regions are defined as follows:

**Posture Regions**
 C to 100 | Fight/Flight | (No Communication) | Bright Red

The "personality" of each class of aliens is partially defined by the placement of the posture threshold markers which subdivide the EDL range. The alien's current posture is determined by comparing where his current EDL is relative to his EDL thresholds AND determining whether he will be Hostile or Obsequious while in region B to C (See "How Player Strength affects Alien Posture").

Most alien races have a default emotional index in the diplomatic or neutral range to begin with and will modify this index based on the player's actions. Different actions such as posture, response to questions, player's shield and weapon status, etc. will modify this value during the encounter. The thresholds between ranges will vary between alien races, and not all aliens necessarily will even use some of these ranges. Actions which modify the emotional index have different values for different alien races. For example to one alien race raising shields and arming weapons is a negative action raising the emotional index, to others it is considered a neutral or even positive action. All actions have a value of X points +/- to the aliens emotional index. Negative actions always move the emotional index a greater distance than positive actions, because it is always easier to annoy someone then is to make friends with them.

Each race through the game will maintain a certain emotional index (which will be stored along with the rest of the player's data). When that race is encountered that emotional index is copied to the temporary emotional index for that particular encounter. After that encounter ends, the difference between the temporary emotional index and the stored emotional index is calculated and then halved. This is then applied to the stored emotional index for that race. This makes drastic emotional changes muted when dealing with an entire alien race. For example if the player has finally convinced a particular alien to be friendly, the next encounter may be diplomatic again but will be easier turn into a friendly encounter. If the player fires upon a friendly race, making that encounter shift into the fight emotional index, the next encounter may be diplomatic or hostile, but will not automatically be set in the fight range immediately if the player was formally on friendly terms. This creates more of a realistic sense of reputation.

CHANGES TO THE EMOTIONAL INDEX

* scripted changes set the temporary emotional index for this encounter to a flat reading. For example giving nid berries to the Dweenle will set their posture to friendly no matter what it was before.
* posture changes. This is what affect the players chosen posture (friendly, hostile, obsequious) has on the temporary emotional index. This value is typically small and is applied every time the player makes a hail (emotional index + 5 \* posture value), a statement in a certain posture (emotional index + 1 \* posture value) or a question (emotional index + 1/2 \* posture value). An example would be friendly = -2, obsequious = -3, hostile = 10. A friendly question would move the index one points to the left, a friendly statement would move the index two points to the left, and a hostile question would move the index five points to the right.
* shields raised or weapons armed status. If the alien race checks for one or both of these, these flags act as thresholds to the alien's temporary emotional index. If the alien is already beyond this threshold they are emotional index is " pulled back" to the threshold as long as the condition exists. For example the Humana Humana may not become friendly if shields are up and/or weapons are armed. The inverse of these conditions can also be checked. For example the G'nunk may have their emotional index set to hostile if shields and weapons are not raised and armed.
* Alien yes/no questions contain a specific emotional value to both the "yes" and "no" responses. These values are stored in the database with all text conversation and are applied when the player chooses an answer. The third choice, terminate, the alien will accept as a "no" response in addition to ending the conversation.
* firing on aliens in space or on the planet moves the emotional index a great deal more hostile for most aliens.

Friendly range unlocks special offers, use friendly conversation questions and answers database. Available questions and answers may greatly overlap neutral, hostile, and obsequious questions and answers but usually contain answers not possible to other postures. When a alien is in this posture they will typically

Diplomatic neutral or aloof questions and answers database. This set of answers to questions is typically smaller than other sets but will generally contain more questions. Again a subset or complete set of answers to questions in this posture may be shared with other postures.

Typically if the players ship(s) is stronger than the aliens, the alien will follow the lower side of the bar depending on their emotional index. This entails being obsequious instead of hostile or fleeing instead of fighting. Not all aliens are rational and some will require different ratios of strength before responding differently. For example one alien race may be cowardly and the fearful if the player strength is even close to theirs, while another alien race may require that the player's strength is twice of theirs before acting obsequiously, and another alien race may be suicidal and always at hostile no matter what the odds.

At fight or flight, no communication is possible. There still is many possible actions available here. The alien may either decide to attack, evaluate that the players ship is too strong and send out a distress call for more ships before attacking, or decide to flee. See conditions for surrendering. Most rational aliens have a threshold on their behavior between the hostile/obsequious and the fight/flight thresholds when the player's strength outmatches the alien's strength. Most aliens will give the player a chance to communicate and change their emotional index rather than flee outright indefinitely.

If the temporary emotional index is increased up to the fight/flight level the alien will terminate communications and perform the appropriate action based on the relative strength index. (described below)

If an alien race is in the fight/flight range a number of conditions may be used to trigger a surrender. One example would be if during a fight condition the relative strength index turned in favor of the player. Another condition may be if the player simply fires weapons at the alien. Another example would be if the alien decides on flight either before or during a battle and is unable to escape for a certain period of time. Cowardly aliens may surrender immediately upon evaluating that the player's strength is greater than theirs, while other aliens may never surrender. A surrendering vessel(s) may choose to either stop or continue fleeing, but on acceptance of a surrender by responding communication the surrendering vessel(s) will immediately stop moving and will lower shields and disarm weapons. Their posture will be set to the obsequious level and will not change the matter what you say to them in that particular conversation.

The player will be notified of the current "color status" during communications if and only if they have a Psychic Probe in their possession, located on the same ship as their player character.

### How Player Strength affects Alien Posture

The computer calculates the relative strength index between the players ship(s) and the aliens ship(s). This index determines the alien's actions when the alien's emotional index is in the hostile/obsequious or fight/flight range. Strength is populated by adding together the shields, armor, and most powerful weapon's strength of every ship on the player side and comparing it to the value obtained by adding together the similar values of all the alien ships. Only the strength of the one most powerful weapon that each ship is equipped is used for this measurement. Inoperative or destroyed equipment is ignored.

The "rational alien" will curb his tendency to be hostile when confronted with a stronger opponent until he can come to terms or escape. To simulate this, a comparison of the attack strengths of the player and the alien is made and modified by the aggressiveness of the alien to determine if the alien is HOSTILE or OBSEQUIOUS when his EDL is between the B and C threshold markers (see illustration above). This strength comparison results in a number called the STRENGTH-DIFFERENTIAL. If the STRENGTH-DIFFERENTIAL is positive (i.e. if the player is stronger), the OBSEQUIOUS posture is selected; if negative, the HOSTILE posture is selected. The formula for computing the STRENGTH-DIFFERENTIAL is as follows:

```
((( STRENGTH-DIFFERENTIAL = PLAYER-STRENGTH - (ALIEN-STRENGTH*(AGRESSION-LEVEL/5)),

   where: STRENGTH-DIFFENTIAL=player-alien strength comparison<br/>
          PLAYER-STRENGTH = player's current strength<br/>
          ALIEN-STRENGTH  = alien's current strength<br/>
          AGRESSION-LEVEL = alien's agressiveness as defined  in
                            the  "personality"  record  for   the
                            alien  ( see ORIGINATOR RECORD FORMAT
                            in TEXT DATA RECORDS)
)))

```

### How the Player Selects a Posture

The player has direct control over which posture he adopts by selecting it from a list of options on the communication menu. The player's posture remains in effect until he opts to change it. The player may adopt any posture but FIGHT/FLIGHT which isn't a communication posture.

### How Player Posture affects Alien Posture

Each class of aliens has, as part of it's "personality" record, a constant for each of the possible postures that the player can adopt which is applied to the alien's EDL when the player issues a statement or question. This constant is called the "Player Posture Effect" (PPE). The rules for applying the Player Posture Effect to the alien's current EDL are as follows:

1. If the player issues a statement: DELTA-EDL = PPE \* (1/(#-THIS-POSTURE + 1))
2. If the player issues a question: DELTA EDL = {PPE \* (1/(#-THIS-POSTURE + 1))}/2,

```
((( where: DELTA-EDL = the amount added to the current EDL<br/>
            PPE = the Player Posture Effect associated with the player's current posture.<br/>
            #-THIS-POSTURE = a count of the phrases issued by the player since he selected his current posture.
)))

```

### How Player Responses to Alien Questions affect Alien Posture

Aliens can either issue statements, respond to player questions or ask the player a yes/no question. If the alien asks the player a yes/no question the following rules apply:

1. The player can select either "yes" or "no" or ignore the question.
2. If the alien becomes impatient (the phrase interval has elapsed) while waiting for the player to respond, the alien will send a "What is your answer?" type phrase.
3. If the alien tires of waiting after prompting the player with a "What is your answer?" type phrase, the alien will assume a "no" response to the pending yes/no question.

Each phrase has an EDL Effect for both "yes" and "no" responses which is simply added to the alien's EDL. (see PHRASE CONTROL RECORD FORMAT in TEXT DATA RECORDS).

### What is the Phrase Interval?

The Phrase Interval is the amount of time that the phrase display routine will wait after displaying a phrase before the next phrase can be displayed. The real time clock is used for the timing of this interval. When the player sends a phrase, the Phrase Interval for the previous phrase is set to the minimum, 2 seconds. The alien cannot issue any phrases until after the Phrase Interval for the last phrase has elapsed.

The value of the Phrase Interval for each type of phrase is as follows:

**Phrase Intervals**
 Player: Question | 2

### How does the Alien's talkativeness affect Conversation Flow?

Each class of aliens has a Talkativeness Percentage as part of their "personality" record. The Talkativeness Percentage controls the likelihood that the alien will issue or answer a hailing request. The alien will send a hailing phrase if a random number between 1 and 100 falls below it's Talkativeness Percentage. Once communications have been established, the Talkativeness Percentage for all aliens is 70%. This figure influences the frequency of alien conversation lags, where he sends no phrase.

### Why an Alien Terminates a Conversation

An alien will terminate a conversation when one of the following cases occurs:

1. TOO AGITATED TO TALK - this occurs when the alien's EDL increases to the point where the FIGHT/FLIGHT posture is selected.
2. TIRED OF TALKING - this occurs when the number of alien phrases given equals the number of phrases allowed for the conversation. When the conversation is initiated a maximum number of alien phrases for the conversation is computed by selecting a random number in the range determined by the alien's initial posture, where:

**Number of Alien Phrases per Conversation**
 HOSTILE | 2 | 5

### What are the Player's Options?

The illustration below shows the options available to the player throughout the communication procedure.

### How Alien Languages are Simulated

To simulate that the player is communicating with an alien race, all or none of each phrase originated by the alien will be scrambled. (All player initiated phrases are displayed in an un-scrambled form.) The factors which control the scrambling of alien phrases are as follows:

1. All phrases will be un-scrambled if any member of the player's crew is the same race as the race of the alien.
2. The setting of flag SCRAMBLE in the alien's "personality" record.
3. The skill level of the communications officer, where the percentage of unscrambled words is equal to %UNSCRAMBLED = COMM-OFFICER-SKILL \* 2

Scrambled words are replaced with words composed of a random number of syllables (from 1 to the maximum for that alien class) selected from a Syllabary Table characteristic of that race. (See Text Data Record Format document; note that this method was found unacceptable in the first Alpha of SF1. For SF3, a set of "garbage" may ultimately be set up using a method similar to the onomastikon code). The phrase frequency bytes is incremented only for phrases given entirely un-scrambled.

*COMMUNICATION OFFICER SKILL*

* Effective Skill = officer's skill + (50 if comm officer is same race as alien) or (25 if crew member is same race as alien
* Effective Skill = 250 if communicating with spemin and the whining orb is on board.
* Percent unscrambled = Effective skill / 250
* Scrambled words are replaced with words composed of a random number of syllables (from 1 to the maximum for that alien class) selected from a Syllabary Table characteristic of that race.

### How Alien decides what Type of Phrase to Send

If the player has asked the alien for information:

1. A check is made for phrases in the alien's phrase pool that match the question topic and whose frequency counts don't exceed the frequency limit for the phrase.
2. If a phrase is not found, send an "I don't know phrase".
3. If more than one phrase exists for the topic select the one with the lowest frequency count.

For each encounter with scout ship(s) three out of five question databases will have a random lock somewhere between 50% and 100% down the list of answers. If the pointer reaches us this lock or is already below this lock then the alien will respond to this particular question with a "I don't know" answer. The pointer will not move so repeated attempts to ask the same question will not change this answer. For war or transport ship(s) only one out of the five question databases will have a lock.

If the alien can initiate a phrase:

1. If a random number between 1 and 100 falls in the region above 70, the alien doesn't send a phrase but sets the phrase interval for a conversation lag.
2. else, build a list of the least frequently given phrases and randomly select from amoung that list.
3. if no phrase is found with a frequency count less than the frequency limit, issue a conversation lag.

## XML

The Communications Engine, like most of the other modules in the game, is largely XML driven; this will help keep it flexible up until SF3's design is finalized (i.e. individual comm messages can be added and removed from the game freely and alien behavioral thresholds modified, based upon what data is available in the XML files). The Communications Engine requires two different types of XML files, one containing information on how various species behave in encounter (the species\_behavior.xml file) and the other containing information on the corresponding communications messages (the (species)\_comm\_messages.xml files). The following briefly goes over what data is located in these XML files.

### (species)\_comm\_messages.xml

The (species)\_comm\_messages.xml files are designed as a repository for communications messages for individual races, which include a number of main messages and may also include a number of pre-programmed responses and further communicative actions. They are designed with much the same structure as gossip messages in the Lounge Module (see that page for further details), though they are not intended to be quite as interactive under most circumstances. Under the root element, entries in the XML file are elements named "message". Message elements must contain an "id" attribute, which can be used by the Event and Plot Handler and the to make specific messages available to the player. Message elements may contain one or more empty sub-elements of the type "msg". Each msg sub-element may contain the following attributes:

* **id**: Used to identify a particular piece of text within a set of messages. This is mandatory, and must be set equal to an integer. The first message to be displayed must be set equal to one.
* **type**: This contains the intent of the text. This is a mandatory attribute and must be set equal to one of the following values:
	+ *hail*: This indicates the message is a statement given by the other party to the player in order to establish communications. The other party has acted first in this case.
	+ *response*: This indicates the message is a statement given by the other party to the player in order to establish communications. The player has acted first in this case.
	+ *statement*: This indicates the message is a statement the other party may issue to the player. Generally, this is used as an indicator of the other's party's present mood.
	+ *end*: This indicates the message is a statement the other party may issue to the player when terminating communications. Again, this is used as an indicator of the other's party's present mood.
	+ *themselves*: This indicates the message is a response to a question asking for details on the other party's own race.
	+ *races*: This indicates the message is a response to a question asking for information on other races that the other party knows about.
	+ *history*: This indicates the message is a response to a question asking the other party about regional history.
	+ *trade*: This indicates the message is a response to a question asking the other party about trade information in the area.
	+ *info*: This indicates the message is a response to a question asking the other party for non-specific information.
	+ *question*: This indicates the message is a question the other party may ask the player. This option generally requires the selection of one or more "replies" attributes with the message.
	+ *reply*: Used as a selection option for the player, allowing them to decide how they'll respond to the initial message.
* **posture**: This contains the current posture under which the other party must be in order to issue the message. This must be set equal to either "friendly", "neutral", "obsequious", or "hostile". If this attribute is missing, the game will use the message regardless of the other party's posture.
	+ *friendly*: The message will be issued if the other party's ECL is in the 0 to A range.
	+ *neutral*: The message will be issued if the other party's ECL is in the A to B range.
	+ *obsequious*: The message will be issued if the other party's ECL is in the B to C range and the player's fleet is stronger than the other party's.
	+ *hostile*: The message will be issued if the other party's ECL is in the B to C range and the player's fleet is weaker than or equal in strength to the other party's.
* **event**: This is used to trigger a specific event when the message appears on screen. May not be used with type="reply" sub-elements. The event will need to be pre-programmed into the Event and Plot Handler (see that page for more information).
* **replies**: This is used to contain the id numbers of the messages to display as replies once the current message has been displayed on screen. May not be used with a type="reply" attribute.
* **nextMsg**: This is used to determine which message appears next, once the player has selected the current message as an option; it is also used to set the next response in a given category. Setting this value equal to 0 signals the engine to terminate communications immediately.
* **text**: This contains the actual text of the message or reply, and is (obviously) mandatory.

Sample structure of the (species)\_comm\_messages.xml file:

```

<?xml version="1.0" encoding="UTF-8"?>
 <root table-name="veloxi_comm_messages" version="0.1">
  <message>
   <msg id="1" type="hail" posture="neutral" text="MOST HARMONIOUS GREETINGS. US IS ILLUSTRIOUS VELOXI. PLEASE NOW THE IDENTIFYING, I<br/>   THINK SO."/>
  <message/>
  <message>
   <msg id="5" type="hail" posture="friendly" text="THE HAPPINESS OF SEEING AGAIN THE SLIGHTLY DISGUSTING ALIEN FRIENDS. EXTREME<br/>   DELIGHTFUL."/>
  <message/>
  <message>
   <msg id="9" type="hail" posture="hostile" text="OF COURSE US IS VELOXI. NOW PREPARING TO DYING, YOU THE EVIL TRESPASSERS OF VELOXI<br/>   GRAND LOVELY."/>
  <message/>
  <message>
   <msg id="12" type="hail" posture="obsequious" text="WE IS VELOXI YOUR BEST FRIEND. PLEASE NOT TO DESTROYING US, BEST GOOD ALIENS A UGLY.<br/>   US IS SURRENDER."/>
  <message/>
  <message>
   <msg id="15" type="statement" posture="neutral" text="IF YOU IS SHOWING PROPER RESPECT FOR DISTINGUISHED VELOXI CHARMING THEN EVERYONE<br/>   IS HAPPY AS BIVALVE MOLLUSK."/>
  <message/>
  <message>
   <msg id="23" type="statement" posture="hostile" text="YOU IS COOPERATING WITH VELOXI JIM DANDY AND MAYBE WE IS NICE GUY THE<br/>   NOT KILLING YOU."/>
  <message/>
  <message>
   <msg id="35" type="question" reply="101, 102" text="IS THE YOU ALIEN PART OF OLD EMPIRE?"/>
   <msg id="101" type="reply" event="adjustRep, 5" text="YES"/>
  <message/>
  <message>
   <msg id="44" type="end" posture="hostile" nextMsg="0" text="YOU IS NOW THE DYING, ALIEN BARBARIAN THE UGLY. I THINK YOU THE SUCK."/>
  <message/>
  <message>
   <msg id="45" type="themselves" nextMsg="46" text="The best of questions and happily answering. We Veloxi is ancient and prestige.<br/>   Illustrious Veloxi empire too old the imagine. Us is civilized the most."/>
  <message/>
  <message>
   <msg id="53" type="races" nextMsg="54" text="Other races small important. Veloxi are number one importance. Other races not even<br/>   knowing prophecy of egg. Barbarians certainly."/>
  <message/>
  <message>
   <msg id="66" type="history" nextMsg="67" text="Veloxi is extreme delightful the old empire was wiped up. The empire was many scoundrel<br/>   activity too naughty"/>
  <message/>
  <message>
   <msg id="86" type="info" nextMsg="87" text="We are receiving old empire distress call from system 175,94. Of course Veloxi could<br/>   caring less."/>
  <message/>
 </root>

```

### species\_behavior.xml

The species\_behavior.xml file is designed to be a pre-programmed record of the disposition of various sapient races, determining how easily they become agitated or friendly depending on the player's choices during communications. Under the root element, entries in the XML file are empty elements named "species". Speices elements contain the following attributes, all of which are mandatory except where noted.:

* **name**: This identifies the name of the species. This needs to be the same as the species identifier used by the Encounter Module.
* **bei**: The Base Emotion Index, this identifies the initial disposition of the species towards the player at the onset of the game.
* **talk**: The talkative percentage. This determines how often and how many messages a species will send before deciding to terminate communications.
* **a**: The "a" threshold level (the threshold below which the species is friendly and above which it is neutral). This needs to be a number between 1-100
* **b**: The "b" threshold level (the threshold below which the species is neutral and above which it is hostile or obsequious). This needs to be a number between 1-100
* **c**: The "c" threshold level (the threshold below which the species is hostile or obsequious and above which it is too agitated to talk). This needs to be a number between 1-100.
* **aggression**: The species aggression index. This determines how easily the species is provoked.
* **surrender**: This is the ratio of the species TCSI to the player's at which the species will surrender.
* **forbidden**: This is a list of objects (seperated by commas) that the player will be required to surrender to the alien or face a fight. This attribute is not mandatory.
* **desired**: This is a list of objects (seperated by commas) that the player may surrender to vastly improve relations. This attribute is not mandatory.
* **barrier**: This describes an event that must occur in order for the player to cross a barrier. Barriers have three parts, seperated by commas:
	+ *Threshold*: This indicates which barrier is affected.
	+ *Above or Below*: This indicates whether the range above or below the threshold is locked,.
	+ *Unlocking Conditions*: This describes the event that will unlock the condition, as well as any other immediate effects.
* **shields**: This is a modifier to the species EDL that is accounted for if the player has their shields up.
* **weapons**: This is a modifier to the species EDL that is accounted for if the player has their weapons armed.

Sample structure of the species\_behavior.xml file:

```

<?xml version="1.0" encoding="UTF-8"?>
 <root table-name="species_behavior" version="0.1">
  <species name="Empire" bei="30" talk=".50" a="35" b="70" c="90" aggression=".05" surrender=".10" forbidden="Endurium, Headfruit"<br/>  barrier="c, above, firedUpon=True" shield=".05" weapon=".25"/>
  <species name="Thrynn" bei=45 talk=".30" a="25" b="50" c="75" aggression=".15" surrender=".05" forbidden="Crew/Elowan" shield=".04"<br/>  weapon=".08"/>
  <species name="Dweenle" bei="50" talk=".15" a="10" b="50" c="99" aggression=".01" surrender=".25" desired="Nid Berry Bush" <br/>  barrier="c, above, None" barrier="a, below, desired" shield=".05" weapon=".05"/>
  <species name="G'Nunk" bei="95" talk=".35" a="25" b="50" c="75" aggression=".25" surrender=".00" barrier="c, below,killScore<20"<br/>  shield="-.01" weapon="-.01"/>
 </root>

```

## Module Status

*This is current as of 5/26/2011.*

This module is currently in the final design phases; while specific descriptions of the intended functions of modules have yet to be written, the remainder of the module's basic description is complete at this point. Further design work on this module has been frozen for the time being, and will remain so until I'm ready to begin method descriptions for all remaining extant modules.

NEXT: Miscellaneous Modules

PREVIOUS: Encounter Module

TOP