It is currently 18 Apr 2024, 05:14
   
Text Size

Customizing Mad Wizard

An original game by ubeefx

Moderators: ubeefx, CCGHQ Admins

Customizing Mad Wizard

Postby ubeefx » 02 Oct 2022, 18:57

Without programming it is possible to do some customizations to Mad Wizard. 8)

The first thing to do is unzipping the release, for instance MadWizard-3.7.jar, to a new folder.

With the following command the game can then be run in the folder.
Code: Select all
java com.magic.main.MagicMain
It is possible to replace several theme assets, it will be best to keep the same image dimensions.
Some examples :
It is possible to add cards if they are supported by the engine.
For instance Diving Griffin. To do this, in sets add the card to one of the files, for instance p22.txt.
Code: Select all
name=Diving Griffin
cost={1}{W}{W}
type=Creature
stats=2/2
rule=Flying, vigilance
url=https://scryfall.com/card/8ed/17/diving-griffin
Also the deck themes can be modified. In decks, put the following in w_random.dec.
It is best to look at the existing deck themes to see by example how they are defined.
The full set of supported cards is copied to the clipboard after startup of the game.
Code: Select all
!w,Griffin
!Diving Griffin custom deck

# 36 creatures
36,36 {
Diving Griffin
}

# 24 lands
24,24 {
Plains
}
A new jar can be made of the customizations by zipping all folders back in for instance Wizard.jar.
This can be executed with this command or double clicked to execute if Java is installed.
Code: Select all
java -jar Wizard.jar
Finally these are the results. Enjoy modding! :D
custom1.jpg
custom2.jpg
User avatar
ubeefx
DEVELOPER
 
Posts: 748
Joined: 23 Nov 2010, 19:16
Has thanked: 34 times
Been thanked: 249 times

Re: Customizing Mad Wizard

Postby ubeefx » 19 Oct 2022, 18:37

I have some more modding tips for today. :D

In Magarena 2.0 and Mad Wizard Blue 3.9 the cards are all in cards.txt in the data folder.
This makes it even easier to modify the cards in the game by adding or removing cards.

It is possible to remove deck themes, just delete the ones you do not want in the decks folder.
In this example I removed all but 5 deck themes. The campaign now only has 5 opponents.
Also I replaced in the themes folder the wood and marble textures.
mod1.jpg

It is also quite easy to modify the save files in the Mad Wizard saves folder.They can be opened with any text editor.
In this example I replaced 10 cards of the player deck with Raging Goblin and put the number of opponents to 11.
Code: Select all
opponents=11
p1.card10=Raging Goblin
p1.card11=Raging Goblin
p1.card12=Raging Goblin
p1.card13=Raging Goblin
p1.card14=Raging Goblin
p1.card15=Raging Goblin
p1.card16=Raging Goblin
p1.card17=Raging Goblin
p1.card18=Raging Goblin
p1.card19=Raging Goblin
mod2.jpg
Happy modding. 8)
User avatar
ubeefx
DEVELOPER
 
Posts: 748
Joined: 23 Nov 2010, 19:16
Has thanked: 34 times
Been thanked: 249 times

Re: Customizing Mad Wizard

Postby ubeefx » 20 Oct 2022, 19:55

Now it is time to add some custom cards. 8)
This will only work for cards with rule text that is supported by Mad Wizard.

Take for instance these 4 Angel themed cards from https://mtgcardsmith.com.
Add the cards to the cards.txt file at the beginning.
Code: Select all
name=Elemiah, Warding Angel
cost={1}{W}{W}
type=Legendary
type=Creature
subtype=Angel
subtype=Cleric
stats=2/2
rule=Flying, lifelink
rule=Other Angel creatures you control have hexproof.
url=https://scryfall.com/card/7ed/341/plains
name=Deathless Angel
cost={4}{W}{W}
type=Creature
subtype=Angel
stats=5/7
rule=Flying
rule={W}{W}: Target creature gains indestructible until end of turn.
url=https://scryfall.com/card/7ed/342/plains
name=Angel's Blessing
cost={3}{W}
type=Legendary
type=Enchantment
subtype=Aura
rule=Enchant creature
rule=Enchanted creature has +3/+3 and has flying, haste and vigilance.
url=https://scryfall.com/card/7ed/343/plains
name=Avacyn, Angel of Hope
cost={5}{W}{W}{W}
type=Legendary
type=Creature
subtype=Angel
stats=8/8
rule=Flying, vigilance, indestructible
rule=Other permanents you control have indestructible.
url=https://scryfall.com/card/7ed/344/plains
Start the game, in release 3.9 there will now be 3902 cards. Download the 4 new images with Images button.
Then in the scans folder of the MadWizard data folder, replace the Plains images with the proper images, for instance 7ed-341-plains.jpg by the image for Elemiah, Warding Angel.

I also created a quick theme deck for these cards by replacing w_random.dec in decks with this.
Code: Select all
!w,Angel
!Custom angels

24,4 {
Segovian Angel
Inspiring Overseer
Elemiah, Warding Angel
Deathless Angel
Angel's Blessing
Avacyn, Angel of Hope
}

# 16 lands
16,16 {
Plains
}
Restart the game and pick the Angel theme. It should look like this.
Notice that also the wood texture in themes is replaced this time with an angel themed texture.
angel1.jpg
Finally lets play a quick game against the Green deck.
angel2.jpg

All of this is possible without a single line of code. Enjoy! :D
User avatar
ubeefx
DEVELOPER
 
Posts: 748
Joined: 23 Nov 2010, 19:16
Has thanked: 34 times
Been thanked: 249 times

Re: Customizing Mad Wizard

Postby ubeefx » 07 Nov 2022, 20:23

All these customisation examples are now much easier to do in Mad Wizard 4. :idea:
User avatar
ubeefx
DEVELOPER
 
Posts: 748
Joined: 23 Nov 2010, 19:16
Has thanked: 34 times
Been thanked: 249 times

Re: Customizing Mad Wizard

Postby Cyril » 08 Nov 2022, 20:05

Cool! The increasing customisation of Mad Wizard brings it close to Wagic which is a game I admired (actually, admire - as it still exists and is being developed) for how easy it is to personalise.

You say that
This will only work for cards with rule text that is supported by Mad Wizard.
Is there documentation somewhere about the rules/mechanics Mad Wizard does not support?
Cyril
 
Posts: 51
Joined: 06 Jun 2022, 15:00
Has thanked: 33 times
Been thanked: 30 times

Re: Customizing Mad Wizard

Postby ubeefx » 08 Nov 2022, 20:45

Hi Cyril, there is a lot of rule text that Mad Wizard does not support.
Internally the engine works with translation of rule text using regular expressions into actual code.
Depending on the rule text there is some flexibility like the amount or the card name that can vary.
As an example both these are supported, so likely gaining 4 life would also work.
Code: Select all
Destroy target enchantment. You gain 2 life.
Destroy target enchantment. You gain 3 life.
I have attached all unique rule texts that are currently supported.
Cards that have similar rule text could work. So making custom cards is possible to some degree.
Attachments
rules.txt
(241.43 KiB) Downloaded 271 times
User avatar
ubeefx
DEVELOPER
 
Posts: 748
Joined: 23 Nov 2010, 19:16
Has thanked: 34 times
Been thanked: 249 times

Re: Customizing Mad Wizard

Postby Cyril » 09 Nov 2022, 17:53

Thanks - that's comprehensive! Interesting that the engine works with natural language expressions - I didn't expect that!
Cyril
 
Posts: 51
Joined: 06 Jun 2022, 15:00
Has thanked: 33 times
Been thanked: 30 times

Re: Customizing Mad Wizard

Postby ubeefx » 31 Jan 2023, 20:26

This is the updated list of all rule text for cards supported by Mad Wizard 4.6.
rules46.txt
Mad Wizard 4.6 supported rule text
(249.45 KiB) Downloaded 262 times

There is no source code provided for the Mad Wizard engine jar, but it is actually very easy to obtain.
With jdec.app the MadWizard4.jar can be uploaded and it provides easy browsing of the decompiled Java source code.
Another one that works is decompiler.
User avatar
ubeefx
DEVELOPER
 
Posts: 748
Joined: 23 Nov 2010, 19:16
Has thanked: 34 times
Been thanked: 249 times

Re: Customizing Mad Wizard

Postby ubeefx » 01 May 2023, 07:33

The supported rules text file is now part of the project.
User avatar
ubeefx
DEVELOPER
 
Posts: 748
Joined: 23 Nov 2010, 19:16
Has thanked: 34 times
Been thanked: 249 times

Re: Customizing Mad Wizard

Postby memorablereceive » 28 Nov 2023, 06:46

there are a lot of rule texts that Mad Wizard doesn't support. how can i do it?
memorablereceive
 
Posts: 2
Joined: 28 Nov 2023, 04:58
Has thanked: 0 time
Been thanked: 0 time

Re: Customizing Mad Wizard

Postby ubeefx » 28 Nov 2023, 18:21

I updated the supported rules text. It is true a lot of rules are not supported.
Of the total card pool of 50565 cards, 14395 or 28 % of the cards are supported.
The main idea is if someone wants to have custom cards, it could be possible by mixing and modding the existing rule texts and checking if the engine can handle them.
Usually supporting new rules will require all kinds of changes to the engine code, ranging from minor to very large.
What specific new rules would be interesting to add and which new deck themes would they enable?
User avatar
ubeefx
DEVELOPER
 
Posts: 748
Joined: 23 Nov 2010, 19:16
Has thanked: 34 times
Been thanked: 249 times

Re: Customizing Mad Wizard

Postby Cyril » 08 Dec 2023, 18:51

Hi ubeefx. I think the questioner is probably a bot... But in terms of new deck themes, landfall would be quite an interesting archetype to play. I'm tempted to say land destruction too, but lots of people hate that so maybe not!

It's noticable that search library effects are not possible in Mad Wizard. But I suspect that this would be very, very difficult for the AI to use properly - and the excellent AI is a real strength of the game so compromising that would be a shame.
Cyril
 
Posts: 51
Joined: 06 Jun 2022, 15:00
Has thanked: 33 times
Been thanked: 30 times

Re: Customizing Mad Wizard

Postby ubeefx » 10 Dec 2023, 09:52

Hi Cyril, landfall is a nice suggestion and should be already feasible.
Land destruction can indeed be annoying to play against.

Searching the library is technically possible, would require work for both UI and AI.
As you state, it might be a challenge to let the AI pick the best card, it would require some custom decision logic to make it work well.
User avatar
ubeefx
DEVELOPER
 
Posts: 748
Joined: 23 Nov 2010, 19:16
Has thanked: 34 times
Been thanked: 249 times


Return to Dreamwalkers

Who is online

Users browsing this forum: No registered users and 20 guests


Who is online

In total there are 20 users online :: 0 registered, 0 hidden and 20 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 20 guests

Login Form