Well, I can’t say for sure but the book started at ep 17, sooooo possibly not lol
In the book, they actually started from ep 16, and they reveal their past story later on. However, in the drama adaptation, they showed their past lives first. I assume they might think that it's easier for the audiences to follow the timelines. (I heard TMOPB also did the same thing.)
Before Shang Gu was born, he was the God of Chaos. However, when he knew that the God of Chaos' fate is to sacrifice…
Ahh! I'm glad you understand. You can leave any of your doubts here. If I know the answer, I will try to explain it. If I can't, maybe other users know the answers and they will reply.
Can somebody help to explain, so Xuanyi is also god of chaos? I am so lost…
Before Shang Gu was born, he was the God of Chaos. However, when he knew that the God of Chaos' fate is to sacrifice themselves to save the three realms, he doesn't want to die, so he went into the Devil's path. The Ancestral God exhausted all of his spiritual power to stop Xuan Yi and his remains transformed into a new god. Thus, Shang Gu was born from those remains and was granted the title to be the new God of Chaos after Xuan Yi's defeat. (I'm sorry if my English is bad. This is also what I understand so far in case my explanation is wrong, please correct me.)