Giter Site home page Giter Site logo

magefree / mage Goto Github PK

View Code? Open in Web Editor NEW
1.8K 1.8K 740.0 802.23 MB

Magic Another Game Engine

Home Page: http://xmage.today

License: MIT License

Shell 0.01% Java 99.86% Perl 0.11% Batchfile 0.02% Python 0.01% Makefile 0.01%
ai card ccg client-server computer-opponents deck game game-engine java linux macos magic magic-the-gathering mtg mtgjson multiplayer scryfall windows xmage

mage's Introduction

XMage โ€” Magic, Another Game Engine

Build Status Lines of Code Coverage Technical Debt latest release commints since latest release Join the chat at https://gitter.im/magefree/mage

XMage allows you to play Magic against one or more online players or computer opponents. It includes full rules enforcement for over 25 000 unique cards and more than 65 000 reprints from different editions. You can also find custom sets like Star Wars. All regular sets have nearly all implemented cards.

It supports single matches and tournaments with dozens of game modes like duel, multiplayer, standard, modern, commander, pauper, oathbreaker, historic, freeform, richman and much more.

Local server supports a special test mode for testing combos and other game situations with pre-defined conditions.

There are public servers where you can play XMage against other players. You can also host your own server to play against the AI and/or your friends.

XMage community and resources:

Servers status:

Beta server with un-released or under development features:

Features

  • Multiplatform app: Windows, Linux, MacOS;
  • Deck editor (support multiple deck formats and deck sources);
  • Two player duel or a multiplayer free-for-all game with up to 10 players;
  • Computer AI opponents;
  • Players rating system (Glicko);
  • Supports special formats like Commander (up to 10 players), Oathbreaker, Cube, Tiny Leaders, Super Standard, Historic Standard and more;
  • Single matches or tournaments supported (elimination or swiss type handling), which can be played with up to 16 players:
    • Booster (also Cube) draft tournaments (4-16)
    • Sealed (also from Cube) tournaments (2-16)

Bug report / feature request

The best way to report bug or feature request is github's issues page.

Installation / running

Wiki page contains detail information about private or public server setup.

Server options

The XMage server locates by default the configuration file from the current working directory to the relative path config/config.xml (config\config.xml in Windows). To change this location, start the server with the property xmage.config.path set to the desired location, for example -Dxmage.config.path=config/otherconfig.xml. The option can be set from the XMageLauncher in Settings > Java > Server java options.

Troubleshooting / FAQ

Github issues page contain popular problems and fixes:

Performance tweaks

If you have a good GPU, it's very likely you'll be able to increase performance by a lot through extra Java flags.

XMage runs on JRE 8, so this link should give you the available flags.

How to enable the extra flags

  1. Launch XMage
  2. In the menu bar from the launcher, click on "Settings", which will open up the Settings Window
  3. Go to the "Java" tab
  4. You can pass extra flags by editing the "Client java options" text field

Linux tweaks

Enable OpenGL

More info about OpenGL:

  • -Dsun.java2d.opengl=true

Possible problems:

  • Caveat: There's a bug with the file chooser when OpenGL is enabled (you use the file chooser when you, for instance, try to load a deck from disk). The suggested workaround will make the game crash, so it's not an option.
  • Workaround: When using i3, you're able to work around the bug by toggling the "floating" capabilities of the window and forcing it to re-render.

Enable XRender

More info about XRender:

  • -Dsun.java2d.xrender=true

Increase memory usage

This is not guaranteed to yield improvements, but it depends on your use-case. If you have a lot of RAM to spare, you can increase the initial heap size for good measure. More details about memory settings:

  • -Xms1G -Xmx2G

Developer

Full project documentation and instructions for developers can be found in wiki pages.

First steps for Xmage's developers:

Torch icons created by Freepik - Flaticon

mage's People

Contributors

alex-vasile avatar awjackson avatar cbt33 avatar ciaccona007 avatar dilnu avatar drmdev avatar emerald000 avatar fireshoes avatar grath avatar ingmargoudt avatar jaydi85 avatar jeffwadsworth avatar jrherlehy avatar levelx2 avatar lonefox78 avatar luziferius avatar magenoxx avatar nigelzor avatar plopman avatar purplecrowbar avatar quercitron avatar rystan avatar spjspj avatar ssk97 avatar styxo avatar susucre avatar theelk801 avatar weirddan455 avatar xenohedron avatar zzooouhh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mage's Issues

The kicker ability

