It is currently 06 Aug 2025, 22:36
   
Text Size

Shandalar Clone

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Re: Shandalar Clone

Postby DennisBergkamp » 24 Aug 2010, 04:49

Wow! Those are some cool resources, thanks for posting them. I've been searching for free sprites / art, but somehow I never ran across those.

I also like a lot of your ideas for the story. I really don't care much about whether it's cliche-ridden or not, the most important thing is just to have some main story line that allows for some cool quests to be built around it.
The main thing I'm wondering about though is the methods through which story is told... I guess it's fine to just use popups (JOptionDialogs) with text and images. It would be nice to script these nicely somehow through text files.
Anyway, right now there's zero elements in the game regarding story, and I'm not sure how to add them exactly ... I made a few towns and some of the shops work, some random battles, and some quests I ripped from Forge's quest mode. That's it...

Also, I currently don't have any information regarding the tiles... there's quite a few tiles (~8000 if I'm not mistaken) on the map, but I haven't assigned any "color" to them yet.
And I'm not sure what's the best way :)
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: Shandalar Clone

Postby Marek14 » 24 Aug 2010, 08:22

As for tiles, I think that each tile should represent a land from Magic. The correspondence is not strict (one tile = one card), but rather you have connected regions (a City of Brass, for example, could take several tiles, but it would still be a single city).

Here's my idea for a story:

The plane the game is at is called the Chaos Forge. It's an artificial plane created millenia ago by a mad planeswalker. Like a pirate ship, it wanders through the multiverse, attaching itself to other realms.

The plane's shape is unstable, and the terrain features may change without warning, shift, or disappear altogether (in game terms, the terrain tiles wouldn't be fixed once and for all, but new ones could be added to edges, and there could be some shifts and changes).

The central feature of the plane is an artifact called "Eye of the Creator". It's a window to other planes. However, whatever passes through the window becomes duplicated. The original stays in its home plane, while the copy is deposited on the Chaos Forge. This way, we can have anything from Magic, including Legends, without interfering with the official story.

The Chaos Forge cannot be left by planeswalking, but planeswalkers are capable of traveling between various points on the plane (imagine having the towns as "teleport anchors" to reduce travel time).

This would also allow for "development", where new expansions enter the world at some time. Attaching the plane to Fallen Empires Dominaria would cause Havenwood Battlegrounds or Icatian Stores appear on the map and Homarids and Thrulls would start to appear, confused.
Marek14
Tester
 
Posts: 2773
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 302 times

Re: Shandalar Clone

Postby lord of 13 » 24 Aug 2010, 16:34

@Marek: Really cool idea... but that would mean a tile-based computer-generated map, while I take it that Dennis is using a pre-drawn map. However, the Chaos Forge allows for, as you mentioned, integration with the official MtG story and characters. As for the plane skimming... errr... implementation would not be fun.
@Dennis:
Glad you liked the story. :P I'll tell you the world design I'm using for Mindgames [my own MtG rules-compliant thingy-ma-jigger] if you're interested; it's a tad more involved and complicated than the cliche.
Quick question: are you making the world map wrap?
Another question: Do you know if you can reasonably easily integrate an existing scripting language into Java? Like Lua? It would help with storyline design.

Also, check out this site: http://www.mapeditor.org/
XMLReaders would be required, but it would be very awesome to have this sort of power over map creation.

Here's some [admittedly C#] pseudocode for designing a IM map.
Code: Select all
//The class def
class TileIM
{
    Tile[,] tiles;
    int width, height;
   
    public TileIM(Tile[,] tiles, int width, height)
    {
        this.tiles = tiles;
        this.width = width;
        this.height = height;
        //code for ensuring the width and height actually match that of the tile array
    }

    public void UpdateInfluence()
    {
        for (int x = 0; x < width; x++)
        {
            for (int y = 0; y < height; y++)
                tiles[x,y].UpdateInfluence(tiles);
        }
    }

    public double GetInfluence(int x, int y)
    {
        //code for ensuring the location is within the bounds of the array
        return tiles[x,y].Influence;
    }
}
Code: Select all
//snippets of the Tile class
public static double Probability = 100;
double baseInfluence, influence, decay;
Dictionary<Tile, double> map = new Dictionary<Tile, double>();

