Giter VIP home page Giter VIP logo

Comments (6)

Branikolog avatar Branikolog commented on June 7, 2024 1

@zenseii

Isn't fighting till the last breath and inflicting maximum damage would help your teammates? :)
Also, surrendered hero could be hired by opposite side, so surrendering into nowhere could be controvertial step.

from fheroes2.

zenseii avatar zenseii commented on June 7, 2024

I've been thinking about this one lately myself and came to the same conclusion of this issue.

I'm trying to approach it as if the AI were a human player

  1. If you're on a team and the rest of your team is still alive, then surrender is the best choice to help your team by avoiding to give artifacts and XP bonus etc to your common enemy after your defeat. But if your defeat in battle will trigger the end of the scenario (capture castle or hero), then don't surrender.
  2. We will have AI vs AI battles in free-for-all maps, and there's no reason for the AI to surrender in its final stand in an AI vs AI battle because it won't have any teammates that their surrendering would help.

from fheroes2.

zenseii avatar zenseii commented on June 7, 2024

@Branikolog

Isn't fighting till the last breath and inflicting maximum damage would help your teammates? :)

Sure but right now the retreating and surrendering works by looking at army strength difference, and this means the AI doesn't have much maximum damage left to give at the moment it decides to surrender. So we're talking about either giving 500 XP plus your artifacts, or not giving those things but some insignificant amount of gold to the common enemy.

Also, surrendered hero could be hired by opposite side, so surrendering into nowhere could be controvertial step.

Defeated hero can also be hired by opposing side just as easily so this doesn't change.

from fheroes2.

oleg-derevenetz avatar oleg-derevenetz commented on June 7, 2024

If you're on a team and the rest of your team is still alive, then surrender is the best choice to help your team by avoiding to give artifacts and XP bonus etc to your common enemy after your defeat.

Yes, that's why I allowed the last hero in last castle to surrender at the time.

But if your defeat in battle will trigger the end of the scenario (capture castle or hero), then don't surrender.

If your defeat will trigger the end of the scenario, then it doesn't matter whether you surrender or not. You will be defeated anyway and the end of scenario will be triggered anyway, no matter what you do.

In any case, I believe that unnecessary logic for checking various cases is redundant here. Less logic means simpler code, fewer tests, easier support in the future.

from fheroes2.

zenseii avatar zenseii commented on June 7, 2024

@oleg-derevenetz.

If your defeat will trigger the end of the scenario, then it doesn't matter whether you surrender or not.

Yes, in other words there is no point in surrendering at that point.

In any case, I believe that unnecessary logic for checking various cases is redundant here. Less logic means simpler code, fewer tests, easier support in the future.

Sure. I did highlight this potential concern people could get in my original issue, and I still feel that it doesn't really matter which way we go. This "last stand" behavior is a matter of personal opinion, rather than optimal AI choices.

@Branikolog does have a point in that it seems inconsistent/weird that the AI will try to make a last stand in cases for retreat, but not for surrender in castles.

from fheroes2.

oleg-derevenetz avatar oleg-derevenetz commented on June 7, 2024

@Branikolog does have a point in that it seems inconsistent/weird that the AI will try to make a last stand in cases for retreat, but not for surrender in castles

We can let it retreat in similar cases, why not.

from fheroes2.

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.