The Avatar race harnessed the power of the sun and channeled it into crystal powered weapons, ships, and even immortality. Their technology was a combination of science, mysticism, and music. Their greatest scholar, Questor Anu studied the legends of the Vagar people and predicted that their world was due for a mysterious cataclysm. Secure in their superiority his people discounted his warnings as madness but a few followed him and survived. As he predicted the Sun rose in the west, the seas tipped in their bowls, the magnetic poles of their world changed, and a second moon appeared in the sky. An ice age overtook their ruined cities and the surviving 500 Avatars struggled to hold on to their empire as their crystals slowly drained of power. Just as they are losing they are about to fall to the Vagar rebels a new foe appears, the armies of the Crystal Queen Ameiya. With a civilization to match the Avatars at the height of their power, they slaughter all who oppose them and drain sacrifices to feed Ameiya's endless hunger.
Aside from some of the ancient sagas what we now call grimdark fantasy kicked off in 1984 with two books, The Black Company by Glen Cook and Legend by David Gemmel. Rather than follow the anti-heroes, Gemmel wanted to explore why and how people can choose to stand before overwhelming odds to fight for their beliefs. From the beginning the reader is told that its a hopeless fight. One well built but neglected fortress with nine thousand poorly trained defenders protecting their empire from half a million barbarian warriors. The dying nobleman in charge sends two desperate calls for help. He sends to the White Temple for the Thirty, a band of psychic warrior monks willing to die for the right cause, and to his old comrade in arms, the famed Druss the Legend who has never lost a battle.