Page 1 of 1

What is the AI Duel skill level in Manalink 3.0?

PostPosted: 01 Aug 2021, 21:32
by etphonehome
In the original game, when you duel the AI, it can have 4 skill levels you can choose from.

In Manalink 3.0 that option disappeared. What skill level are we playing at, if we can't choose the skill level???

imagem_2021-08-01_223216.png

Re: What is the AI Duel skill level in Manalink 3.0?

PostPosted: 02 Aug 2021, 06:12
by Korath
OK, this is somewhat embarrassing. We're playing at Apprentice, and we've been doing so since well before 3.0 - at least since the Momir Basic/Draft/Testing options appeared.

This should have been fixed as part of this bug, where it was discovered that whoever it was that repurposed the difficulty selection into those options didn't get it quite right - the intended hack was to relabel the difficulty options, set the game mode according to the AI skill level (internally, opponent_skill), and then force opponent_skill to Wizard, but they were looking at and changing the wrong data. What I did was to 1) make the dialog in Magic.exe change different (unused) data instead of opponent_skill, and look at that value in C to pick the game mode; 2) track down and remove the places where Magic.exe reset opponent_skill, so that it wouldn't change whatever we set it to in C; and 3) made it so playing at Apprentice difficulty no longer forced the human player to always win the start-of-game coin toss (since that happened before the earliest opportunity (at that time) for us to set opponent_skill in C).

The screwup I made was in 1) - when I replaced the old system that tried to read the dialog results, I removed the nonfunctional attempt to force opponent_skill to Wizard. The funny part is that that attempt would have started working if I'd left it alone, since I updated the C definition of opponent_skill to refer to its real location in Magic.exe. Ugh.

I've put in an option to set difficulty level in config.txt - like I should have done in the first place - and defaulted it to Wizard. For real this time. The good news is that on modern computers, it has much less of an effect than AiDecisionTime.

Re: What is the AI Duel skill level in Manalink 3.0?

PostPosted: 02 Aug 2021, 09:43
by etphonehome
HI Korath!

Thanks for replying, and is good to know you are still around here.

I suspected the AI is not at top because it make some "randomly" bad decisons that helps the player and it NEVER leave creatures to defend against lethal damage, it ALWAYS attack no matter the damage you're going to do next with your creatures.

So, how can we change the difficulty?

You said about change it in config.txt. Is it possible?

Is this going to be in a future update?

This is the best game to play against the AI and it's a pity we can't play it on top difficulty.

Please help change that as you're one of the "code brains" around here.

THX

Re: What is the AI Duel skill level in Manalink 3.0?

PostPosted: 03 Aug 2021, 00:04
by Korath
It will be in the next release.

And don't expect miracles - if you see any difference at all, it's much, much more likely that it's because you've convinced yourself that you'll see one than because there's actually one there. In particular, it'll have no effect whatsoever on attacking or blocking decisions.

The biggest thing opponent_skill does is to increase the minimum number of possibilities the AI looks at for casting spells or activating abilities, while the already-configurable AiDecisionTime changes (among other things) the minimum total amount of time it spends looking at possibilities. Even if you crank AiDecisionTime down to a tenth of the original - like our default config.txt does - it's going to have long enough to look at more than the minimum possibilities for Wizard difficulty, many times over.

Re: What is the AI Duel skill level in Manalink 3.0?

PostPosted: 03 Aug 2021, 16:51
by etphonehome
HI Korath

Let's hope for a miracle! At least, maybe it will end with those plays where AI puts +1+0 counters on your creatures or put some beneficial Auras on your cards.

Well, at least we'll know the AI is on its best.

THX Korath

P.S. Do you know anything about AI showing the creatures it's playing with Morph? It should be hidding those creatures, not showing them.

I'm asking you this because i saw your name in a discussion about this. :D

Re: What is the AI Duel skill level in Manalink 3.0?

PostPosted: 03 Aug 2021, 18:09
by drool66
etphonehome - I'm looking at the morph issue since you brought it up. I have a few things to do before that, but I have an idea of how it can be done.

Re: What is the AI Duel skill level in Manalink 3.0?

PostPosted: 03 Aug 2021, 20:04
by etphonehome
That's cool Drool66 =D>

Take your time. It's a pity AI can't hide morph cards. They are similar to trap cards in YuGiOh.

THX

Re: What is the AI Duel skill level in Manalink 3.0?

PostPosted: 05 Aug 2021, 00:42
by Korath
The AI's choice for a plain do_dialog() is deterministic - whatever you pass in as the last argument, the AI picks that. All you have to do is not call do_dialog() if the AI's going to pick "Play face-down". Or even not call do_dialog() at all if it's for the AI. Just make sure you only do that if it's actually the AI picking, not just player 1, or you'll break multiplayer even worse. (Of course, that also means if multiplayer ever becomes even sort of playable again, you'd need a different solution, like promoting to a DIALOG() call and passing DIALOG_FULLCARD_CSVID(CARD_ID_FACE_DOWN_CREATURE) when player == 1.)

The only real issue in the short term is making sure every card with morph or megamorph actually calls casting_permanent_with_morph(), and nothing handles it on its own.

Is this also an issue for manifest? How about the other cards that let you move objects from hidden zones to the bf face-down? (I think that's just Illusionary Mask, Tezzeret, Cruel Machinist, and Yedora, Grave Gardener?)

Re: What is the AI Duel skill level in Manalink 3.0?

PostPosted: 06 Aug 2021, 01:04
by drool66