//the constructor should initialize baseInfluence and decay to values passed while calling it

public void UpdateInfluence(Tile[,] tiles)
{
    int x, y;
    //find self inside the array

    double infl;
    map = new Dictionary<Tile, double>();
    //iterate through the array again, and calculate the influence on this Tile. Add the items to the
    //dictionary and to the sum.

    influence = infl;
}

public double Influence { get { return influence; } }
public double GetInfluence(int dist)
{
    double toRet = baseInfluence;
    toRet -= dist * decay;
    if (toRet < 0)
        return 0;
    return toRet;
}

public Tile RandomEncounter(Random rand)
{
    double roll = rand.NextDouble() * Probability;
    if (roll <= Influence)
    {
        Tile source;
        //iterate through the dictionary and find which specific tile this encounter originates from
        //then let the engine initiate the encounter
        return source;
    }
}

public EncounterData Encounter()
{
    //pulls up the data required for an encounter, such as by randomizing the theme deck played against, life
    //totals, and so on.
}
And load the data from files. For example:
Code: Select all
//TileDef.def
Tile: Formless
{
    Symbol: .
    Influence: 0
    Decay: 0
    FoeList: null //it doesn't have a bunch of monsters
}
Tile: Plains
{
    Symbol: W
    Influence: 1
    Decay: .33
    FoeList: Plains.foes.def
}
Tile: Island
{
    Symbol: U
    Influence: 1
    Decay: .33
    FoeList: Island.foes.def
}
//and so on for Swamps, Mountains, and Forests
Tile: Village
{
    Symbol: V
    Influence: -1.33 //reduced chance of monsters
    Decay: -.33 //add .33 to the influence
    FoeList: null //it doesn't have a bunch of monsters
}
Code: Select all
//Worldmap.map
WWWWWUUVGGGG
WWWWWU.....W
B..WWUU.WGGR
BB..WUUVRRRR
Code: Select all
//Plains.foes.def
Monsters:
{
    Monster: Serra Angel|5|Angels.gen //NAME|CMC|FILE
    Monster: Captain of the Watch|6|Soldiers.gen //The reason to include the CMC is that it saves time on gen
    Monster: Meadowboon|4|W Elementals.gen
}
Code: Select all
//Soldiers.gen
StartingHand: BOSS_CMC
{
    Card: 1|BOSS
}//it'll gen the rest of the list on its own
Deck: 36 + 4 * BOSS_CMC //there's code that can parse a simple mathematical expression like this; I've
                        //written some too, so getting it is no problem.
{
    Card: BOSS_CMC|BOSS
}//it'll gen the rest of the list on its own
Engine
{
    Card: Elite Vanguard
    //etc
}
I know it seems like a lot of work, [I'm doing something very similar for Mindgames] but it's well worth it in terms of the tradeoff between time and ease of editing.
><><><><><><><
Currently developing Mindgames, for playing a rules-enforced game of MtG.
RECENT PROJECTS
->XMLScript
->Zwiel Platformer
User avatar
lord of 13
DEVELOPER
 
Posts: 79
Joined: 06 Jan 2010, 01:36
Has thanked: 0 time
Been thanked: 0 time

Re: Shandalar Clone

Postby Marek14 » 24 Aug 2010, 17:42

There is an alternative to tile-based map: have the pregenerated maps grow. Add a new map when a character moves too close to an edge, destroy an old map if your character moves more than, say, three maps away. A bit similar to the planechase variant Wizards showed recently :)

And the skimming might be limited to, say, a sudden surge of creatures from a given expansion, and after the surge ends, those creatures permanently become possible opponents.
Marek14
Tester
 
Posts: 2773
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 302 times

Re: Shandalar Clone

Postby lord of 13 » 24 Aug 2010, 17:59

Essentially, maps become like uber-tiles? :P How would you make the map-wrapping clean?
The skimming bit would not be fun to code... at least, given how I code. Data wise... you'd have to keep a list of monsters for each player, and read/write programatically based on the plane infringing. And have those monsters be the only ones that show up in a certain region for a little while.
If you use XML... this is infinitely easier to implement. Pesky, but possible. Well, let's see what Dennis and the other programmers think about it before discussing methods of implementation.
Oh... and one little other thing: for the free cards, what if starting with them reduces the number of cards in your hand? It inherently balances a lot of things, as well as very easily placing a cap on the number of free cards you want.
><><><><><><><
Currently developing Mindgames, for playing a rules-enforced game of MtG.
RECENT PROJECTS
->XMLScript
->Zwiel Platformer
User avatar
lord of 13
DEVELOPER
 
Posts: 79
Joined: 06 Jan 2010, 01:36
Has thanked: 0 time
Been thanked: 0 time

Re: Shandalar Clone

Postby Marek14 » 24 Aug 2010, 18:41

I thought that the maps wouldn't wrap... the geometry is like a plane that can have edges. Like Rath was.
Marek14
Tester
 
Posts: 2773
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 302 times

Re: Shandalar Clone

Postby lord of 13 » 24 Aug 2010, 18:49

Heh. OK... so, what about the edges, though? Where two or more maps met? How would one make it clean? I strongly suggest sticking to strictly defined maps for each plane; allow planeswalking [naturally or via a device like Venser's machine] to access other places.
><><><><><><><
Currently developing Mindgames, for playing a rules-enforced game of MtG.
RECENT PROJECTS
->XMLScript
->Zwiel Platformer
User avatar
lord of 13
DEVELOPER
 
Posts: 79
Joined: 06 Jan 2010, 01:36
Has thanked: 0 time
Been thanked: 0 time

Re: Shandalar Clone

Postby Marek14 » 24 Aug 2010, 20:13

It's a chaotic plane :) It doesn't require clean borders. On the contrary.
Marek14
Tester
 
Posts: 2773
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 302 times

Re: Shandalar Clone

Postby DennisBergkamp » 24 Aug 2010, 20:15

@Marek: Really cool idea... but that would mean a tile-based computer-generated map, while I take it that Dennis is using a pre-drawn map. However, the Chaos Forge allows for, as you mentioned, integration with the official MtG story and characters. As for the plane skimming... errr... implementation would not be fun.
@Dennis:
Glad you liked the story. :P I'll tell you the world design I'm using for Mindgames [my own MtG rules-compliant thingy-ma-jigger] if you're interested; it's a tad more involved and complicated than the cliche.
Quick question: are you making the world map wrap?
Another question: Do you know if you can reasonably easily integrate an existing scripting language into Java? Like Lua? It would help with storyline design.

Also, check out this site: http://www.mapeditor.org/
XMLReaders would be required, but it would be very awesome to have this sort of power over map creation.
I'm very interested indeed :) Is Mindgames another Shandalar clone or is it different?

The World Map doesn't wrap, nope... currently the edges just block further passage.
As for using Lua in Java, I have no idea if it's possible, but it's worth looking into (even though I don't know any Lua). I guess there's: http://www.keplerproject.org/luajava/

Using a textfile for the colors is probably the best bet... I'll see if I can get this working correctly. It is indeed a lot of work, but well worth it, like you said. My tiles are laid out in an interesting way though... they're isometric, and the first row has an even number of tiles, the next row odd, etc.
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: Shandalar Clone

Postby lord of 13 » 24 Aug 2010, 20:37

Excellent about the Lua; it's really simple to learn. I'm planning on using it in Mindgames, but the implementation is a while away yet due to other priorities.
Mindgames... would be a Shandalar clone, yes. 'cept I've never played Shandalar. :P

Copy-pasted from the design doc [ignore references to books]:
Supernatural Forces
Me’ki of the Starcrown § - The Speaker of the Stars
The Me’ki of protection, order, healing, and justice, the Starcrown’s religious hierarchy is regimented, the fully inducted are known as one of three orders: Starchildren, if they lead individual churches; Heiromancers, who serve as judges and healers in cities and large towns; and Baneslayers, who unite both magic and might in order to bring the more powerful foes to justice. Her order is most powerful during the events of the first book.
Me’ki of Inverted Reality § - The Enigma
The Me’ki of Inverted reality promotes the pursuit of knowledge, structured learning, and reasoning. His followers are considered heretical by the adherents of the other Me’kis because they – and their Me’ki – teach that magic comes independent of any god, spirit, or external force, but from channeling the power of the land and shaping it with your will & desire. The followers are highly organized, but still mutable. A inducted follower is one of three schools: Inverters, who head individual academies; Isleweavers, if they spread learning and practice magic in urban regions; and Battlemages if they solve conflict using their vast array of counterspells and unsummoning magic. His order is most powerful during the second book.
Me’ki of the Fallen Ideal § - The Reaper
The Me’ki of the Fallen Ideal allows his followers to do nearly anything selfish unless it impinges upon his own interests. Clerical spells used by his faction can be of any nature, including some available to other Me’kis, but such variant spells cost the caster in life force, time, or energy. His supporters are informally organized; his adherents innately recognize higher ranking, a power bestowed by their god. They are loosely grouped as one of three practices: Impersonators, who infiltrate rival organizations and secretly recruit from them; Necromancers, the bulk of the faithful, who perform standard conjurations such as animating corpses, stealing life energy, and summoning; and Assassins, who, in addition to stealth and silent slaying, command the more unusual or powerful spells available to the followers of the Me’ki of the Fallen Ideal. His followers are most powerful during the third book.
Me’ki of the Secret Fire § - The Warlord
The Me’ki of the Secret Fire encourages passionate, emotional decisions – particularly those that arise from battle and physical conflict - and detests too much order and explanations. His followers have informally grouped themselves into three groups: Fireshapers, who assist tribal and village chieftains and pass knowledge on to the young; Pyromancers, who join raids and battles with fiery magic, instilling their forces with bloodlust or searing their foes; and Vulcans, who seek to act only upon their emotions and passions, and can cause mighty calamities, such as earthquakes, waves of fire, and summoned dragons. His fanatics are most powerful during the fourth book.
Me’ki of the Indomitable Oak § - The Master of the Wild Hunt
The Me’ki of the Indomitable Oak teaches his followers to use their instincts, to protect and nurture nature, and to communicate with the forests that are their homes. Those who are part of his hierarchy are part of one of three branches: Oakwardens, who teach young elves and humans, are wise and often venerable; Druids, who care for the forest and its creatures, and channel the might of the forest; and Hunters, who manage the more difficult problems that arise from interlopers and/or criminals. His faithful are most powerful during the fifth book.
Me’ki of the Divided God §§§§§ → § - The Hand of God
Created during the falling action of the Marosorcerer’s Scrolls, the Me’ki of the Divided God is a union of the five Me’kis that once were worshipped by Ta’rul. S/he contains all of the aspects of all of his/her aspects, and responds to prayers to any of those Me’kis. Some of the denizens of Ta’rul still have not heard of this divine event, and so still pray to their old gods. Over time, the Me’ki of the Divided God will fragment, returning to his/her five component Me’kis. Meanwhile, the Me’ki of the Divided God’s clergy are organized into five ranks: Priest, who manage churches; Warders, who protect the churches; Wizards, who work in the urban regions; Battlemages, who apprehend and subdue their god’s foes; and Superiors, each of whom commands 7 Warders, 2 Priests, and 1 Wizard. However, this is only a loose grasp of the central structure; there are many vestigial offshoots of this hierarchy, each with their own organization. 
In effect, there are 5 colors, each with their own God and heirarchy. The 6th God arises due to the actions of the player, as a entity composed of the 5 previous Gods. Think Karona, but not mana-leeching or mad. Erm... not much left, is there?
Anyhow, the player begins in one of these 5 organizations. Each one has 3 branches: the priestly, the militant, and the third branches preforms a duty directly related to the color's philosophy. You begin as one of the militant branch and set out to cause damage to the enemy colors. Eventually, you may become a multicolor mage [multicolor is very rare here] or continue to advance under your own order. In time, you will make enemies and allies, and rise through the ranks of your order to become the leader of the order. That's when the overarching plot really kicks in. You recieve a vision from your God [cutscene!] that tells you to slay one of the leaders of an enemy colored order, lest s/he become a threat. You engage in a match with that person, and if you win, you recieve more visions, each in turn telling you to slay order leaders. Soon, chaos rules, and you are hated outside of your own order. That's when your God makes his move: he ascends to become the dominant aspect of the Me'ki of the Divided God, and exalts you as the Hand of God. This sparks your planeswalker-self, and out you go to the other planes. [And yes, I plan to support multiple planes]
><><><><><><><
Currently developing Mindgames, for playing a rules-enforced game of MtG.
RECENT PROJECTS
->XMLScript
->Zwiel Platformer
User avatar
lord of 13
DEVELOPER
 
Posts: 79
Joined: 06 Jan 2010, 01:36
Has thanked: 0 time
Been thanked: 0 time

Re: Shandalar Clone

Postby DennisBergkamp » 24 Aug 2010, 22:45

Very interesting...
I must say, I really hardly know anything about the whole storyline behind MtG, I don't even know what a Planeswalker is (apart from the fact that it's a permanent that has loyalty counters and its ability can only be used once per turn at sorcery speed :lol: ). How far are you with your implementation of Mindgames?
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: Shandalar Clone

Postby lord of 13 » 24 Aug 2010, 23:08

Not very - I'm still creating some of the core library code. I scrapped my previous effort because I wanted to convert to a different data format (xml over plaintext) and wanted to support Lua rather than a custom scripting language. Moreover, I'm currently developing a game for forum that should be completed within a week. After that... who knows?

As for PWs... http://www.wizards.com/magic/Multiverse ... lkers.aspx.
><><><><><><><
Currently developing Mindgames, for playing a rules-enforced game of MtG.
RECENT PROJECTS
->XMLScript
->Zwiel Platformer
User avatar
lord of 13
DEVELOPER
 
Posts: 79
Joined: 06 Jan 2010, 01:36
Has thanked: 0 time
Been thanked: 0 time

Re: Shandalar Clone

Postby DennisBergkamp » 28 Aug 2010, 00:53

I have started mapping the various landtypes to the tiles in a big text file (once that's done, it's probably faster to just use a static array with that data) ... progress so far has been pretty slow, but once I'm done with this, I'll definitely release some kind of test version so you guys could try it out also.

The major things that are still lacking at this point:

- card shop doesn't work yet
- story
- main quests
- ...
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: Shandalar Clone

Postby lord of 13 » 28 Aug 2010, 01:57

One thing that would also be good are generated quests - given some sort of quest template, and data that could fulfill the requirements of the template, it would generate a quest.
For example, a quest that requires you to kill a certain type of creature. Say, a beast. So, you would head over to Forests, keep on wandering until you run across, say Llanowar Behemoth, fight it, and then you would get this notification that says "Bob's Quest Completed!" You couldn't make the name too specific; otherwise, they player would never find their target. So, choose something generic, like Beasts, Zombies, Soldiers, Goblins, Wizards, etc. This is obviously something to implement after the core storyline, but it's relatively simple if you code with the future in mind.

I would love to help with the code; I code mostly C#, but the two languages aren't that different.
><><><><><><><
Currently developing Mindgames, for playing a rules-enforced game of MtG.
RECENT PROJECTS
->XMLScript
->Zwiel Platformer
User avatar
lord of 13
DEVELOPER
 
Posts: 79
Joined: 06 Jan 2010, 01:36
Has thanked: 0 time
Been thanked: 0 time

Re: Shandalar Clone

Postby DennisBergkamp » 28 Aug 2010, 15:13

I currently have some kind of quest template (but it's kind of ripped off from the quest mode part in Forge - so it's fairly limited).
Anyway, it allows for creating "hotspots"/bosses on the map from just a text file, specifying the XP/cash/card reward, its location, previous quests to be completed first, minimum level before the quest shows up, a simple description, etc.

I'd like to create some more story-heavy quests that can be obtained from towns... it should be fairly easy, using a similar format.

I could always use the help coding... however, I'd like to wait a little bit before I put this on the SVN, since the code is such a mess (a result of me just experimenting with a lot of things, starting to code before properly thinking things through, etc. :mrgreen: ).
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 11 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 11 users online :: 0 registered, 0 hidden and 11 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 11 guests

Login Form