*Author

Offline ZephyrPhantom

  • Legendary Member
  • ******
  • Posts: 7675
  • Country: aq
  • Reputation Power: 101
  • ZephyrPhantom is a mythical and divine giver of immortality, one of the Turquoise Nymphs.ZephyrPhantom is a mythical and divine giver of immortality, one of the Turquoise Nymphs.ZephyrPhantom is a mythical and divine giver of immortality, one of the Turquoise Nymphs.ZephyrPhantom is a mythical and divine giver of immortality, one of the Turquoise Nymphs.ZephyrPhantom is a mythical and divine giver of immortality, one of the Turquoise Nymphs.ZephyrPhantom is a mythical and divine giver of immortality, one of the Turquoise Nymphs.ZephyrPhantom is a mythical and divine giver of immortality, one of the Turquoise Nymphs.ZephyrPhantom is a mythical and divine giver of immortality, one of the Turquoise Nymphs.ZephyrPhantom is a mythical and divine giver of immortality, one of the Turquoise Nymphs.ZephyrPhantom is a mythical and divine giver of immortality, one of the Turquoise Nymphs.ZephyrPhantom is a mythical and divine giver of immortality, one of the Turquoise Nymphs.ZephyrPhantom is a mythical and divine giver of immortality, one of the Turquoise Nymphs.ZephyrPhantom is a mythical and divine giver of immortality, one of the Turquoise Nymphs.ZephyrPhantom is a mythical and divine giver of immortality, one of the Turquoise Nymphs.ZephyrPhantom is a mythical and divine giver of immortality, one of the Turquoise Nymphs.
  • Awards: Slice of Elements 6th Birthday CakeSlice of Elements 4th Birthday CakeFlavour Text Revival Competition - WinnerSlice of Elements 3rd Birthday CakeSlice of Elements 2nd Birthday Cake
