It is currently 16 Apr 2024, 11:53
   
Text Size

TFM&G2K's Planeswalkers Pool v8g (12/Sep/2014)

Moderator: CCGHQ Admins

Re: TFM&G2K's Planeswalkers Pool v8g (12/Sep/2014)

Postby Xander9009 » 14 Nov 2014, 21:23

NeoAnderson wrote:
Xander9009 wrote:
NeoAnderson wrote:I was looking to the planeswalkers manager code, to try to understand why the game performance slow down so much when we play with planeswalkers.
I found that the most resources are used from the follow ability

Targetting override | Open
Code: Select all
  <!-- 7. Cards not allowed to target Planeswalkers -->
  <TRIGGERED_ABILITY replacement_effect="1">
    <TRIGGER value="CARD_CONSIDERED_FOR_TARGETTING" pre_trigger="1">
    local target = TriggerObject()
    local filter = ClearFilter()
    filter:Add(FE_CARD_NAME, OP_IS, "ENCHANTED_EVENING") -- With Enchanted Evening on the battlefield, Planeswalkers would be enchantments for real
    if filter:CountStopAt(1) == 0 or target:GetZone() ~= ZONE_BATTLEFIELD then
       local targetter = SecondaryObject()
       if PLW_IsInNameSet(target, "PLANESWALKERS") and
       ( PLW_IsInNameSet(targetter, "TARGET_ENCHANTMENTS_NOT_CREATURES") or
       (target:GetCardType():Test(CARD_TYPE_CREATURE) == false and
       PLW_IsInNameSet(targetter, "TARGET_ENCHANTMENTS_AND_CREATURES")) ) then
          MTG():OverrideEvent()
          return true
       end
    end
    return false
    </TRIGGER>
  </TRIGGERED_ABILITY>
I tested the game without this override trigger and the game works without any lag.
So i was thinking if we change the trigger into a static protection action, does it could create any issue? I think could be a good performance improvement.
Oh, please, yes!

Code: Select all
  <!-- 7. Cards not allowed to target Planeswalkers -->
  <STATIC_ABILITY>
    <FILTER filter_id="0">
         local filter = ClearFilter()
         filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
         PLW_FilterNameSet(filter, "PLANESWALKERS", true)
      </FILTER>
    <CONTINUOUS_ACTION layer="0" filter_id="0">
      if FilteredCard() ~= nil then
        local filter = ClearFilter()
        filter:Add(FE_CARD_NAME, OP_IS, "ENCHANTED_EVENING") -- With Enchanted Evening on the battlefield, Planeswalkers would be enchantments for real
        if filter:CountStopAt(1) == 0 or FilteredCard():GetZone() ~= ZONE_BATTLEFIELD and PLW_IsInNameSet(FilteredCard(), "PLANESWALKERS") then
          filter = ClearFilter()
          PLW_FilterNameSet(filter, "TARGET_ENCHANTMENTS_NOT_CREATURES", true)
          if FilteredCard():GetCardType():Test(CARD_TYPE_CREATURE) == false then
            PLW_FilterNameSet(filter, "TARGET_ENCHANTMENTS_AND_CREATURES", true)
          end
          FilteredCard():Protection()
        end
      end
    </CONTINUOUS_ACTION>
  <STATIC_ABILITY>
Starting point, at least?
Xander now i am revising the frame pictures, I will check when finished how to revert this trigger into a protection.
Anyway the concept is simple we need to add FE_CARD_NAME for each spell included into listed cards that can target enchantments, then we need to protect the planeswalkers.
I edited my last post (I didn't notice you'd posted) but that's exactly what that does. The TARGET_ENCHANTMENTS_NOT_CREATURES and TARGET_ENCHANTMENTS_AND_CREATURES are lists within D14_PLW.LOL with all the relevant cards. My edit was to point out it still ran really slow. I think the best way to speed it up will be to work at the start of the game to trim those lists to only relevant cards so it runs faster.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: TFM&G2K's Planeswalkers Pool v8g (12/Sep/2014)

