It is said that Song Jiang, by imperial order, campaigned against the Liao and swept all before him, reaching Tanzhou of the Liao kingdom. The Liao commander-in-chief Wuyan Guang personally deployed the 'Taiyi Hun Tian Xiang Zhen' formation, which was based on the nine palaces and eight trigrams, containing the twenty-eight lunar mansions, and also arranged according to the principle of the five elements' mutual generation and restraint—ever-changing and infinitely profound. Song Jiang sent the vanguard Lu Junyi leading Lin Chong, Wu Song, Qin Ming, Huyan Zhuo and other great generals to attack; the generals charged into the formation as planned, but unexpectedly the formation shifted abruptly, as if entering a maze. Lu Junyi was trapped for a long time; it was only thanks to Yan Qing and Dai Zong, who risked their lives to penetrate deep into the formation, that they managed to rescue him. Many other officers also suffered losses; seeing the defeat in the first battle, Song Jiang could not help but feel deeply worried. After returning to camp, he urgently summoned Wu Yong, Gongsun Sheng, and others to discuss countermeasures. Wu Yong and Gongsun Sheng studied the formation diagram together; Gongsun Sheng discoursed in detail on its mysteries, saying it could not be broken by a direct assault but must be overcome with an ingenious approach—the principle of the five elements' mutual restraint must be used, supplemented by the power of talismans and spells. The two studied for several days and finally devised a plan to break the formation, assigning the one hundred and eight generals to enter the formation according to their corresponding star mansions.
The next morning at dawn, at Song Jiang's command, the generals followed the strategy set by Wu Yong and Gongsun Sheng, dividing their forces into nine routes and charging straight at the Taiyi Hun Tian Xiang formation. Gongsun Sheng, donning a ritual headdress and a crane-feather cloak, ascended a high platform; in his left hand he formed a spell seal, in his right he held a sword, and with his mouth he muttered incantations, performing magic to aid them. In an instant, dark clouds gathered at the horizon, wind and thunder raged, and the Liao army's formation fell into confusion. Black Whirlwind Li Kui and the Flowery Monk Lu Zhishen, like two whirlwinds, brandished their board axes and monk's staff, charging into the formation; they struck down every enemy they met, sweeping all before them. Lin Chong, Wu Song, Hua Rong, Qin Ming and other generals also led elite troops, bravely charging through the gate of life pointed out by Wu Yong. The battle cries shook the heavens; although the Liao army resisted with all their might, under the fierce assault of the Liangshan forces and the bolstering of Gongsun Sheng's magic, the formation gradually collapsed. Seeing the situation turn unfavorable, the Liao general Wuyan Guang hastily redeployed his troops to remedy it, but it was already too late; the Liangshan heroes swept in as if into an undefended land, tearing the Liao army's formation into shreds.