Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: More Modular Animal Behaviors  (Read 983 times)

Warlord255

  • Bay Watcher
  • Master Building Designer
    • View Profile
More Modular Animal Behaviors
« on: April 22, 2010, 04:43:26 pm »

Quite some time ago, I put up this thread; http://www.bay12forums.com/smf/index.php?topic=26743.0

In it, I proposed that more animal behaviors be added to the game, to expand on ideas like beer-chugging bears and mischievous macaques. However, looking at some of the material from the new release - particularly concerning venom, syndromes, and milking - the idea struck me that it might be better to build a flexible template for these behaviors, so as to avoid having too many exclusive and/or conflicting behavior tags.

As an example;

Code: [Select]
[SEEKER:1]
       [SEEK:ITEM:ALCOHOL:50:EAT]

This SEEKER heading would fall into the paradigm of the CURIOUSBEAST tags as they exist now, locating objects on the map and causing the creature to go towards it. This is the set of behaviors responsible for the aforementioned macaque and bear antics. The values here represent intensity (similar to BUILDINGDESTROYER), the type and subtype of object sought, the range within which the behavior is triggered, and the action associated with it.

Now, with this theoretical framework, we expand it to new uses.

Code: [Select]
[SEEKER:2]
       [SEEK:BLOOD_WATER:ON_ARRIVAL:KILL_EAT]

This would reflect violent shark behavior - seeking out blood in the water and attacking any nearby creatures. This is currently not in the game, but is a good example of what could be done with a small amount of tweakability.

Code: [Select]
[SEEKER_PACK:1]
       [SEEK:PREY_CLASS:SMALL:30:KILL_EAT]

A more detailed replacement of LARGE_PREDATOR. The creature is alerted when viable prey enters range, and then commences hunting it. The SEEKER_PACK variant would alert other creatures of its kind in a local area to commence hunting.

By simply generalizing a common creature behavior - "goes after things" - and allowing the criteria to be changed while using the same code, the door can be opened for all kinds of behaviors; giant eagles collecting logs for nests, fell beasts raiding your graveyard, deer eating plants, rock monsters hungering for ore... the list goes on.

Let's reverse that behavior - a [FLEES] tag that causes a creature to run away from the listed object. Werewolves fearing silver, gnomes avoiding gnomeblight, or lesser evil creatures fleeing from powerful good ones.

Granted, this is somewhat complex and perhaps a bit daunting, but isn't that DF in a nutshell? The payoff here would be the ability to flesh out the animal (and monster) kingdoms in more detail without making weird new exceptions for every instance.
Logged
DF Vanilla-Spice Revised: Better balance, more !!fun!!
http://www.bay12forums.com/smf/index.php?topic=173907.msg7968772#msg7968772

LeadfootSlim on Steam, LeadfootSlim#1851 on Discord. Hit me up!

Vattic

  • Bay Watcher
  • bibo ergo sum
    • View Profile
Re: More Modular Animal Behaviors
« Reply #1 on: April 22, 2010, 05:25:26 pm »

I'd like to see something like this, it's good for modding and as you say it's more complex but then animal behaviour would be more complex for it.

Tags that determine attack style would be interesting too. Rhinos should charge, big cats should stalk etc. You could get animals to flee when they are loosing or fight to the death.
Logged
6 out of 7 dwarves aren't Happy.
How To Generate Small Islands

Pilsu

  • Bay Watcher
    • View Profile
Re: More Modular Animal Behaviors
« Reply #2 on: April 22, 2010, 05:39:49 pm »

No animal is going to fight to the death.

How are you going to handle tame animals? Having beak dog mounts running after deer because they got hungry or having war horses graze when they're supposed to be charging and flee when they actually meet the enemy would get stupid, fast.

I'd be happy with the eater tag distinguishing between plants and meat. Not entirely sure vultures would be that interested in my plump helmets.
« Last Edit: April 22, 2010, 05:41:35 pm by Pilsu »
Logged

Warlord255

  • Bay Watcher
  • Master Building Designer
    • View Profile
Re: More Modular Animal Behaviors
« Reply #3 on: April 22, 2010, 06:02:24 pm »

No animal is going to fight to the death.

