It is currently 09 Sep 2025, 08:05
   
Text Size

Forge version 1.2.16

Post MTG Forge Related Programming Questions Here

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

Forge version 1.2.16

Postby Chris H. » 05 Oct 2012, 12:11

Starting a next version thread.

Tentative release target date: Friday November 2nd.
User avatar
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: Forge version 1.2.16

Postby Max mtg » 05 Oct 2012, 12:34

A whole month of fun trying to implement hotseat or even multiplayer.
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: Forge version 1.2.16

Postby moomarc » 05 Oct 2012, 20:51

If we get hotseat and/or multiplayer working for this next beta should we perhaps move over to Forge v1.3.0? With the next major iteration being for next-gen AI?
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Forge version 1.2.16

Postby Chris H. » 05 Oct 2012, 22:59

moomarc wrote:If we get hotseat and/or multiplayer working for this next beta should we perhaps move over to Forge v1.3.0? With the next major iteration being for next-gen AI?
 
Sounds like an idea for us to consider, but we do want to make sure to give Max all of the time that he needs. :)
User avatar
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: Forge version 1.2.16

Postby Max mtg » 07 Oct 2012, 13:29

The methods AllZone.getComputerPlayer and AllZone.getHumanPlayer are deprecated.
Each reference will generate a warning. There are some 850 of them at the moment.

Whenever possible, refactor your code and keep in mind that there may be a number of computer or human players in a game.

Actual routines are: AllZone.getPlayersInGame or Player's methods to check if it is a human or computer.


Player's method "getOpponent" is to be deprecated soon.
(because there will be many opponents)
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: Forge version 1.2.16

Postby Sloth » 07 Oct 2012, 14:17

Max mtg wrote:The methods AllZone.getComputerPlayer and AllZone.getHumanPlayer are deprecated.
I think there is an error here:
getHumanPlayer() | Open
Code: Select all
    @Deprecated
    public static Player getHumanPlayer() {
        if (Singletons.getModel() == null)
            return null;

        return Aggregates.firstFieldEquals(Singletons.getModel().getGameState().getPlayers(), Player.Accessors.FN_GET_TYPE, PlayerType.COMPUTER);
    }
Shouldn't it be PlayerType.HUMAN?
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Forge version 1.2.16

Postby moomarc » 07 Oct 2012, 14:25

Chris H. wrote:
moomarc wrote:If we get hotseat and/or multiplayer working for this next beta should we perhaps move over to Forge v1.3.0? With the next major iteration being for next-gen AI?
 
Sounds like an idea for us to consider, but we do want to make sure to give Max all of the time that he needs. :)
Yea, definitely wasn't trying to rush max. My phrasing shouldn't have stated [ii]this beta[/i]. Merely meant to point out that I think its a major-enough feature to increment the main version, certainly bigger than an AI overhaul in terms of game functionality. I'm just impressed that its finally happening. Sooner than I expected. :mrgreen:
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Forge version 1.2.16

Postby Max mtg » 07 Oct 2012, 14:34

Sloth wrote:
Max mtg wrote:The methods AllZone.getComputerPlayer and AllZone.getHumanPlayer are deprecated.
I think there is an error here:
getHumanPlayer() | Open
Code: Select all
    @Deprecated
    public static Player getHumanPlayer() {
        if (Singletons.getModel() == null)
            return null;

        return Aggregates.firstFieldEquals(Singletons.getModel().getGameState().getPlayers(), Player.Accessors.FN_GET_TYPE, PlayerType.COMPUTER);
    }
Shouldn't it be PlayerType.HUMAN?
Thank you, Sloth.

Now I am working on AbilityFactories with lots of calls to get*player coming from static routines referred by canPlayAI() calls of different abilities. So when I see such a problem, I add Player aiPlayer parameter to static routine and use it instead of getComputerPlayer and expect that the activating player is set by the moment canPlayAI is checked. Multiple AIs might coexist in this way, I hope. As for acquiring an opponent to target with a spell, for now I can only replace getHumanPlayer by aiPlayer.getOpponent, though it may be inaccurate for multiplayer game.

See r17387 for example.
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: Forge version 1.2.16

Postby Chris H. » 07 Oct 2012, 15:18

