2013 starts with... programming?!?

Posted in: Programming, Real life, Red Horizon

First blog post of 2013 and I thought it'd be one of those 'look back on the last year' or 'resolutions for the next year' kind of posts which I've been reading from others for the last week 'cause it all just got me in the mood to do the same. The thing is, I've never really subscribed to writing such posts, although when asked (in real life) about the year just gone or the year now coming, I have plenty to say.

So instead, some programming house-cleaning:

Thymeleaf Layout Dialect 1.0.5 released

The latest version of my add-on to the Thymeleaf templating framework was released on the last day of 2012. Version 1.0.5 adds a feature request to extend the decorator page title with the content page title (rather than just overriding it which it did before), further upholding the DRY principle and insulating web developers from little mistakes in the titles of their web pages. There's also a fix for those who use IE conditional comments around the <html> element so that such comments are now included in the resulting page.

On uploading the new release, I learned that GitHub has deprecated the Uploaded Files / Download sections of each repository, requiring everyone to host downloadable bundles elsewhere. It's made some people unhappy, but given the GitHub mission, the downloads section has always been a nice-to-have that they've been nice enough thus far to have. I've made all the download links now point to the bundles I host from this website so that archive hoarders (like myself) still have a place to go to satisfy their ZIP file needs :)

You can find out more on the Thymeleaf Layout Dialect web page.

Red Horizon now on GitHub

My ongoing and never-finishing game programming project, Red Horizon, is now up on GitHub. It's not the project's main repository, but I'll keep it updated so that it's never too far behind current progress. The Red Horizon pages on this website also got a wee update to reflect the way I'm now presenting my programming projects.

I did this so that interested persons (and there have been a few of you) can take a look at what I'm doing and how I'm doing it. I think the most use of it being up there is that developers can now download or browse the source and commit history without having to get the download bundles I rarely provide.

Having the project up there also adds a psychological element to how I code it. I've found that with all of the projects I've put up on GitHub, I've started to think about design/code consequences quite a lot more in the hopes of coming up with better code that satisfies requirements without adding that dreaded 'technical debt' word that seems to be making the rounds in the developer blogosphere these last several months.

I think the exposure is enough to make me feel more accountable for the code I write. If the code can now be viewed by anybody and everybody, then I should write it like it has nothing to hide: no shameful secrets, no facepalm-inducing design decisions, no fodder for The DailyWTF CodeSODs.

Facepalm
Your code... ugh

At least, those are what I hope to gain from doing this; design is largely subjective (there are still people out there arguing over things like where to put the curly braces), and one man's 'hey that ain't so bad' is another man's WTF, or so the saying goes.

Programming updates

Posted in: Programming, Red Horizon

As well as revisiting my WTF dreams, the extra time I'm getting out of the information diet has allowed me to revisit some old hobbies and projects of mine and get around to doing some things that I've always wanted to do.

Many of the programming-related projects I've since shared on GitHub (to go with the Java Servlet Filter projects I mentioned a while ago) and you can check those out by visiting my GitHub profile page. One project in particular has gained a bit of traction in the relevant community, and that is my Thymeleaf Layout Dialect - an extension to the Thymeleaf templating engine that allows you to reuse your Thymeleaf and HTML code with common layout pages. For anybody who has worked with JSF + Facelets before, the Thymeleaf Layout Dialect brings Thymeleaf's page composition features almost on-par with Facelets.

Another project I've had some time to look at again is my old Red Horizon project - the over-ambitious game thing that I started years ago and haven't done too much work on due to real-life and inconsistent levels of motivation. A month ago I took a look at the project, saw the list of things I wanted to improve with it, and got straight into working at it again.

