Probably not within our lifetimes, to be honest.
Success in Chess and Go boils down to predicting what your opponent is going to do next. You have a limited (if
really large) set of moves you have to analyse and check. Ultimately, developing a good AI for Chess or Go involves developing a more efficient algorithm for picking out "good" moves.
D&D... well, first you run into the fact that D&D has no actual victory condition, so gauging competency becomes much more difficult. Then you run into the fact that RPGs in general hinge on several things that computers are
terrible at.
1) Interpreting natural language. Seriously, this is a
big area of research because computers are
shit at it, due to being utterly incapable of resolving ambiguities on the fly.
2) Social interaction. Oh, sure, we can pull all kinds of magic tricks to make it
look like a computer is talking with you... But that's all those are.
3) Improvisation. I mean, the whole reason we have a DM and not just Friend Computer is because the DM can make value judgements for those times when the rules fall short. You'd have to code each new on-the-fly ruling and houserule into the AI
every time you ran into one.
4) Bringing the Cheetos. I mean, have you ever seen a Cheetos delivery robot?
I mean, you
probably could write an AI that could play a Fighter in combat pretty well? Or one that played some other relatively straight-forward character? But I can't really see one that plays
any kind of character outside of combat (OK, the computer can just be that one dude that shows up
just for combat, and naps through everything else).
The real problem with coding the AI would be dealing with
all of the edge cases monsters introduce. Compared to developing a strategy to defeat (or flee from) an arbitrary encounter, making an AI that wins
every single Go game it plays would be like making one that wins or draws every game of tic-tac-toe that it plays.
For reference, you can build a learning AI for tic-tac-toe from matchboxes and beads. Technically, you could do it for chess too, if you had enough matchboxes (you don't have enough matchboxes.)