I am starting to think I have some sort of OCD with this project. Maintaining motivation is the hardest when you get discouraged.
For me I had to give up all my other hobbies. I take care of my family (including 2 kids) do the best I can for my job but try not to work much more than 40 hours, and then its my side project after the kids go to sleep, from 9-1am at least 4 days a week. Wake up early or stay up late. If you are obsessed like I am you will wake up with no help at 4am, which is a great time to code.
For me, competitive Starcraft 2 really wakes me up (better than espresso).
i run a startup and make games part time.