RELEASED Animal Husbandry Mod (former Butcher Mod) [v2.0.1]

Discussion in 'Mods' started by Digus, Oct 9, 2017.

  1. thewheatcrew

    thewheatcrew Poptop Tamer

    This is cool. I have so much excess crops I don't know what to do with.
     
    • Crunchyleaf

      Crunchyleaf Void-Bound Voyager

      Can we have a cheat sheet with npcs' likes and dislikes, or is this intended to be strictly trial and error?
       
      • Digus

        Digus Cosmic Narwhal

        If you use lookup anything mod, likes and loves will be shown there. https://www.nexusmods.com/stardewvalley/mods/541/
        Besides that, I can show you the code to add the likes and dislikes:
        Code:
                         AddUniversalGiftTaste(data, Taste.Dislike, "-14");
                        AddNpcGiftTaste(data, "Linus", Taste.Neutral, "-14");
                        AddNpcGiftTaste(data, "Linus", Taste.Like, "643");
                        AddNpcGiftTaste(data, "Linus", Taste.Love, "657", "662");
                        AddNpcGiftTaste(data, "Pam", Taste.Dislike, "656", "665");
                        AddNpcGiftTaste(data, "Pam", Taste.Neutral, "-14");
                        AddNpcGiftTaste(data, "Pam", Taste.Love, "657");
                        AddNpcGiftTaste(data, "Gus", Taste.Neutral, "-14");
                        AddNpcGiftTaste(data, "Gus", Taste.Love, "653", "660");
                        AddNpcGiftTaste(data, "Jodi", Taste.Hate, "652", "660");
                        AddNpcGiftTaste(data, "Jodi", Taste.Neutral, "-14");
                        AddNpcGiftTaste(data, "Jodi", Taste.Love, "661");           
                        AddNpcGiftTaste(data, "Jodi", Taste.Like, "640");           
                        AddNpcGiftTaste(data, "Kent", Taste.Neutral, "-14");               
                        AddNpcGiftTaste(data, "Kent", Taste.Like, "642");
                        AddNpcGiftTaste(data, "Kent", Taste.Love, "656", "663");
                        AddNpcGiftTaste(data, "Marnie", Taste.Hate, MeatDishes.Concat(new string[]{"-14"}).ToArray());
                        AddNpcGiftTaste(data, "Evelyn", Taste.Hate, "-14");
                        AddNpcGiftTaste(data, "Evelyn", Taste.Dislike, MeatDishes);
                        AddNpcGiftTaste(data, "Emily", Taste.Hate, "-14");
                        AddNpcGiftTaste(data, "Emily", Taste.Dislike, MeatDishes);               
                        AddNpcGiftTaste(data, "Alex", Taste.Like, "639");
                        AddNpcGiftTaste(data, "Shane", Taste.Hate, "641", "653");
                        AddNpcGiftTaste(data, "Shane", Taste.Love, "655", "658");
                        AddNpcGiftTaste(data, "Leah", Taste.Hate, "644");
                        AddNpcGiftTaste(data, "Leah", Taste.Dislike, "655", "660", "666");
                        AddNpcGiftTaste(data, "Harvey", Taste.Dislike, "654", "655");
                        AddNpcGiftTaste(data, "Harvey", Taste.Love, "657", "664");
                        AddNpcGiftTaste(data, "Sam", Taste.Dislike, "662", "664");
                        AddNpcGiftTaste(data, "Sebastian", Taste.Dislike, "665");
                        AddNpcGiftTaste(data, "Sebastian", Taste.Love, "661");
                        AddNpcGiftTaste(data, "Abigail", Taste.Love, "666");
                        AddNpcGiftTaste(data, "Haley", Taste.Love, "657", "663");
                        AddNpcGiftTaste(data, "Maru", Taste.Dislike, "659");
                        AddNpcGiftTaste(data, "Maru", Taste.Love, "656");
                        AddNpcGiftTaste(data, "Penny", Taste.Dislike, "657");
                        AddNpcGiftTaste(data, "Penny", Taste.Love, "662");
                        AddNpcGiftTaste(data, "Caroline", Taste.Love, "653", "661");
                        AddNpcGiftTaste(data, "Clint", Taste.Dislike, "663");
                        AddNpcGiftTaste(data, "Demetrius", Taste.Dislike, "660");
                        AddNpcGiftTaste(data, "Demetrius", Taste.Love, "665");
                        AddNpcGiftTaste(data, "George", Taste.Hate, "658");
                        AddNpcGiftTaste(data, "George", Taste.Love, "662", "664");             
                        AddNpcGiftTaste(data, "Jas", Taste.Love, "659");
                        AddNpcGiftTaste(data, "Lewis", Taste.Hate, "654");
                        AddNpcGiftTaste(data, "Lewis", Taste.Love, "652", "659", "663");
                        AddNpcGiftTaste(data, "Pierre", Taste.Dislike, "665");
                        AddNpcGiftTaste(data, "Pierre", Taste.Love, "654", "661", "666");
                        AddNpcGiftTaste(data, "Robin", Taste.Love, "652", "665");
                        AddNpcGiftTaste(data, "Sandy", Taste.Hate, "661");
                        AddNpcGiftTaste(data, "Vincent", Taste.Love, "659");
        The numbers mean:
        Meatloaf = 652,
        OrangeChicken = 653,
        MonteCristo = 654,
        BaconCheeseburger = 655,
        RoastDuck = 656,
        RabbitAuVin = 657,
        SteakFajitas = 658,
        GlazedHam = 659,
        SummerSausage = 660,
        SweetAndSourPork = 661,
        RabbitStew = 662,
        WinterDuck = 663,
        SteakWithMushrooms = 664,
        CowboyDinner = 665,
        Bacon = 666

        Beef = 639,
        Pork = 640,
        Chicken = 641,
        Duck = 642,
        Rabbit = 643,
        Mutton = 644

        Later I can think of a better way to shows it.
         
        • Crunchyleaf

          Crunchyleaf Void-Bound Voyager

          Thanks much! I take it "-14" is the entire category of uncooked meat then?
           
          • Digus

            Digus Cosmic Narwhal

            Yes, I forgot to say that.
             
            • Digus

              Digus Cosmic Narwhal

              Status:
              I have adjusted the feeding animation a little since I made the gif. Now the item is a little bit "upper" in the screen, so it's not over the bottom side of the basket. The farmer is also in the crouched position the whole time the basket is on the floor. It's just some minor adjusts to make the animation feel better and a little faster.

              I also investigated a bug and released a version that is supposed to fix the error item people were receiving. I was not able to reproduce it, but there were some part of my code not protected from this kind of bug, so I tried to change it.
               
              • Digus

                Digus Cosmic Narwhal

                Status:
                I was having a had time choosing what each animal should eat and how much friendship they should gain from each food. If all animals should receive the same friendship for loved items, and if there should be a liked item and a neutral item...
                After giving some thought on how the treats mechanic should be balanced, I settled for what should be the better solution.
                Each animal will have a list of items they can receive as treats. The amount of friendship will be based on the item value (considering quality).
                Each animal also will have a specific multiplier.
                Example:
                Chickens value vary from 240 to 1040, for 0 to 1000 friendship. That means a 1.25 friendship/g.
                So, say chickens like corn. That sells for 50g on normal quality. If feed to a chicken, it will receive 62.5 friendship.
                It can be done every 4 days.

                That means animals that value more will gain much less from treats. But I think that is the best way to balance the system. Animals that value less already are not very good to produce meat, at least they can be raised much faster now.
                Cows will be the fastest animals to be raised, since they will like amaranth(150g) for history consistence.
                I'm also considering using milk and goat milk as treats from baby cows and goat respectively. Besides the friendship bonus, it would also decrease one maturity day.

                This formula may seam not worth it, since you will be spending as much money as the animal will be raising in price. But you got to consider that the meat you will receive will always value more than the selling price. So with the quality of the meat in consideration, you will receive 50% more of the value of the crop on average, never less.
                More friendship also means more quality on the products they produce. So it means faster big eggs and big milks with gold quality.

                That way I can also set lots of different vegetables and fruits working for pigs, without making them overpowered.

                I will probably write letters to teach about animals likes, but it can be done on trial and error, the game will tell you if a animal don't want a treat.
                 
                  HopeWasHere likes this.
                • Digus

                  Digus Cosmic Narwhal

                  Status:
                  Coded a little more, but not much.
                  I'm still deciding what each animal should like as treat. Goats and sheep are the ones giving me most trouble. Each animal will have at least 2 crops they like. I'm also trying to choose crops considering value, season, if from desert of second year, current usefulness in game and real life preferences. I'm also trying not to repeat crops between animals.

                  Another thing I decided, to better balance the treat mechanic, is that each animal will have different days between treats. No matter how I try to choose the crops, feeding a 50g corn to a chicken will give 50 * 1.25 = 67 friendship, and a 320g pumpkin to a pig will give only 320 * 0.0625 = 20 friendship.
                  Cheaper animals will still receive more friendship from treats, but the difference will not be so big.
                  Days between treats will vary from 3 to 5 days.
                  Both the list of treats and the number of days will be on the animal data file.
                   
                    HopeWasHere likes this.
                  • Crunchyleaf

                    Crunchyleaf Void-Bound Voyager

                    In-game, Marnie's goats really like cave carrots. It isn't a crop per se, but its something to consider?
                     
                    • Digus

                      Digus Cosmic Narwhal

                      Thank for the info, I didn't knew that.
                      I was already considering make all animals accept cave carrots, since all real life animals like carrots, it's probably the most recommended treat.
                      But in the game it is too cheap to balance stuff. Or they will be too powerful or completely useless. But it's a flavor anyway.
                       
                      • Crunchyleaf

                        Crunchyleaf Void-Bound Voyager

                        Cheap, yes (can't get any cheaper than free,) however players are unlikely to have stacks of cave carrots lying around considering they're somewhat inconvenient to get. You have to hike out all the way to the caves, hoe a bunch of sand and hope you get lucky.
                         
                        • Digus

                          Digus Cosmic Narwhal

                          By cheap I mean that you can sell them for only 25g.
                          I'm doing a formula to make friendship grow based on the selling value of the crop, adjusted by how much the selling value of the animal grow with friendship. I gave some examples on my posts before.
                          In that case, a crop that sell for 25g will give too little friendship.
                          Before that, I was thinking on a fixed amount, like gifts for NPCs, but that would have the opposite effect. Cheaper crops would be so much better to feed the animals.
                          I opted for the former option because it's much easier to balance that way.
                          I can still have some animals like cave carrots. Although there will be better crops for them, like you said, people get cave carrots for 'free', and if they have nothing else to feed the animals, it's better than nothing.
                           
                            Crunchyleaf likes this.
                          • jkautry

                            jkautry Orbital Explorer

                            LOVE this mod! It works flawlessly for me aside from an error I'm getting with loading the Meat Channel --

                            Code:
                            [SMAPI] A mod failed handling the TimeEvents.AfterDayStarted event:
                            System.IO.FileNotFoundException: Could not load file or assembly 'PyTK, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
                            File name: 'PyTK, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
                              at AnimalHusbandryMod.recipes.MeatFridayChannel.CheckChannelDay () <0x17a0e5bd0 + 0x0002b> in <filename unknown>:0
                              at AnimalHusbandryMod.AnimalHusbandryModEntery+<>c.<Entry>b__5_0 (System.Object x, System.EventArgs y) <0x17a0e5b70 + 0x00037> in <filename unknown>:0
                              at StardewModdingAPI.Framework.InternalExtensions.SafelyRaisePlainEvent (IMonitor monitor, System.String name, IEnumerable`1 handlers, System.Object sender, System.EventArgs args) <0x15b3566e0 + 0x001cc> in <filename unknown>:0
                            
                            Has anyone else experienced this same error? I tried re-installing the CustomTV mod with no luck.
                             
                            • Digus

                              Digus Cosmic Narwhal

                              If you are using the latest version of CustomTV, it has a new dependency. You need to also install PyTK as well .
                               
                              • jkautry

                                jkautry Orbital Explorer

                                Ah ha! Many thanks :DD
                                 
                                  Digus likes this.
                                • Digus

                                  Digus Cosmic Narwhal

                                  Status:
                                  I finally decided on the animals liked treats. I was not completely satisfied with the balance, but it was the best I could do, all things considered. If I have any other idea until release I might change something.
                                  With that done, now I can concentrate on coding. It was really easy to implement all the validations and messages.
                                  As of now, you can only place in the basket treats that at least one animal eats. I don't know if that is the best way to do it. Maybe I should let people put any vegetable and fruit in the basket to make things harder to guess.
                                  I'm saying that because now I will implement letters and maybe a TV channel to teach animals likes. If people can just keep trying, these tips will have little propose.
                                  People who want to know the treats without waiting, can always look into the data file.
                                  The number of days between treats for each animal will not be a secret, since when you try to feed an animal again, it will say how many days you have to wait before giving another treat. I could hide that info, like the game hides if you can milk a goat, or how many days are left before a sheep grow back its fur. But it would just be annoying.
                                  I will also place that info on the query menu too.

                                  It will probably take 2 more weeks before releasing this version. But it can vary depending on how much time I will have to work on it.
                                   
                                    HopeWasHere likes this.
                                  • Digus

                                    Digus Cosmic Narwhal

                                    Status:
                                    Yesterday I did some sprite work and coding.
                                    Created the new channel with a custom screen. Now I need to start writing the show.
                                    Implemented the status icon for treats on the animals query menu. It visually shows if the animal has already received a treat recently, and when hovered, show how many days until it will accept more.
                                    Also visually added a meat button. An alternative to the meat cleaver/wand. Still have to code it's logic. It's not my priority, but if I have time I will do it for next version.

                                    I was thinking of a punishing mechanic for treats. But I don't know if it will work well.
                                    Basically if an animal is more than a week without receiving a treat, it would lose a small amount of friendship periodically(weekly or the same amount of days they can be giving treat). Maybe they could just become grumpy for a day.
                                    I thought that because most things you don't do to animals decrease friendship. It would also be another incentive to give them treats, and give some use to the cheaper items. Like cave carrots that any animals will like but will give little friendship bonus.
                                    But it would also be annoying if you have lots of animals already on max hearts. But I could make it so it stop decreasing if a animal is already maxed, or over 4.5 hearts.
                                    But thinking of villagers, they never loose friendship for not receiving gifts. Only if not talked to.
                                    So I don't know, I will probably not add that. Some feedback on this idea is appreciated.
                                     
                                      HopeWasHere likes this.
                                    • genman

                                      genman Space Spelunker

                                      Sorry I just meet an error possibly from Insemination Syringe.
                                      Every time I use Syringe or look animal's state,SMAPI gives me a lot of error message.
                                      Additionally,I cannot do any operation to animal button just like sell it ,disable pregnant, rename it ,ect.
                                      Here is the report from console :(

                                      [SMAPI] An error occured in the base update loop: System.MissingMethodException:
                                      Method not found: 'System.String StardewValley.FarmAnimal.get_displayHouse()'.
                                      at AnimalHusbandryMod.animals.AnimalQueryMenuExtended.receiveLeftClick(Int32
                                      x, Int32 y, Boolean playSound)
                                      at StardewValley.Game1.updateActiveMenu(GameTime gameTime)
                                      at StardewValley.Game1.Update(GameTime gameTime)
                                      at StardewModdingAPI.Framework.SGame.Update(GameTime gameTime) in C:\source\_
                                      Stardew\SMAPI\src\SMAPI\Framework\SGame.cs:line 550
                                       
                                      • Digus

                                        Digus Cosmic Narwhal

                                        Someone reported a similar problem and the solution was to update the game, he was not using the latest version of Stardew.
                                         
                                        • Digus

                                          Digus Cosmic Narwhal

                                          Status:
                                          Made some adjusts to the channel code. Started to write some stuff, but mostly, just listed topics I want to add.
                                          Revamped the query menu a little. To make it work correctly I had to copy the original 'draw' method and add my code in between. What I wanted could not be done drawing before and after the original method.
                                          The meat button is now working. It is more convenient for when you have lots of animals and they are all grouped together, and you don't want to use the Meat Cleaver/Wand on the wrong one.
                                          The pregnant icon is now highlighted when the animal is pregnant, so no need to hover the button just to check if the animal is pregnant.
                                          I should now focus on writing. There is more things I want to code, but they are not essential for the release.
                                           

                                          Share This Page