How are you going to handle tame animals? Having beak dog mounts running after deer because they got hungry or having war horses graze when they're supposed to be charging and flee when they actually meet the enemy would get stupid, fast.

I'd be happy with the eater tag distinguishing between plants and meat. Not entirely sure vultures would be that interested in my plump helmets.

A criteria for whether or not the behavior can be "ironed out" with taming would probably be a good idea; some might need a dungeon master to stamp out, making more "savage" animals like elephants more unpredictable as a tradeoff for their strength.
Logged
DF Vanilla-Spice Revised: Better balance, more !!fun!!
http://www.bay12forums.com/smf/index.php?topic=173907.msg7968772#msg7968772

LeadfootSlim on Steam, LeadfootSlim#1851 on Discord. Hit me up!

Pilsu

  • Bay Watcher
    • View Profile
Re: More Modular Animal Behaviors
« Reply #4 on: April 22, 2010, 06:08:44 pm »

Breeding should probably be required. Taming and training is a tad easy as is with no regard to the suitability of the animal.
Logged

Vattic

  • Bay Watcher
  • bibo ergo sum
    • View Profile
Re: More Modular Animal Behaviors
« Reply #5 on: April 22, 2010, 07:02:21 pm »

No animal is going to fight to the death.

Not usually but perhaps when cornered or defending young.

How are you going to handle tame animals? Having beak dog mounts running after deer because they got hungry or having war horses graze when they're supposed to be charging and flee when they actually meet the enemy would get stupid, fast.

Tame animals should still exhibit some of their wild behaviours under certain circumstances. Idle horses grazing for example. Dogs chasing cats on occasion might be interesting.
Logged
6 out of 7 dwarves aren't Happy.
How To Generate Small Islands

FreakyCheeseMan

  • Bay Watcher
    • View Profile
Re: More Modular Animal Behaviors
« Reply #6 on: April 22, 2010, 09:26:33 pm »

Good idea, but likely a programming nightmare. Not saying Toady couldn't do it... I'm in awe of any man who can make a system *this* complex and make it work *this* well...

Still, I'd say it should be a goal to have this for 1.0
Logged
What do you really need to turn Elves into Dwarves? Mutation could make them grow a beard; insanity effects could make them evil-minded, aggressive, tree-hating cave dwellers, and instant, full necrosis of their lower legs could make them short.

Warlord255

  • Bay Watcher
  • Master Building Designer
    • View Profile
Re: More Modular Animal Behaviors
« Reply #7 on: April 23, 2010, 07:34:31 am »

Good idea, but likely a programming nightmare. Not saying Toady couldn't do it... I'm in awe of any man who can make a system *this* complex and make it work *this* well...

Still, I'd say it should be a goal to have this for 1.0

I don't think it'd be all that hard; all it would be doing would be opening the parameters for existing behavior and allowing its parameters to be changed.
Logged
DF Vanilla-Spice Revised: Better balance, more !!fun!!
http://www.bay12forums.com/smf/index.php?topic=173907.msg7968772#msg7968772

LeadfootSlim on Steam, LeadfootSlim#1851 on Discord. Hit me up!

Silverionmox

  • Bay Watcher
    • View Profile
Re: More Modular Animal Behaviors
« Reply #8 on: April 23, 2010, 07:59:03 am »

A big advantage is that the community can try out different AI behaviours, so Toady doesn't have to.
Logged
Dwarf Fortress cured my savescumming.

Urist McCheeseMaker

  • Bay Watcher
    • View Profile
Re: More Modular Animal Behaviors
« Reply #9 on: April 23, 2010, 08:24:19 am »

Good idea, but likely a programming nightmare. Not saying Toady couldn't do it... I'm in awe of any man who can make a system *this* complex and make it work *this* well...

Still, I'd say it should be a goal to have this for 1.0

I don't think it'd be all that hard; all it would be doing would be opening the parameters for existing behavior and allowing its parameters to be changed.

current behaviour is all pretty much optimized: seekers only have two or so target categories (food and shinies) and plenty of the ideas here haven't even been implemented yet. it's probably harder to program than it seems at first glance.

but hey, if he can do it (and seeing how DF is right now, of course he can!) it'll just make the whole game that much awesomer.
Logged