October 2007 - Posts
Now that the so expected Crysis SP demo is available, I've already finished it but, until the game cames out, I'll replay and fine-tune it as much as possible.
Being one of the big "Vista & DirectX 10" showcases, I was eager to try it on my new gaming PC. But before giving details of how it went (at least initially), let me list my hardware:
- Intel Core 2 Duo @ 3 GHz
- 4 GB DDR2 Low Latency RAM (4x1GB)
- 2x NVidia GForce 8800 Ultra (in SLI, a total of 1,5 GB DDR3 RAM) <- best suited card for DirectX10 available
- 2x 250 GB SATA-II HDD (in RAID 0)
- Liquid cooling in both the CPU and the graphic cards
- Dell 30" monitor (max. resolution, 2560x1600)
- The very latest NVidia drivers (31 oct., v169.04 beta)
- Windows Vista Ultimate 64bits (fine-tunned and fully updated)
A freaking monster. Every game runs perfect and smooth at 2560x1600 with all options to maximum.
Every game... except Crysis :D
First of all, the 64 bits client crashed, so I had to play with 32 bits client (Crysis developers say 64bits brings 10%-15% performance increase).
The game auto-detected for me everything on "Very High" (maximum value). I left it.
I switched the resolution to 2560x1600, and started a new game...
And the game became a Slideshow xDDD I don't think I got more than 5-6 FPS. Amazing achievement, morphing my bad-ass pc into a high-resolution 386 :D
Anyway, I switched down lot of details to "High", and the resolution to 1600x1200. Game goes fine and very smooth with that.
But I remembered that a similar problem happened me with Lost Planet under PC... DX10 version was laggy, but DX9 version runs very smooth. So I've been searching and reading some forums and websites, and this is my current configuration:
- Running under DX9 (gives performance a very noticeable boost)
- 64 bits client (seems that DX10 and the 64 client don't work well together)
- All details to "Very High"
- Resolution switched up to 2048x1536
And the game runs smooth, as it should.
To override DX10 under Vista (if you choose "High" settings the game still runs on DX10), follow this instructions:
- Create a file called System.cfg on your Crysis folder.
- Open it with notepad and add the following lines:
- con_resticted=0 : Allows all console commands and tweaks
- r_driver=dx9 : Forces DirectX9 renderer
- Save, and enjoy the demo :)
I also have added the following parameter to my tweaks:
- r_MotionBlur=0 : Disables the motion blur when turning around (I don't like it in a FPS game, too dizzy)
And to re-enable the "DirectX 10 only" High quality and visual effects under DirectX9, follow this post.
Conclusions?
- Except in one specific game, Bioshock, DirectX9 is actually noticeable faster than DirectX10 under the same hardware and OS. And visual differences are very small compared with the performance loss.
- The game is highly customizable, but not easily.
- Almost everything promised "just for DirectX 10" is available in DirectX 9: Destructible palm trees and buildings, high-quality shadows, shaders, effects, full HDR lighting... The differences are very subtle and anyone can live without them.
- The game is so targeted to high-end PC it scares... I hope that lower detail-resolution combos go well with lower PC specs.
- Apart from the "performance issues", the game is great... meeted my expectations. I can't wait for the full game to be released!
BuddyScript doesnt supports classes, but leaves you a certain degree of flexibility to at least structure the code in tiers.
Today I'm a bit lazy to post code, so I'll just explain how we create our agents logic.
First of all, we have a DAL folder in which we place all the data retrieval code (whenever it's from external sources or files). XML and text file loaders, DataTables and Datasources go here.
Then we have a BLL folder in which we place all the logic. At this layer/tier, initially we don't use any DataTable or Datasources, I prefer handling lists of "buddyscript objects".
At last, we'll probably use the Chat folder the WLA template creates to store conversation handling. It's not always possible (mostly if you start doing asynchronous stuff, you'll be forced to put more code in the BLL), but helps too. You can think of it as the Presentation Layer.
I'm hoping to have more "free" time at work to try more advanced things, like trying to apply design patterns, but it's not easy not having interfaces and classes :/
Also, it has a nice feature I want to use somewhere... a Javascript-like eval }:)
Used carefully can be really powerful...
After spending some hours of fighting with the Google Picasa API (with the help of PedroA), we have found that appears to be no way to get a photo URL to use for example as the src attribute of an <img> tag!
Every URI on the GData query either returns a HTTP address (for viewing the photo in Picasa Web) or the image but "pushed" so you have to download it :(
Tomorrow we will do a second round trying alternative ways, and I suppose the reason is to avoid direct linking of the images outside Picasa, but the option to link directly to the image should be available...
The night from thursday to friday I slept few hours, but it was not because of going out. Pedro and I started to play with the Twitter API and a visual clone (using only javascript and HTML) I had already don of it's badge (which is a flash object).
At first, we used the RSS url Twitter exposes to fetch the entries. I sticked to that approach (building a small javascript XML parser) while Pedro discovered that Twitter can expose too the entries in JSON and tried that.
I finished my version first, but it had a nasty effect: Twitter adds the username before each entry text... So I we ended using Pedro's JSON version.
To circumvent the cross-domain AJAX restrictions (you can't do an AJAX query to a domain name), I built a small ASP.NET proxy that gets the original URL and simply outputs it (so AJAX calls can be made to the proxy inside my domain).
I'll change some bits to be able to add to any blog of the community (and in the future, build a Community Server control).
You can see a live demo of the results here.
By the way, I've setup a subdomain (demos.kartones.net) for more upcoming example codes with web-related topics. Expect soon some sort of default page to browse them ;)
Some days everyone gets so burned of the work that ends thinking "Have I chosen my correct job? Did I choose well?".
But it's normal, and doesn't happens often if you enjoy what you do (even more if you work in what you have passion for, which in my case are computers and development).
And other times, you really enjoy working. Things go as planned, work gets done (even quickier than you thought), and you spend your 8 hours of work with pleasure and end having the reward of seeing things perfectly done.
Today was one of the later ;)
We're on phase 2 of a Windows Live Agent development, and having an initial estimation of near 40 man/hour work, we ended finishing all the big tasks and some smaller ones, almost without problems (probably my newbie skills on defining tasks and planning times for a 3-man team played out an important role too). Doing pair-programming with a colleage, helping and managing another one with his tasks, refactoring some parts, cleaning and optimizing others... We'e reduced the overall size of the project's code while greatly increasing the functionality.
While things not always go as planned, when you cross the line between "knowing something" to "having control of something", at least I feel I've done the correct decision working in an industry that requires much effort to keep updated on knowledge but also gives you the opportunity to create things, to help others (not only our clients ;), to do something useful...
After some delays we finally can download the full archive of presentations from the XNA Gamefest 2007 Microsoft event.
There are a lot of them, covering all aspects of XBox 360, Windows and XNA development, so you should start downloading them right now if you want to learn more about game development!
Reading pending feeds I came across this post from Coding Horror about how software spoils (grows bigger with each new version, often adding unnecessary features), and I can't agree more with it.
My first example is Windows, which in each version adds more and more features that in my oppinion should be at least deactivable before installing the OS, and that sometimes cannot be deactivated without hacks or tweaks.
But as I don't want to flame about Windows good or bad "blunded software", I'll just simply recommend you to read that post and leave my point of view.
I, as Jeff, still use (and love) WinAmp 2.95, have switched from my old ACDSee 5.0 to Windows Image Gallery (I still miss some basic actions as "convert" but I can't live without them), stopped using Photoshop 7.0 in exchange of Paint.NET, and I would love if there were a Windows Live MEssenger Lite version, without all crap for youngsters of winks, nudges, painting, flash-backgrounds and other "features" that only serve to annoy you when you just want to communicate with others (for playing we have the Activity window games).
I hate having to maintain a list of "tweaking guides and applications" to tune-up my Windows, my Messenger, my PDA, my browsers... Life would be much easier if applications were more customizable and less oriented to force you using them exactly as their creators wanted.
Mozilla browser dissapeared in favor of Firefox (and I switched from the former to the later) because it was growing as big as the japanese monster. Around the net you can find "Lite" versions of Photoshop because the "original" application has too many unused stuff. Foxit Reader is catching tons of users because Adobe PDF Reader gets bigger and bigger with lots of features that almost nobody uses. I prefer ImgBurn to Nero, for which I have an unused v8 license that came with the pc, to avoid having to get rid of all Nero Scout and other crap it installs... The list is endless.
I now look at the past and smile remembering when I had my gaming PC running a fully-tunned Windows XP which ate just 200MB and had 19 running proccesses and took less than 1 GB of disk space installed, when I had a fully working Photoshop 7.0 in 180MB, and when Nero was the number one small yet fast burning software...
Today, and thanks to David Salgado, I had the opportunity to chat with Angus Logan (Product Manager of Windows Live Platform) at Microsoft Ibérica.
We talked about Windows Live services and a bit of Silverlight and Angus showed some really really cool web applications, mashups and other stuff that impressed me a lot.
Seems that Microsoft is taking seriously the battle with Google, I just hope all of this to become public ASAP.
One of the features I was waiting for and finally could see was Windows Live Messenger directly via web, signing on and using it directly from a webpage! You can read more about it and see some screenshots here and here.
He showed us his profile on SportsDo (updated in real time), some Silverlight streaming websites, Virtual Earth mashups, Windows Live ID... We talked about Windows Live Agents too (and he told me some really interesting info }:)
I can't blog about some of the features I've seen, but some of them are going to be very cool.
He gave me a bunch of videos and slides from his Mix UK event so I've got something to read this weekend :P
A really nice experience, hope to have more like this soon :)
Update: Added links to more info about Messenger IM Control. Thanks Angus!
This week I've been a bit busy, and with the deadly spree of FPS that have been released (I finally got Halo 3, plus Half-Life 2 Episode 2 + Portal, Quake Wars Enemy Territory, Call of Duty 4 demo, and Unreal Tournament 3 demo...) it's going to be difficult to make me go out of my house until monday :)
But I've been messing with some things too. One I've obtained access to the private beta is Filespots, a virtual drive with the look and feel of Windows Vista, and tons of space to manage files. Since Microsoft's Windows Live SkyDrive is still in closed beta, and features much less space I tried this one and it's fine for my needs.
Here is a small list of the best features:
Features
- File explorer 100% like Windows Vista. Very very cool.
- Not for public file-sharing, but allows to share files with your friends (with read-only, write or administrator privileges).
- 100% AJAX. I've tested it on Firefox and IE7 without any problem.
- 10 GB of space (at least on this phase), and up to 5GB in a single file!
- You can create multiple "storages", each with their users and permissions.
- All common tasks are implemented: cut, copy, paste, rename, upload, download, multi-selection...
- A recycle bin is available in each storage.
- Multiple views (list, details, from small to huge thumbnails...).
- Sorting by columns.
- Exporting of a complete storage in a zip file (fantastic for offline backups!).
Curious things
- The system keeps a historical of each file version.
- You can have more than one file with the same name and extension.
- The queue system it probably implemented via Javascript works very well if you do multiple actions fast.
It still has some small bugs and sometimes takes a while to respond, but I'm going to use it as an online device from now on :)
And some screenshots. Click on the images to enlarge them:

Default view
Copy file dialog

Context-menu actions

User Management
As I don't want to install MS Outlook just to sync with my PDA (I don't use it for my personal email accounts, and I use OWA to look the work account), I thought about developing a pocketPC application to sync PocketOutlook directly with Google Calendar (Gmail contacts are already done).
Yesterday I messed a bit with Google's GData and .NET client dlls, and although it can be done, it's some effort (specially having 8 calendars as I have), because the query system has to be translated to objects and properties plus mapping to PocketOutlook fields.
But searching the net a bit I found the solution: ActiveGcSync. A freeware tool that syncs the default calendar of an account directly with POutlook, installed on the PDA and without need of ActiveSync/WMDC or Outlook.
I've had to "move" all my events to the default calendar and get rid of the others, and the current version doesn't supports recurring events, but the author says he has almost ready another version which will support recurrency, so actually works and will soon be perfect.
If I had more free time maybe I would have tried doing myself a similar app, but right now that's utopic :)
My dog woke me up a bit early so nothing better than a few security articles and slides to start the day. This is what I'm reading right now:
- The Silverlight security model (Parts I, II and III)
- MS Access SQL Injection Cheat Sheet
- LDAP & Blind LDAP Injection (in spanish)
- XPath Injection, Brute Forcing & cracking paper (in spanish)
- And an extra non-security one: Revisiting Programming Fonts
I managed to get this few hours ago making a simple video search :)

I'm starting to think that monkeys are going to rule the world.
And as a sidenote, I can't resist to comment that probably the chimpanzee at Sony that thinks PS3 market strategies has run out of bananas... I can't find another reason after reading how the "new" PS3 of 40GB has been nearly dismembered.
Today we're gonna talk about MSN Messenger Activities stuff. Using activities from Buddyscript means adding handlers in the form of overriden procedures, creating a mini-communication framework (the SDK contains a good example to start from), plus all the code we want to add to make our code more robust and handle possible errors.
I'll focus on detecting and handling problems when for whatever reason the user can't launch an activity.
To use the following code, you must reference lib:/Shared/Utilities/WLMActivityUtilities.pkg, don't forget to ;)
First of all, we can detect if the activity is already launched or not. To do this, BuddyScript has the MSNSLPP4ApplicationIsAvailable() function. I always have additional flags to reflect the action I want the activity to perform when is ready, the state in which it is,... so it's a good idea to wrap this function in another one containing your custom checks too.
If, for some reason the user can't launch the activity, the MSNSLPUserCanNotOpenP4Window() procedure will be called, so you must place an override too in your code, reseting all flags and handling this "disaster".
If the user refuses explicitly to launch the activity, the raised procedure is MSNSLPUserRejectedInvitationToOpenP4Window().
The main call to launch the activity is MSNSLPSendInvitationToOpenP4Application("activityID", "activityName"), but it is a good practice to wrap it in another procedure to check first if user can't launch it, and to avoid having to write the ID and name of the desired activity.
And finally we get into the interesting things. What if the client is running a Web Messenger? Or Messenger from a PDA? Or an old version which can't handle Activities?
With the following code, you can detect all that, and by checking it before launching the activity, avoid most problems and redirect to the "user doesn't supports activities" code fork:
// Checks if the client is on a mobile device, on Web Messenger, or has an old msgr version
function ClientSupportsActivities()
if !Exist(SYS.History[0].Query.ExtraInfo.ClientId)
return false
CLIENTID = SYS.History[0].Query.ExtraInfo.ClientId
if (CLIENTID & 512) != 0 || (CLIENTID & 1) != 0 || (CLIENTID & 4026531840) < 1073741824
return false
else
return true