Animals in 4.A (spoliers)

A place to talk to other users about the mod.
User avatar
Xaedblade
Posts: 112
Joined: Fri Aug 31, 2012 5:09 pm

Animals in 4.A (spoliers)

Post by Xaedblade »

Awesome new Feature FC!

I've never had so much fun trying to catch chickens! makes things more challenging :D. I tried to do my normal early game saving of chicken's by digging them in a whole or boxing them in with blocks but it did not work :D!!!

This is so awesome because I have real chickens at home and this feels just like when I am trying to catch them in real life when the get out of their coop!!

LOVE IT :D
User avatar
magikeh
Posts: 945
Joined: Mon Jul 04, 2011 9:57 pm
Location: Top -o- the Tower

Re: Animals in 4.A (spoliers)

Post by magikeh »

Oh man, if chickens are as hard to herd as in real life, I'm going to have to find some hockey sticks..
Magical Shit
Show
Syruse|Work: i like magic shit
MagikEh: ...
MagikEh: >.>
MagikEh: <.<
»» MagikEh walks to the bathroom
Syruse|Work: hahaaaaaaaaa
Syruse|Work: wait
MagikEh: xD
Syruse|Work: fuck
Syruse|Work: NO
Syruse|Work: DONT
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Animals in 4.A (spoliers)

Post by FlowerChild »

magikeh wrote:Oh man, if chickens are as hard to herd as in real life, I'm going to have to find some hockey sticks..
A stone axe works quite well in that role ;)

IMO, many players tend to place way too much emphasis on trying to "save" animals for later, when it's really not necessary. When I play early game, I pretty much kill everything that moves for food and resources, and never have any problem finding animals later for domestication. I might have to walk a bit for them, but rarely is it far enough to be a serious pain or even to require an overnight trip.

Multiplayer may be a different matter mind you, given you may have multiple people rapidly depleting the animal population, but at least in single player I've never found it to be an issue.
jakerman999
Posts: 262
Joined: Sun Mar 04, 2012 7:58 pm

Re: Animals in 4.A (spoliers)

Post by jakerman999 »

I tried the saving animals for later thing, but I found that getting suitable shelters/holes for them without already having some form of lure just wasn't worth it. My strategy since then has just been to pick a direction, and never walk that way until I have said lure.
User avatar
dawnraider
Posts: 1876
Joined: Sun Dec 11, 2011 7:00 pm

Re: Animals in 4.A (spoliers)

Post by dawnraider »

FlowerChild wrote:
magikeh wrote:Oh man, if chickens are as hard to herd as in real life, I'm going to have to find some hockey sticks..
A stone axe works quite well in that role ;)

IMO, many players tend to place way too much emphasis on trying to "save" animals for later, when it's really not necessary. When I play early game, I pretty much kill everything that moves for food and resources, and never have any problem finding animals later for domestication. I might have to walk a bit for them, but rarely is it far enough to be a serious pain or even to require an overnight trip.

Multiplayer may be a different matter mind you, given you may have multiple people rapidly depleting the animal population, but at least in single player I've never found it to be an issue.
I totally agree with this. In my most recent world, I killed every animal I came across, and yet I still have domesticated cows, sheep, and chickens (I haven't bothered with pigs, no need yet). The farthest I had to walk was about 3 real minutes both ways.
Come join us on discord! https://discord.gg/fhMK5kx
Get the Deco Addon here!
Get the Better Terrain Addon here!
Get the Vanilla Mix TP here!
Get the Conquest TP here!
User avatar
Xaedblade
Posts: 112
Joined: Fri Aug 31, 2012 5:09 pm

Re: Animals in 4.A (spoliers)

Post by Xaedblade »

Yea I tend to kill everything in sight except for one chicken... to get started on some renewable food... but still haven't found a pumpkin so it looks like chicken for dinner :)... love the new changes it has challenged me to change my tactics.

just don't cut down trees next to a cow... learned that the hard way XD
Wibbles
Posts: 118
Joined: Sat Nov 03, 2012 3:45 pm
Location: Norway

Re: Animals in 4.A (spoliers)

Post by Wibbles »

Love the new animal changes. I had a small pig pen prior to updating, went to expand it leaving a gap in the fence... and lo and behold, all the pigs escape in panic, over the hills and far away. Cue Benny Hill moment with me running about with a potato I happened to have in my hotbar trying to round them up again. Sheesh :-)
User avatar
Ethinolicbob
Posts: 460
Joined: Sat Feb 25, 2012 2:03 pm

Re: Animals in 4.A (spoliers)

