Today I started the bulk of the work involved in porting the Netlogo model to Unity. Organisation was one of the biggest problems with Netlogo, Unity should solve some of those problems. However I am also adapting to a new piece of software so I sure I'll make some questionable organisation decisions along the way.
Firstly I'm grouping all the relevant objects inside parent classes so I can easily loop through every person and occupation. This is equal to the command "ask people" or "ask occupations" in Netlogo. Doing some research this seems the best way to do things, as I can simply get all children from the associated parent class.
Each Person prefab has a PersonStats script which contains all the relevant information for the individual. To represent emotions I chose four variables Stress, Confidence, Happiness and Temper. So far I'm unsure how exactly I'm going to use these. High Stress and Temper levels will result in more extreme activity. Happiness and Confidence will factor into how those Stress and Temper levels go up and down. Finally each person will have a "state" which changes based on those four levels, which influences how they act around other people. This state will act used in a finite state machine.
No comments:
Post a Comment