I'm going to do something taboo here....I play pretty much the root notes of the guitar chords, or play the same part as the guitar. This is with my band though, not always.
other. I either compose a little bassline and find something to do with the guitarist or he comes up with the chords and i play around with that...
i come up with something that's usually incredibly complicated, simplify it a little bit and then tell my guitarist to come up with something to back it. sometimes just to mess with him i play the unsimplified version and he just gets scared and runs away.
Usually the guitarist has a riff, I look and see what chord hes playing, figure out the key signature, and then use arpaggios and modes and the sort to make an interesting bass line. Or Ill have a bass line, Ill tell the guitarist what chords he can play under it, and then he plays those chords.
The singer of our band is incredibly creative like he is forever on weed or something. He usually gives me a line and i elaborate on it. Its very hard for me to create riffs but i can play nething my bandmates throw at me
I don't really have a set approach, except that i try to play what i hear in my head when i hear the music. Sounds simple, but...
The guitarist in my band does all the writing. My original stuff sucks. But when I put a line to his guitar, it works out good. I play root at first, then figure out the key its in and then figure out a real scale based line.