moomarc wrote:Yea, definitely wasn't trying to rush max. My phrasing shouldn't have stated [ii]this beta[/i]. Merely meant to point out that I think its a major-enough feature to increment the main version, certainly bigger than an AI overhaul in terms of game functionality. I'm just impressed that its finally happening. Sooner than I expected. :mrgreen:
 
Yeah, I think that we are all on the same page. :)

We might want to call the next beta v 1.3.0 for the new gauntlet mode that Doublestrike has recently added.

Max should be able to add in the code changes for the initial stage of his work but might not actually have enough time to implement a hot-seat/multiplayer game mode.

Once Max is far enough along with the hot-seat/multiplayer game mode we could then go to 1.4.0 to recognize his work.

A new and improved AI as has been discussed elsewhere of SlightlyMagic might warrant a v 2.0.0 number :)
User avatar
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: Forge version 1.2.16

Postby moomarc » 07 Oct 2012, 15:39

A lot of scripts are also going to need fixing up in this regard once multiple players are enabled. A lot of the count methods and targeting types rely on the fact that there is currently only one other player who is always an opponent. We're going to have to split all these into an opponent, any other player, each opponent, each other player. Several cards that use YouDontOwn or YouDontControl probably also need to be adjusted after multiplayer is added.

Thanks Max for the work you're doing. Forge is going to be awesome (moreso than before)!
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Forge version 1.2.16

Postby Max mtg » 07 Oct 2012, 23:27

Update:
cannot deprecate player.getOpponent - too many AI roitines rely on a single enemy convention.
The refactored ai should be able to play against another ai - I'll try it some day.

There still remain 160+ references to global getXXXplayer methods.
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: Forge version 1.2.16

Postby Doublestrike » 09 Oct 2012, 00:14

@friarsol - almost done with the multiblocker dialog, but I've got some questions about damage assignment:

1) Must all blockers receive lethal damage before any can be assigned to an opponent?

2) If a creature has deathtouch, can all trample damage roll over to opponent?

Any other corner damage cases you can think of?
---
A joke is a very serious thing.
User avatar
Doublestrike
UI Programmer
 
Posts: 715
Joined: 08 Aug 2011, 09:07
Location: Bali
Has thanked: 183 times
Been thanked: 161 times

Re: Forge version 1.2.16

Postby friarsol » 09 Oct 2012, 00:55

Doublestrike wrote:@friarsol - almost done with the multiblocker dialog, but I've got some questions about damage assignment:

1) Must all blockers receive lethal damage before any can be assigned to an opponent?

2) If a creature has deathtouch, can all trample damage roll over to opponent?

Any other weird damage cases you can think of?
All blockers must receive lethal damage in order before the defending object (player or planeswalker) can be dealt damage. This means if the attacker has deathtouch, "lethal damage" is only 1 if that blocker has not yet received lethal damage already. (This case is important for creatures that can block multiple attackers or that are indestructible). Damage prevention/protection is not considered when assigning lethal damage to blockers.

And yes, if you have a trampling deathtoucher, in a simple scenario you can deal X damage to the opponent, where X is the assignable damage minus the amount of blockers.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Forge version 1.2.16

Postby Doublestrike » 09 Oct 2012, 07:26

OK all finished. I think it's working properly but there are probably some corner cases I may have missed (hopefully not).
Attachments
damage.jpg
Last edited by Doublestrike on 09 Oct 2012, 08:31, edited 1 time in total.
---
A joke is a very serious thing.
User avatar
Doublestrike
UI Programmer
 
Posts: 715
Joined: 08 Aug 2011, 09:07
Location: Bali
Has thanked: 183 times
Been thanked: 161 times

Re: Forge version 1.2.16

Postby Doublestrike » 09 Oct 2012, 07:50

@moomarc, mostly - would people mind if the specially styled button pictures were removed?

I'm talking about the ones like on the win/lose screen, the "continue", etc. They'll be replaced by a more button-y button, throughout the UI.

Is anyone strongly in favor of keeping that look?
---
A joke is a very serious thing.
User avatar
Doublestrike
UI Programmer
 
Posts: 715
Joined: 08 Aug 2011, 09:07
Location: Bali
Has thanked: 183 times
Been thanked: 161 times

Next

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 32 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 32 users online :: 0 registered, 0 hidden and 32 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 32 guests

Login Form