Silverlight 2 Beta Performance
One of the reasons I’m pleased with the Silverlight version of Legend of the Greasepole is that it represents a reasonably-scaled multimedia application, and therefore a good way to learn about the Silverlight 2 runtime’s performance.
The Silverlight 2 Beta game engine runs rings around the game engine I tried to create using the Silverlight 2 Alpha. Yes, samples existed during the Alpha days that let you build a simple Silverlight game engine, but I didn’t see any applications that were successfully pushing push over 100 bitmap-animated sprites around the screen. I certainly was unsuccessful.
Although, as evidenced by the current build of Greasepole, the Silverlight 2 Beta situation is dramatically imrpoved, the lack of hardware acceleration is still very noticable when running at higher resolutions. This performance impact is relevant to an Image-oriented application like Legend of the Greasepole.
Can the game’s framerate be improved at high resolutions?
Late last year, I tried to make a version of the game run on the Silverlight 2 Alpha.
While the perf in the game’s menus was passable, the actual gameplay caused the Silverlight plugin to grind to a halt and crash (as 150+ sprites, rendered as Images with opacity blending, were presented simultaneously).
When updating my Silverlight game engine to the Silverlight 2 Beta, changes included:
- using ZOrder instead of manually re-ordering Images in the Canvas’s Children collection between frames
- moving bitmaps and sounds from loose, pre-downloaded files to Resources in Assemblies
- an overall reduction in the number of RenderTransforms in the scene
- avoiding setting of Width and Height as per Silverlight Performance Tips (in the MSDN docs)
At game time, performance is superb when running in a window of around the game’s native resolution of 640×480. But when the player toggles fullscreen mode (achieved in code by scaling the Canvas on which the 150+ Images are being drawn), it kinda sorta almost looks good. It definitely achieves less than the game’s desired 24 frames per second.
So… Is the Engine Fill-Rate Limited?
Since the game performs so well at reduced resolutions, I’m currently theorizing that the engine is fill-rate limited in Silverlight at high resolutions. That makes sense, because the Silverlight 2 Beta plug-ins for IE7 and Firefox2 aren’t hardware accelerated.
Still, the changes that took place in the plug-in and the engine that were enabled by the switch between Silverlight 2 Alpha and Beta have made dramatic improvements to the game’s performance. They were enough to bring the game to life.
Legend of the Greasepole, Silverlight 2 Beta Edition
The Legend of the Greasepole is a game that began its life on July 1st, 1996, when a group of Engineering students from Queen’s University in Canada decided they’d create a way to re-live their unexplainable annual tradition from the comfort of their long-suffering computers.
The release of the Silverlight 2 Beta has allowed the game to goop its way to the web! In fact, here it is! (There are sound and fullscreen toggles in the upper-right-hand corner.)
Read the ‘cooks’ (lingo for student notes) for tips. Click mouse to perform actions, Shift to toggle tools, Space to do something silly (try it with beer).
Over the next few days, I’ll write more about how this was possible, and some of the many things I’ve learned about Silverlight development in the process.
For now, though, I’d love to hear how/if the game works for you!
If you didn’t study Engineering at Queen’s, the game isn’t going to make much sense. I mean, honestly, it hardly makes sense to me any more, and I’ve been to six real-life greasepole events myself.
Basically, the premise of the game is that the Frosh (first-year students), who are supposed to learn teamwork through the pole climb event, are a little too keen this year. So, as a thoughtful upper-year student, you need to gently stall the Frosh for as long as you can with whatever you can find as they attempt to (and ultimately do) wrest the tam from the top of the greasepole.
First one to 900 Achievement Points gets a pizza. Really… send me a screenshot and a mailing address.
Related Posts: [updated 30 Jul 08]
Silverlight Greasepole Game Engine Notes
Silverlight 2 Beta Performance
Greasepole Achievement List
Congratulations to Sci ’11 for their one-hour, 47-minute conquering of this year’s greasepole!
Can we all just take a moment to reflect on the academic year called “Sci ’11″? Man, I feel old all of a sudden.
Just for giggles, here’s the current list of achievements for Legend of the Greasepole. I wonder how the crowd around this year’s greasepole would have done.
Pole in Ten (Years!) - (100) - Stall the frosh for at least 10 minutes
Show Some Discipline - (10) – Proudly display the Discipline bar on your Engineering jacket.
Desperate Times, Desperate Measures - (10) – Wind up your arm fully, completely before you toss a road apple.
It’s The Jam, It’s All Good For You - (20) – Offer ‘za or a drink to the Engineering Society President.
You’re a Hoser - (20) – Cool down the frosh with water from the firehose.
Golden Soda - (50) – Offer a drink to hard-working Al ‘Pop Boy’ Burchell.
Like Homecoming, But With Lanolin - (50) – Quench the crowd’s thirst ’til they slam their leather jackets.
Dizzying Heights - (50) – Send a frosh flying all the way from tam to pit-water.
Iron Ring Ceremony – (100) – Unleash the power of the mighty Iron Ring.
Double Fisting - (150) – Wear two Iron Rings at the same time!
Exam Avoidance – (50) – Stall the frosh for five minutes without lobbing a physics ‘smart bomb’.
Fully Loaded Fun Fur - (70) – Stuff your pockets with 99 apples, 99 slices of ‘za, or 99 Clark mugs.
Secret Achievement - (??) – Keep stalling the frosh to discover this achievement!
Secret Achievement - (??) – Keep stalling the frosh to discover this achievement!
Secret Achievement - (??) – Keep stalling the frosh to discover this achievement!
Secret Achievement - (??) – Keep stalling the frosh to discover this achievement!
Portrait of the artist playing Greasepole on the XBox360
Just 2 days before her surname will no longer be correct in the credits of the game, here’s my sister Elizabeth, who designed the Frosh character, playing Legend of the Greasepole on the XBox360!