This all came at a good time because around then some e-mails landed in my inbox, asking about the Utilities sub-project of Red Horizon. The first e-mail came from a Spanish-speaking person, asking how to use the program (it is a command-line utility, so there isn't a GUI that you can use to feel your way through the program). The second came from a modder of the old Dune 2 game who has been using the previous versions of my conversion utilities to convert common file types to the lesser-known ones used specifically by the game.

I managed to get a solution together for the latter and have an updated version of the utilities project which can be downloaded from the Red Horizon >> Downloads, page. (Note to self: I really need to update the content of those pages). As for the former, I'm now working towards creating a GUI for the utilities project to help a newer generation of users, ie: those who didn't grow-up using the command line when they were learning to use a computer :)

I'm now in the process of finalizing the project structure so I can share it on GitHub as well. I'd really like to be able to get the code out there since I've found that putting my programming projects out in the public arena has made me feel more motivated to do a better job with them: adding documentation, utilizing proper dependency management, using better build tools, and so on.

Room for improvement

Posted in: Thoughts, Red Horizon

I was going to start this post by saying something like 'I often complain about the number of hobbies I've accumulated', but to try back that up I did a Google site search for the words 'complain' or 'hobbies', and it turns out I really haven't complained about that at all. I guess I just thought about it a lot, or complained about it in my own head, which surprises me that I haven't made a blog post about it because the things I think about or complain about are quite often what I blog about - sometimes it feels like this blog is just one big online whine-fest punctuated by brain farts.