I was adding the Buyback ability and noticed that the KickerAbility (which I am using as a template) does not display the "Use kicker" text prompt during activation. In fact, it does not appear to use the activation code.

Livewire Lash is not implemented correctly

Just met it in the game, creature with Infect was targeted by me and dealt damage but it was usual.

I looked at the code and it is really so: DamageTargetEffect deals 2 damage from source.getSourceId() but as it comes from Livewire Lash it happens so that Livewire Lash deals that damage not equipped creature.

Please reimplement when have time.

Can play card revealed by opponent

Description

One can play a card from the list revealed by an opponent.

Setup

hand:Computer:Relentless Skaabs:1
hand:Computer:Appetite for Brains:1
battlefield:Human:Swamp:2
hand:Human:Appetite for Brains:1

Elderscale Wurm Tooltip incomplete

When picking order of triggered abilities, the tooltip of the Elderscale Wurm only shows "When Elderscale Wurm enters the battlefield,."

Craterhoof Behemoth calculates +x/+x wrong

The +x/+x is equal to all creatures on the battlefield but is only has to be +x/+x for each creature Craterhoof Behemoth controller controls.
The
static {
filter.add(new ControllerPredicate(TargetController.YOU));
}
is missing.

SearchLibraryPutInHandEffect reveal and forceShuffle changes

As I've seen, the only cards that have an optional shuffle are the ones from optional abilities. As such, the optional part should either be in the effect or in the ability. There is forceShuffle in the effect, but unless using player.chooseUse, it is only inducing bugs.

Also, the default for reveal should be true. This means all the cards using this effect must be checked while refactoring.

Edit: All search effects should be refactored. I am thinking over using a builder.

Huntmaster of the Fells triggered ability shouldn't be optional

The triggered ability of Huntmaster of the Fells shouldn't be optional.
It must be mandatory because there is no "may" in the wording of the ability.

Rule:
603.5. Some triggered abilities' effects are optional (they contain "may," as in "At the beginning of your upkeep, you may draw a card"). These abilities go on the stack when they trigger, regardless of whether their controller intends to exercise the ability's option or not. The choice is made when the ability resolves. Likewise, triggered abilities that have an effect "unless" something is true or a player chooses to do something will go on the stack normally; the "unless" part of the ability is dealt with when the ability resolves.

Create User Guide on wiki

Create a wiki page with screenshots explaining various aspects of the game:

  • hot keys
  • configuring phase skipping
  • downloading images/icons
  • setting avatars
  • generating decks (e.g. saying that {X}{X} means double color deck where two color are defined randomly)
  • etc. etc. etc.

Some sort of user manual, with pictures.

AI blocked Chapel Geist with Tangle Mantis

AI: mad ai
Version: 0.8.4

Sometimes AI blocks creature it can't block. This time it blocked creature with flying by creature without flying.
Tangle Mantis was equipped with Wolfhunter's Quiver

Hint: seems the method that determines the available blockers is not correct

Creature with undying didn't forget -1/-1 after dying and returning from graveyard

Version 0.9.0 Human vs. Human
Turn 4 - Player A casting a Strangleroot Geist (2/1, Haste, Undying)
Turn 5 - Player B casting Cower in Fear (Opponent Creatures get -1/-1 until end of turn)
Strangleroot Geist dies and returns with a +1/+1 counter. But P/T will only be shown with 2/1.
So it seems like the -1/-1 of the Cower in Fear will be used for the returned Strangleroot geist.
Turn 6 - Strangleroot Geist now has P/T 3/2

But this is wrong imho.
Rule:
An object returned to the battlefield with the undying ability is a new object with no memory of its previous existence. It has "summoning sickness".
7/1/2012: Cower in Fear affects only creatures your opponents control at the time it resolves. It won't affect creatures that come under their control later in the turn.

Creature can't block because of Blazing Torch equipment

The bug is in BlazingTorchEvasionEffect extending CantBlockSourceEffect that automatically adds
@OverRide
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) {
return false;
}

Assigning to you, Robert, because seems it was implemented by you first.

Exalted doesn't work correctly

play Sublime Archangel
play Captain's Call

all tokens will get Exalted (according to tooltips)
but when Sublime Archangel attacks alone, it will get exalted bonus only from two creatures - Sublime Archangel and one token

if you play any other creature, only two bonus will be applied anyway

Creature display order on the battlefield random

Wouldn't it be better to display the creatures on the battlefield in the order they first entered the battlefield?
Now the order seems to me random and it's less convenient to find the last cast creature on the battlefield.

