It is currently 20 Apr 2024, 03:44
   
Text Size

Achivement discussion

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Re: Achivement discussion

Postby drdev » 13 Sep 2014, 20:47

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).
drdev
Programmer
 
Posts: 1958
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 565 times

Re: Achivement discussion

Postby KrazyTheFox » 14 Sep 2014, 03:04

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...
    }
}
User avatar
KrazyTheFox
Programmer
 
Posts: 725
Joined: 18 Mar 2014, 23:51
Has thanked: 66 times
Been thanked: 226 times

Re: Achivement discussion

Postby drdev » 14 Sep 2014, 04:31

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
drdev
Programmer
 
Posts: 1958
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 565 times

Re: Achivement discussion

Postby Agetian » 14 Sep 2014, 04:41

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
Agetian
Programmer
 
Posts: 3471
Joined: 14 Mar 2011, 05:58
Has thanked: 676 times
Been thanked: 561 times

Re: Achivement discussion

Postby drdev » 14 Sep 2014, 04:43

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.
drdev
Programmer
 
Posts: 1958
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 565 times

Re: Achivement discussion

Postby Agetian » 14 Sep 2014, 05:09

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
Agetian
Programmer
 
Posts: 3471
Joined: 14 Mar 2011, 05:58
Has thanked: 676 times
Been thanked: 561 times

Re: Achivement discussion

Postby drdev » 14 Sep 2014, 05:38

Actually, I think I've found some better ones.

AchievementsScreen.png

Is that better?
drdev
Programmer
 
Posts: 1958
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 565 times

Re: Achivement discussion

Postby Agetian » 14 Sep 2014, 06:05

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
Agetian
Programmer
 
Posts: 3471
Joined: 14 Mar 2011, 05:58
Has thanked: 676 times
Been thanked: 561 times

Re: Achivement discussion

Postby drdev » 14 Sep 2014, 06:11

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.
drdev
Programmer
 
Posts: 1958
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 565 times

Re: Achivement discussion

Postby Agetian » 14 Sep 2014, 06:12

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
Agetian
Programmer
 
Posts: 3471
Joined: 14 Mar 2011, 05:58
Has thanked: 676 times
Been thanked: 561 times

Re: Achivement discussion

Postby drdev » 14 Sep 2014, 06:15

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.
drdev
Programmer
 
Posts: 1958
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 565 times

Re: Achivement discussion

Postby Agetian » 14 Sep 2014, 06:26

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
Agetian
Programmer
 
Posts: 3471
Joined: 14 Mar 2011, 05:58
Has thanked: 676 times
Been thanked: 561 times

Re: Achivement discussion

Postby Fizanko » 15 Sep 2014, 00:20

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 ?
probably outdated by now so you should avoid : Innistrad world for Forge (updated 17/11/2014)
Duel Decks for Forge - Forge custom decks (updated 25/10/2014)
User avatar
Fizanko
Tester
 
Posts: 780
Joined: 07 Feb 2014, 11:24
Has thanked: 155 times
Been thanked: 94 times

Re: Achivement discussion

Postby lugaru » 15 Sep 2014, 01:55

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.
lugaru
 
Posts: 79
Joined: 19 Jun 2011, 16:17
Has thanked: 1 time
Been thanked: 1 time

Re: Achivement discussion

Postby Xitax » 15 Sep 2014, 02:13

Would you add support for custom trophy graphics? BTW, are all these going to be hard-coded, or can they be scripted?
Xitax
 
Posts: 918
Joined: 16 May 2010, 17:19
Has thanked: 183 times
Been thanked: 133 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 94 guests


Who is online

In total there are 94 users online :: 0 registered, 0 hidden and 94 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 94 guests

Login Form