So I've got a bunch of hobbies. There. And as well as complaining about the number of them (in my head), I often feel bad that I can't dedicate the amount of time I would like to each of them, mainly because I have other hobbies that take up my time. (Seriously, I should just cut the number of interests I have in half and then I won't have anything to complain or feel bad about!)

One of those hobbies I've managed to find some time for recently is an old programming project, that 2D game engine for the classic Command & Conquer game, Red Alert, that I started back in 2006 which I entitled 'Red Horizon' (it even has a tab in the navigation bar of my site). That project hasn't seen any real activity since mid-2008.

Domo-kun, hiatus

For the coders out there: have you ever taken some time to look at the old work you did - the code you wrote from a couple of years back - and then eyed it with mild curiosity as you read it back and wondered, What the hell was I thinking? Yeah, I had that sort of moment when I went back to my Red Horizon code last month and tried to figure-out how to continue it.

It's only been 3 years since I last worked on it, yet in that time I've learned so much more about programming that re-reading my Red Horizon code causes me to scratch my head and occasionally brings some bile to my mouth. I mean, it's not terrible code, but over the course of the work project I've been assigned for almost 2 years now (went live this weekend, so yay that's over) I've been trying to hold a high standard to my own work. That standard clearly isn't present in Red Horizon.

I remember having this sort of talk with my university classmates in our final year. When we weren't studying or playing networked games of Tetris on the Unix machines, we once talked about taking a look at all the code we wrote in first-year and disbelieving that stuff was actually our own. What the hell was I thinking? would often come up, because what we put together as first-years just looked so crude, so 'beginner-ish', so the work of a newbie.

Of course, being work from our first year of university, that code was the work of newbies, but now, more than 5 years out of university, which itself was 4 years worth of programming, I can still look back at code I wrote 3 years ago and have a good old WTF moment.

I'm not really sure if that's a testament to how much I've learned or improved over the years, or how little I actually knew back then. If anything it's reminded me of another conversation I had with my friends at university - not the coders - where we discovered a pattern amongst ourselves in the attitudes we had towards our own fields of study: that as first-years we didn't know anything, as second-years we thought we knew everything, but in our final year (fourth for most of us) we realized that we knew very little.

Website redesign 2009 - part 2

Posted in: Site updates, Red Horizon

Some minor site updates:

  • splash page removed for now, tracker moved to main layout
  • CSS fixed up on some buggy pages (but still not IE tested)

My hosting service does provide me web statistics, so I really should get rid of that old site counter, but I noticed that the hosting service stats don't include URL query strings - the stuff after the ? character in a URL. Since my site is kind of built around the query string, this kind of skews the stats and doesn't give me a very good picture. It's been on the To-Do list for a while to get rid of ?-based URLs on this site, 2 reasons:

  • having URLs like artwork/name_of_artwork seem to be more the norm around the internet
  • URLs like that are more SEO-friendly

And we all like being SEO-friendly so that Google and the like can put us at the top of everybody's search results ;)

In other news, the last couple of weeks have seen some Red Horizon related queries *gasp* Yes, that's right, stuff has happened on the old Red Horizon front, but not programming progress I'm afraid.

Firstly, Nyerguds (Google his name, it'll come up in a lot of C&C circles) asked for the latest Red Horizon: Utilities stuff so he could refer another C&C modder to it - YAY, people are using my stuff!

Secondly, rm5248 (another C&C fan who frequented the now-defunct CNCTechCenter site where I used to put the development thread of this project) asked to take a look at the code to see if he could do something with it. The idea that I'm losing a tiny bit of ownership on my code did make me hesitate in his request, but it's not like the code was doing anything better sitting on my computer and not going anywhere. I will continue the project, but with the way things are with me now, not anytime soon. So I gave him the code in its current state - which is to say error-ridden and doesn't compile - and I wish him luck in whatever he wants to do with it.

Red Horizon (game) on hold

Posted in: Red Horizon

Alrighty, so my current issues with this project are all related to how I'm getting the engine to tell it to play a C&C-type game, without C&C-type code/stuff being a part of that engine (I'd really like to re-use that engine for other things in future).

So what I'm going to do is put the Red Horizon game part on a temporary hold while I focus on making something much much simpler (like Space Invaders or something arcade-y). During this time I hope to improve the engine in such a way that I can re-use it, and then just shove those improvements back into Red Horizon.

Red Horizon Utilities update

Posted in: Red Horizon

The utilities part of the project has just been updated to version 0.28, and details can be found in this post.

To the mystery person who contacted me via ICQ wanting to ask questions about the utilities program: I sent an offline IM to you, but Trillian has been acting funny and even once told me that my ICQ contact list was gone (even though it still looks intact?!?!). If you still want to ask something, you can register at the forums where I made the above post, or e-mail me:
LightninUltraq [AT] Netscape [DOT] net

Red Horizon page update

Posted in: Red Horizon

Just a minor website update to the Red Horizon section where I've just removed a whole bunch of stuff and added links to any forum threads I've made in relation to the project. Those threads will be better indicators for how things are going.

Opening-up the XML

Posted in: Red Horizon

I've expanded the XML format of the units/structures just recently to try make allowances for several types of animation combos, like the one found in the original Red Alert war factory. Modders would have noticed that the war factory consists of 2 animations: the base, and the opening/closing door to let the unit roll out.

Previously, I only allowed 1 animation, and that made it so that the war factory only had the base showing. Now, I've got both the base and door showing as expected.

By allowing the definition of multiple animations for any unit/structure, Red Horizon can now cope with the simple case of the war factory, and some more radical cases like multiple-turret units/structures Yes, I've opened it up so that you can have multiple turrets placed on a single unit/structure.

With every new option like this, it does make the coding take a little longer, but this is one of the goals of the project: to open-up the modding possibilities of the old C&Cs. Admittedly, I kinda like what I'm getting myself into.

Red Horizon + XML + FengGUI = progress?

Posted in: Red Horizon

The project is still (and always) moving forward, albeit at the pace of most spare-time-only projects on the Internet (ie: slowly). Most recently I've started ironing-out an XML format of Red Alert's Rules.ini file. That file defined all of the configurable settings of the game, so there'll be a 'base' Rules.xml file (which includes new configurable options plus the original game settings) which can then be overriden by a RA-mod-suppplied Rules.ini, or another Rules.xml. This will allow the backwards compatibility with original mods, and open up the option to edit new, previously-unconfigurable options in newer mods. The new rules file will also be more flexible, allowing the creation of new (that's right, NEW!) units, structures, weapons, and the like.

Here's a current (although ever-changing) example of the RA Jeep unit in XML:

<unit:Vehicle
    ID="JEEP"
    Template="DefaultVehicle"
    Armour="light"
    Cost="600"
    Hitpoints="150"
    Points="20"
    Prerequisites="WEAP"
    RateOfTurn="240"
    Sight="144"
    Speed="6"
    TechLevel="3"
    Characteristics="CREWED">
    <unit:Footprint>
        <unit:Selection width="24" height="24"/>
        <unit:Hitbox width="24" height="24"/>
    </unit:Footprint>
    <unit:Weapon
        ID="JeepWeapon"
        Template="M60mg"/>
    <unit:Portrait
        ID="JeepIcon"
        Filename="jeepicon.shp"/>
    <unit:Animation
        ID="JeepUnitAnim"
        Filename="jeep.shp"
        IncludedAnims="TURRET"
        RotationAngles="32"/>
</unit:Vehicle>

As well as making the attributes look a little like those found in the original Rules.ini file, I've taken a look at how C&C3's XML files were structured, and taken some pages out of their book.

I've also started thinking about how I'm going to implement a graphical user interface (GUI) into the game. One option is to make my own, but that seems like an unnecessarily long use of my time. The other option is to use an existing Java/OpenGL GUI framework, and this is where FengGUI comes into play. The demo looks impressive, and taking a look through the FengGUI API, I'll have to make a few changes so that it'll fit into my existing code. If it works as I expect it should, then this could be the beginning of a beautiful friendship.

Update

Posted in: Red Horizon

Red Horizon Utilities project has been updated to version 0.21 (dev) which includes Dune 2 SHP <-> paletted PNG support. Details on this sub-project can be found here.

Update

Posted in: Red Horizon

Small update on Red Horizon: I've been asked by Nyerguds to expand the utilities to include support for conversion of Red Alert mouse cursors into a more popular image format, like PNG. I've uploaded a screenshot of my program displaying the RA mouse cursors using the same file reader initially written for Dune 2 SHP files. It turns out that RA and TD mouse cursors are of the same type. Now all I gotta do is get the PNG reading/writing part done; something which should be relatively easy considering PNG image support is built into Java.

If you're interested in this tool, or have some requests/ideas, you can make posts and follow it's progress in this thread.

Update

Posted in: Red Horizon

One new Red Horizon development screenshot, showing my second attempt at putting structures on the map. What happened to the first attempt you ask? It looked similar to the second screenshot, except the structures were in all the wrong places. Like a structure-humping orgy or sorts :P

Other 'recent' Red Horizon developments include:

  • new Rules.ini tags, to make the game more customizable using the familiar Rules.ini file
  • better dual-core CPU support
  • game now loads the first Allied mission properly (it was hard-coded in the last release)

Update

Posted in: Red Horizon, (pre-blog era) Rants, (pre-blog era) Updates

Bah, only now did I find-out that the link to e-mail me on the left-hand side wasn't working! Thanks to JG from Florida for letting me know that there were no e-mail links on my website :) (if you're reading this now JG, I'm creating those savegames you requested, and will have them ready for you sometime this weekend)

So that link is obviously fixed now, what else is there to say? Oh yeah, Nyerguds, the one responsible for several great C&C patches/fixes for The First Decade - has requested I make a Dune II SHP converter (create Dune II SHPs from, say, a PCX file). What use is a SHP converter for such an old game? Well, the original C&C's mouse cursors were built on that format, and he hopes to use such a tool to create custom cursors for his C&C total conversion.

I was very surprised to find-out that nobody else has done this before, so I decided to step-up to the challenge. It's bit of a sidetrack from the current stream of Red Horizon development, but I always did intend to provide a small toolset as a part of the overall project.

From a program design perspective, I welcome the addition because it then forces me to develop more separation between what used to be such tightly-coupled program modules. And so far, it has helped me to create a more robust set of file objects; ones that support both saving and loading, which will be of great help in the future.

Update

Posted in: Red Horizon, (pre-blog era) Rants, (pre-blog era) Updates

Now I've managed to get units to show-up on the screen, and to make them selectable (pics). Doing so has raised some challenges (not surprising, since I've never programmed a game before), but it's becoming more of a test of my aspect/object-oriented design skills, rather than programming sounds and graphics.

One thing I've been seeing a lot of recently is blog sites. I've even included a few of my friends' blogs to the links on the right. As well as reading their content, I've been checking-out how they're structured because I've been considering expanding this site's program to restructure the news portion in a similar way. It won't be too hard as my web host - interAdvantage, who have been very good to me considering my slightly different website requirements - includes several features in their standard plans which I can use. It would be kinda cool to finally use some more of what I pay for too. My only worry is that it'll detract from the rest of my free time, and I'll admit right now that I don't have a lot of that.

Another free-time killer on the horizon is a new space pic. I'm aiming to create something along the lines of an aurora, which will give me some reason to start using Terragen again.

Lastly, I'll need to expand the Stuff section to include some e-mails that I've been writing. Sounds rather mundane (I mean, e-mails, c'mon), but I've been writing them in a manner consistent with some of the books I've been reading during my commute between work and home (it's a long train ride otherwise). The recipients have been pretty happy with their narrative style and content, so I'll be putting them up here to archive them, and for future reference.

Update

Posted in: Red Horizon

This is aimed mainly at the programmers, but anybody can take a look. I've made the current development version of Red Horizon available for download. Both as a sort of progress update, as well as letting some of the people interested in the source code finally take a look. I haven't yet made a dedicated page for it on the website, so instead details can be found at my favourite C&C forums, here.

Rant

Posted in: Red Horizon, (pre-blog era) Rants

Happy New Year everyone! To welcome 2007, I'm half-way through my Christmas / New Year holiday, and enjoying every little bit of being able to do nothing at all. Not that I'm sitting on my ass eating chips all day, but it just feels good to not do anything which might have adverse consequences.

On the Red Horizon front, I've managed to get streaming animations and sounds (and thus, videos), so watching/playing any of the vids/sounds doesn't suck-up 200+ MB of RAM like it used to. So if you were to run this program and expect it to play C&C Red Alert, it would:

  • display the title screen
  • play the intro video
  • play the 'select a mission' animation
  • play the first mission briefing video
  • display the first mission map

And that's it.

The maps are only what I had in the last screenshot I posted: terrain, ore/gems, fences, trees. I haven't yet got around to creating an actual unit you can move around. And to think that when I started out, I thought I'd have a moving unit within a few months...

I'm also thinking of making whatever source code I have available for download sometime this week, before I finish my holiday and have to go back to work. When I first announced this project, some of you expressed interest in getting the source, if even just to see how I write my Java code.

Rant

Posted in: Red Horizon, (pre-blog era) Rants

I've now got animations working as a part of actual game engine (I've had animations working for some months outside of normal gameplay circumstances) and am now debating how I'm going to present them. I mean, I could take screenshots, but still shots of animations and/or videos kinda defeats the purpose of showing them off. If I do decide to make little video screen captures, I'll also have to up my hosting to the next level; I'm almost out of space :(

Minor issues aside, I hope everyone has a good Christmas this year. I know I will; no work for a couple of weeks!

Update

Posted in: Red Horizon

Just 1 new Red Horizon screenshot to show-off. I've finally got the overlay tiles to display correctly, as well as the alpha blending to work the way I want it. Both of these minor achievements can be seen in the latest image in the screenshots section.

Update

Posted in: Artwork, Red Horizon

Just some minor updates to the last post. First of all, one new sketch to the Artwork section:

Secondly, I've added 2 semi-old development screenshots of Red Horizon. The first has the program simply displaying the Red Alert title screen, the second shows it drawing the map tiles of Red Alert's first Allied mission. Note that the map is drawn in 800x500 resolution, instead of the older 640x400.