Add common effect for putting cards from top to graveyard

We need to make putting cards from library to graveyard as game method.
It is rather common effect, so won't it be better if we have

game.putCardsFromTopToGraveyard(player, amount)
or at least
new PutCardsFromTopToGraveyardEffect(player, amount).apply(game, source)

have a look at cards like Altar of Dementia

Scope:

  • add common effect
  • refactor all cards with such effect

AI choosing can only choose one target

Description

Issue found at mage.player.ai.ComputerPlayer.choose(Outcome outcome, Target target, UUID sourceId, Game game, Map<String, Serializable> options)

For every target it is always considered to require only one choice.

Setup

battlefield:Computer:Glistener Elf:3
battlefield:Human:Swamp:5
hand:Human:Barter in Blood:1

Fix target required behavior

The target should be required by default. It becomes optional just for abilities with optional effects. As such, this behavior should be implemented there. It can also be found in some custom effects implementations that handle the optional part themselves.

It's possible to equip opponents creature

At first, it was found during playing vs AI: it simply equipped my creature with its own equipment

I've created EquipAbilityTest that proved the bug existance.
Probably it's related to new filters somehow.

Islandwalk from Master of the Pearl Trident remains after the Master is in the graveyard

Turn 5 Computer casts Master of the Pearl Trident
Turn 15 Computer casts Talrand, Sky Summoner, getting the "Islandwalk" and the "+1/+1/ from the master.
also in turn 15 the computer attacked with the Master of the Pearl Trident and I blocked it and the Master died.
Turn 17 computer attacked with the Talrand, Sky Summoner and I couldn't select the Talrand to block like he has islandwalk. The "Islandwalk" in the tooltip was gone, but it seems as if the islandwalk was internaly not removed.

Have lightweight cards representation

I propose to keep a database with all the meta-information that we update dynamically.

There will be a column with the className so that we can easily instantiate the cards implementation in a game. This is the field we will check against to see if the card is already added to the database. This way, there is no need to instantiate all the cards.

We can use the file we currently have for card generation to add the exact oracle text for the abilities.

Graveyard dialog not displayed when multiple games played

If you create two games and you open Graveyard dialog in the first game then you won't be able to open the graveyard dialog in second one.
Whenever you click grave button in the second game, dialog is opened in the first game instead.

War Falcon - Attack condition does not work properly

Vers. 0.9.0 Human vs. Human

Turn 12 - Opponent casts a Switcheroo giving me his Faerie Invaders and taking my War falcon. I have a 1/1 soldier from Captains's call on my side.
Turn 16 - He can attack with the War Falcon without having any Knight or Soldier (guess he could have attacked also on turn 14).
Seems like my soldier count for the attack condition.

You can re-cast Bond Beetle from battlefield

For unknown reason it is possible to cast Bond Beetle again from battlefield. Could reproduce it in several games.
Checked on other (this time white) creature, it didn't happen.

it may relate to the bug with giving to all green creature flash.

AI equips creatures over and over

Sometime it ruins PvAI games as AI stops casting spells spending all mana for the same equipment reequiping pair of its own creatures from one to another and back

Now sure what can be done here, but at least it shouldn't happen so easily as evaluation function should return less value as reequipping almost always results in tapped lands what shouldn't happen as there is a big penalty for tapped permanents.
It is especially seems strange when AI starts reequipping from first creature and ends with it through several cycles: so AI has the same game board position but with all lands tapped, that means that it is not because of horizon effect.

Should be fixed before Mage Release 0.9

Add notification if a player joins your table

Now it is not possible to know if someone joined your table except in GUI
That's the problem as you may create a game and switch Mage.Client to any other program while waiting for a player to join.
But now the only option to start the game is check regulary the gui for player joined.

Rewrite filters

Filters need to be changed to offer more flexibility. This shouldn't come by having to modify the filter class. A strategy pattern shall be applied.

Card display order in graveyard random

Wouldn't it be better to show the cards in graveyard in the order they went to the graveyard.
Currently the order seems to me is random, so it's sometimes hard to find out, which card(s) went to the graveyard lately.

Improve DynamicValues for effect texts

I don't have a clear idea at the moment on how this should change. Some "research" must be done first to come up with a set of specifications for the dynamic values.

This will have an impact on the effect texts and should provide a cleaner way of implementing a DynamicValue. Currently, some conventions were used like the toString method should return some specific text. This isn't a good practice.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.