*Author

Offline GG

  • Legendary Member
  • ******
  • Posts: 2253
  • Reputation Power: 28
  • GG is a proud Wyrm taking wing for the first time.GG is a proud Wyrm taking wing for the first time.GG is a proud Wyrm taking wing for the first time.GG is a proud Wyrm taking wing for the first time.GG is a proud Wyrm taking wing for the first time.
  • Retired from everything...
  • Awards: Slice of Elements 5th Birthday Cake3rd Trials - Master of Gravity2nd Trials - Master of GravityC-C-C-Combo Maker Winner!Weekly Tournament WinnerChampionship League 1/2011 WinnerWeekly Tournament WinnerWeekly Tournament WinnerChampionship League 3/2010 2nd PlaceNew Passive Ability Competition Winner
Re: Game Coding Q&A https://elementscommunity.org/forum/index.php?topic=32442.msg410958#msg410958
« Reply #36 on: October 16, 2011, 01:30:14 pm »
As you've mentioned in the OP... How do bolt spells work? Multiple of 3 damage or just as a bulk?
Ex-Master of :gravity, still a fervid supporter! GO GRAVY!

Offline furballdn

  • Legendary Member
  • ******
  • Posts: 7573
  • Reputation Power: 86
  • furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.
  • Facetious trollnotmod
  • Awards: Epic 3 Card Winner - Clockwork GolemBest Recruiter of FriendsBest JournalistBest Chat PainterBattle - Slayer of The Great ChimeraBest Crafted Relic of Other
Re: Game Coding Q&A https://elementscommunity.org/forum/index.php?topic=32442.msg411242#msg411242
« Reply #37 on: October 16, 2011, 11:29:42 pm »
If the AI has a weapon, and I have a weapon, and the AI has a crusader on the field ready to endow a weapon, whose does it endow? Which weapons have priority?

Offline XenocidiusTopic starter

  • Legendary Member
  • ******
  • Posts: 2696
  • Reputation Power: 49
  • Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.
  • Fear the Darkness ...
  • Awards: Slice of Elements 3rd Birthday CakeFavorite Community Member of 2011Weekly Tournament WinnerWinner of Design a Competition Competition
Re: Game Coding Q&A https://elementscommunity.org/forum/index.php?topic=32442.msg411245#msg411245
« Reply #38 on: October 16, 2011, 11:35:55 pm »
What's the AI priority with permanents? I noticed the AI tends to hate my hourglass more than my arsenic more than my fog shield.
For permanents, this formula is used for score. Destroy and steal both have an estimate of -1.

Score = (permanent cost + 1)  * -estimate / 20

That means that the permanent with the highest cost will get targeted. If two permanents have the same cost the one with a lower slot number will be targeted.

That's not entirely true, from my experience in game the AI will target Eternity over anything else (including for example Permafrost Shield) and Hourglass over everything other than Eternity. I think there could also be an exception for Bone Wall (I think it takes Pulverizer over BW).
edit. Also Fahrenheit over Fire Buckler.
Yeah, I've noticed that as well. I'm searching through the code to find out why that formula isn't the only thing being used. I'll keep you updated.

As you've mentioned in the OP... How do bolt spells work? Multiple of 3 damage or just as a bulk?
Bulk.

If the AI has a weapon, and I have a weapon, and the AI has a crusader on the field ready to endow a weapon, whose does it endow? Which weapons have priority?
The algorithm for selecting a weapon to endow is actually quite complex. I'll post it here later.
Don't cry because it's over, smile because it happened.

Contrary

  • Guest
Re: Game Coding Q&A https://elementscommunity.org/forum/index.php?topic=32442.msg411287#msg411287
« Reply #39 on: October 17, 2011, 01:41:20 am »
How does the AI use Catapults? I got it as an arena oracle card and I tried making a Flying Titan decks for lols, but when I tested it the AI wasn't using it, prefer to hack away with me turn by turn rather than finish the game with a quick throw.

