Using custom game time for FactionMember memory durations

Announcements, support questions, and discussion for Love/Hate.
User avatar
Tony Li
Posts: 20767
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using custom game time for FactionMember memory durations

Post by Tony Li »

tylerwsavatronix wrote:It sounds like #2 is only a temporary measure until the next release; do you have a rough ETA on that (If it's in the next few weeks then I can probably wait on that step specifically).
I'm going to try to get the next release out in a few weeks, but you can go ahead and make the change yourself right now, just in case my timeline slips. It's FactionMember.cs line 351:

Code: Select all

if (m_currentMemoryCleanupFrequency != m_currentWaitForSecondsValue)
{
    if (Mathf.Approximately(0, memoryCleanupFrequency)) yield break; //<--ADD THIS LINE.   
This way you can move ahead without waiting for the next release. (My timeline may actually slip on this one because several educational institutions have asked for a non-commercial DLL-only academic version similar to what's available for the Dialogue System. It requires a little extra work to set everything up so it's all cross-compatible between DLL and source versions.)
tylerwsavatronix wrote:For Gossip and Aura I'm assuming we'll need to take similar steps as with Greeting (implement an AbstractXTrigger), is that accurate?
Yes, something like:

CustomGossipTrigger.cs:

Code: Select all

using UnityEngine;
using PixelCrushers.LoveHate;

public class GossipTrigger : AbstractGossipTrigger {
    void Awake() {
        timeBetweenGossip = 0; // We'll handle this manually.
    }

    private void OnTriggerEnter(Collider other) {
        if (/*your condition*/) TryGossip(GetFactionMember(other.gameObject));
    }
} 
tylerwsavatronix wrote:I think we are going to use StabalizePAD (at least initially, need to see it in action and do some prototyping of our personalities and see them in action). I haven't looked too much into it, but it looks like if we'll just need to set the ChangeRate for each one and treat it as days.
Mostly. StabilizePAD runs every frame (in Update) and observes GameTime.deltaTime. Let's say you want a character's Arousal to stabilize toward a target value over 24 hours, jumping toward the target at noon and sleep time. Here are the steps:

1. Set Arousal Settings > Change Rate to 100. In your context, this means fully reaching the target in 1 day.

2. For one frame at noon, set GameTime.deltaTime to 0.5f. In your context, this means half the day has passed.

3. For one frame when the character goes to sleep, set GameTime.deltaTime to 0.5f.

At all other times, leave GameTime.deltaTime at 0.

If you want the character to take 4 days to stabilize its Arousal, set Change Rate to 25.
tylerwsavatronix
Posts: 33
Joined: Tue Jul 05, 2016 6:18 pm

Re: Using custom game time for FactionMember memory durations

Post by tylerwsavatronix »

Thanks!
tylerwsavatronix
Posts: 33
Joined: Tue Jul 05, 2016 6:18 pm

Re: Using custom game time for FactionMember memory durations

Post by tylerwsavatronix »

Hey, I know it's been a while but I'm just now getting around to this particular functionality (had to push it to get some other things done).

Will taking manual control of GameTime mess anything up with Dialogue System (I noticed GameTime was under the common PixelCrushers namespace, and so assume it may be used by both systems)?
User avatar
Tony Li
Posts: 20767
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using custom game time for FactionMember memory durations

Post by Tony Li »

The Dialogue System predates GameTime. It works off a separate UnityEngine.Time wrapper called DialogueTime. So you can take control of GameTime without affecting the Dialogue System.
tylerwsavatronix
Posts: 33
Joined: Tue Jul 05, 2016 6:18 pm

Re: Using custom game time for FactionMember memory durations

Post by tylerwsavatronix »

Thanks! That's a load of worry off my chest.
Post Reply