Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 434707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:18:06+00:00 2026-05-12T20:18:06+00:00

I am working on a Magic The Gathering game simulator. I haven’t found any

  • 0

I am working on a Magic The Gathering game simulator. I haven’t found any free systems that allow you to create your own decks which also manage the game (life/toughness, counters, triggered events, etc.).

My problem is that I need to find an efficient way to have triggered events fire for cards which are in play. I am envisioning the card lists being stored in XML format and containing identifiers for the actions they take like follows:

<card>
   <name>Bloodghast</name>
   <cost>BB</cost>
   <type>Creature</type>
   <subtypes>Vampire,Spirit</subtypes>
   <stats>2,1</stats>
   <color>B</color>
   <attributes>
      <attribute>
         <id>C41</id>
         <description>Bloodghast can't block.</description>
      </attribute>
      <attribute>
         <id>C42</id>
         <description>Bloodghast has haste as long as an opponent has 10 or less life/</description>
      </attribute>
      <attribute>
         <id>LF5</id>
         <description>Landfall - Whenever a land enters the battlefield under your control, you may return Bloodghast from your graveyard to the battlefield.</description>
      </attribute>
   </attributes>

Sorry for making that verbose (and probably not understandable for anyone who doesn’t really play Magic). So I would read in this tree for each card that is loaded for a deck. I need a way to hook the attributes of the card into the “game engine” so that, for instance, when a player’s life total drops below 10 Bloodghast gains haste, or when a land is played, the engine will allow me to grab him out of my graveyard. For those who have not played Magic, other examples would be that some cards trigger an action when a player discards a card or play a spell of a certain color.

I was thinking I would probably have to have an event handler on the engine for each circumstance which would trigger an event (player plays a spell, player life total changes) and that each card would have to somehow add an element to some list allow it to link itself to that event, but I couldn’t even start to think of a good way to do it.

Any help would be greatly appreciated. I’m a pretty decent programmer, but I would rather not have to start this project 5 times and re-write the entire thing.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T20:18:06+00:00Added an answer on May 12, 2026 at 8:18 pm

    I would suggest using a proper database such as SQLite or SQLExpress so you can set up relationships and normalize your data (no comma delimited lists, for example).

    Coming up with a rules engine is going to be difficult for Magic; Effects can do all sorts of crazy things and your rules engine will have to accommodate all of them. Essentially, you’ll be recreating the rules engine from the Magic: The Gathering video games in order to know what is going to happen and when.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a game, and all of my graphics use magenta as transparent/magic
I am working with a CMS that needs pretty urls. I found this snippet
I am currently working on a project to create simple file uploader site that
I'm working on some xslt transformations and I've just found out that there might
I'm working on an ASP.NET Web Project with some AJAX magic. As my GridView
Working with a SqlCommand in C# I've created a query that contains a IN
Working on a project that parses a log of events, and then updates a
I am working on to create a custom control inherited by CheckboxList control. We
I'm currently working on an ASP.NET 3.5 project, and I wanted to know your
I'm working on a Function that will do a POW long handed. It's an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.