Saturday, February 27, 2016

New Pad and OpenGL

Lots of changes over the last couple months! I've moved into an apartment all of my own, which has kept me very busy these past weeks. I'm getting better and better at my job every day, and meeting all kinds of new people here in Nebraska.

Shares same code-base as "Kontinuity"
I've had a lot of opportunity at work to build some cool tools that may be able to help in the future. My time there is usually sapped answering phone calls and just doing regular work, but sometimes we get a few minutes of quiet, and when that happens, I work on tools that can help speed up our processes. For instance, we use telnet at work. A lot. Most of our equipment has a telnet interface, so I'm working on a telnet client with preconfigured actions (okay, scripts) that will request information, send commands or do just about anything we can think of. This is going pretty quickly because of my experience working with PyQt already, and since Python is cross platform, it hardly changes the process to make my tools available on Windows (as I do most of my development in Linux).

I had a breakthrough with some of my PyQt coding a few weeks back when I was trying to insert an entry into a database and actually alert my data visualization (in this case, a grid or list) that the data had changed. I fought with this for several weeks, but finally was able to figure out the right way to pass the signal. Before, I had to close and re-open the program in order to see saved changes. Now, when you add an entry, it just shows right up in the main window! I also added a save database option, that actually writes changes to the hard disk (kind of important).

The difficult part comes next: OpenGL. See, I want to be able to put all these events on a timeline. There isn't some QT widget for a timeline that I know of, and aside from that, I want to have precise control over how this timeline acts. For that, I require OpenGL. I want to be able to draw a timeline my own way and be able to do just about anything with it--say, change the color of background for the era you're looking at, expand an entry in a certain year, or zoom in and out to look at weeks, months, decades, whatever you want to see in your view. A pre-built solution will not do because this would be a core part of my timeline program. So I figure it's best to get down to the nuts and bolts and learn how to do this right.

Both programs look pretty similar right now...
QT has a built-in way of adding an OpenGL element to your program, just like any other kind of widget. But actually getting it to work took me weeks. I've actually been working on that one part of my program since December. It's not that it took a lot of code or anything, it's just a little complicated and I found lots of tutorials that went about it in ways that I couldn't do with my program. Finally, one day, after hours of tweaking the script, trying different things, and researching on the internet, it worked. I only had a small triangle in one corner of the screen, but it was working! I was ecstatic.

While in the world of OpenGL, I went down a rabbit-trail on game development. I read an article that really got me thinking about how the medium of games is very much like that of films. Anybody who has known me over the past four years will know that I love telling stories through film. But many of the principles that apply to films also apply to games. Look at how both can be merely cheap entertainment or, if done correctly, they can tell a story in a unique and meaningful way. I'm curious about telling a story in this way, and would certainly like to experiment with it in the future. I don't need anything amazing to drive a point--for example, you tell a story using nothing but small squares. Just another thing that arrests my interest. When I want to learn about how to build a quality game, I watch videos from ExtraCredits, because I think they have some very valid insights. They treat games as an art form, much like how I was learning films need to be treated. In the same way, I view every program I create as a (potential) work of art.

Now that I am on an internet connection of my own, I can fully utilize some tools I'd like to share: Kiwix allows me to download an offline copy of Wikipedia's current state, while Project Gutenburg has an FTP server I intend to utilize. Also, I'm interested in the KA Lite project, and would like to have all three of these sources of information on my home server. Because, you know, I can! Data, data, data...