In SGYY, Wei Yan seemed to be killed caz of betrayal to Shu. But I doubt about his intention... and I really want to know more about that.
All I know and read is:
1. Wei Yan insisted to conquer the north (Wei), even though Zhouge, the commander, was dead.
2. Wei Yan wanted to betray Shu and tried to escape to Wei.
3. Wei Yan led his own troop to battle other Shu troops as to prevent they from going back to Yi Zhou.
After analyzing 1, 2 & 3, my mind is still full of ''???'' , who can tell me what happened at that Shu army's retreat, Wei yan's death, and his intention?