Git Product home page Git Product logo

Comments (11)

Wedge009 avatar Wedge009 commented on May 18, 2024

It sounds like when the AI can't find a path to Gorlack, it doesn't know where the yetis should move and thus gives up.

CC: @Jonathan-Kelly

from wesnoth.

Wedge009 avatar Wedge009 commented on May 18, 2024

They have simple modified AI:
1. Attack anything hostile in range
2. Move towards Gorlack

I'm not sure where that is located. I only note that specific terrain is avoided in the general spawner macro. I'm not even sure what that terrain represents.

[ai]
village_value=0
[avoid]
terrain=*^V*
[/avoid]
[/ai]

from wesnoth.

soliton- avatar soliton- commented on May 18, 2024

That should match only village terrain. Probably better done as formula=village

from wesnoth.

IskarJarak01 avatar IskarJarak01 commented on May 18, 2024

The bats on the map - which can move on unwalkable terrain - do follow Gorlack.

I assumed the Yetis have modified AI because they don't move on villages at all and their behaviour in this issue (I might doublecheck, but I don't think the AI in Dead Water just stops moving landbound units because the player's leader is in deep water).

When the Yetis are Poisoned, they stop attacking even when flanked. AI leaders share this behaviour but regular recruits don't. In this scenario, a Poisoned AI unit just moves adjacent to Gorlack and hangs around. This might be a byproduct of avoiding villages, but it definitely isn't typical AI behaviour.

from wesnoth.

Jonathan-Kelly avatar Jonathan-Kelly commented on May 18, 2024

When the Yetis are Poisoned, they stop attacking even when flanked. AI leaders share this behaviour but regular recruits don't. In this scenario, a Poisoned AI unit just moves adjacent to Gorlack and hangs around. This might be a byproduct of avoiding villages, but it definitely isn't typical AI behaviour.

Hmm, did you notice anything like this happening with the wildlife during scenarios 1 or 5? Those scenarios use the same village avoidance AI modification but their maps have healing oases which the creatures can retreat to.

It is possible there are some bugs with the default AI when no healing tiles are available to it.

from wesnoth.

IskarJarak01 avatar IskarJarak01 commented on May 18, 2024

I went back and checked. In S1 and S5, Poisoned units behave properly - they attempt to move towards an oasis and are still willing to attack.

I tested S02 in WoF. As it turns out, the AI does actually does do nothing when the player's leader is on unwalkable terrain. The AI moves to capture villages, but then stops moving. Single units still move to attack, but once all villages are captured, anything that can't attack remains stationary.

from wesnoth.

Jonathan-Kelly avatar Jonathan-Kelly commented on May 18, 2024

I went back and checked. In S1 and S5, Poisoned units behave properly - they attempt to move towards an oasis and are still willing to attack.

Alright, so then I guess either the Wyrms could lose their poison bite or the map could get a few healing oases to work around that limitation. Really wish we had more than one type of non-village healing terrain besides oases, but oases may not look too far out of place on this map given its volcanic microclimate...

Single units still move to attack, but once all villages are captured, anything that can't attack remains stationary.

Do you mean they will not pursue your units while your leader stays out over deep water? In my tests (of S02) enemy land units moved across the map to attack any player unit which moved onto land, regardless of whether the player's leader stayed out over the deep sea tiles. The enemy land units only stayed still if presented with zero reachable targets. Which seems like reasonable behavior (for scenario 2)?

from wesnoth.

IskarJarak01 avatar IskarJarak01 commented on May 18, 2024

I've attached two replays of S2 (to be clear, the AI behaviour in this scenario isn't a real problem, it's just for demonstration). I debug killed the boats because they attack normally.
In replay 1:
I move my leader forward, adjacent to shallow water (can be attacked) -> no response
I move a burner forwards -> response from closest AI
I move leader onto land -> all AI troops head towards leader

In replay 2, I reduce the burner's max moves so it can't attack the AI leader. This leads to no response from that AI.

The AI occupies villages and castles, but I believe only because those are where the unit stopped / was recruited. I think the issues with AI behaviour here are from the default AI, it's just that they are masked by other behaviours (village capture / defend leader).

I don't think the Wyrm's Poison matters enough to modify the unit as the scenario is effectively won at that point. The player's only access to Poison is Water Serpents, which the Yetis can kill in one attack. Is it possible to "puppet" the Yetis and instruct them to attack adjacent units?

In a similar vein, can the default AI be overidden and instructed to always move towards the closest hostile unit or a different hero? There's an Eastern Invasion scenario (13_Spoils_of_War) which implements custom AI like this.

WoF-Reclamation replay 20240417-131112.gz
WoF-Reclamation replay 20240417-131313.gz

from wesnoth.

Jonathan-Kelly avatar Jonathan-Kelly commented on May 18, 2024

Okay, after looking at your replays and digging further into how the AI works, it sounds like ordinary units are not considered move-to targets by default. Which means an AI controlled unit will only attack a regular enemy unit if it is one move away. It will not pursue anything more than one move away unless that thing is an enemy leader, an enemy unit adjacent to its own leader (an assassin threat) or a village to be captured (as these three types of things are considered move-to targets automatically).

I believe you can add all hostile units (or just the player's heroes) as move-to targets using a [goal] tag. But that presumably has the consequence of letting the AI "know" where all your units are at all times and relentlessly pursuing them if no other targets are close or more valuable.

Why the wildlife in S1 and S5 seem more dynamic is because they tend to have more enemies spawn or move inside their "hunting radius" of one move away (and to a lesser extent because they have healing oases to retreat to when injured.)

from wesnoth.

IskarJarak01 avatar IskarJarak01 commented on May 18, 2024

I believe the AI can have fog enabled independently of the player, but it'll probably just make the AI stop moving until one of their units spots the player's leader, at which point they'll all start moving towards the player.

The addon campaign Return From the Abyss (trial_of_arms) has a couple of Giant Spiders (controlled by an otherwise normal AI side) which randomly walk in a small area near where they start. I think this behaviour is set by a unit variable:

[variables]
    [micro_ai_mai_hunter]
    [/micro_ai_mai_hunter]
[/variables]

However, if the AI doesn't have a goal it proabably won't travel very far or be relatively easy to bypass or otherwise lure away. If the Yetis all spawn in the mountains and just roam around, the player might not even see them until the end.

from wesnoth.

Jonathan-Kelly avatar Jonathan-Kelly commented on May 18, 2024

Yeah a lot of the Micro AIs have a random walk function. Among these the Big Animals Micro AI seems the most promising. In the past these AIs were buggy and limited but they have improved in recent years. At least the Goto Micro AI works fairly well in the new King of the Hill multiplayer scenario. So I have it on my todo list to test out how well Big Animals performs on this and the other two "wildlife" scenarios.

Optimally, it would be the same as the default AI except that the usual move-to-targets behavior focused on capturing villages and assassinating/protecting leaders would be replaced with the simple random wandering behavior.

from wesnoth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.