My favorites | Sign in
Project Home
Project Information
Members
Featured
Downloads
Wiki pages
Links

Magarena

Magarena is a fantasy card game written in Java and Swing. The name is a contraction of mage and arena. You play a duel against the computer with 40 card generated decks. There are 900 cards available to build the decks. It is possible to check the deck strength before playing. The computer AI is capable and fast. The game fully enforces the rules. It is possible to undo moves. A comprehensive card browser is available. This game should run well on most computers. The minimum screen resolution is 1024x768. A Java runtime 6 is required to play.

History

Magarena was developed over a time span of two years. It was designed and developed by ubeefx as a hobby project. Development started in June 2009. It became open source in November 2010. This generated a lot a valuable input and some nice contributions which finally resulted into the gold release in April 2011. Giving this game an outstanding AI was one of the main goals that ubeefx wanted to achieve. This is also the main aspect that people like the most about Magarena coming from all feedback. The functional and user friendly UI together with the overall stability of the program are also appreciated. This project is in a finished state. All continued development will happen on the new Magarena project page. Also feel free to check out my experimental card game Dreamwalkers.

Download

The gold release 1.11 can be found in the featured downloads. The zip archive contains the Windows executable and the readme file. The Windows executable is made with launch4j. It can be placed on your desktop or in any folder. Magarena can be executed on Mac and Linux with the Java jar file. To obtain the Java jar file, rename the .exe file to a .jar file. The Java jar file is executable, but it is recommended to run it with java -Xmx256m -jar Magarena.jar to give it a bigger heap. The download is quite small because most resources are not included and must be downloaded separately. All data saved or downloaded by the game is put into the Magarena folder in your home or users folder. However if a Magarena folder is present where the program is executed, that is used instead as data folder. More information on customizing Magarena can be found on CustomizingMagarena. The Limited Edition release 1.13, see readme file, is no longer available for download.

Images

After starting the game for the first time, you can execute download images in the Arena menu. After downloading is completed, the game will stop automatically. Now the game can be restarted and it will be more convenient to play. Some of the download locations could become invalid over time. When downloading failed, delete the image folders or failed image files in the Magarena data folder and retry.

Thanks to IcoJoy for the nice free mage logo and icon.

Game Design

This game is fanware based on a very popular fantasy card game. It focuses on playing limited duels with generated multicolor decks against a computer opponent. Creating an advanced AI is the main challenge for this project.

A custom cards Cube was carefully composed for this purpose. These are some of the requirements :

  • cards printed starting from Invasion block and 7th edition
  • all cards must be good on their own : no combo or very narrow cards
  • strong focus on multicolor : no cards that only work well in monocolor
  • maximum converted mana cost is 9
  • maximum three colors in mana cost
  • limit modelling and gameplay complexity : e.g. no Planeswalker cards
The goal of this project is not to support thousands of cards or play with constructed decks. Player versus player or online play does not belong in this project.

Rule Differences

These are some decisions taken to simplify the gameplay for the AI :

  • no draws, there is always a winner
  • no mulligan (custom card shuffler)
  • no maximum hand size
  • no mana pool : mana abilities are played while paying mana costs
  • X is at least one in a mana cost
  • combat damage is automatically assigned :
    • defending player determines order of blockers while declaring blockers
    • attacker deals lethal combat damage in order of blockers
    • all remaining damage is dealt to first blocker
    • trample : all remaining damage is dealt to defending player
    • deathtouch : lethal damage dealt to blockers is 1
  • fixed order for power and toughness changing effects (no timestamps)
  • triggered abilities are ordered on the stack automatically
  • may is ignored in some conditional triggers like life gain
  • most choices are made when a spell or ability is put on the stack

Artificial Intelligence

There are multiple AI implementations available in Magarena. The Random AI always picks a completely random move. The Monte Carlo and Vegas AI depend on random game simulations to find the best move and are thus non deterministic.

These are the characteristics of the default AI :

  • Minimax game tree
  • Fast forward and backward tree traversing
  • Fast iterative scoring system : determines the AI behavior
  • Alpha-beta pruning and score caching
  • Multi-threaded
  • Specific algorithms for :
    • Paying mana costs
    • Playing spells and abilities
    • Picking targets and colors
    • Declaring attackers and blockers
  • Difficulty level : number of main phases used for lookahead

The AI is limited by how far it can lookahead because the further the more processing power is needed. The AI will only play the best moves for the period in time it can lookahead, for instance a full turn. This also means that it will not try to hold back creatures or removal. To reduce the number of future game permutations, the AI must sometimes limit the number of choices it makes locally. The scoring system that is used has a large impact on how the computer plays and will sometimes result in choices a human player would not generally make. The AI does not work with fuzzy facts, e.g. it will not try to bluff or take into account the hand and unused mana of the player. A more detailed description of the AI can be found on MagarenaArtificialIntelligence and on MonteCarloTreeSearchAI.

User Interface

The user interface is written in Swing and has a number of custom made widgets. It supports scaling with custom layout management. It has no support for multiple language. There is basic skinning with textures and support for themes. Mouse over is used to show more detailed card images or the messages log. There is a switchable graphical and textual overview of the game. During playing it shows at all times the available options to the player. It was designed to allow quick gameplay so there are no animations. Keyboard shortcuts are available for action and undo.

Powered by Google Project Hosting