Giter VIP home page Giter VIP logo

Comments (9)

peter1591 avatar peter1591 commented on May 16, 2024

Move some analyze beforehand

Now we can decide:

  1. not enough resource
  2. attacker is not attackable
  3. hero power is not usable

Still cannot decide:

  1. client card cannot be played
  2. calient card needs target, but failed
  3. GetDefender() return invalid target
  4. defender vanished

TODO:

  1. no space for minion
  2. secret exists

from hearthstone-ai.

peter1591 avatar peter1591 commented on May 16, 2024

TODO:
check simulation failure rate

from hearthstone-ai.

peter1591 avatar peter1591 commented on May 16, 2024

Fixed in commit: 37f9437

from hearthstone-ai.

peter1591 avatar peter1591 commented on May 16, 2024

TODO: when minion is somehow full due to pre-summon triggers,
the minion card should be considered as played successfully, rather than treated as an invalid action.

from hearthstone-ai.

peter1591 avatar peter1591 commented on May 16, 2024

More fixed in commit: f459d1d

from hearthstone-ai.

peter1591 avatar peter1591 commented on May 16, 2024

There are only two possibilities to lead to an invalid state:

  1. defender returned by callback is invalid
    a. this is a desired design
  2. the card's onplay_handler.PrepareTarget() failed
    a. can we check this beforehand (i.e., in ValidActionGetter)
    b. if we do this check beforehand, but still failed at onplay_handler.PrepareTarget() when doing PlayCard(), we should stop the flow, but returned as a valid state.

from hearthstone-ai.

peter1591 avatar peter1591 commented on May 16, 2024

Need a const version of FlowControl::Manipulate to provide some interfaces to client cards, which allowed client cards to do some checks in onplay_handler.PrepareTarget().
Also, we can fix TODOs in ValidActionGetter.

from hearthstone-ai.

peter1591 avatar peter1591 commented on May 16, 2024

A manipulator, by its name, should be able to manipulate the underlying game state, so adding a const-manipulator doesn't make much sense.

Maybe need to pass const& of game state directly

from hearthstone-ai.

peter1591 avatar peter1591 commented on May 16, 2024

No invalid state anymore.
Fixed in several commits; ending with 5ebc79f.

from hearthstone-ai.

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.