Hanako Games

News, Walkthroughs, and Chat about Anime Games

Mood Management (Weekend Activities)


Rhidian

Mood Management (Weekend Activities)

#1 by Rhidian - Jun 18 2012

After a lot of trial and error, I have managed to make a (Java) program that is able to print out all the various activities you can do to get from Mood A to Mood B, within any given number of weeks.

I'll say this now: The program I made ignores any and all mood changes that might occur from the storyline

A list of what moods affect what skills is listed in Atarun's thread here:
Moods Impact


Until I figure out how to put it up on a website (if I ever get around to doing so), I'll be taking requests either here or via PM.

The information that I would need to give a useful result is the following:
1. What values are your current moods at? Given that there are 4 spectrums of moods, and taking upwards as the positive direction (and the middle as 0), you'll need to give me 4 numbers.

Example: If I was fully angry, and 0 everything else, I would use {5, 0, 0, 0}, whereas if I were fully afraid, it would be {-5, 0, 0, 0}

2. What mood are you wanting to become?

3. (Optional) Within how many weeks? Generally a lower number has better accuracy. If none is provided, I'll provide up to 2-3 weeks (or whatever the lowest amount needed is).

4. (Optional) Let me know if you have access to any of the unlockable activities, like sports, hunting, ballroom dancing, and the treasury.

I'll probably work out a better way to do this later (when I'm less sleep deprived Cool ). And on an unrelated note, to those who have been PM'ing me about it... I'm not passing out any debugger codes right now to anyone.

Rhidian

#2 by Rhidian - Jun 26 2012

No one has PM'd me, which means no one is really interested in finding out the various mood paths.

But for those who are interested about what I made, here is the source code (in Java) Cool
public class moodNode {
    static int[] attend = {0,-1,-2,1};
    static int[] explore = {-1,0,0,-1};
    static int[] tomb = {-1,-1,0,0};
    static int[] walk = {0, 1, 0, -1};
    static int[] sneak = {0,0,2,-1};
    static int[] play = {0,1,-1,-1};
    
    static int[] servAng = {-1,0,0,0};
    static int[] servAfr = {1,0,0,0};
    static int[] servChe = {0,-1,0,0};
    static int[] servDep = {0,1,0,0};
    
    static int[] dungWil = {1,0,1,0};
    static int[] dungYie = {-1,0,-1,0};
    
    static int[] huntAng = {-2,1,0,0};
    static int[] huntAfr = {2, -1, 0, 0};
    
    static int[] sports = {1, 0, 0, 0};
    static int[] ball = {0, 0, 0, 1};
    static int[] treasury = {0, 0, 1, 0};
    
    static String desiredMood;
	static int maxIter;
    
    public moodNode(){
        
    }
    public moodNode(String des){
        desiredMood = des;
    }
   
    //Recursive function
    public void findPath(int[] curr, int[] addition, String pth, int iter){
        int[] current = addArrays(curr, addition);
        current = addArrays(current, addition); //Update the current mood values
        int iteration = iter;
		
		//Output the result if you found the desired mood
        if (desiredMood.equalsIgnoreCase(getCurrentMood(current))){
            System.out.println(iteration + " " + pth);
        }
            
        int servFlag = 0;
        int dungFlag = 0;
        int huntFlag = 0;
        
        if (Math.abs(curr[0]) > Math.abs(curr[1])){
            if (curr[0] > 0)
                servFlag = 1; //Anger
            else
                servFlag = 2; //Afraid
        }
        else if (Math.abs(curr[0]) < Math.abs(curr[1])){
            if (curr[1] > 0)
                servFlag = 3; //Cheerful
            else
                servFlag = 4; //Depressed
        }
        
        if (curr[2] > 0)
            dungFlag = 1; //Willful
        else if (curr[2] < 0)
            dungFlag = 2; //Yielding
        
        if (curr[0] > 0)
            huntFlag = 1;
        else if (curr[0] < 0)
            huntFlag = 2;
        
        if (++iteration <= maxIter){
            findPath(current, attend, pth + " + Attend Court", iteration);
            findPath(current, explore, pth + " + Explore Castle", iteration);
            findPath(current, tomb, pth + " + Visit Tomb", iteration);
            findPath(current, walk, pth + " + Walk in Garden", iteration);
            findPath(current, sneak, pth + " + Sneak out", iteration);
            findPath(current, play, pth + " + Play with Toys", iteration);
        
            switch (servFlag){
                case 1:
                    findPath(current, servAng, pth + " + Attend service", iteration);
                    break;
                case 2:
                    findPath(current, servAfr, pth + " + Attend service", iteration);
                    break;
                case 3:
                    findPath(current, servChe, pth + " + Attend service", iteration);
                    break;
                case 4:
                    findPath(current, servDep, pth + " + Attend service", iteration);
                    break;
            }
            
            switch (dungFlag){
                case 1:
                    findPath(current, dungWil, pth + " + Visit Dungeons", iteration);
                    break;
                case 2:
                    findPath(current, dungYie, pth + " + Visit Dungeons", iteration);
                    break;
            }
            
            switch (huntFlag){
                case 1:
                    findPath(current, huntAng, pth + " + Hunting", iteration);
                    break;
                case 2:
                    findPath(current, huntAfr, pth + " + Hunting", iteration);
                    break;
            }
            
            findPath(current, treasury, pth + " + Visit Treasury", iteration);
            findPath(current, sports, pth + " + Sports", iteration);
            findPath(current, ball, pth + " + Attend Ball", iteration);
        }
    }
    
    public int[] addArrays(int[] first, int[] second){
        if (first.length != second.length){
            return null;
        }
        int[] temp = new int[first.length];
        
        for (int i = 0; i < first.length; i++){
            temp[i] = first[i] + second[i];
            
            if (temp[i] > 5)
                temp[i] = 5;
            
            if (temp[i] < -5)
                temp[i] = -5;
        }
        
        return temp;
    }
    
    public String getCurrentMood(int[] current){
        int ele = 0;
        int max = 0;
        for (int i = 0; i < current.length; i++){
            if (Math.abs(current[i]) > max){
                ele = i;
                max = Math.abs(current[i]);
            }                
        }
        
        if (max == 0)
            return "Neutral";
        
        switch (ele){
            case 0:
                if (current[ele] > 0)
                    return "Angry";
                else
                    return "Afraid";
            case 1:
                if (current[ele] > 0)
                    return "Cheerful";
                else
                    return "Depressed";
            case 2:
                if (current[ele] > 0)
                    return "Willful";
                else
                    return "Yielding";
            case 3:
                if (current[ele] > 0)
                    return "Pressured";
                else
                    return "Lonely";
            
        }
        
        return "Neutral";
    }
}

EightDeer

#3 by EightDeer - Jun 27 2012

Rhidian:

No one has PM'd me, which means no one is really interested in finding out the various mood paths.
It's not that no-one is interested in the mood paths, it's that having to PM you each and every time we want to perform a check is a right pain.

Rhidian

#4 by Rhidian - Jun 27 2012

That's true. Hopefully with the source code for a basic mood path finding program, the program-savvy folks will be able to use this any number of times that they want, or maybe even improve upon it Smile

With regards to incorporating the mood-changing events, it should be (somewhat) straightforward if you knew the changes beforehand. Just put the changes into a 2-dimensional array (iteration x 4), then simply make "current = addArrays(current, addition);" into something like "current = addArrays(addArrays(current,addition), changes[iteration]);"

Rhidian

#5 by Rhidian - Jun 27 2012

If you know the following information:
Elodie's current mood values at the beginning
How Elodie's mood will change each week based on choices
Which moods you want on which week

Then it's possible to figure out what weekend events you would have to do Cool
I've incorporated those into the program, which I *think* works correctly, but I haven't tested it in-game so I could be totally off.

For example, if Elodie starts at a Neutral mood (0's across the board), has no mood changes caused by weekly events, and wants to be Willful for 5 weeks in a row... She could do something like:
Walk in Garden + Sneak out + Explore Castle + Walk in Garden + Sneak out (in that order)

But if she gets +1 angry each week, she could do the following to be Willful 5 weeks in a row:
Explore Castle + Sneak out + Explore Castle + Explore Castle + Explore Castle

Of course, mood changes that occur during the weekly events depend on your choices, but if you have all of your choices planned out, and know what mood changes go with each one... Cool

Alfilaria

#6 by Alfilaria - Jun 28 2012

EightDeer:

Rhidian:

No one has PM'd me, which means no one is really interested in finding out the various mood paths.
It's not that no-one is interested in the mood paths, it's that having to PM you each and every time we want to perform a check is a right pain.
Yep >.< I've wanted something like this, but having to PM and wait for a response before continuing the game was too much of a hassle.
Hanako forum archive - Topic list