Wednesday, April 29, 2009

Under The Hood: Building S.E.D.S. 2.0 (Part 1)

While I begin work on some new functionality for the Source Engine Demo Saver, I thought I'd take a bit of time to explain how it came to be, how it works, and where I intend to make improvements and additions from here.  The year was 1967; the place, Arizona- wait, wrong story...

Part 1 - The TF2 Demo Saver and Growing Pains

The Source Engine Demo Saver originated from two problems, both ultimately related to my enjoyment with making gameplay videos.  The first was that it was annoying to have to remember what I named demos to prevent overwriting them; the second was that my clanmates weren't saving demos, and I wanted multiple perspectives for video making.  Even if I convinced them to save demos, it was tricky for me to sort them out since everyone named and sorted them differently.





The first iteration was the TF2 Demo Saver, a proof of concept Batch File program and autoexec.cfg file.  It was functional, but barely and very unintuitive.  Version 1.0 had ten keybinds for recording (1-9 and 0 on the Numpad) and was only capable of backing up those explicit files, so a new demo had to be started every map.

I quickly found this setup to be cumbersome and inelegant, so I set out to make improvements.  Trial and error and a good dose of Google filled in the gaps of my knowledge on batch files and coding and in a week of updates, changes, and whole segments of recoding, I had built the TF2 Demo Saver into a new beast, the Source Engine Demo Saver V1.5:

Version 1.5 had a vast amount of improvements over prior versions.  The first was an Installer Batch File to simplify setup, as my presence was often almost required to help figure out how to get it ready to use before this point.  Another addition was a detailed Readme file, which had been included in some prior versions as well.  Left 4 Dead was added as a Supported Game in Version 1.4, an easy task once the code was in place.    Instead of an autoexec.cfg file, S.E.D.S. now had a dedicated cfg file for itself, and added a call to the autoexec.cfg; and keybinds 1-9 and 0 were replaced with an alias setup using only the numpad Enter key.  It even let users set a directory for S.E.D.S. to look for Steam that wasn't one of the default install paths.

I was very pleased with 1.5; it worked well, was easy enough to use and setup, and seemed to work.  Once I completed 1.5 I encountered a problem though.  Batch files are limited in flexibility, and there's only so much you can do.  If there was a problem in the coding, batch files weren't throwing much of an exception to go by, so it was a lot of scouring for the problem.  Finally, it lacked in appearance.  Certain I could do more with the program and interested in learning some programming, I looked around.  Visual Basic looked interesting.  I had done some C++ back in High School, but most of it was forgotten to me and C++ looked daunting now.  I had heard of C# before, and decided to see what all the hullabaloo was about with some Visual C#...

Continued in Part 2 -S.E.D.S. + C# in 10 Days or Less

No comments:

Post a Comment

Questions? Comments? Suggestions? Leave a message.