myk's code contributions
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: myk's code contributions
by Chris H. » 14 Mar 2013, 12:25
I have run a couple of play tests so far.
The Import Data button will bring up a dialog that includes a checkbox labeled "Remove source files after copy". This checkbox is on by default so be careful. Myk might want to make this off by default.
Myk's archive includes a file in the root folder named "forge.profile.properties.example". Read this file as there is some important info that you need to know.
This file will tell you where your data files will be moved to. People who were using the old properties file can follow the instructions in this new file as it will allow you to move your data from the default location to an area of your own choice.
The CHANGES.txt and the README.txt files in the archive do not include any instructions on how to use this new system. The instructions will be added after the next beta release, 1.3.10 on Friday March 15.
The Import Data button will bring up a dialog that includes a checkbox labeled "Remove source files after copy". This checkbox is on by default so be careful. Myk might want to make this off by default.
Myk's archive includes a file in the root folder named "forge.profile.properties.example". Read this file as there is some important info that you need to know.
This file will tell you where your data files will be moved to. People who were using the old properties file can follow the instructions in this new file as it will allow you to move your data from the default location to an area of your own choice.
The CHANGES.txt and the README.txt files in the archive do not include any instructions on how to use this new system. The instructions will be added after the next beta release, 1.3.10 on Friday March 15.
-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: myk's code contributions
by myk » 14 Mar 2013, 15:30
@Agetian: the location you're using in res/ is absolutely fine -- the res directory isn't going anywhere! The only directories that have changed location are the ones that have to do with user preferences and saved data, like res/decks and res/preferences and res/quest/data. After the merge, we might want to clean up the res/ directory structure further, but I wanted to change the fewest number of files in there as possible to avoid merge conflicts.
@Chris: The dialog has two modes - Import and Migrate. The dialog is in Import mode when accessed as the 'Import Data' option on the Content Downloaders submenu. The Migrate mode is temporary and is only there for this initial data migration. I think you're definitely right about keeping 'move' off by default in Import mode, but for the initial migration mode, if the files aren't deleted, then the dialog will just come up again prompting for migration on next program start. Originally, I actually had all checkboxes selected and unchangeable when in migrate mode, but I realized that the users might want to play with the checkboxes a bit to see how it affects how data is migrated. For example, I found that to easily verify that my decks were going to the right spots, I turned off import of everything but, say, Draft decks so I could examine a nice, short list and make sure they all were going to the same place.
How about if I keep everything changeable (except the 'Choose directory' button, which /is/ correctly disabled in Migrate mode after being pre-populated with the res/ directory), but pop up a dialog if any non-zero checkbox is deselected when the 'Start import' button is clicked, giving the user the chance to change the selection and warning them that if they don't they will have to take care of that data manually? I also already provide a summary of leftover files that were not recognized and could not be migrated automatically.
@Chris: The dialog has two modes - Import and Migrate. The dialog is in Import mode when accessed as the 'Import Data' option on the Content Downloaders submenu. The Migrate mode is temporary and is only there for this initial data migration. I think you're definitely right about keeping 'move' off by default in Import mode, but for the initial migration mode, if the files aren't deleted, then the dialog will just come up again prompting for migration on next program start. Originally, I actually had all checkboxes selected and unchangeable when in migrate mode, but I realized that the users might want to play with the checkboxes a bit to see how it affects how data is migrated. For example, I found that to easily verify that my decks were going to the right spots, I turned off import of everything but, say, Draft decks so I could examine a nice, short list and make sure they all were going to the same place.
How about if I keep everything changeable (except the 'Choose directory' button, which /is/ correctly disabled in Migrate mode after being pre-populated with the res/ directory), but pop up a dialog if any non-zero checkbox is deselected when the 'Start import' button is clicked, giving the user the chance to change the selection and warning them that if they don't they will have to take care of that data manually? I also already provide a summary of leftover files that were not recognized and could not be migrated automatically.
Last edited by myk on 14 Mar 2013, 15:38, edited 3 times in total.
- myk
- Posts: 439
- Joined: 17 Jan 2013, 02:39
- Location: California
- Has thanked: 38 times
- Been thanked: 57 times
Re: myk's code contributions
by Agetian » 14 Mar 2013, 15:32
@ myk: Oh, OK, thanks for clearing that up!
- Agetian
- Agetian
- Agetian
- Programmer
- Posts: 3486
- Joined: 14 Mar 2011, 05:58
- Has thanked: 683 times
- Been thanked: 569 times
Re: myk's code contributions
by Chris H. » 14 Mar 2013, 21:01
Ran another import data test today. I selected a copy of my daily snapshot build. This copy has LQ pics that were originally the HQ pics but were cropped to remove the borders, scaled down to 200x285 and then saved at 100%.
After doing the import data test I checked out the cards folder in my caches folder and the pics appear to not match what I had in the copy of my daily snapshot build.
Is the new code copying over my pics or is it re-downloading them? Or am I somehow mistaken? I noticed that the card pic file names are different and now match the HQ pic file names.
After doing the import data test I checked out the cards folder in my caches folder and the pics appear to not match what I had in the copy of my daily snapshot build.
Is the new code copying over my pics or is it re-downloading them? Or am I somehow mistaken? I noticed that the card pic file names are different and now match the HQ pic file names.
-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: myk's code contributions
by myk » 14 Mar 2013, 22:42
That is right -- to simplify the image filename generation algorithms, the LQ pics are named like the HQ pics. The filenames are translated as part of the migration process. They are the same LQ files as before, though, just renamed.
new version uploaded, btw, that has the changes discussed in my previous post.
http://cardforge.org/releases/snapshots/forge/branches/myk-separate-writable-data/current/
new version uploaded, btw, that has the changes discussed in my previous post.
http://cardforge.org/releases/snapshots/forge/branches/myk-separate-writable-data/current/
Last edited by myk on 15 Mar 2013, 09:03, edited 1 time in total.
- myk
- Posts: 439
- Joined: 17 Jan 2013, 02:39
- Location: California
- Has thanked: 38 times
- Been thanked: 57 times
Re: myk's code contributions
by Chris H. » 15 Mar 2013, 02:22
It looks like the file name of the plane cards do not end in ".full".
-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: myk's code contributions
by myk » 15 Mar 2013, 03:46
I'm not seeing this -- my cards folder has:
edit: ah, or is it that planechase cards /shouldn't/ be ending in .full?
- Code: Select all
20130314 20:45:05 [myk:~/Library/Caches/Forge/pics/cards] $ ls Krosa.*jpg
Krosa.full.jpg
20130314 20:45:20 [myk:~/Library/Caches/Forge/pics/cards] $ ls HOP/Krosa.*jpg
HOP/Krosa.full.jpg
edit: ah, or is it that planechase cards /shouldn't/ be ending in .full?
- myk
- Posts: 439
- Joined: 17 Jan 2013, 02:39
- Location: California
- Has thanked: 38 times
- Been thanked: 57 times
Re: myk's code contributions
by moomarc » 15 Mar 2013, 04:07
The planes are released by the HQ team without the .full, but I added it to the planes at cardforge because that's what the downloader looks for.myk wrote:edit: ah, or is it that planechase cards /shouldn't/ be ending in .full?
-Marc
-
moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: myk's code contributions
by myk » 15 Mar 2013, 06:50
In the interest of full compatibility, I can make the adjustment to not add .full to the plane/phenomenon cards. would it be possible to add in non-".full" versions of those cards to the cardforge site?
- myk
- Posts: 439
- Joined: 17 Jan 2013, 02:39
- Location: California
- Has thanked: 38 times
- Been thanked: 57 times
Re: myk's code contributions
by moomarc » 15 Mar 2013, 08:47
Should I upload a duplicate of each so that anyone using older versions can still get the images, or just replace the current ones?myk wrote:In the interest of full compatibility, I can make the adjustment to not add .full to the plane/phenomenon cards. would it be possible to add in non-".full" versions of those cards to the cardforge site?
-Marc
-
moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: myk's code contributions
by myk » 15 Mar 2013, 08:49
I'd say upload a duplicate, if that's ok -- we don't want to break the downloads for those on older (or current trunk) versions.
On that note, I uploaded a new version of my branch code. Among other fixes, I put the migration help text in a scroll panel so the dialog should fit on smaller screens now.
For those just looking at this now, here's the background for what's going on:
On that note, I uploaded a new version of my branch code. Among other fixes, I put the migration help text in a scroll panel so the dialog should fit on smaller screens now.
For those just looking at this now, here's the background for what's going on:
- test procedure | Open
- I'm gearing up to merge in the work I've been doing to separate the program data from user-writable data. I have taken care to make the data migration safe and as painless as possible, but I was hoping to get validation from a few additional users that (1) everything gets migrated correctly and (2) what is happening is clearly communicated. If anyone has a few minutes, I would really appreciate your help! The procedure is safe -- you aren't going to lose any data even if things go horribly wrong. Just follow the following steps:
- Copy your entire forge installation to another location on your hard drive. Be sure to copy from the installation root so you include all your picture files, quest data, and decks.
- Download the snapshot build of my branch from http://cardforge.org/releases/snapshots/forge/branches/myk-separate-writable-data/current/
- Install it over the copy that you made
- Run it! The prompts that automatically come up should guide you the rest of the way.
Once the migration is done, play with Forge a bit as you usually do. Make sure all your data is there, and please report back on your experiences! As I fix any bugs that come up and make further enhancements, I'll upload updated versions and write a notification here, but the link above will always get you to the most recent version.
- myk
- Posts: 439
- Joined: 17 Jan 2013, 02:39
- Location: California
- Has thanked: 38 times
- Been thanked: 57 times
Re: myk's code contributions
by Chris H. » 15 Mar 2013, 12:44
I figured out what was happening on my end. I ran an import data test. After running this test I attempted to download any missing pic files and was surprised to see that I was missing about two dozen pics. I thought that I was up to date.
Some of my LQ pics were using upper case chars in the file name and I am using a case-insensitive OS. Forge would recognize and display these images in-game.
The new branch version apparently does not include these LQ pics that were using upper case chars in the file name in the import data process. They were not copied over. This is why Forge then felt that there was missing pics to download.
Forge also found five pics that did not download in my current snapshot build of the trunk version:
aretopolis.jpg
feeding_grounds.jpg
haakon_stromgald_scourge_avatar.jpg
jaya_ballard_task_mage_avatar.jpg
undercity_reaches.jpg
For some reason the Jaya Ballard avatar downloaded without the "task_mage" portion.
Some of my LQ pics were using upper case chars in the file name and I am using a case-insensitive OS. Forge would recognize and display these images in-game.
The new branch version apparently does not include these LQ pics that were using upper case chars in the file name in the import data process. They were not copied over. This is why Forge then felt that there was missing pics to download.
Forge also found five pics that did not download in my current snapshot build of the trunk version:
aretopolis.jpg
feeding_grounds.jpg
haakon_stromgald_scourge_avatar.jpg
jaya_ballard_task_mage_avatar.jpg
undercity_reaches.jpg
For some reason the Jaya Ballard avatar downloaded without the "task_mage" portion.
-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: myk's code contributions
by Chris H. » 15 Mar 2013, 13:08
myk wrote:In the interest of full compatibility, I can make the adjustment to not add .full to the plane/phenomenon cards. would it be possible to add in non-".full" versions of those cards to the cardforge site?
This is probably a good idea. We currently do not have a downloader for HQ pics and people have to grab the pics from
-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: myk's code contributions
by myk » 15 Mar 2013, 15:53
@Chris: Good catch! I'll see if I can make the import code do a case-insensitive match for filenames.
@moomarc: in an effort to save you some time, here is an archive containing the additional pics for the HOP fpics directory. I see the PC2 non-".full" pics are already up.
@moomarc: in an effort to save you some time, here is an archive containing the additional pics for the HOP fpics directory. I see the PC2 non-".full" pics are already up.
- Attachments
-
additional.HOP.pics.tar.gz
- (777.9 KiB) Downloaded 236 times
- myk
- Posts: 439
- Joined: 17 Jan 2013, 02:39
- Location: California
- Has thanked: 38 times
- Been thanked: 57 times
Re: myk's code contributions
by Chris H. » 15 Mar 2013, 16:03
Ran another test this morning using the newest branch build.
This time I am getting 10 pics that need to be downloaded after the import data. Nine of the pics will download:
Aretopolis.jpg
Chaotic AEther.jpg
Feeding Grounds.jpg
Haakon, Stromgald Scourge Avatar.full.jpg
Jaya Ballard Avatar.full.jpg
Mutual Epiphany.jpg
Planewide Disaster.jpg
Undercity Reaches.jpg
and one pic will not be download and is being skipped:
Horizon Boughs.jpg
This time I am getting 10 pics that need to be downloaded after the import data. Nine of the pics will download:
Aretopolis.jpg
Chaotic AEther.jpg
Feeding Grounds.jpg
Haakon, Stromgald Scourge Avatar.full.jpg
Jaya Ballard Avatar.full.jpg
Mutual Epiphany.jpg
Planewide Disaster.jpg
Undercity Reaches.jpg
and one pic will not be download and is being skipped:
Horizon Boughs.jpg
-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Who is online
Users browsing this forum: No registered users and 9 guests