Game Development Reference
'These variability parameters are tunable!
thisNeed.value = 21 - getDx(41)
net += thisNeed.value
'Everyone has a net of zero; adjust a random need.
'Net of zero is another tuning parameter!
If Needs.Count > 0 Then
'Get the random need.
thisNeed = CType(PersonalNeeds(getDx(Needs.Count)), NVP)
'Adjust it to make our net be zero.
thisNeed.value -= net
Debug.WriteLine("cannot create SetOfNeeds: No needs in database.")
'Give a person a set of individual preferences.
'Preferences run from -2 to +2.
Public Function SetOfPreferences() As Collection
Dim PersonalPreferences As New Collection
Dim Activity As String
For Each Activity In ActivityNames
Dim thisPreference As New NVP
thisPreference.name = Activity
'The variability here is a tuning parameter.
'Five minus three gives -2 to +2.
thisPreference.value = getDx(5) - 3
'Seven minus four gives -3 to +3.
'thisPreference.value = getDx(7) - 4
Note in the comments where it calls out the tunable parameters. Initial values for
needs are restricted to 20 to þ 20 in range, except that a random need is forced
to yield a net of zero. Both the range and the net of zero are tunable and will make
a difference in the simulation. Recall that we give a bonus to relationships if both
parties have an unmet need that the activity in question satisfies. If we move the
balance point up from zero, that bonus becomes less likely. If we make the net
sum of the need values a negative number, the bonus will become more likely; if