Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homicidal military kills all farm animals including the cat and dog. #146

Open
comaldave opened this issue Jan 9, 2021 · 15 comments
Open
Labels
bug Something isn't working

Comments

@comaldave
Copy link

comaldave commented Jan 9, 2021

Expected behaviour

Rancher put animals in the pasture while military eliminates threats

Bad behaviour

The military went on a rampage and killed all farm animals.

@rschurade
Copy link
Owner

You paying them enough?

@Ext3h
Copy link
Collaborator

Ext3h commented Jan 9, 2021

Are you sure they haven't been set to "Attack" behavior? That has been (at last) enabled with the last update, so squads which had been primed did not do their job previously.

If you mean to say that they also killed animals which already were assigned to a pasture, that would be unintended.

Mind that an animal might be on a pasture (but not belong to it), or have escaped a pasture, but still is assigned to it.

@comaldave
Copy link
Author

Well, this was a brand new start, the game was unpaused, so no animals were in the pasture. My current workaround is to not form squads until the animals are pastured. At Sierra Online we would not classify this as a bug, but rather an undocumented feature.

@Ext3h
Copy link
Collaborator

Ext3h commented Jan 12, 2021

We will need to make sure that squads are initially configured as "passive".

@rschurade
Copy link
Owner

Don't like that solution. The problem here and question in general is should the military be able to attack and kill non-aggressive and farm animals.

@Ext3h
Copy link
Collaborator

Ext3h commented Jan 12, 2021

Yes, must be able to as they can as well count as pests (think exploded chicken farms etc., something apparently every player is bound to encounter eventually).

Just must not do that as default, and just double check we don't kill tame animals.

@comaldave
Copy link
Author

I have never had an exploding chicken farm but then again I always set a limit of three roosters.

We could perhaps have an open hunting season for select animals that become a pest. Check Wild chickens and the guards will kill the wild chickens, but only if it is open season.

With Gnomoria, I would put my extra bulls at the entrance early in the game, they would sometimes take out one or two of the goblins while my security was getting organized.

  • Military needs to cooperate with aggressive yaks that attack goblins.
  • Medics need to bandage damaged yaks injured by goblins.

@rschurade rschurade added the bug Something isn't working label Jan 13, 2021
@CptVolkow
Copy link

At first they assaulted a crowded pasture, went from +5 over limit to 0/22
They stacked on one spot and killed everything
Screenshot 2021-01-13 165903

After that they would occasionally kill on mass strays from a open pasture
Stretchleopard.zip

@Ext3h
Copy link
Collaborator

Ext3h commented Jan 13, 2021

That's a bug in the "defend" behavior then. It's currently implemented as "attack targets if they can be reached without moving", but is lacking the prerequisite that the target should be hostile.

@condac
Copy link
Contributor

condac commented Jan 25, 2021

I have this behavoir also, Have some cows and all of the sudden my squad that i set up with default "defend" settings started to kill all cows.

@gloowa
Copy link

gloowa commented Nov 18, 2021

I believe this problem is caused in

if ( prio.attitude == MilAttitude::DEFEND && dist < 4 && g->cm()->hasLineOfSightTo( m_position, targetID ) )
{
return BT_RESULT::SUCCESS;
}

It seems that the only condition to attack when DEFEND option is selected is dist < 4. No checks on target hostility are made.
Perhaps someone can figure something out here (add additional check to see if target is attacking another gnome or something).

[EDIT]
Perhaps a simple solution/temporary workaround would be to add a new option IGNORE, which would simply always return BT_RESULT::FAILURE?

@Ext3h
Copy link
Collaborator

Ext3h commented Nov 18, 2021

MilAttitude::FLEE is effectively that IGNORE option.

This logic here is missing the concept of "aggression" in general. The idea was to extend the instance of each monsters with a flag of "creature classes it's hostile to", defined by having attempted at least a single attack at that class or having received one. Without that logic, there is nothing which would define a creature as hostile at all. Aggression is part of the behavior tree after all.

@gloowa
Copy link

gloowa commented Nov 19, 2021

I think more robust solution would be to have to consist of sort of factions (fox faction, goblin faction, cow faction, tamed animals faction) and 2 types of agression

  1. I don't know how to name it, but sort of "political stance": for instance, goblin faction should be understood as being hostile to all gnome faction and tamed animals faction, etc

  2. Active hostility: whenever any actor (monster, goblin, etc) is engaging another in combat, they should mark themselves as being in combat with its target. Then other actors could do stuff like check both engaged actors and their faction, and then based on relation of actor's own faction and its relation to the factions of parties involved in combat choose to ignore, or join the combat on either side. Or to engage both sides i guess.

It would also allow for differentiation on behaviour based on just encountering hostile actor or encountering hostile actor that is in combat with friendly/allied actor etc.

@Ext3h
Copy link
Collaborator

Ext3h commented Nov 19, 2021

@gloowa Take a look at https://github.com/rschurade/Ingnomia/projects/4 , future AI improvements are being planed over there.

Factions are superseded by that per-species stance system as is.

Active hostility is what we actually need to be able to implement a "defend" option. I expect it makes most sense to flag the attacker as hostile towards the entire target species (counter with decay, not just boolean). In that case, "being flagged at all" makes you eligible to be counter-attacked from the Defend stance.

Having a higher counter opens up more options in the behavior tree.

@gloowa
Copy link

gloowa commented Nov 19, 2021

Oh, i haven't checked the projects page. What is described there, is pretty much what i had in mind, just expressed way better.

That looks awesome, i will be anticipating the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants