Game Development Reference
In-Depth Information
'These variability parameters are tunable!
thisNeed.value = 21 - getDx(41)
PersonalNeeds.Add(thisNeed, need)
net += thisNeed.value
Next
'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
Else
Debug.WriteLine("cannot create SetOfNeeds: No needs in database.")
End If
Return PersonalNeeds
End Function
'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
PersonalPreferences.Add(thisPreference, Activity)
Next
Return PersonalPreferences
End Function
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
Search Nedrilad ::




Custom Search