Post by Ethinolicbob »

Xaedblade wrote:Yea I tend to kill everything in sight except for one chicken... to get started on some renewable food... but still haven't found a pumpkin so it looks like chicken for dinner :)... love the new changes it has challenged me to change my tactics.

just don't cut down trees next to a cow... learned that the hard way XD
Yeah my mistake was putting dirt slabs down while crossing a hill, didn't see the cow but felt the hooves in me face.
Gotten free meat that way too when cows kill nearby pigs/sheep.

Can creepers target cows? I was climbing over a hill putting down slabs when I heard a boom! I have no idea why the creeper exploded out of sight unless a cow accidentally smacked it.
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Animals in 4.A (spoliers)

Post by FlowerChild »

Ethinolicbob wrote:Can creepers target cows? I was climbing over a hill putting down slabs when I heard a boom! I have no idea why the creeper exploded out of sight unless a cow accidentally smacked it.
Creepers will only target cows if attacked by them. Hence the occasional sound of explosions in the middle of the night, which is usually the result of another creature attacking a cow, and the cow randomly running by a creeper and giving it the hoofsies.

I've actually had it happen where such an explosion wound up taking the roof off my hidey-hole which is always a good time :)
User avatar
Gilberreke
Posts: 4486
Joined: Thu Jul 14, 2011 3:12 pm
Location: Belgium

Re: Animals in 4.A (spoliers)

Post by Gilberreke »

Ah yes, the bovine agents of chaos keeping it real :)
Come join us at Vioki's Discord! discord.gg/fhMK5kx
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Animals in 4.A (spoliers)

Post by FlowerChild »

Gilberreke wrote:Ah yes, the bovine agents of chaos keeping it real :)
Indeed :)

Back when I implemented the hoofsies I hadn't even anticipated that happening either and uttered a "wtf?" when I started hearing explosions during the night while testing, quickly followed by a "Oh man, that's too cool..." after realizing what had happened ;)
User avatar
Gilberreke
Posts: 4486
Joined: Thu Jul 14, 2011 3:12 pm
Location: Belgium

Re: Animals in 4.A (spoliers)

Post by Gilberreke »

It starts to get really interesting when you decide to make your base somewhere else, because there's cows around :)

Also, animals are attracted by light, no? So maybe we shouldn't put a torch on top of our dirt hovel.
Come join us at Vioki's Discord! discord.gg/fhMK5kx
User avatar
Elevatator
Posts: 573
Joined: Tue Jan 03, 2012 6:32 pm

Re: Animals in 4.A (spoliers)

Post by Elevatator »

Wasn't the 'attracted to light' just a rumor from back in Beta when animals spawned and despawned?

Speaking of cows. Leading a group of them through a desert was a mistake.
⠀⠀⠀⢀⣀⣠⣤⣤⣤⣶⣶⣶⣦⡀
⠀⠀⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦
⠀⢀⣾⣿⣿⠟⠉⠀⠀⠀⠀⠈⠻⣿⣿⣷⣄
⠀⣼⣿⣿⠏⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⣿⣿⣧
⣰⣿⣿⣿⡀⠀⢀⣴⣾⠿⣵⣦⠀⠀⣿⣿⣿⠇
⠙⢿⣿⣿⣇⠀⠈⠛⠁⠀⠈⠁⠀⣠⣿⣿⡏
⠀⠀⠻⣿⣿⣷⣤⣀⣀⢀⣀⣠⣾⣿⣿⡿
⠀⠀⠀⠈⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡥⠤⠒⣢
⠀⠀⠀⠀⣀⣽⣿⣿⡿⠿⠿⠛⠉⠁⣀⣤⣶⠟⠁
⠀⠀⢴⣭⣥⣶⣾⣿⡇⠀⠀⠀⠀⢸⣿⣿⠁
⠀⠀⠀⠀⢀⣿⣿⣿⡷⠀⠀⠀⠀⢸⣿⣿⣧⡀
⠀⠀⠀⠀⢾⣿⣿⣿⣤⣤⣤⣤⣤⣼⣿⣿⣿⠇
⠀⠀⠀⠀⠀⠀⠉⠉⠉⠉⠉⠉⠉⠉⠉⠁
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Animals in 4.A (spoliers)

Post by FlowerChild »

Gilberreke wrote: Also, animals are attracted by light, no? So maybe we shouldn't put a torch on top of our dirt hovel.
If I remember right from looking at the pathing code in the past, it's not light, but grass, which has a similar effect when you're talking about caves, but not with regards to lit player structures.

