Easiest way I found to beat wave 40 was to adapt TsuSungShi's hints: Use a mage for tanking at front, a conjuror for golems and a ranger for health regen. Remember that auras last forever on survival. However, instead of a rogue for accuracy, I added a cleric on the back row. He never attacks with his weapon, but he can revive and, most importantly, he can heal your curses/blinds/etc. Just remember to put some points into benediction. Also, DO NOT USE DAMAGE REFLECT ON FRONT ROW. One of the best ways to survive is to leave a single melee type and just pass rounds till you regen health and mana. You can't have him dying from hitting you. Also, remember that you can buy stuff from the store, equip, then reload the game for new stuff. Best of luck to you all.
Small bug which you should know about: Sometimes the squads kill everyone except for the "flag bearer" and then don't attack any more. Bringing in archers doesn't do anything either. Only allied units can kill them, on those maps where one exists. The only option for the others are to restart.
@gendori (and anyone else who wants the last badges): When it says "normal" game, it actually means the classic map. Playing on the pentagram or any other non-"normal" map won't award you the badge.
Upgrade bunny archers to level 20. Ignore every other class. Improve food production and offensive skills (berserk, haste, etc). Almost every single level can be easily accomplished by simply spamming archers. By the end, you might want to improve rhinos and penguins a bit, mostly for the "mouth" levels. For the "lanes" levels, just spam archers on lane 2 (so you can keep 2 pressed down) and send only a few to stall the opponents on other lanes. Don't bother with gold or xps (you can always replay levels). I finished all badges by level 77 this way and there wasn't a level I had to replay more than twice.
A really nice feature would be to let us know: 1) The category of the badge when you select a random one by difficulty. 2) The difficulty of the badge when you select a random one by category.