[FAQ] Wagic's Folder structure - how to add cards, images...

Need help installing/playing Wagic? Post here
Pablohc86
Posts: 15
Joined: Tue Nov 17, 2009 3:28 pm

Re: [FAQ] Wagic's Folder structure - how to add cards, image

Post by Pablohc86 »

wololo wrote:- make sure that your zips are using the "store" compression

Can you send me a screenshot of your folders to see what might be the problem?
Sorry Wololo for my long time without no reply but i've had lot of work to do.. i've solved.. i just create the folder on the user side and i paste inside the image folder.. But some set can't load picture.. i want to watch better before ask..
Now the problem is another.. with 0.17.1 versione and full image the game is terribly slow.. i've a psp fat versione.. maybe a too old firmware problem? or my psp is too old?
or maybe wagic it's too heavy now and we need crop image to play fastly?
if some player have a full series of crop image i will appreciate a lot if he can share.. because the other link on this forum it's not available...
if want share on some sharing website give me the link or if anyone want share with dropbox contact me via pm.
thanks
rob3d
Posts: 110
Joined: Sat Oct 18, 2008 5:31 am

Re: [FAQ] Wagic's Folder structure - how to add cards, image

Post by rob3d »

The single zip method is working for me on android and windows but I can't seem to get it working iOS. How would I go about adding images to the current iOS version?
mnguyen
Posts: 229
Joined: Thu Apr 29, 2010 4:13 pm

Re: [FAQ] Wagic's Folder structure - how to add cards, image

Post by mnguyen »

rob3d wrote:The single zip method is working for me on android and windows but I can't seem to get it working iOS. How would I go about adding images to the current iOS version?
just drop the zipped file into the Documents folder and the app should move it into the right place. Just make sure that your zip file has the right directory structure and has 0% compression.
rob3d
Posts: 110
Joined: Sat Oct 18, 2008 5:31 am

Re: [FAQ] Wagic's Folder structure - how to add cards, image

Post by rob3d »

mnguyen wrote:
rob3d wrote:The single zip method is working for me on android and windows but I can't seem to get it working iOS. How would I go about adding images to the current iOS version?
just drop the zipped file into the Documents folder and the app should move it into the right place. Just make sure that your zip file has the right directory structure and has 0% compression.
Thanks for the reply. I did just just that and still no luck. Im using the same single zip on windows and android and it works just fine. Just no luck on ios. The zip gets moved to the correct folder but it just doesn't work. Any other ways I can try.
devi59
Posts: 157
Joined: Sat May 09, 2009 5:56 pm
Location: South Dakota, USA
Contact:

Re: [FAQ] Wagic's Folder structure - how to add cards, image

Post by devi59 »

me and my xperia play android issues viewtopic.php?f=8&t=3292&p=26927#p26927
mnguyen
Posts: 229
Joined: Thu Apr 29, 2010 4:13 pm

Re: [FAQ] Wagic's Folder structure - how to add cards, image

Post by mnguyen »

rob3d wrote:
mnguyen wrote:
rob3d wrote:The single zip method is working for me on android and windows but I can't seem to get it working iOS. How would I go about adding images to the current iOS version?
just drop the zipped file into the Documents folder and the app should move it into the right place. Just make sure that your zip file has the right directory structure and has 0% compression.
Thanks for the reply. I did just just that and still no luck. Im using the same single zip on windows and android and it works just fine. Just no luck on ios. The zip gets moved to the correct folder but it just doesn't work. Any other ways I can try.
The only other issue would be that you have a conflicting zip file of images that cause your new one to not get read. you would need to inspect your User folder and remove all the unused image zip files. that should clear it up.
leander05
Posts: 3
Joined: Sat Aug 18, 2012 7:56 pm

Re: [FAQ] Wagic's Folder structure - how to add cards, image

Post by leander05 »

hi, im new new here, im glad i can play magic(wagic) on my android phone alcatel OT 995
but im very sorry im not sure where to put these card images, im sure my sd card can handle it (4gb)
i've read the previous posts but but the instructions seems to change and can somebody guide me step by step? on what folder should i put it?
GOd BLess everyone more power to wagic!
im happy i can play again since i quitted cuz the cards are pretty expensive unlike 10 yrs ago.

Sorry for the very noob and stupid question...
Darth Agnon
Posts: 125
Joined: Mon Sep 22, 2014 8:00 pm
Location: United Kingdom
Contact:

Re: [FAQ] Wagic's Folder structure - how to add cards, image

Post by Darth Agnon »

Thanks for posting this guide, Wololo and co. :D

D.A.
Image
Like Wagic? Check out my custom themes, etc. at viewtopic.php?f=9&t=66181
Wololo's article: http://wololo.net/2016/07/14/new-wagic- ... rth-agnon/
shi
Posts: 24
Joined: Thu Nov 26, 2015 9:33 am
Location: Carnate island

Re: [FAQ] Wagic's Folder structure - how to add cards, image

Post by shi »

wololo wrote:Starting with Wagic 0.17, the folders of Wagic are changing.

A bit of history to explain this change:
Initially all files in Wagic where in a subfolder called "Res". This caused 3 types of issues:
- The amount of files to install wagic was huge, and took a long time on poor USB devices
- The amount of files to install was so huge that it caused massive lags in recent PSP firmwares. Because of that, at some point we moved the Resource files of Wagic in a folder called psp/wagic_res, which caused other types of troubles
- People who modded Wagic and made the game crash had no easy way to revert their changes and had to entirely reinstall the game

New since 0.17
In order to address all the issues above , we came up with a new folders structure:
Wagic now has access to 2 resource folders, the system folder, and the user folder.
On PSP and on Windows, the system folder is called Res, and the user folder is called User
on iOS (TODO)
On other platforms, these two folders are actually one single folder (On Android, for now these two folders are common, in /sdcard/Wagic/Res)

In addition to this dual folder system, Wagic now supports its resources to be zipped. In Wagic 0.17, the default resources for the game are found in the system folder (Res) and are called core_017.zip. We expect further versions of the game to keep a similar naming convention.

Both these 2 things (the dual folder and zip support) constitute the new Wagic folder structure. This system offers features and limitations that you will need to understand if you want to mod the game, add images, cards, etc...

Things mentioning the User and the System folders only apply to systems which use both these folders. Some systems such as Android only use one folder instead, in that case just ignore the comments comparing User and Res folder.

1. Zipping is not compulsory, and you can get back to the old system if you prefer
First of all, zipping is not compulsory, and basically Wagic is still compatible with the old "not zipped" file structure. If you were a user of Wagic 0.16 or older versions and want to "get back on your feet", you can do the following:
- unzip core_017.zip into the User folder (for systems where there is only one folder - see above - the User folder is actually the Res folder) , then delete core_017.zip
- that's it, you should basically feel at home now, except that for PSP and Windows you work in the User folder instead of the Res folder

However I do not recommend to do this as you will lose some of the benefits of the zip system (consistency of the install file so less risk of losing stuff, and Res/User separation allows you to quickly erase your mods if you want to get back to a vanilla install)

2. Priorities
- (for systems that have two folders) The User folder takes precedence over the System (Res) folder. This means that if you have two files with the same name (and full path) in the User folder and in the Res folder, the one from the User folder will be used. Additionally, Wagic will always save files and create new files in the User folder.
- Real files have priority over zipped files. If you have a file in a zip archive (ex: Res/core_017.zip/sets/primitives/mtg.txt) and the same file outside of a zip archive (ex: Res/sets/primitives/mtg.txt), the "real" file will be used by wagic instead of the zipped one.
- With the two rules above, the User folder always has precedence (for systems where there is a dual folder mechanism), and therefore if you have a file in a zip inside the User folder, it will take precedence over a real file in the Res folder
- zip files are read in alphabetical order, and the "greatest" file takes precedence. For example, if you have the same file in two zip archives, for example in the Res folder, (ex: Res/core_017.zip/sets/primitives/mtg.txt and Res/core_018.zip/sets/primitives/mtg.txt), the latest one will "win" (in my example, Res/core_018.zip/sets/primitives/mtg.txt).

Summary of priorities (highest priority on top)
User folder's real files
User folder's zipped files(reverse alphabetical order, e.g. b.zip has more priority than a.zip)
Res folder's real files
Res folder's zipped files (reverse alphabetical order, e.g. b.zip has more priority than a.zip)

Wagic always writes/saves content in the user folder

3. How to mod/add content to Wagic
The rule of thumb is that you should never add any content in the System (Res) folder, but always in the User folder (except for systems that have no "User" folder of course)

As explained in 1. you can extract all wagic's files from core_017.zip into the User folder, and start modding in there. I personally however recommend to only extract the files you want to mod, or even create new ones when it makes sense. For example if you want to add a set named "WOLOLO", just create a folder "sets/WOLOLO" in the User folder, and add your _cards.dat file in there.
If you want to add your set images, the same is true. technically you could add them to the System(Res) folder, but it is recommended to add them in the User folder.


3. Zip format
You can zip files as you want, create as many zip files as you want, and put whatever you want in them. This is very convenient for modders as you can create your mod, zip it, and tell users to just put the zip file in their "User" folder. There are only 2 rules:
- One very important thing is that the only supported zip format is "Store" (no compression). All zip utilities I know have this option, so be sure to use that. If you use a compressed zip in Wagic, the behavior is undocumented. Most likely the system won't find your files, but potentially the game could crash.
- Secondly, the insides of your zip files need to follow the Wagic folders structure (ex: if you want to add sets, your zip needs to contain a folder set, and then subfolders for each set...). It's difficult to explain, bu just by looking at core_017.zip you should grasp the idea

Historically Wagic supported zip files for images. As an exception, Wagic now supports zips inside zips (all of them need to use the "store" compression!) for images only. This is very convenient as you can now put all your images in one single file! Here's what it should look like:
Just one file: User/images.zip
inside, you will have a subfolder sets, then a subfolder for each set, and then the card images zip file. It looks like this:
User/images.zip/sets/10E/10E.zip
User/images.zip/sets/ZEN/ZEN.zip
etc...
Remember that all zip files should use the store compression method, even the zips inside the zip.

You can also have the following structure, which involves only one zip file, instead. This technique is NOT recommended on the PSP because it lacks Ram, and building the zip index for thousands of files would take time and space:
User/images.zip/sets/10E/12345.jpg
User/images.zip/sets/10E/12346.jpg
User/images.zip/sets/10E/12347.jpg
etc...
User/images.zip/sets/10E/thumbnails/12345.jpg
User/images.zip/sets/10E/thumbnails/12346.jpg
User/images.zip/sets/10E/thumbnails/12347.jpg
etc...
User/images.zip/sets/ZEN/22345.jpg
User/images.zip/sets/ZEN/22346.jpg
User/images.zip/sets/ZEN/22347.jpg
and so on...


I messed up my mods, and wagic stopped working, what do I do?
Assuming you did all your changes in the User folder and never touched the core_017.zip file, you can easily get back to a working version of Wagic by deleting your User folder. If you're on a system that doesn't have a User folder and/or changed some stuff in the Res folder, delete everything except the core zip file (core_017.zip). Always do a backup of your files somewhere before deleting them, you might then want to put them back progressively in order to get your achievements, decks, etc... back

im pretty newby about all this is there a simplified instructions, like how to make a .dat file seeing how i dont have that save option when trying to save the text document, please i really want my zendikar decks in, please help me.
"Take away a man's light, his clothes, his food, his friends, his air, and you leave him with nothing but himself. And for most that is not pleasant company."

~RT
i-am-not-one
Posts: 304
Joined: Fri Dec 07, 2012 4:36 am

Re: [FAQ] Wagic's Folder structure - how to add cards, image

Post by i-am-not-one »

I think you are a bit confused about a couple of things.

I will try to simplify but without leaving anything out. Some things you may be aware of so try to stick with me through the boring bits.

First there are cards. Wagic has the rules for each card in a text file called primitives.txt

Next there are sets made up of many cards. The cards for a set are stored in a .dat file

Zendikar is a set. It is stored in ZEN.dat

Zendikar is already part of Wagic but it starts off as a locked set.

5th edition is the only unlocked set to begin. You can see it in the trophy room.

Next there are decks which contain your 60 or so cards.
These are saved as deck1.txt...deck###.txt there cannot be gaps
These are usually stored in USER/player/
You can create your own deck and put it in there and play it. Due to the beautiful open source nature of Wagic, you don't even have to unlocked the set you want to use cards from. (but beware you cannot edit them in deck editor if you have not bought the card in Wagic)

For an example of how to format your deck##.txt file look at AI/BAKA/
deck1.txt has an example of the old style using the gatherer ids
deck37.txt has an example of the new style using the names it even has a Zendikar card

Kabira Crossroads (ZEN) * 2

(Also some cards are not in Wagic so if you make your deck and are a few cards short. Check the spelling and also check that the card is in Wagic.)

i forgot to mention that if you are in deck editor you should press the start button(or windows/iOS/Android equivalent) to bring up the save menu.
Locked