Update

Posted in: Red Horizon, (pre-blog era) Rants

Although work has still been hectic, I've managed to find time again for Red Horizon. So I'm starting to build the screenshots section for it, and then I'll add some more recent pictures of development progress.

In Red Alert related news, I've been helping-out with some of the graphical aspects of someone's mod. I've mainly been converting icon pictures into useable icons for in-game, but just recently I've also created a title screen. The mod's thread can be found here (my picture can be found on the last pages of that thread).

Update

Posted in: Red Horizon

Following-up on the previous news post, I've got 1 more screenshot to show. Link can be found in my latest post in the same place, and shows a properly loaded map. Well, just the map tiles part anyway.

I'll start putting these together in a proper screeshots section once I get around to building a page for it.

Update

Posted in: Red Horizon

OK, so they're not the sorts of Red Horizon screenshots I've been wishing for, but since somebody asked I've posted some very un-exciting pics of some in-game GUI, and me messing-around with loading images. The topic with the links to the pictures can be found here.

Update

Posted in: Red Horizon, (pre-blog era) Updates

I've spent the past few days overhauling the behind-the-scenes workings of this site, using the many things I've learned at my work since it's last major overhaul. It's been a good little practice for me as I spend some time and practice with technology during any lulls at work.

Now that's out of the way, I'm gonna work towards adding a few screenshots to the Red Horizon section. After checking-out other C&C projects out there (like a port of C&C to the Nintendo DS), I told myself I really gotta get some pics. So next on the agenda: playing some videos from the missions and taking screenies to put up here.

Update

Posted in: Artwork, Red Horizon, (pre-blog era) Rants

Another small update, but this time on the state of Red Horizon. The small subsection dedicated to this project is pretty much done, but will only be a (very long lived) temporary home. It really is a mess, especially the progress section. For something of this magnitude, I should create a whole new look-and-feel subsite using that 1 subdomain I get with my hosting plan :P

As for progress on the program, I've got pretty much everything done EXCEPT gameplay! So it installs, starts, shows some options, but when you hit play... nothing happens! When you hit the close button of that 'nothing happens' phase, it shuts-down, hopefully taking with it all of the resources that it took. I'm pretty confident that it does, but I should write some small aspect profiler to verify that.

In other news, my entry for the art competition didn't receive a pedestal position, so I guess that's that :(

Rant

Posted in: Red Horizon, (pre-blog era) Rants

Still working on Red Horizon and the section for it. Firstly, I want to get the first milestone release done: a showcase of my ability to display the old file formats of Red Alert & Tiberium Dawn.

All of the file formats are now readable and playable, but I want to add some optimizations, especially the videos. Just yesterday, a 4MB VQA video file took 200MB of memory to play it! While I had a good laugh at that, I know that is totally unacceptable and so have begun to work on it. As of today, that same video now takes 100MB of memory. Hopefully, after implementing some sort of 'streaming-content' system, the memory usage should drop to somewhere in the order of less-than 20MB.

And when that's done, I'll put the project on hold to start work on my entry for that art competition I wanted to enter (link on the right). It's about time I created a new picture anyway :)

Rant

Posted in: Red Horizon, (pre-blog era) Rants

Woohoo! Graduation ceremony just last night :)

In website and project related news, I've made some more progress with my Red Alert revival project (under the working title of 'Red Horizon'). As well as being able to read content from the MIX files that contain most of the game's sounds and graphics, I've also been able to display the graphics of units and structures to a rendering context using OpenGL.

A section of my website dedicated to Red Horizon info and progress is still in the works.

Update

Posted in: Red Horizon, (pre-blog era) Rants

I wanted to announce my latest Command & Conquer related project, but didn't yet have a section of my site dedicated to it. So I made a post here about it until I can get around to creating a small 'about' page for it. In short, it's a programming project with goals very similar to the now defunct FreeCNC, but if you haven't heard of that either, then go to the forum post I made about it to get an understanding.