Game Development Reference
In-Depth Information
'Dump a single relationship.
Private Sub DumpRelationship(ByVal PersonA As Person, _
ByVal PersonB As Person)
'How compatible are these people?
Dim compatibility As Integer = 0
Dim activity As String
For Each activity In MDB.ActivityList
'Use their preferences to add to their score.
compatibility += PersonA.Likes(activity) * PersonB.Likes(activity)
Next
Debug.WriteLine("[C: " & compatibility.ToString & ", R+R: " & _
(PersonA.CurrentRelationship(PersonB.Name) + _
PersonB.CurrentRelationship(PersonA.Name)).ToString & "] " & _
PersonA.Name & " (" & _
PersonA.CurrentRelationship(PersonB.Name).ToString & ") (" & _
PersonB.CurrentRelationship(PersonA.Name).ToString & ") " & _
PersonB.Name)
End Sub
Run the code in the debugger and click the Dump button. In the Immediate
window, you will see blocks of data, one block per person. The block begins with
the person's own internal statistics. Let us look at an example:
Taylor[ -14 -13 27 ] View=9 Op=1.89; tennis=2 swimming=1 ...
The string begins with the person's name. In square brackets are the three need
values for exercise, culture, and dining, in that order. View is the numeric sum of
the person's preferences. Taylor in this run is a pretty positive person, since the
expected value is 0. The next value is how opinionated the person is. Taylor in
this run is modestly opinionated. Remember that opinionated values are com-
puted as the average of the squares of the preferences. As a result, strongly
opinionated people have a value above 2 and approaching 3. Following that is a
list of the person's personal preference values.
After the person's own statistics are his relationship statistics. Without interac-
tions, only the compatibility number has a value. Let us look at the output and go
through it.
[C: -7, R+R: 0] Taylor (0) (0) Morrill
The first value in square brackets is the mutual compatibility score. The second
value is the sum of their individual relationship scores. Taylor and Morrill are
 
Search Nedrilad ::




Custom Search