Offline Rutarete

  • Legendary Member
  • ******
  • Posts: 6505
  • Country: us
  • Reputation Power: 72
  • Rutarete frolics as one of the Phase Dragons, timeless and superior, gargantuan beasts of peerless wisdom.Rutarete frolics as one of the Phase Dragons, timeless and superior, gargantuan beasts of peerless wisdom.Rutarete frolics as one of the Phase Dragons, timeless and superior, gargantuan beasts of peerless wisdom.Rutarete frolics as one of the Phase Dragons, timeless and superior, gargantuan beasts of peerless wisdom.Rutarete frolics as one of the Phase Dragons, timeless and superior, gargantuan beasts of peerless wisdom.Rutarete frolics as one of the Phase Dragons, timeless and superior, gargantuan beasts of peerless wisdom.Rutarete frolics as one of the Phase Dragons, timeless and superior, gargantuan beasts of peerless wisdom.Rutarete frolics as one of the Phase Dragons, timeless and superior, gargantuan beasts of peerless wisdom.Rutarete frolics as one of the Phase Dragons, timeless and superior, gargantuan beasts of peerless wisdom.Rutarete frolics as one of the Phase Dragons, timeless and superior, gargantuan beasts of peerless wisdom.Rutarete frolics as one of the Phase Dragons, timeless and superior, gargantuan beasts of peerless wisdom.Rutarete frolics as one of the Phase Dragons, timeless and superior, gargantuan beasts of peerless wisdom.Rutarete frolics as one of the Phase Dragons, timeless and superior, gargantuan beasts of peerless wisdom.Rutarete frolics as one of the Phase Dragons, timeless and superior, gargantuan beasts of peerless wisdom.
  • Creativity should be nurtured.
  • Awards: Slice of Elements 6th Birthday CakeSlice of Elements 5th Birthday CakeSlice of Elements 4th Birthday CakeRuby Shard of DeckbuildingSlice of Elements 3rd Birthday Cake
Re: Game Coding Q&A https://elementscommunity.org/forum/index.php?topic=32442.msg411322#msg411322
« Reply #40 on: October 17, 2011, 03:34:04 am »
Why does the AI withhold playing something (referring to permanents here) even though playing it would save handroom (preventing discarding) and act as a contingency?
It is the greatest mystery of all...
Rutarete: Roo tah reh teh
[22:50] <Jyi> meaning gets lost in translation... even in the same language.
My Decks

Offline XenocidiusTopic starter

  • Legendary Member
  • ******
  • Posts: 2696
  • Reputation Power: 49
  • Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.
  • Fear the Darkness ...
  • Awards: Slice of Elements 3rd Birthday CakeFavorite Community Member of 2011Weekly Tournament WinnerWinner of Design a Competition Competition
Re: Game Coding Q&A https://elementscommunity.org/forum/index.php?topic=32442.msg411354#msg411354
« Reply #41 on: October 17, 2011, 05:44:26 am »
If the AI has a weapon, and I have a weapon, and the AI has a crusader on the field ready to endow a weapon, whose does it endow? Which weapons have priority?
The algorithm for selecting a weapon to endow is actually quite complex. I'll post it here later.
Okay, it's not actually that complex. Note that it goes through all weapons, both permanent and creature.

First it gives each weapon a skillscore based on this formula:

If weapon skill is triggered (manually activated), skillscore = AI quanta in skill element / (1 + skillcost).
Otherwise, skillscore = 1.

Then it gives each weapon a score:

Score = weapon attack + skillscore

Weapon with the highest score will be targeted. In short, it takes both weapon damage and whether it can readily pay for the weapon's skill into account.

How does the AI use Catapults? I got it as an arena oracle card and I tried making a Flying Titan decks for lols, but when I tested it the AI wasn't using it, prefer to hack away with me turn by turn rather than finish the game with a quick throw.
First an estimate is made. If the AI has more than 20 creatures on the field, the estimate is 100. If the player has 20 or less creature, the estimate is 20. Then it gives each of its creatures a score:

Score = (estimate * current HP of creature) / (player HP + 1) + (number of turns creature is frozen for) + (poison counters on creature)*3 - (current attack of creature)/20

And it only decides to use catapult if the maximum score found > random score, where:

Random score = ((random number between 0 and 1) + 0.1) / (number of cards in AI hand)

Why does the AI withhold playing something (referring to permanents here) even though playing it would save handroom (preventing discarding) and act as a contingency?
Because it's not smart enough.

I've talked about the algorithm for playing shields and weapons before - generally a weapon or shield will be played if its cost is greater than the one currently equipped.

