Page 2 of 27

Re: Achivement discussion

PostPosted: 13 Sep 2014, 20:47
by drdev
I just finished refactoring the Achievements code to support separate sets of achievements for each game type. As part of this, Achievements are no longer an enum but rather a set of classes, accessible using FModel.getAchievements(gameType).

Re: Achivement discussion

PostPosted: 14 Sep 2014, 03:04
by KrazyTheFox
I've finally crossed almost everything off my list of things to get done on the main branch today (that sure was a lot) and I've just started looking through the achievements code.

It's all looking great and really simple to use, but I must ask if this can be made non-abstract:
Code: Select all
protected abstract int evaluate(Player player, Game game, int current);

That way an Achievement can use overloaded evaluate methods without having to implement every one of them. For example, the following could be used to track matches without any losses:
Code: Select all
protected int evaluate(Player player, Match match, int current) { return -1; }

Or even:
Code: Select all
protected int evaluate(QuestEventDraft draft, int current) { return -1; }

I think that change would really open this up, though the current system would need some re-writing to allow for that.

Might I propose:

Let achievements know something happened:
Code: Select all
FModel.getAchievements(gameType).notify(player, game);

Update the achievements with new info: (Replaces current updateAll())
Code: Select all
public void notify(Player player, Game game) {
    for (Achievement achievement : achievements.values()) {
        achievement.update(achievement.evaluate(player, game));
    }
    save();
}

Update the achievements with new info:
Code: Select all
private final void update(int score) {
    if (score == -1) {
        return; //Doesn't accept this kind of update
    }
    if (score > best) {
        //And so on...
    }
}

Re: Achivement discussion

PostPosted: 14 Sep 2014, 04:31
by drdev
So I've made some progress on creating an Achievements screen. I've set it up to look like a trophy case, with placards on each shelf for the achievement name and the best/current scores for each achievement. The combo box at the top allows switching between the achievements for different game modes.

AchievementsScreen.png

Next up I'll add tooltips for each trophy that will give the details of what's required to achieve each tier of the achievement, then work on fleshing out some more achievements. Krazy, I'll keep your suggestion in mind in terms of supporting other types of achievements.

Let me know what you think.

Thanks.
-Dan

Re: Achivement discussion

PostPosted: 14 Sep 2014, 04:41
by Agetian
drdev wrote:So I've made some progress on creating an Achievements screen. I've set it up to look like a trophy case, with placards on each shelf for the achievement name and the best/current scores for each achievement. The combo box at the top allows switching between the achievements for different game modes.
<...>
Next up I'll add tooltips for each trophy that will give the details of what's required to achieve each tier of the achievement, then work on fleshing out some more achievements. Krazy, I'll keep your suggestion in mind in terms of supporting other types of achievements.

Let me know what you think.

Thanks.
-Dan
This looks really cool, Dan! Thanks for the feature!
The only issue I can see is that the scaled trophies and the case look somewhat blurry... will there be higher resolution representations later (just curious)?

- Agetian

Re: Achivement discussion

PostPosted: 14 Sep 2014, 04:43
by drdev
Yeah, I'm hoping to find better looking trophies. Any help here will be appreciated, as I don't have the graphics skills to make them from scratch, which limits me to finding free ones online, which often lack the necessary transparency at the edges.

Re: Achivement discussion

PostPosted: 14 Sep 2014, 05:09
by Agetian
drdev wrote:Yeah, I'm hoping to find better looking trophies. Any help here will be appreciated, as I don't have the graphics skills to make them from scratch, which limits me to finding free ones online, which often lack the necessary transparency at the edges.
Umm I'm no great artist but I'll see if I can 3D-model the trophies for you based on the pixel art you're using... No promises but I'll see what I can do ;)

- Agetian

Re: Achivement discussion

PostPosted: 14 Sep 2014, 05:38
by drdev
Actually, I think I've found some better ones.

AchievementsScreen.png

Is that better?

Re: Achivement discussion

PostPosted: 14 Sep 2014, 06:05
by Agetian
drdev wrote:Actually, I think I've found some better ones.

AchievementsScreen.png

Is that better?
Yep, looks really awesome now! :)
Do you need a higher resolution trophy case, perhaps? (I can try 3D modeling that, it's not hard I think).

- Agetian

Re: Achivement discussion

PostPosted: 14 Sep 2014, 06:11
by drdev
Agetian wrote:
drdev wrote:Actually, I think I've found some better ones.

AchievementsScreen.png

Is that better?
Yep, looks really awesome now! :)
Do you need a higher resolution trophy case, perhaps? (I can try 3D modeling that, it's not hard I think).

- Agetian
Go for it if you like. Keep in mind that I'm currently scaling the two image files for the trophy case by 3x in game (to 798px wide), but if you make them 3 times larger in the file, I can just get rid of the in-game scaling.

Re: Achivement discussion

PostPosted: 14 Sep 2014, 06:12
by Agetian
drdev wrote:
Agetian wrote:
drdev wrote:Actually, I think I've found some better ones.

AchievementsScreen.png

Is that better?
Yep, looks really awesome now! :)
Do you need a higher resolution trophy case, perhaps? (I can try 3D modeling that, it's not hard I think).

- Agetian
Go for it if you like. Keep in mind that I'm currently scaling the two image files for the trophy case by 3x in game (to 798px wide), but if you make them 3 times larger in the file, I can just get rid of the in-game scaling.
So basically, you need a 800 pixel wide picture, right? I can render it out as big as you need to, just give me the dimensions and I'll go for it ;)

- Agetian

Re: Achivement discussion

PostPosted: 14 Sep 2014, 06:15
by drdev
Both pictures should be 798px wide, but keep in mind that the shelf picture is repeated vertically, so the grain of the wood on the sides needs to match top-to-bottom to prevent seams.

Also, make sure the foreground face of the shelf is 39px tall so that the plate height matches up with it.

Re: Achivement discussion

PostPosted: 14 Sep 2014, 06:26
by Agetian
drdev wrote:Both pictures should be 798px wide, but keep in mind that the shelf picture is repeated vertically, so the grain of the wood on the sides needs to match top-to-bottom to prevent seams.

Also, make sure the foreground face of the shelf is 39px tall so that the plate height matches up with it.
Oh, I mistakenly thought it was just one picture scaled up. :) Ok I'll take a look at the constituent elements of the shelf in the skin files then and see if I can figure out how exactly the elements match up. I'll tell you if I come up with a higher res modeled equivalent. ;)

- Agetian

Re: Achivement discussion

PostPosted: 15 Sep 2014, 00:20
by Fizanko
If possible, i would suggest a possibility to see how many times you earned a specific achievement (for those appropriate, as the streak one it wouldn't matter how many time you did a streak, as it's the length of the streak that matter there), maybe by hoovering the mouse over the trophy to avoid adding too much clutter on the interface ?

Re: Achivement discussion

PostPosted: 15 Sep 2014, 01:55
by lugaru
Personally I recommend approaching the achievements as though Magic is your game and you want to make sure new players explore the possibilities. You guys are already doing that a bit with Quest Mode since that is your baby, but you kind of need to pretend that all of magic is 'yours' and you want to show it off.

Personally I would add some easy ones that require different deck styles such as:
Pyrexian: Win By Poison
Schemer: Win by Alt Condition
Mind Sculptor: Win by Decking your Opponent

These achievements would make somebody 'new' to magic really explore the game.

Re: Achivement discussion

PostPosted: 15 Sep 2014, 02:13
by Xitax
Would you add support for custom trophy graphics? BTW, are all these going to be hard-coded, or can they be scripted?