Yang Yi, the Imperial Secretariat of the state of Shu Han, has participated in the Northern Expeditions of Shu under the command of the strategist Zhuge Liang.
He and Wei Yan do not get along well, and it is only the command of Zhuge Liang that keeps them from fighting one another outright.
Zhuge Liang has launched a series of six invasions on Cao Wei between 228 and 234, but has failed each time due to lack of supplies or the incompetence of his officers.
In the spring of 234, Zhuge Liang leads one hundred thousand troops through Xiagu Pass after three years of preparation since his last Northern Expedition.
At the same time, Zhuge Liang sends an emissary to Shu Han's ally state, Eastern Wu, hoping that Wu will attack Cao Wei concurrently.
In April, Shu forces reach the Wuzhang Plains near the Wei River and make camp there.
The Cao Wei commander, Sima Yi, is well-prepared with a two hundred thousand-strong army, which holds a fortified position on the southern bank of the Wei River.
Guo Huai suggests that Sima Yi form a position in the northern part of the Plains, since Zhuge Liang will likely strike there.
Sima Yi agrees, and sends Guo Huai to set camp there.
Shu forces attack the Wei camp there while it is being built, but Guo Huai is able to hold them off.
Sima Yi will not engage the Shu forces, instead trying to make the enemy retreat through attrition.
Zhuge Liang understands the problem, and implements the tuntian system to sustain his troops.
While the tuntian system is made famous by Cao Cao's administration, Cao's writings show that the system had been instituted as early as the Western Han dynasty, during the reign of Emperor Wu, where soldiers on distant expeditions were set to work converting and farming the conquered land, both to provide food for the army and to convert the region into one based around agriculture—in effect, an economic conquest.
After the death of Emperor Wu, however, the system was only used sporadically and therefore less effectively.
The Shu army awaits an agreed offensive by Wu for the moment to strike.
However, Sun Quan's armies in the Huai River region are defeated by forces led by the Wei emperor, Cao Rui, and succumb to an endemic disease.
Thus the stalemate remains in place and continues for hundreds of days.
Shu forces try to engage the Wei forces several times, but Sima Yi remains firmly in camp and refuses to engage the enemy.
In an attempt to provoke Sima Yi to attack him, Zhuge Liang sends women's clothing to Sima, suggesting that Sima should be a woman since he does not dare to attack him.
Sima Yi's subordinates are enraged by the insult, but Sima himself remains calm.
To appease his men, Sima Yi asks Cao Rui for permission to engage the enemy.
Cao Rui understands the situation and sends minister Xin Pi to persuade the Wei army to be patient.
In another attempt to force Sima Yi to go to battle, Zhuge Liang sends an emissary to urge Sima to fight him.
However, Sima Yi refuses to discuss military issues with the messenger, and instead inquires about Zhuge Liang's daily tasks.
The emissary replies that Zhuge Liang has been personally overseeing all affairs in the army, ranging from strategic planning to his men's daily meals, and that Zhuge himself has not been eating and sleeping well.
Sima Yi later tells an aide that Zhuge Liang will not last long.
In August, Zhuge Liang falls ill due to exhaustion, and his condition worsens daily.
News reaches the Shu emperor, Liu Shan, who sends minister Li Fu to ask Zhuge Liang about future plans for Shu.
Zhuge Liang replies that Jiang Wan can succeed him, and Fei Yi can succeed Jiang.
When Li Fu asks again about Fei Yi's successor, Zhuge Liang falls silent.
Li Fu then returns to the capital Chengdu.
Zhuge Liang also gives instructions on how the Shu forces should withdraw back to Hanzhong: Yang Yi and Fei Yi will lead the army while Jiang Wei and Wei Yan will lead a force to defend the rear; if Wei Yan disobeys orders, the army will proceed on without him.
Zhuge Liang eventually dies at the age of 53 in the early autumn of 234.
Yang Yi and Wei Yan argue about whether to follow Zhuge's orders to retreat.
Their disagreement finally breaks out into a full-fledged battle, which Yang Yi eventually wins.
He also slays Wei Yan's entire family shortly after.