Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Better animal behavior needed  (Read 405 times)

GoblinCookie

  • Bay Watcher
    • View Profile
Better animal behavior needed
« on: March 20, 2017, 02:20:05 pm »

At the moment, much as with many things animals while physically quite developed mechanically, are rather lacking in the behavior front. I have come up with a list of basic problems with animal behaviors that annoy me and their solutions.

Birds on the ground

Birds and other flying creatures presently always spawn on the ground and then take off when the player approaches, whether to attack or flee.  While it might be the case that we would find a bird or other flying creature on the ground, chances are that that would not be the normal manner in which to encounter them. There is no good reason for this, the game generates the Z-Levels above our heads as we pass, hence there is no reason that the birds cannot be generated in flight. This could be defined in the raws quite simply and easily, by default the bird groups are generated at a random Z-Level above our heads but there is also a small chance that they will generate on the ground.  Custom raw definitions would allow us to eliminate this altogether by setting the grounding value to 0, but equally we could set the value to 100 so that things are as present.  Related to this is the situation with pheasants, chickens, guinea fowl, peacocks and the ilk, they need a tag that tells them that they prefer to walk, keeping them from using flying except when they cannot reach their destination by any other means.

Predator/Prey behavior

At the moment everything is either [LARGE_PREDATOR] or [BENIGN], the absence of either tag causes creatures that are considered hostile but yet fail to act as such.  Predators attack creatures that are of a different species, while prey flee from creatures that are of a different species, this is a pretty solid system if simple, but it results in a silly situation.  Predators attack things that are too big from them to have any reasonable chance of harming while prey flee from things that are minute and they could crush underfoot effortlessly; basically in dwarf fortress elephants really are scared of mice.  I propose that these tags be made size dependent, a predator creature attacks only things that are below a certain size while a prey creature flees only from things that are above a certain size.  Otherwise the creatures should remain passive but the whole group should respond as regular enemies do if hostility is initiated against any one of their number, this would be the default behavior.  In this system a creature can be both predator or prey, or neither.

At a more advanced level there are a number of other things to consider adding in.  One of these is pack strength, predators should have a modifier that basically makes other things appear smaller than they are as per size calculations based upon the present strength of the group, so only a very large pack of wolves will hunt a human and a lone wolf will flee from one.  Certain prey animals could benefit from a threat range, this is a number of squares within which the creature will respond either with hostility or flight should a non-specific enter it; certain creatures while herbivorous are also extremely dangerous to get close to.  Another consideration is the reputation of one's species, entities probably ought to have a multiplier value defined that determines how big the prey animals are that the civilization can hunt, for instance if we have 10X value then we will kill off things 10X our size, so a human of 70000 would kill things up to 700000.  This ought to change the behavior of the creatures in biomes where that entity is close enough to hunt, this would override the normal default logics, causing creatures to flee from creatures even if they would be too small to normally fear them if they reside in biomes where they are hunted BY creaures of YOUR species.

The mechanics of hunting could do would other improvements as well.  Creatures that are prey animals should not stop running away until they are offloaded and creatures that are alerted should not be possible to sneak up on, basically they should be given extravision.  Extravision should be a general thing in this sense, alert creatures should no longer be constrained by their normal field of vision becoming impossible to sneak up on until they return to the normal unalert state.  Predators on the other hand that are hunting the player should methodologically follow the players tracks, stopping only when they find something else to eat.  That means that dumping a pile of meat on the ground along your tracks once the predators are out of sight should work to facilitate your escape.


Intelligent 'Animals'

Groups of intelligent creatures basically bite the biscuit when it comes to dysfunctionality at present.  Aside from fixing all the bugs that presently exist, one idea that really should be in is simply to allow us to define items IN the creature file DIRECTLY.  Instead of having all item bearing creatures HAVE to belong to an entity, we simply give them non-tracked items generated as soon as they are loaded and decide where to put them on the creature as normal.  The behavior of the creatures should also be unique, basically non-entity dwelling creatures should respond intelligently to threats in the enviroment.  That means that they would not simply run away or attack but would instead respond according to a 'reputation' that the nearby entities have given your own creature-type.  If your entity eat sentients AND hunts expect to end up killed, otherwise you should be able to have a chat with them or maybe even trade items. 
Logged