Tuesday, November 22, 2016

Test

hey all, This is mostly just a test to see if I can get my C# code to show up.
    [Range(0, 100)]
    float hunger;
    [Range(0, 100)]
    float tiredness;
    [Range(0, 100)]
    float thirst;
    [Range(0, 100)]
    float lust;
    [Range(0, 100)]
    float warmth;

I originally started with something like the above.But as I thought more about it, I realized that a struct is probably closer to what is needed.

PhysicalNeed[] needs = new PhysicalNeed[6];

public struct PhysicalNeed
{
    [Range(0, 100)]
    float severity;
    float changeRate;
    PhysicalNeedType type;
}

public enum PhysicalNeedType
{
    Food,
    Hydration,
    Rest,
    Sex,
    Comfort,
    Cleanliness
}

Upon starting, the array of physical needs needs to be initialized, and during each update loop, the NPC's physical needs are updated depending on the NPC's physical state: if the NPC is sleeping, the need for rest will decrease, while if working, all the needs will slowly increase.

I also have some callbacks setup between the PhysicalState class and the Mood class, so that whenever the PhysicalState class is updated, it will update the NPC's mood.

No comments:

Post a Comment