December 11, 2024, 05:46:34 PM

Author Topic: I've discovered the Mage Wars equation (I think)  (Read 21198 times)

fas723

  • Sr. Mage
  • ****
  • Posts: 277
  • Banana Stickers 0
    • View Profile
Re: I've discovered the Mage Wars equation (I think)
« Reply #30 on: April 29, 2014, 08:21:37 AM »
Imaginator,
I've also been trying to read / understan your equation. It not very easy to follow everything (if you have spent hours it is not strange it is hard for us to follow based on just a forum post).

You probably have some good thouts behind all this, which I really would like to understand.

Am I following you that for Mana, life, damage etc you just type in whatever you have? For all creatures? For each given round?
The parameter Object, tempo etc is harder to follow... Do you use 1,2,3 at object based on the number of enchantments / equipment you have? Tempo is +1 each time your opponent pass one of his action?
At the end you summuraz everything (before gi+r|total|*(m(cavg/r)+(areset)avg/r)

∑[(-sn∨-cn∨-mn∨-on∨-an∨-trn∨-pn∨-tn∨-dn∨-ln∨0n∨-stpn∨-phn∨-stgn∨-rcurrentn)+(sn, cn, mn, on, an, trn, pn, tn, dn, ln, 0n, stpn, phn, stgn, rcurrentn)]*[r|total|*(a+tr)avg/r]

I struggel a bit with your parameters having different units. Is it correct to add all the differnet things together. At a first view it looks like you are adding car with bananas, blue and happy. Maybe I'm not reading it right...

lettucemode

  • Guest
Re: I've discovered the Mage Wars equation (I think)
« Reply #31 on: April 29, 2014, 09:10:57 AM »
It's not really an equation for predicting a game state, it's the equation for what the game state will be after some stuff has happened. The first part of it is "gameStateFinal = gameStateInitial + ...."

It would be useful for making an AI mage wars opponent (or at least I hope).

I have done a good chunk of AI work in the past. For something like a board or card game, the overall best way to make an AI is called a state space search. In essence, the game has an initial state, a "goal" state which the AI is trying to reach, operations that move the game from one state to the next, and a heuristic (or formula) that determines how favorable a particular state is. An example of this is Chess AIs, which have been better than humans for at least a decade because they literally check every single game state for at least 20 moves out and figure out which path is the best. This is also the reason why Go AIs are generally bad - the state space is so gigantically enormous that it simply can't be searched in the time the human player is willing to wait.

From that perspective, I think your equation makes sense if the things you are adding together are not strictly numbers, but more like actions or pieces of a game state. I think some of the confusion in this thread is because it's very normal to see the word "equation" and think of a numerical formula. But you have made something more like a model.

It is easy to model a Mage Wars game state with modern programming tools already. However, something that would be insanely, incredibly, amazingly useful for an AI would be the heuristic I mentioned. That is, a formula where the input is the game state and the output is a number that represents how favorable that particular game state is for one player. An extremely naive example would be something like: favorability = number of my creatures - number of opponent's creatures. But a really good one would take into account creatures, whether it's early, mid, or late game, current life, mana, and channeling, and a host of other things. If you could tweak your model into something like that, I think it would generate a great deal of positive discussion and could produce something very cool and useful.
« Last Edit: April 29, 2014, 11:38:08 AM by lettucemode »

Zuberi

  • Rules Guru
  • Playtester
  • Legendary Mage
  • *
  • Posts: 2504
  • Banana Stickers 57
    • View Profile
Re: I've discovered the Mage Wars equation (I think)
« Reply #32 on: April 30, 2014, 04:31:23 AM »
The post by lettucemode really helped me to understand what was going on. That makes a lot of sense.

ringkichard

  • Flightless Funpire
  • Playtester
  • Legendary Mage
  • *
  • Posts: 2564
  • Banana Stickers 18
  • Kich, if you prefer.
    • View Profile
Re: I've discovered the Mage Wars equation (I think)
« Reply #33 on: April 30, 2014, 06:21:44 AM »
I also really like LM's post about AI modeling.
I can take the fun out of anything. It's true; here, look at this spreadsheet.

Hedge

  • Full Mage
  • ***
  • Posts: 174
  • Banana Stickers 1
    • View Profile
Re: I've discovered the Mage Wars equation (I think)
« Reply #34 on: May 02, 2014, 03:27:17 PM »
Great news guys, it seems we have found our solution to the tie break problem.





Hedge

Sailor Vulcan

  • Secret Identity: Imaginator
  • Legendary Mage
  • *****
  • Posts: 3130
  • Banana Stickers 3
    • View Profile
Re: I've discovered the Mage Wars equation (I think)
« Reply #35 on: May 02, 2014, 05:31:26 PM »

Great news guys, it seems we have found our solution to the tie break problem.





Hedge

Do you mean by seeing which player has a larger portion of victorious final game states that are possible? Or are you being sarcastic?
  • Favourite Mage: Salenia Forcemaster
I am Sailor Vulcan! Champion of justice and reason! And yes, I am already aware my uniform is considered flashy, unprofessional, and borderline sexually provocative for my species by most intelligent lifeforms. I did not choose this outfit. Shut up.

Hedge

  • Full Mage
  • ***
  • Posts: 174
  • Banana Stickers 1
    • View Profile
Re: I've discovered the Mage Wars equation (I think)
« Reply #36 on: May 03, 2014, 03:17:30 PM »

Great news guys, it seems we have found our solution to the tie break problem.





Hedge

Do you mean by seeing which player has a larger portion of victorious final game states that are possible? Or are you being sarcastic?

I'm Being Sarcastic as it would take too long to input the data as you have already mentioned. I thought it was quite funny. I understand the point of the equation and how one would use it once the end values have meaning.





Hedge

lettucemode

  • Guest
Re: I've discovered the Mage Wars equation (I think)
« Reply #37 on: May 03, 2014, 05:05:36 PM »
Quote
I thought it was quite funny.

As did I!

Do you mean by seeing which player has a larger portion of victorious final game states that are possible?

That number is infinity, for both players, always.

Sailor Vulcan

  • Secret Identity: Imaginator
  • Legendary Mage
  • *****
  • Posts: 3130
  • Banana Stickers 3
    • View Profile
Re: I've discovered the Mage Wars equation (I think)
« Reply #38 on: May 03, 2014, 05:27:32 PM »
Maybe so, but some infinities are bigger than others.

http://www.youtube.com/watch?v=elvOZm0d4H0
  • Favourite Mage: Salenia Forcemaster
I am Sailor Vulcan! Champion of justice and reason! And yes, I am already aware my uniform is considered flashy, unprofessional, and borderline sexually provocative for my species by most intelligent lifeforms. I did not choose this outfit. Shut up.

Layana

  • Apprentice
  • *
  • Posts: 1
  • Banana Stickers 0
    • View Profile
Re: I've discovered the Mage Wars equation (I think)
« Reply #39 on: June 11, 2014, 02:36:00 AM »
@Imaginator: That is indeed true, but in our case, as we are dealing with cardinals, IF they are infinite, they are countably infinite (and thus bijective/equal in size)

@lettucemode: That number is not ALWAYS infinite, for both players. suppose a situation where neither player has any cards left in his spellbook and no way to heal or generate life. imagine there is a ghoul rot on one of the players - that game will end in a finite number of turns bounded by (HP of Mage left)/2+1,  and in each turn, there are only finitely many options, therefore you are indeed looking at a situation where there are only finitely many possible outcomes. In fact, i have heard (from AI research guys) that playing a few random games from a position can be somewhat viable as a measure for how good the position is, even in go (this amounts basically to a Monte Carlo simulation of the game space).

lettucemode

  • Guest
Re: I've discovered the Mage Wars equation (I think)
« Reply #40 on: June 12, 2014, 08:50:06 AM »
@lettucemode: That number is not ALWAYS infinite, for both players. suppose a situation where neither player has any cards left in his spellbook and no way to heal or generate life. imagine there is a ghoul rot on one of the players - that game will end in a finite number of turns bounded by (HP of Mage left)/2+1,  and in each turn, there are only finitely many options, therefore you are indeed looking at a situation where there are only finitely many possible outcomes. In fact, i have heard (from AI research guys) that playing a few random games from a position can be somewhat viable as a measure for how good the position is, even in go (this amounts basically to a Monte Carlo simulation of the game space).

That is true, I did not consider a situation like the one you describe. I was more thinking that if both players are out of cards and the only thing they have left is a melee attack, there is an infinite number of ways for the game to end. Or rather, there is a finite number of game end states, but the number of paths to those states is infinite, because the mages could just walk in circles for 5 or 500 rounds before attacking the other (though any decent AI would prune those branches). But you raise a good point.

Anyway. AIs are hard guiz, doubly so for a game like Mage Wars.