Re: Game Coding Q&A https://elementscommunity.org/forum/index.php?topic=32442.msg434945#msg434945
« Reply #120 on: December 04, 2011, 10:31:11 pm »
As for my question:
Is there any way to know how cards are coded into the game?
That's quite a broad question. I'm fairly sure I know how cards are coded into the game in general but I'm not sure what your question specifically means. Could you clarify?
Sure, I'll split my question into two parts.
How are a card's stats, ability, and cost coded?
How is targeting coded?
(Probably a simple concept, but I'm interested anyway.)

klown420

  • Guest
Re: Game Coding Q&A https://elementscommunity.org/forum/index.php?topic=32442.msg436309#msg436309
« Reply #121 on: December 08, 2011, 03:15:38 pm »
thnx xeno questions asked part hlped alot

Offline plastiqe

  • Hero Member
  • *****
  • Posts: 1749
  • Country: ca
  • Reputation Power: 0
  • plastiqe hides under a Cloak.
Re: Game Coding Q&A https://elementscommunity.org/forum/index.php?topic=32442.msg437471#msg437471
« Reply #122 on: December 11, 2011, 02:58:16 pm »
Antimatter:  Four turn duration.  Cost changed to :entropy X, where X is the cost of the target creature.
(eg. Casting Antimatter on Abomination costs 6 :entropy (1 + 5 casting cost).  It will always cost a minium of 1 :entropy to play Antimatter.  When the duration runs out the effect will revert.)
Can you have a variable casting cost in Elements?

Mitosis can recognize the casting cost of a creature and assign a skill cost based on that.  Wouldn't the same thing work with a spell that just read the target creatures cost and applied it to the casting cost when the spell was cast?

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.msg437606#msg437606
« Reply #123 on: December 11, 2011, 08:12:35 pm »
Can you have a variable casting cost in Elements?
Can it also have a variable ability cost?
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.msg437719#msg437719
« Reply #124 on: December 11, 2011, 11:55:52 pm »
As for my question:
Is there any way to know how cards are coded into the game?
That's quite a broad question. I'm fairly sure I know how cards are coded into the game in general but I'm not sure what your question specifically means. Could you clarify?
Sure, I'll split my question into two parts.
How are a card's stats, ability, and cost coded?
How is targeting coded?
(Probably a simple concept, but I'm interested anyway.)
Stats, ability and cost are all properties of an object (the object being the card). Look up 'object-oriented programming' if you're interested.

I'm not entirely sure what you mean by targeting.

Antimatter:  Four turn duration.  Cost changed to :entropy X, where X is the cost of the target creature.
(eg. Casting Antimatter on Abomination costs 6 :entropy (1 + 5 casting cost).  It will always cost a minium of 1 :entropy to play Antimatter.  When the duration runs out the effect will revert.)
Can you have a variable casting cost in Elements?

Mitosis can recognize the casting cost of a creature and assign a skill cost based on that.  Wouldn't the same thing work with a spell that just read the target creatures cost and applied it to the casting cost when the spell was cast?
Yes.

Antimatter would be given a cost of 1 :entropy (that would appear on the card). However, part of its ability would be that it also drains :entropy quanta up to the casting cost of the target creature when cast. Alternatively, it could be restricted such that you can only target creatures for which you can pay the full cost. The first option would be much easier though.

Can you have a variable casting cost in Elements?
Can it also have a variable ability cost?
Basically the same thing as above.
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.msg437751#msg437751
« Reply #125 on: December 12, 2011, 02:04:48 am »
Antimatter:  Four turn duration.  Cost changed to :entropy X, where X is the cost of the target creature.
(eg. Casting Antimatter on Abomination costs 6 :entropy (1 + 5 casting cost).  It will always cost a minium of 1 :entropy to play Antimatter.  When the duration runs out the effect will revert.)
Can you have a variable casting cost in Elements?

Mitosis can recognize the casting cost of a creature and assign a skill cost based on that.  Wouldn't the same thing work with a spell that just read the target creatures cost and applied it to the casting cost when the spell was cast?
Yes.

Antimatter would be given a cost of 1 :entropy (that would appear on the card). However, part of its ability would be that it also drains :entropy quanta up to the casting cost of the target creature when cast. Alternatively, it could be restricted such that if you did not have enough quanta to pay for the whole 1 + casting cost, it would reject the casting and send it back to your hand. The first option would be much easier though.
The problem I see with variable casting costs is related to calculating whether to show the usable or unusable signal in the hand. The hand GUI would not know whether to show the 1+X casting cost as usable or unusable since it is not tracking available targets.

Is this accurate?
"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.msg437755#msg437755
« Reply #126 on: December 12, 2011, 02:13:11 am »
Indeed. What would happen is that you would be able to cast it if you had 1 :entropy. The available targets themselves would depend on their casting costs and your quanta.

Essentially, though the usable or unusable signal in the hand wouldn't really work with variable casting costs, targeting would. The thing to realize is that it is actually a constant casting cost, but part of its ability both drains extra quanta when fully cast, and prevents you from targeting a creature that costs more than you can afford.
Don't cry because it's over, smile because it happened.

Offline teffy

  • Hero Member
  • *****
  • Posts: 1689
  • Country: de
  • Reputation Power: 20
  • teffy is a Mummy waiting to discover the path to glory.teffy is a Mummy waiting to discover the path to glory.teffy is a Mummy waiting to discover the path to glory.teffy is a Mummy waiting to discover the path to glory.
  • May the oracle be with you
  • Awards: Slice of Elements 15th Birthday CakeSlice of Elements 14th Birthday CakeSlice of Elements 4th Birthday CakeSlice of Elements 3rd Birthday CakeWeekly Tournament WinnerSlice of Elements 2nd Birthday Cake
Re: Game Coding Q&A https://elementscommunity.org/forum/index.php?topic=32442.msg443281#msg443281
« Reply #127 on: December 29, 2011, 12:26:48 pm »
Hello.
Here is my question:
How does the oracle decide, which FG prediction you get ?
I`m teffy, here - and Ringat on Kongregate

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.msg443300#msg443300
« Reply #128 on: December 29, 2011, 01:47:21 pm »
Hello.
Here is my question:
How does the oracle decide, which FG prediction you get ?
It picks a random number between 1 and 29.
Don't cry because it's over, smile because it happened.

Offline willng3

  • Legendary Member
  • ******
  • Posts: 5763
  • Country: us
  • Reputation Power: 77
  • willng3 is a mythical and divine giver of immortality, one of the Turquoise Nymphs.willng3 is a mythical and divine giver of immortality, one of the Turquoise Nymphs.willng3 is a mythical and divine giver of immortality, one of the Turquoise Nymphs.willng3 is a mythical and divine giver of immortality, one of the Turquoise Nymphs.willng3 is a mythical and divine giver of immortality, one of the Turquoise Nymphs.willng3 is a mythical and divine giver of immortality, one of the Turquoise Nymphs.willng3 is a mythical and divine giver of immortality, one of the Turquoise Nymphs.willng3 is a mythical and divine giver of immortality, one of the Turquoise Nymphs.willng3 is a mythical and divine giver of immortality, one of the Turquoise Nymphs.willng3 is a mythical and divine giver of immortality, one of the Turquoise Nymphs.willng3 is a mythical and divine giver of immortality, one of the Turquoise Nymphs.willng3 is a mythical and divine giver of immortality, one of the Turquoise Nymphs.willng3 is a mythical and divine giver of immortality, one of the Turquoise Nymphs.willng3 is a mythical and divine giver of immortality, one of the Turquoise Nymphs.willng3 is a mythical and divine giver of immortality, one of the Turquoise Nymphs.
  • Your tears are delicious
  • Awards: 10th Trials - Master of LifeSlice of Elements 7th Birthday CakeWeekly Tournament WinnerSlice of Elements 6th Birthday CakeWar Correspondent Competition - WinnnerWeekly Tournament Winner6th Trials - Master of LifeSlice of Elements 3rd Birthday Cake5th Trials - Master of Life4th Trials - Master of LifeSlice of Elements 2nd Birthday CakeShort Story: Rare Mythology Competition Winner
Re: Game Coding Q&A https://elementscommunity.org/forum/index.php?topic=32442.msg443444#msg443444
« Reply #129 on: December 30, 2011, 03:07:55 am »
Hmm...I had a recent run-in with my own Arena deck where its field was almost filled with Skeletons (unupped) as well as 2 Otyugh.  I had about 8 Giant Frogs on the field, but at some point the AI turned away from Devouring my Frogs and instead began to try and eliminate its own Skeletons.

Is there something in the code that causes the AI to switch its targeting priority once its field becomes filled to a certain point?
"If you want to know what a man's like, take a good look at how he treats his inferiors, not his equals"

Forum reigned by my mixtape

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.msg443453#msg443453
« Reply #130 on: December 30, 2011, 03:33:42 am »
Hmm...I had a recent run-in with my own Arena deck where its field was almost filled with Skeletons (unupped) as well as 2 Otyugh.  I had about 8 Giant Frogs on the field, but at some point the AI turned away from Devouring my Frogs and instead began to try and eliminate its own Skeletons.

Is there something in the code that causes the AI to switch its targeting priority once its field becomes filled to a certain point?
The answer is found here (http://elementscommunity.org/wiki/articles/coding-of-the-game-ai/#Autotarget).

Quote
If skill is “devour”:

estimate = -1
targeting = "smaller"

Now scrolling down a bit:

Quote
If skill is targeting “smaller”

This targets a creature to be devoured.

Loop through all the AI’s creatures with less def than the devouring creature.

If creature is poisoned or (current ATK + current def < 3 and it has no active skill):

score[AI creature] = -estimate / 10

If AI has more than 20 creatures:

score[AI creature] = -estimate / (current ATK)

Loop through all the player’s creatures with less def than the devouring creature.

If creature has an active skill:

skillscore = 3

Now calculate score:

score[player creature] = (skillscore + 1 + current ATK) / -estimate / 10

This piece of code is used to calculate Giant Frog's score:

score[player creature] = (skillscore + 1 + current ATK) / -estimate / 10
So: score[Giant Frog] = (0 + 1 + 5) / 1 / 10 = 6/10 = 3/5 {Because Giant Frog has no skill, skillscore is 0}

Normally, this piece of code is used to calculate Skeleton's score:

If creature is poisoned or (current ATK + current def < 3 and it has no active skill):
score[AI creature] = -estimate / 10

So, score[Skeleton] = 1/10, as opposed to Giant Frog's 3/5. Therefore, it devours Giant Frog over Skeleton.

However, when the AI has more than 20 creatures, Skeleton's score is calculated like this:

score[AI creature] = -estimate / (current ATK)

So, score[Skeleton] = 1 / 1 = 1.

Skeleton's score is now 1, as opposed to Giant Frog's 3/5, hence it devours Skeleton.


tl;dr: When AI has more than 20 creatures, turns masochistic.
Don't cry because it's over, smile because it happened.

Re: Game Coding Q&A https://elementscommunity.org/forum/index.php?topic=32442.msg443466#msg443466
« Reply #131 on: December 30, 2011, 04:56:23 am »
Xeno,
I see the methods here are pretty straight forward variable fixed code set...
I don't know much about what systems and tool sets additional languages outside of flash are being used nor budget matters, etc;
But,  I have some AI experience behind me in different application, but I was wondering if zanz or anyone else deeply involved in development of this site is interested in some different approaches to the AI to make it much more dynamic?

 

anything
blarg: