I'm just under three months into this project and I still haven't gotten to the really fun stuff (graphics and animation). Why? Because a disciplined programmer must build a well-planned, scalable infrastructure while resisting the temptation of taking shortcuts or "just winging it".
The last two weeks were dedicated to user interface (UI) controls and mechanics such as character profiles, merchant inventories, and conversation windows. It's no secret that building these things can get a little tedious, but man, once they're implemented your app starts to really feel like... well, a bona fide app.
An example is the character profile pictured on the right. It still needs work (like replacing the cheesy placeholder graphics and labeling the equipment slots), but it's almost ready for primetime. This window looks and feels intuitive but there's a crapload of stuff going on under the hood.
The idea is to click a slot to put an item on your mouse cursor, then drop the item elsewhere (another character perhaps, or an equipment slot if the item can be worn/wielded). If you're looting an enemy or buying from a merchant, you move items from the loot/merchant window to your profile. To further complicate things, some items are "stackable" in the same slot. There are many different scenarios to account for, including:
- Is the item on the mouse cursor compatible with the destination slot?
- What if there's an item already in the destination slot?
- What if there are no slots available and you purchase an item from a vendor?
- What if you buy a "stack" of 5 items, but every slot is filled except the last, which has 48/50 of that item. What happens to the 3 items that would overflow your inventory?
The slots are just a part of it. The stats in the middle are bound to the character you're viewing and they're updated real-time. So, if you have the window open while you're getting your butt kicked, tada, your stats will reflect that. The magic of binding certainly makes Silverlight development easier, assuming you build the architecture correctly. On the other hand, if you slap a bunch of properties together willy-nilly you'll find yourself writing just as much code to babysit the bindings as you would've spent on traditional code.
This UI was certainly influenced by the original EverQuest, and I can safely say that in the process of building it I gained a world of respect for what the EQ devs went through. They clearly adopted the same mindset I've had: a great UI helps you complete a task quickly and intuitively, then gets out of your way. And while it's true that most users won't appreciate the work that goes into an effective UI, it's better than having them suffer through a clumsy one.