August 2007 - Posts
I almost forgot that today is the 3rd Blog Day! Here are 5 blogs (well, two of them are more than just a blog) that I read about game development:
- CodePixel: In spanish. Fantastic source for 3D and game development resources. Lots of info and papers about GPU programming, OpenGL, DirectX...
- Eternal Lands development journal: An blog written by the admin and main developer of a MMORPG game. Better than those pure marketing "development diaries" that now appear before a new game is released.
- GameProducer.Net: Points of view, discussions, tips... all about producing videogames.
- Terranova: Articles, essays and papers about MMORPGs. With varied points of view, quite objective.
- Critical Hits: A RPG and comics devoted blog. Very interestng RPG articles and posts.
I'm right now in the final weeks of the first phase of a project. We're very tight on schedule and having to leave a few features for the next phase. Although the project may be delayed because of the client, we want it to be because of them, not us.
One thing that I've done in the project has been using mock objects for simulating an important part of the architecture, a web service which we have to access to do some business logic. This web service has to ve provisioned by the client to us, and because it is a big company, they seem to have delays and lots of approvals before anything important gets done.
So we are nearly 3 weeks before deadline, and we still don't have access to that web service, to the real source. If it wasn't because of the mock-WS I've implemented, we couldn't finish on schedule. I couldn't have coded nearly 50-60% of the really important logic the application needs.
We have frecuent meetings with the client (we're doing XP and specifically Scrum), and they gave us the WSDL and the specification of how the data from the WS will come, so I've mocked it (using a simple ASP.NET Web Service) and right now we haven't goy any problem coding the business logic.
And not only that. By having a mock, I've created some additional commands to enable and disable by specific WS calls things like simulated timeouts, malformed data, missing data and other specific aspects. I've writen tests inside the code that does things like:
- Activate timeout
- Call the WS
- Test if everything went ok and the timeout was catched by the code
- Deactivate timeout
- Call the WS again
- Test if this time data was gathered without problems
While mock objects don't have to be used always and are not "the ultimate salvation", sometimes they become really, really handy, and in my case, critical to reaching all project's requisites (and deadline, I hope ;)
Leverage not just "the extra development time" but the extras they can bring, as better and more deep tests, fast and non-intrusive simulations, and less dependencies on external sources.
Today I've been reading an interesting Wired article about Halo 3. I strongly recommend to you, because it's very interesting how Microsoft has setup a "gamers lab" to test their responses to playing games.
They use in-game data (hot-zones for maps, statistics,...), playing sessions recorded in first person view and even videocameras recording the players reactions. Seems that they're taking very seriously the "fun" component of the game.
Apart from little bits of text which smell like unnecessary flatteries to Bungie, in general the article is quite good, explaining the problems the studio had when developing Halo 2, and they made the same point I always say when talking about Halo franchise: Part of it's success was that there was no other good FPS in the console market.
Probably both Halo's have been a disaster on the PC, mostly because there are lots of FPS much better, both in history (Unreal, Half-Life, to mention a few) and in multiplayer (Unreal Tournament, CounterStrike, Quake series...). The main character name is the most stupid one I've ever heard of, but hey, if game sells, cheers to them.
But still seems that Halo 3 may be better, as they are focusing on making a "perfect" title both in singleplayer and multiplayer. While in single player I doubt it will shine too much (having The Darkness, Bioshock or the incoming Crysis), adding the high number of franchise fans with the success of XBox Live it will become a must-have for lots of console owners.
I love FPS and although I prefer playing it on the pc (Mouse + Keyboard will never, ever be defeated with a gamepad), but I'll probably give it a try.
Meanwhile... I'll return to Rapture, I've got more little sisters to save... or to harvest, who knows ;)
Yesterday I finished toying with PocketOutlook and GMail CSV export option. Now I've got (at last) my GMail contacts clean and tidy, and imported into my phone.
I did a small application that reads a CSV file (you must export your contact list in 'GMail CSV' format) and imports it using the PocketOutlook .NET object model. I can only say it's great, I spent more time mapping GMail fields into Outlook fields that coding business logic (and the whole coding didn't took me more than a few hours).
This is how the app looks:
As for the source code, it is for Windows Mobile 6, and uses the fantastic FileHelpers Library (thanks for showing it to me, Jesus). The main PPC app just instantiates my GMail2PocketOutlookLib which does all the heavy stuff.
To access Outlook just reference Microsoft.WindowsMobile.PocketOutlook and write code like this:
OutlookSession outlookSession = new OutlookSession();
ContactCollection existingContacts = outlookSession.Contacts.Items;
Contact newContact = new Contact();
newContact.FirstName = newContacts[index].Name;
newContact.FileAs = newContacts[index].Name;
newContact.Email1Address = newContacts[index].Email;
// ...
existingContacts.Add(newContact);
With FileHelpers I did all the CSV reading in no time, and as you can see the import process can't be easier.
You can download the full source code and binaries in the Downloads section.
Next is doing a bit of I+D about Google Calendar API and coding a small sync tool. I don't like the fact that either you sync with outlook or you can't sync anything except files (and I use Google Calendar instead of Outlook).
Note: Code contains one unused Property, some comments missing, and the import process may mess up because of some issues with GMail CSV contents (there's a txt file explaining all). Initially I don't plan to update it, but if you fix or improve something, you're welcome!
I've been playing with Sketchup since before Google buyed it, but I haven't done anything great. I want to make my future house floorplan in 3D, but as usual time is precious, so I'm always delaying it.
Anyway, for those wanting to transform buildings into 3D, you should check this video... just amazing what can be done with a photo and 3 minutes! (I didn't know I could load a photo to use it as reference, cool idea)
Note: Now that I finally have my new (and fantastic) HTC Touch with Windows Mobile 6, I'm playing a bit with the .NET Compact Framework to make a small tool I need, so expect soon one or two posts about development with .NET and PocketPC ;)
While writing my previous post about optimizing time in the real world, I wanted to write about more computer specific things, but was not the place, so here's a second part centering on daily Windows use.
- Order the Start Menu: I've got my start menu as ordered as possible. I create categories and manually move shorcuts to them, deleting the program folders created when installing new apps. It's way faster to find Visual Studio 2005 shorcut under "Development" than having to look at dozens of folders for "Microsoft Visual Studio 2005", opening it and finding the desired shorcut. Also remember you can add or remove right-side shorcuts by personalizing it. If you don't use something, get rid of it, less things to read, faster human response times ;)
- Tidy Desktop: Although this is more personal, I hate having the desktop full with icons. I prefer just the necessary and most used ones. This are all my Desktop icons:
- Web Browser favourites and buttons: Another basic one. I use Firefox, so I've got Google Bookmarks extension to sync them. I have the most frecuently visited places in the Bookmarks toolbar (so I don't even have to search the favourites), and as some extensions have menus, if I use them frecuently I add a button (for example, AdBlock autoupdater doesn't need a button, but Web Developer toolbar is a mandatory). Other extensions like PermaTabs or FaviconizeTab help having organized the opened tabs.
- Default programs and default actions: Having them properly configured grants valuable time. I use Paint.Net to edit photos, so doing right click -> Edit on a photo is quite fast, I don't have to open first the app and drag&drop the photo on it. I use too Notepad2, even for fast .xml and .config editing, so I've changed the default program handling to use it. Notepad is way faster than loading VS2005 just to modify a XML tag.
- Some "out-of-the-box" vendor software it is actually useful: In my new laptop, I've got a small tool to enable/disable bluetooth and/or wireless with just 2 clicks. Windows Update auto-downloading of updates means you don't have to remember each wednesday to run it manually to install new Windows updates and fixes.
- Shorcuts are good: In this point-and-click era, learning that CTRL+S saves a photo, document or code source file is faster than moving the mouse to the save icon. If you use a tool frecuently (Word, Visual Studio...) learn the basic shorcuts. And most of them are the same always (for example the save shorcut combination).
- Creating folders is free: Having hundreds of GigaBytes means if you don't impose some order, you'll have to relay on searching for everything if you need it. Why just moving all to "My Documents"? Why not creating subfolders (Work, Home, TODOs, Manuals...). You will win valuable time by having everything organized.
- RSS is the present, not the future: Most websites have RSS feeds (either with full text of the news, or at least headlines). Would you be able to have more or less up to date almost 100+ websites by manually surfing to each of them? I don't think so. This are my Google Reader stats:
Visiting websites for me has become the uncommon task (and 99% of them as a result of using search engines). I got all the news I want right in one place, so I can easily choose what to read and what to skip. - Customize application's toolbars: In Visual Studio, combined with shorcuts for me means not having to use the standard menus except for very specific actions. Add or remove buttons as you see they're missing or they ain't being used.
- Windows remembers each folder's view type: You want big thumbnails for your pictures folder? perfect, but maybe using the "List" or "Details" mode for the rest is better to find a file without scrolling down. You can always change specific folders view mode and next time you access them the will retain it.
I'm sure I've left a lot more of things, but you'll get the idea of what I mean.
If you use something frecuently, adapt it to yourself. We don't have to strictly adapt to the tools anymore, we can customize them to our needs.
And here goes another book review, this time about Videogame marketing and public relations. As usual, on my Book Reviews section.
Sometimes we're asked to optimize code routines. To make them faster, more compact, less memory consuming... But what about real world? Have you tried to optimize your time in mudane tasks, in common things you do everyday?
Here are some examples of small optimizations I've made in my common tasks:
- Wardrobe: T-shirts in two groups: common and geek/funny ones. So If I'm going to have a meeting with a client, I don't go with a "SELECT * FROM girls WHERE freesex = TRUE" T-shirt ;)
- Home network: One PC acting as a software repository. Programs, Games, Music... All go to one place. I've got shared folders so I can easily access them from any pc in my home. I make ISOs of my games (and download cracks for those games that require CD/DVD to play ¬¬), get rid of the covers and put them in CD-albums to have enough space in my bookcases.
The repository PC, as it is commonly accessed, doesn't have keyboard, mouse nor monitor. I use VNC to access it from any pc in the local network, so I can use at the same time the real pc. 2x1 :D - Room placement: Do you use frecuently your PocketPC? Do you sync a lot your iPod with the pc or connect it to a sound-system? Then place it near them, so you only have to move your hand and not yourself to manipulate them.
- Garbage bin: As I'm left-handed, I discovered that by putting it under my desk but in the left side I missed less when throwing papers at it without looking :) Seems stupid, but a correct placement is critical to avoid time catching loose garbage if you're busy with other things.
- Ordering the books: I've got all my computer books in the same bookcases. Science fiction ones together, terror ones same... You spend less time searching for a given book or magazine.
- Tools at hand: I always have in my desk some common tools: A screwdriver, scissors, a pen, clips...
- Multitasking: When I wake up, I usually have to go to the bathroom. Why not first put the coffee into the microwave? That way you do "multitasking", and when you're finished, the coffee is hot and ready to drink.
Another example: Do you have to do a long and tedious (but automated) backup of your laptop? Go watch a film meanwhile, or read your pending RSS, staring at a progress bar is not only boring but useless. - Correctly timing: I discovered that in the early morning, if I miss the bus I may have to wait up to 30 minutes for the next one. But arriving 10 minutes earlier guarantees me catching the bus, because it's the start of the line and they always stop for 10-15 minutes to have a break.
Sometimes I get crazy because I try to do too many things in a day (30 minutes remaining until the supermarket closes? ok, I've got the date with my friends in 1 hour so give it a try!), but usually is more productive than "leaving it for tomorrow". - Training yourself to do things unconsciously: For example, I always put my showing towel at the left of the shower. I can take a shower almost asleep, but I can take the shower with my eyes closed because I know where it is. I leave my mobile phone at the right of the laptop, so if the phone rings I can take it without looking where it's placed. I do a quick check of all my pocket stuff at the elevator before leaving my building (wallet? phone? ipod? cigarettes?). If I'm missing something it's only wasting few seconds and not going back home later, and if something is missing an unconscious mental alarm tells me "hey, something's not right! check it out!".
- Notes, notes and more notes: I'm a bit disaster remembering things, so I do a heavy use of Google Documents and Google Calendar reminders (now with SMS notifications is marvelous!). And for when I'm out, I've use a PocketPC (now I'm waiting for a new HTC Touch so I'll only carry a PDA-phone). post-it notes are useful at work, but everywhere else I don't recommend them (you can lose them very easily).
Next post will be "Optimizing the time using your computer" ;)
I've started looking in depth current JADE 2.0 code (it's being massively re-done from scratch, with even a custom .NET DirectX Wrapper), so I'm going to post more frecuently about it's development.
I'm still learning how what's actually done works, but one of it's coolest features is the Pluto framework (which is now branched into a separate project). Pluto allows to develop applications based on pluggable modules, easily configurable via XML. It does a heavy use of generics and reflection to load them, and even includes a virtual file system to abstract from physical storage.
I strongly encourage you to give a look at it, but right now the feature I'm going to talk about is Double Dispatching.
Most languages use single dispatch, which said in a rude manner is like math's least common multiple. At runtime if the code itself doesn't specifies the type, the program chooses it's type and executes it's implementation. In reusable applications this can mean we could not be able to use derived types without being forced to do specific casting and type checks.
Double dispatch works like math's greatest common divisor. By using reflection and polymorphism, a double dispatch implementation looks for the base class of an object, and then goes up, checking every derived class until it finds the most suitable one, the most "complete" one.
With polymorphism this means we can automatically have derived classes methods getting executed without specific casting.
Double dispatch is based on the Visitor pattern, so we could execute any of the derived class methods. We have a more generic code, just by structuring our application according to the mentioned pattern.
JADE 2.0 uses double dispatch in the scene graph, allowing to walk through it's nodes (entites), applying matrix transformations and node-specific operations. This way only common operations are done at the Node class, and each entity's Update() method is called without any need of code. The mechanics are similar to XNA GameComponent's Update() method, which is automatically called in each game loop pass.
Note: Double dispatch calls the most suitable method according to the object and the first parameter. And Pluto implementation speeds up reflection by generating IL on the fly. Thanks to Vicente for the tip.
The SANS Institute has published an interesting paper about Vista vs XP SP2 security features for laptop users.
The paper compares existing (and improved) features and the new features added in vista (like Bitlocker or UAC).
It is interesting to read as a fast overview, and as it concludes, almost every user should choose Vista instead of XP if buying a new laptop, because you get for free a lot of security enhancements.
I'm with that opinion. Unless you're going to play with the laptop, or you have an old one (single core, less than 2 GB RAM and bad graphics card), choosing Vista is correct, but upgrading from an old laptop can degrade the performance noticeably (as happens with my work laptop, which suffers the lack of horsepower a lot).
Now that I've got my new laptop for development, with Dual Core, 2 GB RAM, a laptop SATA HD and a decent NVidia graphics card, Vista goes very very smoothly even when doing intense use (moving GB of data, installing software and other CPU/HD intensive tasks). RAM consumption is still a bit high (800-900 MB with just Firefox and 2 IM clients), but the fast HD helps a lot to speed-up the memory paging.

I've just arrived today from spending the weekend at London with some friends. We went to see some friends that were there having vacations, and to go party and have some beers :D
We didn't visit too much places because of the lack of time, but we had a great weather (no rain and sunny!) and above all, tons of laughts and good moments. We'll have to come back again ;)
As usual, I've uploaded some photos at my web photo albums.
It's time to spend some money and upgrade my home machines!
As I love playing games and watching movies, I've bought a new gaming PC (a real monster). Also, I'm getting a new laptop for development (including JADE and XNA development ;) and a new mobile phone (because I'm tired of having to manually "sync" my agenda and contacts between PC and Nokia).
-The gaming machine is an Alienware PC, along with a Dell 30" monitor (that's what I call real Home Cinema ;) It will be plugged to my current 7:1 sound system.
-The new laptop is an ASUS G1S Santa Rosa, the new revision, perfect for development and (I hope) for Windows Vista. I'll use my current desktop pc's monitor (a 17") as a secondary monitor.
-The new phone is an HTC Touch, with Windows Mobile 6 and iPhone-like touch screen and features.
-Hades, the repository and DB server, will be kept (it's an XPC, one of those small boxes, without keyboard/mouse nor monitor, controlled via VNC).
-And Penguin, my old laptop, will stay too as actually, with Ubuntu 7, for Linux learning and experiments. I just hope to be able to recompile NVidia graphic drivers to enable 3D and Beryl, but for the rest runs smoothly and without problems.
Here's my planned machine & network schema:

Click on the image to enlarge
I expect to have everything before September.
Note: Nokia PC Suite & bluetooth sucks. It may be because of Vista or just because crappy sync, but it's a hell. From time to time the pairing goes wild and I have to re-configure it.
Today I'm a bit lazy for going out, so I've taken my Community Server "wish list" and developed another module (and I don't discard making another one or two more... it's 7 PM only :)
KartonesNet.Modules.DiggItAddon adds a "DiggIt" button at the bottom of each post, allowing you to send to Digg the post. Some stuff can be configured, like the skin of the button (normal or compact), the background color and others.
Go grab it from Kartones.Net Downloads Section if you want. And from now on, if you like one of our posts (of the whole community, not just this blog) remember to DiggIt ;)
Many thanks to Mykres for his post about how to develop a DiggIt module.
I've added a new Spam Rule to my addon pack, BadWordNoRegExpSpamRule, that works almost exactly as CS default one, but without using regular expressions to search for the bad words. Instead, it uses substring comparisons, so anyone can easily add non-alphanumeric bad words without regexp knowledge.
Soon more stuff for your Community Servers :P