Sundial will only be played if player has Phase Shield or damage player is dealing > damage AI is dealing.

Flooding will only be played if the field is not already flooded and the player has 7 or more creatures (Zanz obviously forgot to change this - it should be 5).

Cloak will not be played if there is one on the AI's field with counters left on it.

Nightfall will not be played if there is Nightfall or Eclipse already on the field.

Eclipse will not be played if there is Eclipse already on the field.
Don't cry because it's over, smile because it happened.

Offline OldTrees

  • Legendary Member
  • ******
  • Posts: 10297
  • Reputation Power: 114
  • OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.OldTrees is a mythical and divine giver of immortality, one of the Turquoise Nymphs.
  • I was available for questions.
  • Awards: Brawl #2 Winner - Team FireTeam Card Design Winner
Re: Game Coding Q&A https://elementscommunity.org/forum/index.php?topic=32442.msg411380#msg411380
« Reply #42 on: October 17, 2011, 07:14:38 am »
How does the AI use Catapults? I got it as an arena oracle card and I tried making a Flying Titan decks for lols, but when I tested it the AI wasn't using it, prefer to hack away with me turn by turn rather than finish the game with a quick throw.
First an estimate is made. If the AI has more than 20 creatures on the field, the estimate is 100. If the player has less than or equal to 20 health, the estimate is 20. Then it gives each of its creatures a score:

Which dominates? The AI with 21 creatures or the player with 19hp?
Why the low estimate (20) when player hp is low?
"It is common sense to listen to the wisdom of the wise. The wise are marked by their readiness to listen to the wisdom of the fool."
"Nothing exists that cannot be countered." -OldTrees on indirect counters
Ask the Idea Guru: http://elementscommunity.org/forum/index.php/topic,32272.0.htm

Offline XenocidiusTopic starter

  • Legendary Member
  • ******
  • Posts: 2696
  • Reputation Power: 49
  • Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.Xenocidius is towering like an Amethyst Dragon over their peers.
  • Fear the Darkness ...
  • Awards: Slice of Elements 3rd Birthday CakeFavorite Community Member of 2011Weekly Tournament WinnerWinner of Design a Competition Competition
Re: Game Coding Q&A https://elementscommunity.org/forum/index.php?topic=32442.msg411382#msg411382
« Reply #43 on: October 17, 2011, 07:15:59 am »
Whoops, sorry. Fixed.

That is, it's not 20 health but 20 creatures.
Don't cry because it's over, smile because it happened.

Offline BluePriest

  • Legendary Member
  • ******
  • Posts: 3771
  • Reputation Power: 46
  • BluePriest is towering like an Amethyst Dragon over their peers.BluePriest is towering like an Amethyst Dragon over their peers.BluePriest is towering like an Amethyst Dragon over their peers.BluePriest is towering like an Amethyst Dragon over their peers.BluePriest is towering like an Amethyst Dragon over their peers.BluePriest is towering like an Amethyst Dragon over their peers.BluePriest is towering like an Amethyst Dragon over their peers.BluePriest is towering like an Amethyst Dragon over their peers.BluePriest is towering like an Amethyst Dragon over their peers.
  • Entropy Has You
  • Awards: Slice of Elements 5th Birthday Cake
Re: Game Coding Q&A https://elementscommunity.org/forum/index.php?topic=32442.msg411477#msg411477
« Reply #44 on: October 17, 2011, 12:46:39 pm »
Why does the AI withhold playing something (referring to permanents here) even though playing it would save handroom (preventing discarding) and act as a contingency?
This isnt based on any coding I saw, but instead based on what Ive seen the ai do. Aside from them not having a reason to based on the requirements xeno mentioned, it also seems certain cards have a higher priority to play, therefor they will hold off playing one card, even if it means having to discard so that they can play another one that they deem more worthy.
This sig was interrupted by Joe Biden

Offline bored_ninja777

  • Hero Member
  • *****
  • Posts: 1080
  • Reputation Power: 13
  • bored_ninja777 is taking their first peeks out of the Antlion's burrow.bored_ninja777 is taking their first peeks out of the Antlion's burrow.
Re: Game Coding Q&A https://elementscommunity.org/forum/index.php?topic=32442.msg411502#msg411502
« Reply #45 on: October 17, 2011, 01:54:30 pm »
I know the AI has played nightfall with eclipse on the field... or other way around.. it did it because whichever one it is gives a bigger +/+. although they dont stack the AI does put out both if the first one is the weaker version.. only in Arena did i see this though. There are many situations like catapult and others where having a card in hand and not playing it kills them.. but playing it would kill me. There has got to be a way to have the AI look at our hp and add up the damage to be dealt already in play.. If it only needs X damage and it has X or more in hand or through a card effect on the field it should use it. also the way it draws is really obnoxious.. typically you want to do any and all drawing of cards FIRST, before any other actions.. instead it randomly draws all through the turn playing in between.. having cards in hand FIRST is best so you know what to play AFTER that.. unless you are close to decking out. Also i think that immolation should get a higher priority to play it over a buff just to prevent wasting cards.. ive seen the AI do it too many times now... photon, immolation, photon, armor, immolation.. in that order.. Also sacrificing only photons? is that hardcoded? unless i Antimatter a creature they only use it on photons or each elements -2 cost creatures that are more or less useless outside of that.. why not phoenix? is it to prevent not damaging the opponent by making it an ash on purpose?
 
as you stated about the shields, why the one that costs more.. More often than not the AI switches shields and screws themselves by doing so. should be some sort of rule set for each shield that only certain conditions warrant a change. maybe give each a rating?

Bonewall and phase shield : highest due to stall. never play over bonewall though unless its at 1 left?
then go by damage prevention? with diamond shield, ice shield with freeze, jade with deflection of spells, then Shield
after that the weaker ones that stop 1 damage or stop at a % with higher percentages being above.
then ones that only reflect, poison creatures, or fire shield damages them.

~McPasty was here~

Offline Calindu

  • Legendary Member
  • ******
  • Posts: 3874
  • Country: ro
  • Reputation Power: 50
  • Calindu brings all the vitality and activity of a Life Nymph.Calindu brings all the vitality and activity of a Life Nymph.Calindu brings all the vitality and activity of a Life Nymph.Calindu brings all the vitality and activity of a Life Nymph.Calindu brings all the vitality and activity of a Life Nymph.Calindu brings all the vitality and activity of a Life Nymph.Calindu brings all the vitality and activity of a Life Nymph.Calindu brings all the vitality and activity of a Life Nymph.Calindu brings all the vitality and activity of a Life Nymph.Calindu brings all the vitality and activity of a Life Nymph.
  • Abomination is quite pretty
  • Awards: Slice of Elements 8th Birthday CakeWeekly Tournament WinnerFourth Budosei of BudokanSlice of Elements 7th Birthday CakeWar #9 Winner - Team Darkness8th Trials - Master of EntropyChampionship League 2/2013 2nd PlaceWeekly Tournament WinnerColosseum II Champion7th Trials - Master of EntropyWeekly Tournament WinnerWeekly Tournament WinnerSlice of Elements 4th Birthday CakeWeekly Tournament WinnerChampionship League 3/2012 Winner6th Trials - Master of EntropyWinner of There Can Be Only One!Slice of Elements 3rd Birthday CakeChampionship League 3/2011 2nd PlaceWeekly Tournament WinnerWeekly Tournament Winner
Re: Game Coding Q&A https://elementscommunity.org/forum/index.php?topic=32442.msg411506#msg411506
« Reply #46 on: October 17, 2011, 02:08:59 pm »
How Ai decides what creature to fractal?
You know, a long time ago being crazy meant something. Nowadays everybody's crazy.
War

Offline furballdn

  • Legendary Member
  • ******
  • Posts: 7573
  • Reputation Power: 86
  • furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.furballdn is a mythical and divine giver of immortality, one of the Turquoise Nymphs.
  • Facetious trollnotmod
  • Awards: Epic 3 Card Winner - Clockwork GolemBest Recruiter of FriendsBest JournalistBest Chat PainterBattle - Slayer of The Great ChimeraBest Crafted Relic of Other
Re: Game Coding Q&A https://elementscommunity.org/forum/index.php?topic=32442.msg411705#msg411705
« Reply #47 on: October 18, 2011, 12:17:23 am »
When does the AI decide to hit you with a spell instead of your creature?

 

anything
blarg: