It is currently 20 Sep 2018, 09:06
   
Text Size

Implementation of EnhancedHints

Moderators: Malban, CCGHQ Admins

Implementation of EnhancedHints

Postby Malban » 13 Mar 2011, 18:58

Enhanced Hints

Why were new hints neccessary?
* Because the old ones couldn´t handle all I wanted - hopefully the new ones are able to.
* There were no "Restrictions" on the hints - so you couldn´t reliably base code on them. You
were forced to rely on sensible card designers

What´s new, what´s the main difference?
Hints can be grouped, and one single card can have more than one group of hints. Each group may
belongs to a different kind of situation. So for one card there may be different hints for
playing out the card, decide whether attack or block or activate an ability. This was not
possible with old hints.
New kind of hints can only be added by changing the code. This places necccessary restrictions on
the development of new hint types. They can not grow without control and new hints can be
categorized and named "correctly".

Hint Categories
---------------
There are different Categories of hints:
- Time
- Play Restrictions
- Occurrence

- Target: Target
- Target: Restrictions
- Target: Count
- Target: Type

- Source: Source
- Source: Restrictions
- Source: Count
- Source: Type

- Playability

The Target / Source Hints are basically the same. Some cards refer to two cards,
like steal 2 HP from creature A and heal player B by the same amount...
In this scenario A is the "Source" and B the "Target".

Playability
is not really used yet. It is supposed to give the AI general hints, which refer more to
common sense than to the abilities a card may have.

This basically leaves us with 7 Categories.

- Occurrence
- Type
- Target
- Target-Restrictions
- Target-Count
- Time
- Play-Restrictions

Occurrence
----------
WHEN does the effect the hint refers to takes place.

Definition: csa.jportal.ai.enhancedHints.HintOccurrence

May be one of:
HINT_OCCURRENCE_WHEN_PLAYED,
HINT_OCCURRENCE_WHEN_ATTACKED,
HINT_OCCURRENCE_WHEN_BLOCKED,
HINT_OCCURRENCE_WHEN_ATTACKING,
HINT_OCCURRENCE_WHEN_BLOCKING,
HINT_OCCURRENCE_WHEN_IN_PLAY,
HINT_OCCURRENCE_WHEN_IN_TIMING,
HINT_OCCURRENCE_WHEN_ACTIVATED,
HINT_OCCURRENCE_WHEN_DRAW_CARD,
HINT_OCCURRENCE_WHEN_PUT_TO_GRAVEYARD,
HINT_OCCURRENCE_WHEN_NOT_BLOCKED,

Type
----
WHAT is the effect the hint refers to.

Definition: csa.jportal.ai.enhancedHints.HintSourceTypes / HintTargetTypes

May be one of:
HINT_STYPE_TOUGHNESS_ADD,
HINT_STYPE_POWER_ADD,
HINT_STYPE_ABILITY_ADD,
HINT_STYPE_COLOR_ADD,
HINT_STYPE_PROTECTION_ADD,
HINT_STYPE_TOUGHNESS_SUB,
HINT_STYPE_POWER_SUB,
HINT_STYPE_ABILITY_SUB,
HINT_STYPE_COLOR_SUB,
HINT_STYPE_PROTECTION_SUB,
HINT_STYPE_COLOR_CHANGE,
HINT_STYPE_COLOR_CHANGE_TEXT,
HINT_STYPE_TAP,
HINT_STYPE_UNTAP,
HINT_STYPE_HEAL,
HINT_STYPE_DAMAGE,
HINT_STYPE_CONTROL_CHANGE,
HINT_STYPE_FIELD_TO_GRAVE,
HINT_STYPE_FIELD_TO_HAND,
HINT_STYPE_FIELD_TO_LIBRARY,
HINT_STYPE_FIELD_TO_EXILE,
HINT_STYPE_HAND_TO_LAND,
HINT_STYPE_HAND_TO_GRAVE,
HINT_STYPE_HAND_TO_FIELD,
HINT_STYPE_HAND_TO_LIBRARY,
HINT_STYPE_HAND_TO_EXILE,
HINT_STYPE_LAND_TO_HAND,
HINT_STYPE_LAND_TO_GRAVE,
HINT_STYPE_LAND_TO_LIBRARY,
HINT_STYPE_LAND_TO_EXILE,
HINT_STYPE_LIBRARY_TO_GRAVE,
HINT_STYPE_LIBRARY_TO_HAND,
HINT_STYPE_LIBRARY_TO_LAND,
HINT_STYPE_LIBRARY_TO_FIELD,
HINT_STYPE_LIBRARY_TO_EXILE,
HINT_STYPE_REPLAY_TURN,
HINT_STYPE_REPLAY_PHASE,
HINT_STYPE_LIBRARY_TOP,
HINT_STYPE_GRAVE_TO_HAND,
HINT_STYPE_GRAVE_TO_FIELD,
HINT_STYPE_GRAVE_TO_LAND,
HINT_STYPE_GRAVE_TO_LIBRARY,
HINT_STYPE_GRAVE_TO_EXILE,
HINT_STYPE_ALL_BLOCK_ONE,
HINT_STYPE_ALL_MUST_ATTACK,
HINT_STYPE_ONLY_ONE_BLOCK ,
HINT_STYPE_UNTAP_DENIAL,
HINT_STYPE_ATTACK_DENIAL,
HINT_STYPE_HALF_LIFE,
HINT_STYPE_NOT_CREATURE_DAMAGEABLE,
HINT_STYPE_GENERAL_DEBUF,
HINT_STYPE_GENERAL_BUF,
HINT_STYPE_GENERAL_BLOCK_LIMITATION,
HINT_STYPE_GENERAL_BLOCKER_LIMITATION,
HINT_STYPE_GENERAL_ATTACK_LIMITATION,
HINT_STYPE_NOT_BLOCKABLE_IF_SINGLE_ATTACKER,
HINT_STYPE_CANT_BLOCK,
HINT_STYPE_CHOSE_FROM_LIBRARY,
HINT_STYPE_NOT_BLOCKABLE,
HINT_STYPE_SELF_DESTRUCT,
HINT_STYPE_LIBRARY_ROCHADE,
HINT_STYPE_AURA,
HINT_STYPE_PLAYER_AURA,
HINT_STYPE_STACK_NEGATE_STACK_CARD,
HINT_STYPE_STACK_NEGATE_ABILITY,
HINT_STYPE_STACK_NEGATE_PLAYER_DAMAGE,

Target
------
WHO/WHAT will be effected.

Definition: csa.jportal.ai.enhancedHints.HintSource / HintTarget

May be one of:
HINT_TARGET_FROM_FIELD,
HINT_TARGET_FROM_HAND,
HINT_TARGET_FROM_LAND,
HINT_TARGET_FROM_LIBRARY,
HINT_TARGET_FROM_GRAVE,
HINT_TARGET_FROM_EXILE,
HINT_TARGET_IS_PLAYER,
HINT_TARGET_IS_OPPONNET,
HINT_TARGET_OWNER,
HINT_TARGET_STACK,
HINT_TARGET_SELF,

Target-Restrictions
-------------------
TARGET RESTRICTIONS that may be effected.
Definition: csa.jportal.ai.enhancedHints.HintSourceRestrictions / HintTargetRestrictions

May be one of:
HINT_SR_TYPE_NEEDED,
HINT_SR_SUBTYPE_NEEDED,
HINT_SR_COLOR_NEEDED,
HINT_SR_ABILITY_NEEDED,
HINT_SR_TYPE_RESTRICTION,
HINT_SR_SUBTYPE_RESTRICTION,
HINT_SR_COLOR_RESTRICTION,
HINT_SR_ABILITY_RESTRICTION,
HINT_SR_TAP_NEEDED,
HINT_SR_UNTAP_NEEDED,
HINT_SR_COUNT_MIN_RESTRICTION,
HINT_SR_COUNT_MAX_RESTRICTION,
HINT_SR_POWER_MIN_RESTRICTION,
HINT_SR_POWER_MAX_RESTRICTION,
HINT_SR_TOUGHNESS_MIN_RESTRICTION,
HINT_SR_TOUGHNESS_MAX_RESTRICTION,
HINT_SR_COST_MIN_RESTRICTION,
HINT_SR_COST_MAX_RESTRICTION,
HINT_SR_PLAYER_CARDS,
HINT_SR_OPPONENT_CARDS,
HINT_SR_BLOCKER,
HINT_SR_ATTACKER,
HINT_SR_SELF_OK,

Target-Count
------------
HOW MANY targets are effected, AMOUNT of the effect (heal / damage).
Definition: csa.jportal.ai.enhancedHints.HintSourceCount / HintTargetCount

May be one of:
HINT_TCOUNT_SINGLE_TARGET,
HINT_TCOUNT_MULTI_TARGET,
HINT_TCOUNT_TARGET_MIN,
HINT_TCOUNT_TARGET_MAX,
HINT_TCOUNT_TARGET_COUNT,
HINT_TCOUNT_AMOUNT_COUNT,
HINT_TCOUNT_X_COUNT,
HINT_TCOUNT_ALL_TARGETS,
HINT_TCOUNT_ALL_PLAYERS,
HINT_TCOUNT_ONE_PLAYER,
HINT_TCOUNT_POWER,
HINT_TCOUNT_TOUGHNESS,
HINT_TCOUNT_SPECIAL,
HINT_TCOUNT_OPPONENT_MORE_DIF,
HINT_TCOUNT_HAS_AMOUNT_MULTIPLYER,
HINT_TCOUNT_MULTIPLYER_FACTOR,
HINT_TCOUNT_MULTIPLYER_PLAYER,
HINT_TCOUNT_MULTIPLYER_OPPONENT,
HINT_TCOUNT_MULTIPLYER_RESTRICTION_TYPE,
HINT_TCOUNT_MULTIPLYER_RESTRICTION_SUBTYPE,
HINT_TCOUNT_MULTIPLYER_RESTRICTION_COLOR,
HINT_TCOUNT_MULTIPLYER_RESTRICTION_TAPPED,
HINT_TCOUNT_MULTIPLYER_RESTRICTION_UNTAPPED,
HINT_TCOUNT_MULTIPLYER_RESTRICTION_HAND,
HINT_TCOUNT_MULTIPLYER_RESTRICTION_LAND,
HINT_TCOUNT_MULTIPLYER_RESTRICTION_FIELD,
HINT_TCOUNT_MULTIPLYER_RESTRICTION_GRAVE,
HINT_TCOUNT_MULTIPLYER_RESTRICTION_ATTACKER,

Time
----
HOW LONG will the effect last.

Definition: csa.jportal.ai.enhancedHints.HintTime

May be one of:
HINT_TTIME_TURN_COUNT,
HINT_TTIME_PHASE_COUNT,
HINT_TTIME_TARGET_DEATH,
HINT_TTIME_SOURCE_DEATH,
HINT_TTIME_ONCE,

Play-Restrictions
-----------------
RESTRICTION on PLAY, when can the effect be played out.

Definition: csa.jportal.ai.enhancedHints.HintPlayRestrictions

May be one of:
HINT_PR_INSTANT_ANY,
HINT_PR_INSTANT_CARD_PLAYED,
HINT_PR_INSTANT_ATTACKER_DECLARED,
HINT_PR_INSTANT_BLOCKER_DECLARED,
HINT_PR_INSTANT_ATTACKER_DECLARED_FINAL,
HINT_PR_INSTANT_BLOCKER_DECLARED_FINAL,
HINT_PR_PLAYER_TURN,
HINT_PR_OPPONENT_TURN,
HINT_PR_OPPONENT_MORE_CARDS,

Examples
--------

Portal: Assassin's Blade
........................
Code: Select all
No   Key     Type                   Name                      Value
1   INSTANT   PLAY RESTRICTION     OPPONENT TURN                 true
1   INSTANT   TARGET RESTRICTION   COLOR(s) RESTRICTION          B
1   INSTANT   TARGET RESTRICTION   ATTACKER                     true
1   INSTANT   TARGET RESTRICTION   OPPONENT CARDS               true
1   INSTANT   TARGET               TARGET FROM FIELD             true
1   INSTANT   TARGET EFFECT TYPE   FIELD TO GRAVE               true
1   INSTANT   OCCURRENCE           WHEN PLAYED                   true
1   INSTANT   PLAY RESTRICTION     WHILE ATTACKER DECLARATION   true
1   INSTANT   TARGET EFFECT COUNT   IS SINGLE TARGET              1
1   INSTANT   TARGET RESTRICTION   TYPE NEEDED                  Creature
Renewing Dawn
.............
Code: Select all
No   Key     Type                    Name                     Value
1   MAIN   TARGET EFFECT COUNT       MULTIPLYER LAND            true
1   MAIN   TARGET EFFECT COUNT       MULTIPLYER OPPONENT        true
1   MAIN   OCCURRENCE               WHEN PLAYED                true
1   MAIN   TARGET EFFECT COUNT       MULTIPLYER COLOR           R
1   MAIN   TARGET EFFECT COUNT       HAS AMOUNT MULTIPLYER      true
1   MAIN   TARGET EFFECT COUNT       MULTIPLYER TYPE            Land
1   MAIN   TARGET EFFECT COUNT       MULTIPLYER FACTOR           2
1   MAIN   TARGET EFFECT COUNT       MULTIPLYER SUBTYPE       Mountain
1   MAIN   TARGET                   TARGET IS PLAYER          true
1   MAIN   TARGET EFFECT TYPE       HEAL                      true
Homepage of JPortal: http://jportalgame.de/
Malban
DEVELOPER
 
Posts: 84
Joined: 26 Apr 2010, 14:11
Has thanked: 0 time
Been thanked: 12 times

Return to JPortal Documentation

Who is online

Users browsing this forum: No registered users and 1 guest


Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 10 minutes)
Most users ever online was 279 on 11 Jul 2013, 22:03

Users browsing this forum: No registered users and 1 guest

Login Form