Content: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Background: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Pattern: Blank Waves Notes Sharp Wood Rockface Leather Honey Vertical Triangles
Welcome to TerraFirmaCraft Forums

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

  • Announcements

    • Dries007

      ATTENTION Forum Database Breach   03/04/2019

      There has been a breach of our database. Please make sure you change your password (use a password manager, like Lastpass).
      If you used this password anywhere else, change that too! The passwords themselves are stored hashed, but may old accounts still had old, insecure (by today's standards) hashes from back when they where created. This means they can be "cracked" more easily. Other leaked information includes: email, IP, account name.
      I'm trying my best to find out more and keep everyone up to date. Discord (http://invite.gg/TerraFirmaCraft) is the best option for up to date news and questions. I'm sorry for this, but the damage has been done. All I can do is try to make sure it doesn't happen again.
    • Claycorp

      This forum is now READ ONLY!   01/20/2020

      As of this post and forever into the future this forum has been put into READ ONLY MODE. There will be no new posts! A replacement is coming SoonTM . If you wish to stay up-to-date on whats going on or post your content. Please use the Discord or Sub-Reddit until the new forums are running.

      Any questions or comments can be directed to Claycorp on either platform.
Two

[Solved][79.6] Familiarization with animals does not work

29 posts in this topic

Version #:79.6

SSP/SMP (Single/MultiPlayer): SP

Suggested Name: Familiarization with animals does not work

Suggested Category: Severe

Description:

After feeding way too much grain to my sheep without them breeding I took a look at the source code and noticed that a bug is preventing the familiarization to happen as planned. Using EntitySheepTFC.java as example:

In line 362 it is specifically checked that the code is executing only on the client. In line 365 this.familiarize(player) is called to adjust the variables familiarity and familiarizedToday. But these variables are never synced to the server, so the server always considers those values to be 0/false.

In addition in the handleFamiliarityUpdate method in line 687 it is checked if familiarity is between 30 and 80, and if that is true nothing is done. So that value will be stuck once it raises past 30 and can never reach a value >90 for the special baby case.

Have you deleted your config files and are still able to reproduce this bug?: Yes

Do you have any mods other than Forge and TFC installed?: No

0

Share this post


Link to post
Share on other sites

You are wrong about most of that. Line 362 says "if(!worldObj.isRemote)" which specifies ONLY the server, not the client.

 

The >30 < 80 case is specifcally designed to do nothing, as you will see there is also an isAdult() check. I mentioned in the changelog that adult animals HAVE A CAP on how much they can familiarized. Baby animals can be familiarized between 30 and 80, and so you must get a baby animal above 80 before it reaches adulthood in order to continue to familiarize it as an adult.

 

You should only attempt to familiarize an animal once per day. Anything more than that is throwing food away.

0

Share this post


Link to post
Share on other sites

You should only attempt to familiarize an animal once per day. Anything more than that is throwing food away.

I was just thinking, is there ingame any way to tell that you already fed one specific animal that day once?Otherwise it could get quite messy with a bunch of animals running around in your pit when you don't know anymore which one already fed and which not ...Except, of course, if you go so far as to tie every single one to its own post while familarizing them ^^
0

Share this post


Link to post
Share on other sites

I was just thinking, is there ingame any way to tell that you already fed one specific animal that day once?Otherwise it could get quite messy with a bunch of animals running around in your pit when you don't know anymore which one already fed and which not ...Except, of course, if you go so far as to tie every single one to its own post while familarizing them ^^

we're considering limiting it to a once-a-day thing, where you won't be able to familiarize them more than once.

0

Share this post


Link to post
Share on other sites

Unless there is a significant differance between how much grain you need to get sheep and pigs to breeding level, somthing still feels broken. I was able to get my sheep to breed fairly quickly while it seems like i have been feeding my  pigs for twice as long and they wont breed. It would be nice to be able to check the familiarity in game other than just the will it breed test.

0

Share this post


Link to post
Share on other sites

I fed my sheep about 400 oz of grain now and they still are not familiarized, refuse to breed and refuse to be sheared. I very much hope that is not working as intended.

Sorry for the client confusion.

0

Share this post


Link to post
Share on other sites

I got my sheep shearable in only a few days and breeding not all that long after, used less than 160oz for two sheep in total, havent tried other animals. sheep also seem to prevent me from overfeeding them

0

Share this post


Link to post
Share on other sites

i had no problem breeding pigs after feeding them once a day for 4 days

0

Share this post


Link to post
Share on other sites

In what version did you do this, it was around 0.79.5 when it seemed that giving them grain stoped doing anything. In my case anyway.

0

Share this post


Link to post
Share on other sites

I am also having this problem. I've been staring at EntityHorseTFC.java for a while and I think I've found the cuplrit in the handleFamiliarityUpdate().

 

Line 1081 "lastFamiliarityUpdate = TFC_Time.getTotalDays();" is needed to ensure that familiarity updates only happen once per day, however it is nested within the if statement that is only executed if the animal has been familiarized that day. However if it has been a day since familiarization but the animal has not been familiarized that day, the familiarity reduction on line 1099 occurs without updating the lastFamiliarityUpdate time, and is therefore executed over and over until the Familiarity is zero.

0

Share this post


Link to post
Share on other sites

I am also having this problem. I've been staring at EntityHorseTFC.java for a while and I think I've found the cuplrit in the handleFamiliarityUpdate().

 

Line 1081 "lastFamiliarityUpdate = TFC_Time.getTotalDays();" is needed to ensure that familiarity updates only happen once per day, however it is nested within the if statement that is only executed if the animal has been familiarized that day. However if it has been a day since familiarization but the animal has not been familiarized that day, the familiarity reduction on line 1099 occurs without updating the lastFamiliarityUpdate time, and is therefore executed over and over until the Familiarity is zero.

 

This is intentional behavior. You need to keep maintaining your animals regularly, or else they will slowly become wild again.

0

Share this post


Link to post
Share on other sites

This is intentional behavior. You need to keep maintaining your animals regularly, or else they will slowly become wild again.

I think you misunderstand.

 

I believe the familiarity decrease is intended to occur once per day, same as the frequency of familiarity increase.

 

However the code in its current form will decrease familiarity every OnLivingUpdate(), bringing Familiarity down to zero within a few ticks of the start of the new day. It's practically impossible to feed the animal before that occurs.

 

Yes, there is an If statement that is supposed to prevent this on line 1079: "if(lastFamiliarityUpdate < TFC_Time.getTotalDays()){"

The reason why it fails is because it relies on lastFamiliarityUpdate being updated every time something happens to the familiarity, such as line 1081. However, the familiarity-decrease does not contain this kind of update. Thus the lastFamiliarityUpdate date remains constant and the check on line 1079 continues to pass multiple times.

A possible solution would be to copy the content of 1081 to just below 1098 or just before 1080.

EDIT: this would not be a solution. I just realized that doing this would only reveal/cause another related bug. If the familiarity decrease happens before the player can feed the animal (this is already the case), but now prevents additional updates (what I'm suggesting), then there would never be an update that increases the familiarity even once familiarizedToday becomes true.

EDIT2: nevermind, I need more coffee. Why doesn't TFC have coffee?

 

On a related note, I think the intended rate at which animals regress to untamed is a bit excessive. I don't want to spoil anything by posting numbers, but I think it would be rather difficult to maintain animals on a multiplayer world.

0

Share this post


Link to post
Share on other sites

Even if this was working as intended, with daily feeding just my 4 sheep would require a huge farm. The low growth rate of oat would force me to have a lot of backup-food, stored somehow so that it does not decay. This feels very excessive to me.

0

Share this post


Link to post
Share on other sites

I'm on 79.6 and can't get pigs to take anything.  I'll hold any grain in my hand, they'll flock to me but I get something to the effect of "the animal won't let you do that"

 

Am I missing a step?

0

Share this post


Link to post
Share on other sites

I was doing the math in class and the amount of food needed for animals did seem excessive but my guesses might have been off. also, you feed animals by shift+right clicking, not just right clicking

0

Share this post


Link to post
Share on other sites

I'm on 79.6 and can't get pigs to take anything. I'll hold any grain in my hand, they'll flock to me but I get something to the effect of "the animal won't let you do that"Am I missing a step?

Maybe the [shift] button? :)
0

Share this post


Link to post
Share on other sites

I had a look at the sources so we can do some math:

- Feeding an animal takes 5 oz away from the food

- Oat growth to full on average in 32 days.

- Oat drops on average 14 oz when harvested.

If that is correct, then a single farm spot of oat will produce 0,4375 oz per day, and since you need 5 oz to feed an animal per day, each animal would require about 12 farmland spots growing oat minimum. A flock of 4 sheep would therefore require 48 spots minimum, which is about a 7x7 area of farmland. If you are very much on time with the harvesting and do not loose anything to decay, otherwise you would have to increase the farmland accordingly.

I guess that given normal play-style and some decay, 16 farm spots (4x4) per animal would be a realistic number.

0

Share this post


Link to post
Share on other sites

I had a look at the sources so we can do some math:- Feeding an animal takes 5 oz away from the food- Oat growth to full on average in 32 days.- Oat drops on average 14 oz when harvested.If that is correct, then a single farm spot of oat will produce 0,4375 oz per day, and since you need 5 oz to feed an animal per day, each animal would require about 12 farmland spots growing oat minimum. A flock of 4 sheep would therefore require 48 spots minimum, which is about a 7x7 area of farmland. If you are very much on time with the harvesting and do not loose anything to decay, otherwise you would have to increase the farmland accordingly.I guess that given normal play-style and some decay, 16 farm spots (4x4) per animal would be a realistic number.

And if you're playing at a latitude with significantly long winters, good luck.

0

Share this post


Link to post
Share on other sites

Not to mention that you first need to find that many seeds to actually be able to grow them.

0

Share this post


Link to post
Share on other sites

The changelog say :

 

  • [*]
Familiarity will decrease slightly each day if it hasn’t reached a certain level and you haven’t interacted with the animal [*]Familiarity has a set cap after which it can no longer be increased in adult animals. Baby animals can always increase their familiarity, and do so much faster than adults. [*]Baby animals retain 50% of their mother’s familiarity when born, unless she is close to maximum familiarity, in which case they will retain 90% of it

 

That should only require a lots of resources and daily work for the first wild animals you bring to your base.
If you manage to breed them once, or twice (depending on the offspring size) and to raise the babies familiarity higher than the cap where it decrease then you are done.

It requires just a good amount of resources and time investment at the beginning. I don't think it's a bad thing as that forces the player to make choices about wich kind off resources he needs more.

0

Share this post


Link to post
Share on other sites

i do like that i requires lots of grain to build a herds, its a good way to limit them.

 

 

On a related note, I think the intended rate at which animals regress to untamed is a bit excessive. I don't want to spoil anything by posting numbers, but I think it would be rather difficult to maintain animals on a multiplayer world.

 

I do on the other hand agree with this, it probably does decrease to fast.

0

Share this post


Link to post
Share on other sites

Thought I'd tag on my experience. I started a new game in 79.6. I fed grain to two wild sheep for 4 days in a row (fed them each twice on the last day to double check). When I opened up NBTExplorer to check if they were familiar with me, the "familiar" tag was set to 0. I don't know exactly how this mechanic is supposed to work, but manually changing the tag to 100 allows me to shear them.

 

If this is a bug, hopefully it gets fixed, if not, can someone explain what I should do differently?

0

Share this post


Link to post
Share on other sites

Thought I'd tag on my experience. I started a new game in 79.6. I fed grain to two wild sheep for 4 days in a row (fed them each twice on the last day to double check). When I opened up NBTExplorer to check if they were familiar with me, the "familiar" tag was set to 0. I don't know exactly how this mechanic is supposed to work, but manually changing the tag to 100 allows me to shear them.

 

If this is a bug, hopefully it gets fixed, if not, can someone explain what I should do differently?

Without spoiling any numbers, 4 days in a row should be more than enough to shear them. Based on my understanding of the code, it is a bug.

0

Share this post


Link to post
Share on other sites

I fed and got wool from my sheep in 7.6, i think 3 or 4 days is how long it took to be able to shear them, but it worked for me on the current version, so idk

0

Share this post


Link to post
Share on other sites

You must feed the animal every day until the CAP is reached; if you miss one day familiarity goes back to zero and you must start over.

Increasing is only done once a day; but decreasing is done on every EntityUpdate (very often a day) unless the animal was feed that day (actually the day before).

Log of familiarity changes (H - hour, 6:00 is start of day):

   DAY  H  FAMIL  ?  AnimalID    61  8     -2  -  611506    61  8     -2  -  611506    61  8      5  +  611506    62  6      3  -  611506    62  6      1  -  611506    62  6     -1  -  611506    62  6     -2  -  611506    62  6     -2  -  611506

Not sure if that is what was wanted, I changed the code on an own fork to test decreasing only once a day - worked better (IMHO).

 

I just added the line

lastFamiliarityUpdate = TFC_Time.getTotalDays();

after decreasing the familiarity in the "handleFamiliarityUpdate()" method in each animal entity class (EntityPigTFC, EntitySheepTFC, ...)

 

Edit: Pull Request (#607) created on GitHub

Edit2: Pull Request integrated in master source code, thanks [:-)

1

Share this post


Link to post
Share on other sites