For a long time I have been trying to figure out how classical guitarists and finger pickers, play arpeggio, bass line and melody at the same time. Do they use chord shapes 1, 3, 5(for example) and play melody embedded in these shapes?
Not sure exactly what difficulty you are having understanding this, but it is not terribly difficult for a classical guiitarist to play a melody on the higher strings while simultaneaouly playing an arpeggio-style accompaniment on the lower strings.
The technique might involve using the thumb and maybe the first finger (or two) of the right to play the arpeggios on the bass strings while playing the melody on the higher strings using the 3rd or 4th finger.
Usually the arpeggio might be a chord based on a 1-3-5 chord shape, but many possibilities exist.
To get an idea of what is involved, you might take a look at this guitar tab for a famous (anonymous) Romance for classical guitar:
The notes on the highest string (initially at fret 7) are the melody and are played with the fourth finger. The thumb plays the bass notes on the lowest string, and the B and G strings are played using the index and middle finger.
Classical guitarists never think in terms of chord-shapes, and neither do the composers who wrote the music. In fact many classical guitar students can study for years without ever learning any chord shapes. They are not in the standard method books. Classical guitar is based more on reading and playing individual notes, melodies and counterpoint than on chords. When a classical guitarist arpeggiates chords, they are reading the individual notes off the page and may or may not be aware of the chords outlined by those notes. Classical guitar sheet music usually does not have any chord symbols in it.
I found a reference from a website called learnclassicalguitar.com, written by Trevor Maurice, that discusses how classical guitarists tend to be ignorant of chords and chord shapes.
Here are quotes:
When playing classical guitar music you are playing chords all the time. There is not usually any indication of this via a chord box or even a chord symbol, but the chords are there...
It is unfortunate that most classical guitarists don't really know enough about the theory and naming of most chords...
Mostly, when playing chords, the classical guitarist will arpeggiate them.
There are many ways to arrange for guitar, but you can produce melodies within a set of related shapes eg using standard open shapes C, CM7, C add 9, C with a g note on the high e (where it's just changing fingers on the b and high e string). If you accent the right notes a melody will pronounce itself and you can add in hammer-ons and pull-offs for more richness and to simplify right-hand patterns. To make things more complicated, you could add alternating or walking bass notes.
This is just one technique, which I think is more common in folk and pop than classical, I think you should consider getting some books on guitar arrangement and general fingerpicking.