Could be wrong mind you, but that's what I remember anyways.
User avatar
Gilberreke
Posts: 4486
Joined: Thu Jul 14, 2011 3:12 pm
Location: Belgium

Re: Animals in 4.A (spoliers)

Post by Gilberreke »

Elevatator wrote:Wasn't the 'attracted to light' just a rumor from back in Beta when animals spawned and despawned?
Certainly not a rumor, this is something I noticed myself. Not sure if it's still that way in 1.5.2, but it used to be that animals flocked around torches, it was quite obvious. There used to be lots of animals around my door at night, they dispersed at dawn.

I'll try to do some tests.

EDIT: just looked it up, the wiki says I'm right at least:

http://minecraft.gamepedia.com/Chicken
They share some behaviors with other "farm animals":

They are drawn to light when in a dark environment.
Come join us at Vioki's Discord! discord.gg/fhMK5kx
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Animals in 4.A (spoliers)

Post by FlowerChild »

Gilberreke wrote: EDIT: just looked it up, the wiki says I'm right at least:
Decided to take a minute to look it up in code as I had a good idea of where it would reside if it was the case, and looks like you are (at least partially) right:

From EntityAnimal, and this is unmodified vanilla 1.5.2 code:

Code: Select all

    public float getBlockPathWeight(int par1, int par2, int par3)
    {
        return this.worldObj.getBlockId(par1, par2 - 1, par3) == Block.grass.blockID ? 10.0F : this.worldObj.getLightBrightness(par1, par2, par3) - 0.5F;
    }
So, looks like I was right in that they prioritize grass blocks, but you were right in that barring that, they favor lit blocks.

However, that likely won't be noticeable in grassy areas since grass has such a high weight, and the brightness (which I believe is between 0 and 1 in this case) doesn't even come into play to show preference for brightly lit grass blocks. I would suspect the intention there is to help animals path out of caves by directing them towards more brightly lit areas if there are no grass blocks around, whereas it wouldn't have much of a noticeable impact above ground unless you paved over a large area with cobble or something.

EDIT: And yeah, I just confirmed through debug that light brightness varies between 0 and 1, so we're talking either a path weight of 10 for grass blocks, and between -0.5 and 0.5 depending on brightness for other block types, making grass blocks the strong preference.

Anyways, all told I wouldn't worry about torches attracting animals unless you're living in a parking lot :)
User avatar
MoRmEnGiL
Posts: 1728
Joined: Sat Oct 08, 2011 5:29 pm
Location: Bosom Higgs

Re: Animals in 4.A (spoliers)

Post by MoRmEnGiL »

That is interesting. Recently I covered a huge area of my world with mycelium, creating a custom mushroom biome. Since there is no grass for chunks upon chunks, And I plan to make a brown mushroom forest with a thick "canopy", it will be very interesting to observe animal behaviour in the dark depths of the fungal forest. I can already picture dense vegetation with a few rays of light shining through and animals fighting for a chance to feel the sun on their backs.

I imagine this can be used to make fun mob mazes too, with various things affecting path choice. Also makes desert slightly more dangerous i suppose, since animals wandering in might be attracted to your torches and getting antsy around creepers. Very unlikely, until it actually happens to someone ;p
War..
War never changes.

Remember what the dormouse said
User avatar
Gilberreke
Posts: 4486
Joined: Thu Jul 14, 2011 3:12 pm
Location: Belgium

Re: Animals in 4.A (spoliers)

Post by Gilberreke »

Very interesting. I was sure about the light thing, as I'm sure I witnessed that, but somehow the high grass priority surprises me.

I ran some tests and I'm just baffled. When I place a torch in a forest at nighttime, not only will all the animals compulsively walk over the torch (well, chickens at least), but most of them will also stand on the tree leaves near the torch. It's as if they are avoiding grass at night. It's hard to really quantify this, as there seems to be randomness involved. I wonder if I can devise a proper experiment.

This was tested in vanilla 1.5.2, to be able to use peaceful.

EDIT: preliminary test:
Image
Come join us at Vioki's Discord! discord.gg/fhMK5kx
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Animals in 4.A (spoliers)

Post by FlowerChild »

Gilberreke wrote:It's hard to really quantify this, as there seems to be randomness involved.
There definitely is. Unless an AI entity has a specific target (like the player) to aim for, they tend to enter a wander state where a selection of random possible points is created and evaluated for how desirable they are.

If the list of random points for a particular animal doesn't happen to include the torched areas, then their weight will never be evaluated and they'll just wander off to whatever point happens to have the highest priority in their list. So, a lit area like that might make it more likely that an animal will head on over there, but it won't be a certain thing.

