Many people have thought about making their own library or engine whether it be for game development, graphics, or some other personal project. Should you do it? Should you find pre-existing tools? Wondering these same questions myself, I asked Kalvin, a software engineer with some experience on developing personal tools, to do a quick interview on his experience making personal libraries and engines. He is currently working on his own Graphics Library, which has been in active development for the last couple months. So, without further ado, here we go!
Question: How long have you been programming? Why did you choose to program?
Answer: Well, I started programming when I was about, I’d say 14 years old? Maybe 13. So around 12-13 years. My first experience with programming was with the TI-83 Plus calculators, I had an older friend who had one and that caught my attention. I quickly learned that my old computer, like a really old computer, 6GB hard drive, 800MHz CPU, had a safe environment for me to program in. While it wasn’t the TI-83 Plus my friend had, it still worked.
I started programming using Visual Basic for Applications that came with Microsoft Word 97. My first ever program, and first ever ‘game’ was a battleship game. It was pretty simple really, but because of that little game, and how much power, I felt when programming, I was hooked! I later then got a TI-83 Plus, you can guess what I did with it in school! [laughs]
Question: What would you consider your biggest accomplishment as a programmer? Why would you consider this your largest accomplishment?
Answer: My biggest accomplishment? Hmmm, that’s pretty hard to say. If I had to choose, I think I’d go with learning OpenGL and making a handful of my own graphics engines. While I had a 3D graphics engine made before, it was a mess of copy-paste code because I really didn’t understand OpenGL, like at all. Then came the big “ah-ha” moment, and OpenGL became clear as spring water, instead of the mucky opaque mud it was before.
After that, I’ve made two other engines for fun, and working on one right now which I hope will be used in games, and maybe even other applications.
Question: How long have you been working on your graphics library, and how much time do you spend on daily improvements?
Answer: This graphics engine, or graphics library, has been in development for 2 months now. It has presented some challenges I didn’t have with the others as I’m focused on making this library easy to use and understand. Because of that, my usual mess of a code has to be easy and simple to understand for the other programmers in the team. Also, being the spearhead of this team, that left me with other responsibilities, which take a chunk out of my time for personal programming.
As for the time, I spend on it daily? Well, on a perfect day where I’m not being interrupted by other duties, I can spend up to 6 hours working on the engine, planning it out and coding. Though most days haven’t been perfect, and there’s always something poking at me to get done that isn’t coding, and because of that, I’m lucky if I get 3 hours in with the engine and its code base.
Question: Why did you decide to make a graphics library in the first place?
Answer: Well, I was always curious about how things work. At the time, I was and still am, a big fan of games. I always wanted to make my own. I first got introduced to OpenGL by some member of a programming community. At the time, I was using a programming language called FreeBASIC, a spin-off of QBASIC. FreeBASIC had its own graphical abilities built into the standard library, which I liked.
Since I was so interested in games, I decided to try to make them. Of course being completely new at this, I thought the best way to do this was to put something onto the screen. Therefore, Graphics! I then searched far and wide for information about anything graphics and programming related. Thankfully I had the internet so that gave me a nice boost at the time. I got interested in 3D early on, made a 3D software renderer in ActionScript. Well, okay, I was a kid back then so I copy-pasted the code, but I still went into the code and tried my best to make a software renderer.
I then succeeded in making a software renderer, later on, unfortunately, I was still learning to program, so it could only render a single filled triangle at 12 frames per second. Wasn’t too great. But the thirst for learning was still there, so I hit the internet, searched OpenGL and out came my first OpenGL program, complete with .obj file loader. And I haven’t stopped since, though I use more updated versions of OpenGL of course. [Laughs]
Question: Many programmers working on personal projects like you often suffer something called ‘coder’s block’. What would you recommend they do to stay motivated on a long-term project like you have?
Answer: ‘Coder’s Block’ ahh my arch-enemy. Well, there are many things you can do, but the biggest thing you really can do is to love the project you’re working on. It also helps to have other people there helping you and motivating you. Writing a journal may help as well. It’s really an individualistic thing.
What works for me may not work with someone else. You can search up “How to stay motivated on a long-term project” in your favorite search engine. You’ll get as many results as there are ways. Each way works for someone different. My own personal way is to have fun, not work too hard, but of course, still, work. If you’ve been staring at code for too long, it might help to do something else. If you’re just coding a game, or an engine, and doing nothing else but that, it can get difficult.
Now, if you’re coding, and doing something for the game, or engine, on the side, then you can bounce back and forth between the two. Also, another important thing is to always be making some form of progress, even if it’s not coding, but something else. Record that progress as well. You may not think you’re doing a lot, but when you take a look back you may realize you’ve done a lot more than you give yourself credit for!
But as I said, for motivation, each person is different. Though if the project isn’t fun, it’s almost certain you won’t be motivated to do it. So work on a project that’s fun, gives you a lot of new and fun things to work on, and just keep on truckin’!
Question: What has been the hardest part of the development process so far? Why do you consider that the hardest part, and what would you recommend other people in a similar situation do?
Answer: Other than motivation, which I’d consider the hardest part of any project, big or small, I would have to say the hardest part of the development of this current project is the fact that I have to think of other programmers when I’m making the library. As it’s planned to be used in other projects, I have to make it easy to understand for others and my future self. This requires a lot of work, as you have to document, explain your thought processes, and ensure that everything is easily understood by others. This also means that working alone isn’t possible, you can’t just write a lot of code, make sure it works, then go to the next step. You must ensure that the team, especially those who need to work with your code, understands it enough not to create a horrible mess.
Another aspect is that in case someone does make a horrible mess, how robust is your code? When you’re working alone, you understand your code, your mess is a working mess. For others? If they provide the wrong parameters, if they do something that your code doesn’t, and shouldn’t, expect, how does your code react? You really have to think about others and how your code works and how the interfaces are designed, and that makes it really hard to code for and with others, cause no one shares the same thought processes.
Question: Would you recommend all programmers try their hand at creating a personal library or engine? Why or why not?
Answer: Creating a library, as a set of reusable code that one can use for multiple projects? Yes. A million times yes. The reason for this is simple: if you’re coding a lot, there will be certain things that you’ll be rewriting a lot, debug functions/macros, maybe a simple text parser, a math library, etc. While certain things I recommend you don’t remake unless you’re looking for the experience or the fun of it, like the math library, other things I would highly recommend, like a simple debugging library which can be really easy to make.
Creating your own personal engine? Yes and no. Depends on what you’re aiming for here. I would recommend programmers to try their hand at making a 2D graphics engine, for the learning experience for one. Another reason is so that the programmer can get a very small glimpse of the work other library programmers have to deal with when making a library, API, or another interface that millions of other programmers take advantage of. It can also be a lot of fun and a 2D graphics engine isn’t the hardest thing to make. It’s not the easiest either of course, but it’s easy enough that someone who has a firm grasp of programming should be able to do, have fun with it, and make something fun with it.
Should you make a 2D or 3D graphics engine for yourself or your team when you want to make great games? I would lean on “no” for that answer. There are other great libraries and engines out there for you to use. If you need a specific feature if you have a lot of time, and if you really want to learn the guts of a 2D or 3D engine that’ll be used in a more professional setting? Then sure, but from ‘knows nothing of 2D/3D engines’ to ‘half-functional engine that can make a cheap clone of X game’ will take years of steady learning, studying, and playing around. It’s worth it, but it’s hard.
As we can all see, making your own tools can take a lot of hard work and patience. But in the end, it is worth it. Whether all you gained is experience, or if you managed to create the next hit thing, you can now tackle larger projects with gusto and have a deeper understanding of how the tools you use every day truly work on the inside. Feel free to ask any questions you have in the comments section! And don’t forget to share, tweet, and like this post to help out your fellow programmers.
Do you have any experience making your own tools or libraries? Why did you choose to make them and what makes a good library good to you? Tell us about it in the comments section below!