For creativity, get used to running a fan nearby. If you're like me, your inbuilt pattern-matcher will autocomplete and drag up 'ghost impressions' while you're otherwise occupied. A fan is better than an electronic noise source because its air, and thus its sound, interacts with the surrounding world; instead of being a point-source, it's a better background.
For problem solving, dwell on the problem in its domain just before bedtime, and make sure it's the last thing on your mind as you settle down into sleep. Let the subconscious have sole access to your understanding of the problem overnight.
Everybody's built different, but these work for me.
Has an interesting side effect of screwing with threshold of movement, particularly finger movement.
I play rhythm games (sifac, llsif, deresute, mirishita...) regularly and tried modafinil. My fingers wouldn't auto-move anymore, and furthermore even if I moved them consciously, it took more effort to do so.
At everything else, it puts caffeine to shame, with no tolerance buildup or withdrawal symptoms.