Still have no idea why they're doing that in grassed areas though. Might be another area of the pathing code that's responsible for it. Will see if I can track it down tomorrow.
User avatar
Gilberreke
Posts: 4486
Joined: Thu Jul 14, 2011 3:12 pm
Location: Belgium

Re: Animals in 4.A (spoliers)

Post by Gilberreke »

K, did a test with a bigger sampling size:

Torched grass: 14
Cows: 5
Sheep: 1
Pigs: 3
Chickens: 5

Torched stone: 12
Cows: 4
Sheep: 1
Pigs: 2
Chickens: 5

Unlit grass: 7
Cows: 2
Sheep: 2
Pigs: 1
Chickens: 2

Unlit stone: 6
Cows: 1
Sheep: 3
Pigs: 1
Chickens: 1

So yeah, about double the amount of animals seem to go towards the light. It seemed to me like chickens were the most gung-ho to get to light, while sheep didn't really (as you can see, there are double the amount of sheep in the darkness versus light). I'm not sure what this all means?

Image
Come join us at Vioki's Discord! discord.gg/fhMK5kx
User avatar
MoRmEnGiL
Posts: 1728
Joined: Sat Oct 08, 2011 5:29 pm
Location: Bosom Higgs

Re: Animals in 4.A (spoliers)

Post by MoRmEnGiL »

I tend to think variance, due to the small sample size man.
War..
War never changes.

Remember what the dormouse said
User avatar
Gilberreke
Posts: 4486
Joined: Thu Jul 14, 2011 3:12 pm
Location: Belgium

Re: Animals in 4.A (spoliers)

Post by Gilberreke »

MoRmEnGiL wrote:I tend to think variance, due to the small sample size man.
Sure, I can try some larger sample sizes, but I also think the setup needs some work. If anyone knows of a good test setup, let me know and I'll test it with larger sample sizes.

I do have to say that the first tests with 50 animals did exactly what I was expecting and after asking around, it seems like multiple players report chickens dancing around on torches. I've also seen a ton of LPs where people end up having animals show up at their base doorstep at night. That said, unless I can prove this is a thing, I'm not going to assume anything, because I know this sounds a lot like confirmation bias.
Come join us at Vioki's Discord! discord.gg/fhMK5kx
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Animals in 4.A (spoliers)

Post by FlowerChild »

Gilberreke wrote: I do have to say that the first tests with 50 animals did exactly what I was expecting and after asking around, it seems like multiple players report chickens dancing around on torches. I've also seen a ton of LPs where people end up having animals show up at their base doorstep at night. That said, unless I can prove this is a thing, I'm not going to assume anything, because I know this sounds a lot like confirmation bias.
Will dig into the code some more as one of the features I'm working on involves the pathing system and I'd prefer to have a better understanding of the factors governing it anyways.

While I don't think the tests above represent absolute scientific proof or anything, I do think they're sufficient it warrant further investigation on my part, and I'll report back here with what I discover :)

EDIT: No, I really don't think animals give a shit about light levels with an abundance of grass around. I didn't find anything else in the pathing code that would indicate they would, and running my own versions of your tests above Gil, I can see a clear attraction to light in paved over areas (it's not at all ambiguous there), where in purely grass areas the animals seem to just randomly mill about.

Anyways, if you want to continue discussing this one, please take it to another thread as it's gotten way off topic here :)
User avatar
Gilberreke
Posts: 4486
Joined: Thu Jul 14, 2011 3:12 pm
Location: Belgium

Re: Animals in 4.A (spoliers)

Post by Gilberreke »

Yeah, I was going to create another thread, but eh, if the code is obvious, I'm not going to bother. Back on-topic, I think I'm going to create another world, I haven't since before hoofsies, so I want to go through early game again.
Come join us at Vioki's Discord! discord.gg/fhMK5kx
User avatar
FlowerChild
Site Admin
Posts: 18753
Joined: Mon Jul 04, 2011 7:24 pm

Re: Animals in 4.A (spoliers)

Post by FlowerChild »

Gilberreke wrote:Yeah, I was going to create another thread, but eh, if the code is obvious, I'm not going to bother.
Well, keep in mind: animals don't behave that way according to the code *as I know it*. It's a rather massive code base where there are some odd interactions with the legacy AI system, and I'm working from a deobfuscated codebase where things can get rather obtuse.

Just to say: mistakes can obviously be made. I'm fairly certain that the behavior I've described here with regards to grass and light is accurate, but I certainly wouldn't stake my life on it ;)
Post Reply