How do I stay motivated

I am doing programming for 24 years now and I don’t see myself getting bored with it. There is always one more thing to learn or to solve and I really want to know everything .

The goal I am most interested in is making my own game engine. But I don’t want to take the SDL library, some image and 3D data loading library and just write rendering logic. I want to learn how it all works.

I want to know how windowing is done on different platforms, how inputs are processed, how sound is produced, how images or sounds or 3D models are parsed and loaded. I want to know every little thing that comes on the way.

I don’t care that I will never get done. I don’t care if in 10 years I am still scratching the surface. As long as I am learning something new I am happy.

Obstacles

I do have to confess it is easy to get sidetracked. I want to write the png loader, but for that I need a decompression library which needs an Adler hashing algorithm. I would check if there are good implementations of those in the language I am working on but if for any reason I am not happy about that implementation or I find someone wrote a better one in another language I want to port that or write a new one that is to my liking.

Sometimes I realize I am not happy with the language I chose so I would investigate others until I find a new pet. Or if I don’t find anything at the moment I might even try to write a compiler for my own language. At some point I also realize the path I took doesn’t hold my interest any more so I would go back and just choose some other path. Something interesting to learn is everywhere.

It also surprised me how often the things I learned turned out useful in my job even though I chose my hobbies to be different. On the other hand, I specifically chose not to go into making my own operating system. It would be too much removed from my daily work and I do have my limits.

Besides all of this I always have motivation to play some games or watch movies or read books but about that some other time.