Animated film is based on the fairy tale of the same name (1834) by Alexander Pushkin.
The music in the film uses the motifs of Nikolay Andreyevich Rimsky-Korsakov.
The text in the cartoon was written by Vladimir Vladimirov (using separate motifs and fragments of the libretto by Vladimir Belskiy to the opera by Nikolay Rimsky-Korsakov) and almost completely does not correspond to the original fairy tale by Alexander Pushkin.
Unlike the original, in the cartoon (as in the operatic libretto), Tsar Dodon convenes a council in order to decide what to do next. In the original, he sends a messenger for help to the sage.
In the operatic libretto, the senior prince is named Guidon (as well as the prince from The Tale of Tsar Saltan, Pushkin), and the younger one is Afron. In the film, as in the original, none of them is called by name.