Monday, November 20, 2006

Almost Normal

The schedule change is going very well. I'm now getting up a little before six in the morning. My first activity is a one-hour exercise, sort of. I'm actually playing basketball every first hour of my day. I figured that doing routine exercise will bore me to death and I won't be able to sustain the activity. Basketball at least is something I enjoy doing. I've played more basketball the last six days as compared to the last six months! What can I say? Programming is too chair-bound a career.

In other areas, I finally got a working arkanoid clone. It only has one level, but it is easy to modify since the layout is just a text file listing positions where bricks ought to be. However, it is enough to validate that the engine port is doing good. The next module up for porting is the windowing system. Or maybe I should do the sound modules first? I'm not sure yet.

Friday, November 17, 2006

Wrapping the Windows message loop

Back when my engine was created in Delphi, I created the Application class. It's job is to wrap the Windows message loop such that I won't have to worry about it elsewhere. It's basically a thin wrapper though, which is useful if you want to work at a lower level. The problem with that version is you have to sub-class it to actually use it. It wasn't much trouble then since I'm the only one using it.

Now in C++, I have redesigned it to make use of patterns. It's still a thin-wrapper. However, instead of the dispatching being embedded and useable only by sub-classing, it now uses an observer model. There is another class whose job is to manage a list of multiple observers. This made the Application class design cleaner. It also has better support for multiple target when dispatching just by registering multiple observers.

Part of the design is to insulate the code using it from caring how the application window changes state (minimized, selected, etc). To facilitate this, an enum was created which is what gets passed around during observer-registration and event-dispatching. The windows messages are still available for interception -- though the observers must explicitly be registered to expect it.

If anyone at all is interested, I may post the code. I probably have to clean it up some since it has dependencies I may not necessarily want to post. My library/engine is mostly unicode configured using UTF32 characters so it may not mesh instantly with anybody else's code.

What to post, what to post....

Hmmm, there doesn't seem to be enough time in a day to do all my stuff and still post about it. But I did promise this blog to be used so I will. I will.

I've been busy recoding my old isometric engine to C++ -- it was originally written in Delphi. Some of the code have to be rethought, some practically unchanged, and still others just get discarded (those delphi classes I wrote to support containers seemed to have gotten the worst of the shafting). I'm already at the stage where the port is useable. I have written the beginnings of an arkanoid clone, and it's running. And as this library/engine is quite a big project, I'll just discuss them in chunks in upcoming posts. Maybe start with how I wrapped the Windows application message loop?

Wednesday, November 15, 2006

Scheduling

Before I go on and post about code, I decided to fix my schedule. I'm normally a late-day person -- I've done my best work during late afternoons, or just before going to bed (3am or so). But then I recently re-examined this assumption and I believe I just trained myself to do it this way. Way back in secondary school, I usually wake up at 5am no matter what time I sleep. I trained myself to wake up that early because I have lots of school activities to attend to, and the extra time I get were invaluable. So now I'm training myself to wake up around 530am. I'm sure I can put the extra time to better use this time.

On top of that, I'm also inserting a daily 1-hour exercise activity to get and keep me physically fit. Being a programmer, physical exertion is something of a foreign concept. And this is slowly weakening me physically. This wasn't a big deal a few years earlier since I still have some youth in me. These days, it doesn't help enough. I need to be pro-active in maintaining my health. I still haven't decided on whether or not I should trade in my soda for water though... :)

Tuesday, November 14, 2006

Initial Post

I've read lots of blogs the past two months or so. Some for information, some for entertainment, and still others for general enlightment. But what actually influenced me to start my own is a blog by an aspiring game developer chronicling his development activities. I found that I'm picking up new things to add to my knowledge store, and I'm also picking up links here and there to gobble up even more information.

So today I'm starting this blog in the hope that I can contribute to the cyber knowledge-store. Failing that, I would hope I can help myself streamline my own thought processes and be a more efficient developer.

I will probably discuss various topics that interest me, but I'm gearing towards journaling my game development adventures. I program those on the side way back when I was programming business applications and/or tools. And even though a game dev shop hired me, I just can't get enough of it. Part of this is because I have a game I want to create, but I still lack the tools and codebase to make it happen. I'm hoping that putting my ideas into words could kickstart me into actually coding them.