Table of Contents

Method ClearThoughts

Namespace
GrindFest
Assembly
GrindFest.dll

ClearThoughts()

Clears the conversation history for AI interactions, starting fresh without previous context.

public static void ClearThoughts()

Remarks

Use this method when you want the AI to forget previous conversations and start thinking with a clean slate. This can be useful when:

  • Switching to a completely different task or strategy
  • The conversation has become too long and affecting performance
  • You want to reset the AI's understanding of the current situation
Reset AI when changing areas:
public override void Hero.OnEnterArea(AreaBehaviour area)
{
    Hero.ClearThoughts(); // Start fresh thinking in new area
    Think("I've entered a new area. What should I do here?").ContinueOnMainThread(response => {
        Hero.Say(response);
    });
}
Advantage of persistent conversation - strategic planning:
// WITH conversation memory - AI builds coherent strategy:
Think("I'm about to enter a dangerous boss room with 3 elite enemies").ContinueOnMainThread(response => {
    Hero.Say(response); // "You should prepare carefully - check your potions and plan escape routes"
Think("I have 5 health potions and 2 mana potions").ContinueOnMainThread(response2 => {
    Hero.Say(response2); // "Good, that should be enough. Focus on the archer first since you're a melee fighter"

    Think("The archer is dead, what's my next priority?").ContinueOnMainThread(response3 => {
        Hero.Say(response3); // "Perfect! Now handle the warrior while keeping distance from the mage we discussed"
    });
});

});

// WITHOUT conversation memory (after Hero.ClearThoughts) - AI has no context: Hero.ClearThoughts(); Think("The archer is dead, what's my next priority?").ContinueOnMainThread(response => { Hero.Say(response); // "I don't know what archer you mean or what situation you're in. Need more context." });