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.
Sign in to follow this  
Followers 0
PhineasWynd

Animal AI / Behaviour

8 posts in this topic

Have you read, understood, and followed all of the rules listed in large text at the top of the suggestions forum?(Yes/No): yes
 
Preface: I know AI is a pain in the ass. But I think it's worth it :)
 
What it adds to the game:

  • A whole lot of immersion and makes the whole world feel alive
  • A skill element / difficulty level to hunting - animals will flee from you, you will need to sneak up on them,
  • Complexity to building and farming - protecting yourself and your crops from the wildlife
  • Danger to the player - some animals will stand their ground/charge you, some will stalk and hunt you.

Overview:

  1. Lots of different actions
  2. Spectrum of states
  3. Spectrum of dispositions
  4. Seasonal/Regional Migration
  5. Reaction to player

Mechanisms:
1. Lots of different actions
 
Animals have basically 3 functions: Sustain themselves(Eat/drink), Survive(flee/attack/intimidate), Mate(displays, competing with others). I think the first two are the most important for the purposes of the game, as they can involve the player directly, whereas mating behaviours don't really involve the player much.
 
List of actions: (If you think of any more, I can add them to the list)

  • Drink. Find water edge and do eating animation on it
  • Stalk. Hide from line of sight of target at a distance away. Can be a variable distance, or gradually get closer
  • Hunt (Carnivore). After stalking close enough to target, run at target as fast as possible, attacking it. Animals will only hunt other animals of lower Threat level than them (see below)
  • Cling (Carnivore). Attach to target, doing damage quickly. Like a lion clinging to the back of a zebra sort of thing
  • Graze (Herbivore). Find closest tastiest food (crops included) and do eating animation on it, destroying the food.
  • Feed (Carnivore). Eat from animal corpse (if there is such a thing)
  • Flee. Threat detected, run as fast as possible in a path away from the threat's location
  • Intimidate. Face target and do intimidation animation and/or noise
  • Stand ground. Face target and stay in position, attack only when target gets close
  • Charge. Face target and run through them, do damage on passing. Keep going for a while after doing damage
  • Hide. Find a hidden spot and stay there until threat is gone
  • Protect. Get between threat and protectee, and intimidate, stand ground, attack.
  • Dying. Stagger around slowly, randomly

2. Spectrum of states

Key: Capital letter words are variables

 

Each animal should have a base Threat level (set when it is born or fully grown, within a range depending on species) and a Threat-Multiplier, which changes depending on what action the animal is taking at the moment. There should also be an environmental multiplier, which is affected by the type of block the animal is standing on/walking through, to simulate noise.

 

Each animal should also have a Hunger level and a Thirst level which depend on the animal's hunger and thirst, and an Alarm level, which is variable in response to the environment and animals around it, and its current health level. Then it goes through a Converter to convert from Hunger/Thirst/Alarm to different actions.

 

The higher the Hunger/Thirst level, the more likely it is to ignore the Alarm level, and take care of its needs.

The Alarm level is calculated from the Threat level divided by distance (squared?) of animals around it.

Alarm responds to other animals' Alarm level as well, and some animals' Alarm level lowers in response to being around more of the same species.

Alarm goes to very high when damage is taken. Also goes high when other animals of same species near it take damage.

 

3. Spectrum of dispositions

 

Different species of animals (and different genders, pregnant, with baby, alpha male, etc.) should have different dispositions, which means different actions in response to its various Need levels. Or in other words, a different Converter.

 

Key: Lower Threat, Same Threat as own, Higher Threat

 

Types of disposition: (If you think of more you're welcome to post them, and I'll add them to the list)

Prey, small -  Possible actions in order from lowest Alarm to highest: Drink, Graze, Hide, Flee

Prey, medium - Drink, Graze, Flee

Prey, large - Drink, Graze, Intimidate, Charge, Flee

Predator, medium - Drink, Feed, Hunt, Intimidate, Flee

Predator, large - Drink, Feed, Hunt, Cling, Intimidate, Stand ground

 

Many more types, eg. 

Mother Bear - Drink, Graze, Feed, Protect

 

There should also be some randomness so that animals don't always do exactly the same thing.

 

4. Seasonal/Regional Migration

 

Animals should move around in the world. Some species should migrate to different areas for different parts of the year, some species should wander around a territory, some should do it in groups, some solitary.

They should also travel to different areas when not loaded in the chunks (change of coordinates of the unloaded animal?). This can be done properly with the way islands are going to be partially pre-generated.

 

This should pose a good challenge for the player, as animals will not always be in the same location. Deer and other prey will move around, and you will need to track them. Also, predators will move into your region, and may decide to hunt you.

 

This is almost another suggestion, but maybe there can be a tracking mechanic (right click on ground with hand as if you're checking for prints and droppings? Shows where animals were recently, higher tier skill reveals animals further back in time, the direction of travel of the animal, more types of animal.

 

5. Reaction to player

 

The player would count as a middling high Threat animal - some predators might try to hunt him, and most animals would count him as a threat.

Threat level of the player would increase/decrease for different actions/wearables.

Crouching lowers Threat level of the player, drinking lowers Threat a lot, running towards an animal increases Threat, running away decreases it. Jumping increases Threat level. Standing still lowers Threat the longer you stand, etc.

Edited by PhineasWynd
3

Share this post


Link to post
Share on other sites

I really love this suggestion and hope it gets implemented. It would add  so much life to tfc.

If someones tackle AI, the only other thing I would like to be added to all tamed animals, is the command to wander in opposition to the commands follow and stay.

Most tamed animals in real life will follow you without a leash. 

I just hate the way the command stay works for dog in Vanilla minecraft.

I want to have the option for all tamed animals to follow you, so it would be possible to move my base and have my cattle to follow me to my new base.

The wander command would be needed because stay means to stay in one place without moving, so animals would not eat.

Another reason for the wander command is so dogs can guard the area inside your base, as long as they are fenced or inside walls they should wander inside and attack strange mobs.

1

Share this post


Link to post
Share on other sites

i agree with everything said prior

0

Share this post


Link to post
Share on other sites

Yes, I think that animals in Minecraft are stupid...

We need more immersion in the Stone Age.

The most important thing for a caveman was gathering food.

0

Share this post


Link to post
Share on other sites

A few days ago I posted this into r/minecraftsuggestions in reddit, but obviously it don't had success.

But I think it has some basic ideas for the behavior of animals that you can take into TFC.

Obviously it's though for vanilla Minecraft and has something that does not have to be considered.

 

0

Share this post


Link to post
Share on other sites

Some good suggestions. I'll be thinking about stuff of that nature.

0

Share this post


Link to post
Share on other sites

I was playing with 'Hungry animal mod', where similar to TFC, wild animals needs long taming process but additionally they flied away from player, what makes really challenging survival, with needs to make traps to capture or kill. It would be great, if deers etc would run away if player is nearby, other like horse would run if player is killing something.

0

Share this post


Link to post
Share on other sites

I agree with Ciekma. I also had been using Hungry Animals; I like those aspects of it and that the animals will eat tile entities laying around. In others words, you can through [or drop (Q)] seeds and your chickens run over and "eat" them. Like in the real world. However, one of my peeves with mods these days is that everyone adds their own crops. What's wrong with the Vanilla ones and there are so many mods out there that are made to add crops. In Hungry Animals they give you a configure page in the mods button that allows you to add modded foods to what the animals eat and their values. Maybe you could do the same. This might also work for what the player eats.

Edited by Celtic Humingbird
0

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0