Postby NeoAnderson » 14 Nov 2014, 21:40

Xander9009 wrote:I edited my last post (I didn't notice you'd posted) but that's exactly what that does. The TARGET_ENCHANTMENTS_NOT_CREATURES and TARGET_ENCHANTMENTS_AND_CREATURES are lists within D14_PLW.LOL with all the relevant cards. My edit was to point out it still ran really slow. I think the best way to speed it up will be to work at the start of the game to trim those lists to only relevant cards so it runs faster.
I think that the first step could be to put the protection inside each planeswalker so it should protect effectSource so it reduces the calls to planeswalkers filter function.
NeoAnderson
 
Posts: 914
Joined: 10 Sep 2013, 07:49
Has thanked: 18 times
Been thanked: 139 times

Re: TFM&G2K's Planeswalkers Pool v8g (12/Sep/2014)

Postby fallenangle » 15 Nov 2014, 15:39

Fixed Teferi's first ability so that it works as intended and not as a copy of his second. Updated download.
fallenangle
 
Posts: 319
Joined: 20 Jul 2013, 02:31
Has thanked: 73 times
Been thanked: 41 times

Re: TFM&G2K's Planeswalkers Pool v8g (12/Sep/2014)

Postby Xander9009 » 15 Nov 2014, 17:02

NeoAnderson wrote:I think that the first step could be to put the protection inside each planeswalker so it should protect effectSource so it reduces the calls to planeswalkers filter function.
That would definitely help. You think it might work better by using Riiak's Characteristics? I think it might.

I've put together some code to cut down the lists to only the cards that are actually in someone's deck or hand. However, right now, it's just storing the index of those cards (from the original arrays in the LOL) in an ObjectDC. That means that retrieving the cards would still not be the best it can be. Is it possible to store an array so that functions in the LOL can access it? By that, I mean if I make a function which will store a global array in the LOL, will calls to that function do what I'm hoping, or does each call get a fresh file? If no one knows, I'll just test it and see what happens, but I don't want to waste too much time if someone already knows it won't work.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: TFM&G2K's Planeswalkers Pool v8g (12/Sep/2014)

Postby RiiakShiNal » 15 Nov 2014, 18:03

I believe that for each action it has to recreate any "globals" that you use as each Lua instance seems to be independent of the others so it is likely that a stored array would have to be reloaded each time. Though since I have not done extensive testing with this I can't say for certain.
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 496 times

Re: TFM&G2K's Planeswalkers Pool v8g (12/Sep/2014)

Postby NeoAnderson » 15 Nov 2014, 18:35

I have just finished to make some test using the whole card list that targets Enchantments, i made a static ability protection inside the planeswalker card, i played with 5 different planeswalkers and the game don't have previous lags!
This means will be more complicated to updated the planeswalker when new cards(that target enchantments) will come out, but at least the gameplay haven't massive frames drop.
I will upload my modded version later.
NeoAnderson
 
Posts: 914
Joined: 10 Sep 2013, 07:49
Has thanked: 18 times
Been thanked: 139 times

Re: TFM&G2K's Planeswalkers Pool v8g (12/Sep/2014)

Postby NeoAnderson » 16 Nov 2014, 00:55

MTG - GRAPHICS UPDATE M15 - ALTERNATIVE PLANESWALKERS MOD
UPDATE RELEASE 2.0 CHANGELOG :
Replaced all the card frames with High Resolution pictures.
Now the cards and the texts should appear more defined.
Added a modified version of Planeswalker's Mod, now the planeswalkers are protected from targetting
with a protection effect instead of an override trigger. It is handled inside each planeswalker instead of the manager.
The game's performances should be more fluid without too many lags, so it allows to use more planeswalkers into a single deck

MTG - GRAPHICS UPDATE M15 - ALTERNATIVE PLANESWALKERS MOD
All the credits for the Planeswalkers are of Firemind, Gorem2k, Falleangle, Xander9009 and other guys who are working on that mod.
NeoAnderson
 
Posts: 914
Joined: 10 Sep 2013, 07:49
Has thanked: 18 times
Been thanked: 139 times

Re: TFM&G2K's Planeswalkers Pool v8g (12/Sep/2014)

Postby Kithkin » 21 Nov 2014, 16:52

Nahiri, the Lithomancer -- +2 ability: custom texts missing [CARD_QUERY_MC_SOLDIER]
User avatar
Kithkin
 
Posts: 456
Joined: 21 Feb 2014, 07:12
Location: Cologne, GERMANY
Has thanked: 11 times
Been thanked: 56 times

Re: TFM&G2K's Planeswalkers Pool v8g (12/Sep/2014)

Postby mamoul » 21 Nov 2014, 17:44

I have also an issue with Dack Fayden : i can use their abilties several times per turn (so it's too easy to win :lol: )
mamoul
 
Posts: 16
Joined: 27 Oct 2014, 17:20
Location: France
Has thanked: 0 time
Been thanked: 0 time

Re: TFM&G2K's Planeswalkers Pool v8g (12/Sep/2014)

Postby orlouge82 » 11 Dec 2014, 18:15

Hi, I kind of need some help. I installed the most recent version of the planeswalkers mod from a few pages back, and now my game won't load. And nothing I do to change it back will make it work again. Here's my error dump if that helps. https://drive.google.com/file/d/0BwzWqI ... sp=sharing
orlouge82
 
Posts: 25
Joined: 06 Aug 2013, 02:41
Has thanked: 1 time
Been thanked: 0 time

Re: TFM&G2K's Planeswalkers Pool v8g (12/Sep/2014)

Postby Kithkin » 11 Dec 2014, 18:23

orlouge82 wrote:Hi, I kind of need some help. I installed the most recent version of the planeswalkers mod from a few pages back, and now my game won't load. And nothing I do to change it back will make it work again. Here's my error dump if that helps. https://drive.google.com/file/d/0BwzWqI ... sp=sharing
Try to load the game folder into RSN's Deck Builder. If there is an error message, post it.
User avatar
Kithkin
 
Posts: 456
Joined: 21 Feb 2014, 07:12
Location: Cologne, GERMANY
Has thanked: 11 times
Been thanked: 56 times

Re: TFM&G2K's Planeswalkers Pool v8g (12/Sep/2014)

Postby orlouge82 » 11 Dec 2014, 18:49

Kithkin wrote:
orlouge82 wrote:Hi, I kind of need some help. I installed the most recent version of the planeswalkers mod from a few pages back, and now my game won't load. And nothing I do to change it back will make it work again. Here's my error dump if that helps. https://drive.google.com/file/d/0BwzWqI ... sp=sharing
Try to load the game folder into RSN's Deck Builder. If there is an error message, post it.
...and what if there isn't an error message? Is the dump terribly difficult to parse through to figure it out (I don't have a ton of experience with identifying bugs, so I wouldn't know)?

EDIT:

So, I figured it out, I think. There was an older version of the planeswalkers WAD in the same folder that my computer didn't delete when I copied the new version in there for some reason, and a bunch of the decks used that older version. Seems to be working okay now.

Sorry to bother everyone!
orlouge82
 
Posts: 25
Joined: 06 Aug 2013, 02:41
Has thanked: 1 time
Been thanked: 0 time

Re: TFM&G2K's Planeswalkers Pool v8g (12/Sep/2014)

Postby Xander9009 » 11 Dec 2014, 22:04

orlouge82 wrote:
Kithkin wrote:
orlouge82 wrote:Hi, I kind of need some help. I installed the most recent version of the planeswalkers mod from a few pages back, and now my game won't load. And nothing I do to change it back will make it work again. Here's my error dump if that helps. https://drive.google.com/file/d/0BwzWqI ... sp=sharing
Try to load the game folder into RSN's Deck Builder. If there is an error message, post it.
...and what if there isn't an error message? Is the dump terribly difficult to parse through to figure it out (I don't have a ton of experience with identifying bugs, so I wouldn't know)?

EDIT:

So, I figured it out, I think. There was an older version of the planeswalkers WAD in the same folder that my computer didn't delete when I copied the new version in there for some reason, and a bunch of the decks used that older version. Seems to be working okay now.

Sorry to bother everyone!
Just for the record: Yes, the dumps are pretty much impossible to make sense of.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
User avatar
Xander9009
Programmer
 
Posts: 2905
Joined: 29 Jun 2013, 07:44
Location: Indiana, United States
Has thanked: 121 times
Been thanked: 445 times

Re: TFM&G2K's Planeswalkers Pool v8g (12/Sep/2014)

Postby Kithkin » 22 Dec 2014, 04:58

Bug report

Chandra, Pyromaster -- (+1): that creature can block this turn
User avatar
Kithkin
 
Posts: 456
Joined: 21 Feb 2014, 07:12
Location: Cologne, GERMANY
Has thanked: 11 times
Been thanked: 56 times

Re: TFM&G2K's Planeswalkers Pool v8g (12/Sep/2014)

Postby fallenangle » 06 May 2015, 05:24

Update 05-06-2015:

Dear friends of the community,

I have been away for a long time and have not updated the PW pool as I had intended, for which I apologize. I never really intended to be the semi-official caretaker of TFM and G2K's awesome mod, but here I am. Today I bring you several improvements, viz:

1. Updated the PW Manager to make Gideon Jura's first ability possible. Massive thanks to Xander9009 for showing me how to do this! Added Gideon Jura.

2. Added the two Dragons of Tarkir Planeswalkers, Narset Transcendent and Sarkhan Unbroken. For Narset's second ability, when the rebounded spell resolves it will show the spell like normal, but the text on the bottom of the screen will read "Narset Transcendent" because I couldn't figure out a better way to restrict rebound to one spell than making it a triggered ability on Narset herself. This is just a graphical effect, however, and the card should work properly. Both of these two were coded by me. I hope you like them.

3. Added Tejahn's Ugin, the Spirit Dragon from his FRF mod, updated so it creates a regular PLW Manager rather than the CW one. I changed nothing else about his awesome work, so thank him for it!

4. Added a fix for the "creature can't block" part of Chandra Pyromaster's first ability. This wasn't in the code before, and I haven't tested it, but it should work.

5. Updated the PW LOL file so that it now includes all known Planeswalkers up to and including the Dragons of Tarkir set.

Some of you may have seen a post regarding Karn Liberated hinting that he might be possible. It is true that I had the good fortune of working with some very talented people, especially NeoAnderson and Xander, in attempting to realize my own best approximation of what he might be like in Duels. It's also true that Karn and, even more so, Sorin Markov, are extremely heavily approximated at best. Since one of thefiremind's goals in making the original mod was to reduce approximations as much as possible, I have elected not to include my versions in the pool. I did, however, send them, along with the unique functions required to make them work (coded for me by Neo) to Xander, caretaker of the Community Wad. If he ultimately decides they are good enough to include in the CW, then I will consider releasing them here for everyone to enjoy. Until then, please enjoy what has been made available and do not ask me for Karn or Sorin, as I don't plan on showing them to anyone else at the moment except Riiak Shi Nal, if he's interested. Thank you to everyone in the community for being so awesome and supportive for so long. If anyone finds any more bugs, please let me know. Otherwise, enjoy the mod, and remember to thank all of the talented modders here for their awesome work that makes it possible!
Last edited by fallenangle on 12 May 2015, 11:11, edited 1 time in total.
fallenangle
 
Posts: 319
Joined: 20 Jul 2013, 02:31
Has thanked: 73 times
Been thanked: 41 times

PreviousNext

Return to 2014

Who is online

Users browsing this forum: No registered users and 33 guests


Who is online

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

Login Form