Friday, February 23, 2007

The Other Good Book

Yesterday, I received my copy of Aaron Hillegass' "Cocoa Programming for Mac OS X", which is heralded as the book to get to learn Cocoa. I'm already through the first couple of chapters and grasping the basics pretty quickly which, of course, has me quite enthused to dive into working on making Sidorkiewicz functional.

Thursday, February 8, 2007

Code (Feb 8 2007)



 I took an evening off last night to actually play EHM 2007 after buying a license for my iBook. I've admittedly been skipping around chapters trying to piece together bits of knowledge to accomplish certain goals (in this case, read index.dat) and I'll probably regret not trying to learn in the order of the books.

The code above will open index.dat and partially parses the file correctly; I can get the filenames to read properly but I'm still having an issue on getting the number values to properly display. I suspect it's just one of those things I haven't learned/remembered yet. :)

I changed the code a bit tonight, but it's still outputting the same data that you can see in the screenshot immediately below it in the previous post.  I'm going to keep hacking at it tonight and see what I can do.

Wednesday, February 7, 2007

Getting Closer

It appears that I now have it properly grabbing the file names, now I just need to fix the remaining three values per data record.
 

Unexpected Rush

I'm shocked how much has come back to me. :)
In a combination of remembering quite a few things and a really good chapter on file stream reading in C for Dummies, I've actually managed to produce this in under four hours of relearning C:

It appears that it's reading a bit off from the structure of index.dat, , but I don't think it should be too hard to track that issue down.

I have to admit, I'm amazed.  While something as basic as this to an experienced coder may seem trivial, I never expected to be at this stage this early in the process.

Tuesday, February 6, 2007

Back to Basics

You have to start somewhere. :)

My weapon of choice for the first stage of this experiment is MS Visual C++ 6.0.  I bought it years ago while at the University of New Brunswick and I'm pretty sure the only thing I've ever compiled with it was a LAME MP3 encoder DLL.

In a way, it feels weird going back as far as compile the programming-standard "Hello, world!" to start with, but if I want to do this right then I'll start at square one and re-acquaint myself with all of the nuances of programming.

From here, I intend to develop a small program which will read in and parse index.dat from the EHM /database files, then output the data to verify the correct values were read in.

One step at a time...

GUI Prototypes

In between sessions or reading to relearn C, I've been goofing around with Xcode to sketch out a prototype GUI for the editor.
I've been mulling over the idea of what the important features of an editor should be.  Clearly, data editing is the most important one, but I think an often-overlooked ease-of-use feature is the ability to quickly transfer the rights to players and/or staff from one organization to another.
As an obsessive-compulsive roster updater, I've found the best editor for the EA Sports hockey video games to be NHLView.  From that inspiration, I've drafted up an early GUI for player/staff transferral.  Ideally, you would select the two teams for the transaction from the drop-down box (sorted alphabetically), highlight the player(s)/staff you would like to transfer (list should be sorted alphabetically in order of LastName, FirstName), then click the appropriate directional arrow.  The rights to the player would then be changed from their existing team to the new one, and the database updated accordingly.

There is an insane amount of data in the EHM database, it would seem.  Mac OS X GUIs are praised as being well-layed out and covenient to navigate to easily find your way.   I'm trying to find a way to break all of this data up into logical chunks for the user to traverse.

Currently, I have split everything into four core data groups:
  • Players & Staff, where users can edit every detail pertaining to players, staff, and perform simple transactions between teams or free agents.
  • Leagues & Teams, where users can edit league names, conference and division names, awards, etc.
  • Locations, where users are able to manipulate data in regards to continents, countries, cities, arenas, etc.
  • Injuries, where you can modify existing types of injuries or add your very own ("Eric Lindros, added to injuried reserve on 3/2/2007 due to spontaneous human combustion.")
Under each of those four master categories will be a selection of subcategories to further facilitate finding the information you'd like to edit.

As you can see, I've also Canadianized some of the terms.  While they're terms that fans in North America may be familiar with, it's not necessarily terms European fans may be comfortable with so I would like to add an option to toggle between terms used in EHM itself, and the terms I'm comfortable using that the user can set based on their own preference.

C Spot Run (Die, Puns. Die.)

 When you dive head-first into something, sometimes you can come to realization that you have a bit of wading to do before you're ready to swim.  Such is the case in the project I've started.

It's been about seven years since I've done any coding in C (and even then, it was a basic dabble).  However, it has been something I have wanted to learn for a long time since.  There's just something about creation and the work itself to make things function properly that's always been fascinating to me.  I have always been looking for a project to cut my teeth on, and thankfully I stumbled onto something that I really found a passion for.  

I have been playing the Eastside Hockey Manager games since its freeware days, and it is - bar none - the best representation of hockey you can play.  Text-based sims rarely get the love that console-based video games do, but this is just one of those programs that have found a home on my iBook (and before that, my PC) and never get removed.

When I read that the EHM jersey was being raised up into the banners due to a few reasons I won't go into here, I discovered upon visiting the official forums that the data structures for the data files were well documented and that the data could be manipulated to enhance the EHM2007 experience.  I had found my project.

As I read through the books I own (I have a surprising amount of ones geared toward Dummies), a lot of my old knowledge is coming back along with the realisation that there is a lot of stuff I have yet to learn.  I love that; I love the fact that not only am I learning something new but at the same time I could also - somewhere far down the line - provide something that could benefit other people as well.

It's going to be a long road; I don't deny that for a second.  That being said though, it's one I am really looking forward to and hope that when I hang up my skates on this project, I can take the same pride I hope to have in my work that everyone at the EHM team should have in theirs.