Page 1 of 1

FOrge pics

PostPosted: 01 Feb 2013, 13:52
by ckapanga
hello everybody

yesterday i downloaded FORGE
but when i start to play ,the game doesnt have pics of cards
what i want to do?

thanks cya

Re: FOrge pics

PostPosted: 01 Feb 2013, 15:59
by myk
ckapanga wrote:but when i start to play ,the game doesnt have pics of cards
what i want to do?
Go down to the last menu option on the left, "Game Settings". Choose "Content Downloaders". Then go through and download the resources. It will take a good long while -- the download rate is throttled so the content server doesn't get overloaded -- but you only have to download the bulk of the files once. When new cards are added in new versions, return here and go through the download buttons again to download the new stuff (which will only take a few seconds). Have fun!

Re: FOrge pics

PostPosted: 01 Feb 2013, 20:23
by ckapanga
ok
im doing this now
thanks so much!!

Re: FOrge pics

PostPosted: 03 Feb 2013, 20:55
by xPUNskis
When I try to download the the LQ pictures it'll download maybe 1 or 2 pictures before it freezes on one the third or fourth picture. I then have to exit out and restart the process and then it will do it all over again, only downloading a few pictures before needing to be restarted. Is there a way to fix this? Is it normal for this to be happening? Or does my computer just suck?

Edit: It seems like it works fine when my internet isn't connected. Are the picture located somewhere within the Forge file and maybe the internet connection somehow interferes with it?

Re: FOrge pics

PostPosted: 03 Feb 2013, 21:05
by timmermac
Are you downloading LQ or LQ Set pics? My recommendation would be the LQ Set pics. I just helped my brother set Forge up on his computer a couple of days ago, and the LQ Set pics downloaded fine onto his computer in about 3 to 4 hours.

Re: FOrge pics

PostPosted: 04 Feb 2013, 04:50
by xPUNskis
I've tried both, but both have similiar results. LQ pictures will freeze after maybe 2 pictures downloaded and LQ Set pictures will freeze after about 20 or so. It was the same way with past versions of the program too. It's very strange.

Re: FOrge pics

PostPosted: 04 Feb 2013, 06:40
by moomarc
Don't have much to offer in the way of advise here, but can tell you tat it's definitely not meant to work that way. The download's are throttled though, so if your connection is super fast perhaps it 'freezes' after a few then if you leave it, it would carry on. Have you tried leaving it for a while after it seems to get stuck?

As for it working without an internet connection, the images definitely aren't packaged with Forge, so while the downloader might appear to run, it won't actually download anything that you don't already have.

Re: FOrge pics

PostPosted: 04 Feb 2013, 13:10
by Max mtg
I've been thinking of card images to be downloaded by demand.

Re: FOrge pics

PostPosted: 04 Feb 2013, 13:41
by moomarc
Max mtg wrote:I've been thinking of card images to be downloaded by demand.
What do you have in mind?

Re: FOrge pics

PostPosted: 04 Feb 2013, 13:53
by myk
+1, and while we're at it, maybe we can get it out of the program directory and into some sort of shared area so users don't have to do anything to import pics when they extract a new version of forge to a new directory.

Code: Select all
private static final String userDataBaseDir;
static {
    String os = System.getProperty("os.name").toUpperCase();
    String baseDir;
    if (os.contains("WIN")) {
        userDataBaseDir = System.getenv("APPDATA") + "/Forge";
    } else if (OS.contains("MAC")) {
        userDataBaseDir =
            System.getProperty("user.home") + "/Library/Application Support/Forge";
    } else if (OS.contains("NUX")) {
        userDataBaseDir = System.getProperty("user.home") + "/.forge";
    } else {
        userDataBaseDir = System.getProperty("user.dir") + "/.forge";
    }
}
Then have a subdir of cache/ under which we can put the pics. On Linux, at least, <userDataBaseDir>/cache/ should be a symlink to $HOME/.cache/forge where the real bulk files should be kept. In the future, we might want to migrate preferences and quest data there too so upgrades will always be trouble free. Un-upgradable files can be backed up then overwritten with defaults from the installed program dir.

Re: FOrge pics

PostPosted: 04 Feb 2013, 15:22
by Max mtg
A request for card image makes our game request that image from web server if no file is found.
A complicated part is about notifying the UI components that requested the image about its readiness.

myk, I like the idea of storing preferences in user profile by default. Yet, not sure if symlinks are needed - firstly, they are quite an advanced technique. And second, some people might keep an image database shared by several magic applications... at least I do. So should one download a new version of game, he might just edit the preferences file to point at that folder with all images ready.

Re: FOrge pics

PostPosted: 04 Feb 2013, 17:47
by myk
Yeah, all drawing would have to be done in an asynchronous callback. Like maybe with:
Code: Select all
public class ImageDb {
    /**
     * Requests a card image.  The given function will be called when the image has been
     * retrieved.  If multiple outstanding calls have been made with targetId parameters
     * that compare equal, only the callback for the most recently requested image will
     * be called.  The callback may be called from the calling thread if the image is
     * already at hand.
     */
    public <T> void getCardImage(Function<Pair<Image, T>, Void> onImageReady, T target);
}
Internally, getCardImage will use concurrent structures to communicate with a worker thread (I presume we'll still only have one or two if we still want to throttle). If, when the image comes back, the request is still the latest one for the given targetId, the worker thread will call the callback via SwingUtils.invokeLater().

re: symlinks, that was just so the cache would appear in a "standard" location according to Linux file placement guidelines. the symlink would just be for convenience. it wouldn't be required. moreover, if forge.preferences were stored in userDataBaseDir, any other path could be set to an optional custom value there and wouldn't have to be changed/copied on update