Zimmster|Home
Mar 15 2011
Game Event Triggers in XNA

A level editor is great for building rich, detailed environments but modern games require more for the levels to feel truly engaging. Have you ever played a game where the levels looked absorbingly stunning, but felt void of life? Levels must not only look pretty, they should feel dynamic, fluid and react to player actions.

Thats why for ElectoStatic I decided to implement a Trigger system. Triggers allow level editors to add fun and interesting functionality to a level. If you’ve ever used the Starcraft or Warcraft III editors, you probably already know what I’m talking about.

Trigger systems are great because they allow editors to move beyond simply placing sprites and objects into the game world. They allow editors to create dynamic ‘events’ and actions (E.g. “When the player enters an area, spawn enemies, lock a door and make lights flash” or “After the player kills 5 enemies, start a cutscene and open a door”). These type of actions though simple, can have an enormous impact on what a level feels like. Levels feel more like real worlds to play in; rather than just barren playgrounds to pass through.

In my system, a Trigger is a collection of Conditions and Actions. Once all of the conditions are met, the actions are performed in order.

Even with only a few Conditions and Actions, its easy to make lots happen. Since you can combine as many as these as you want, think of the possibilities with this set of conditions and actions:
Conditions

  • Actor X enters area Y
  • X Seconds have passed
  • Actor X Kills Y Actors
  • Actor X uses object Y
  • Player has X Ys in their inventory

Actions

  • Kill Actor X
  • Spawn Actor/object Z at X, Y
  • Move object/actor Z to/by X, Y
  • Wait X seconds
  • Unlock door X

You could make a trigger like:

Player enters trapRoom
Wait 2 seconds
Spawn turret at trapRoom
Spawn turret at trapRoom

Player kills 2 turrets
Wait 1 seconds
Unlock door trapRoomDoor

Now a level editor, without typing a single line of code has made a room that when the player enters it, 2 turrets spawn and when the player kills them, the door unlocks. Pretty cool, eh?

If anyone would like me to do a short tutorial/explanation on how coded the trigger system, leave a message in the comments!

Mar 8 2011
Comments Fixed – Spam Removed

The blog’s been getting hit pretty hard by spammers lately, it took some time, I removed all of the spam comments without losing the real comments. There were over 7000 messages in the queue and I’m hit for about 300-500 per day.

I apologize for taking this long to fix it, but the comments section should be usable once again!

Mar 6 2011
ElectroStatic Reboot

I’ve always liked ElectroStatic’s interesting concept of magnets in a 2D Platformer world. After it won 1st prize at the University of Toronto’s showCaSe 2009 contest, co-creator Llythe and I decided to continue it’s development from prototype into a full game. It never quite got there, but it was improved significantly over the original prototype. The following video shows the game at this stage:

The main reason we stopped development was a combination of time, a buggy level editor, and internal engine problems. The physics engine was built in-house and didn’t perform well enough on the Xbox 360 to be viable for the game that I wanted it to be, so I put the project on hold.

Three years later, I decided to revive the project, and redesign the engine from scratch, redesign the editor, and use the Farseer Physics Engine. It already is performing much better than before and looks much better too. The new engine will allow for some interesting new features that I’ll talk about in the future.

Nov 22 2010
Found some old source code for my Final Project in high school.

I was going through some old files on my laptop when I came across the source code to a project I did in high school for my final project in a computer science class. It’s basically just a simple, buggy Mario clone made in Java, but still kind of fun to play.

I posted this video on YouTube a while after I finished the project, and surprisingly people wanted to see the source code, so I uploaded it. The site I was using to host the files went out of business, and I thought my files were lost, but apparently I still had them. I’ve uploaded them here.

I don’t pretend it’s great code, but it seems that having some source code to go off of has helped students get a handle on how to go about building a game of this type for projects, so I share it only for educational/reference purposes.

Nov 21 2010
Browser Compatibility

With a name like SteamAnywhere with a tagline that you can chat with Steam friends on the Web or on a phone, cross-browser compatibility is a must. My goal is to have everything JustWork(TM) regardless of how you’re viewing the site. This is especially important if you’re at work, school or somewhere where you’re stuck using an older browser.

As anyone with web development experience can appreciate, getting the site to work in Chrome, Firefox, Safari, Opera and other (almost) standards equivalent browsers was easy. Internet Explorer of course is a much different beast. Luckily after a few hours of tinkering with problematic bugs and just plain weirdness, I was able to get SteamAnywhere to work the same in all of the major browsers. There are a few graphical features like subtle shadows and rounded edges in better browsers, but the functionality is all there even in IE.

Its a shame that IE has a significant market share, but luckily the it’s losing out to Firefox, and chrome is picking up speed to.

This means that phase 1 of SteamAnywhere is launched. I now need to finish up the client and the android app, both of which are almost complete. Then I can start actually advertising SteamAnywhere and someone might actually read these posts :D

Nov 19 2010
SteamAnywhere – Progress Update

Now that I’ve mostly finished the blog design and layout (I still want to work on the sidebar a little bit though), I decided to work on SteamAnywhere, my web based solution to talking you your Steam friends anywhere in the world, without having steam installed on your device.

The project comes out of beta when I’ve completed the following:

  • Website - Will allow any internet-enabled device access to SteamAnywhere. It will be designed and optimized for a larger screen.
  • App - Currently I only have plans for an Android App, but if there is enough demand I will consider developing an iPhone app, though I don’t have a Mac to develop on.
  • SMS (Text) – Get SMS messages forward to your mobile device from your Steam friends. You can also send messages to other users, get a list of your friends, add friends and more basic functionality.

I’ll likely be working on the components in that order, and the website is almost complete. You can apply for beta participation here.

The site definitely works best in Google Chrome at the moment, and fairly well in Firefox as well. Internet Explorer is of course problematic, but I won’t move on to the other components until I have support for all major browsers.

Check back soon for more updates!

Nov 16 2010
Hard Drive Woes

I’ve been using Windows XP for years now without problems, but lately my computer has been running much slower than usual. Loading directories, transferring files and watching video files became very laggy and slow. It’s been almost 2 years since I reformatted my computer (I usually do it every 8 months or so), so I decided to upgrade to Windows 7 Professional (Free thanks to MSDNAA).

For about 2 days I was running without a problem, super fast like it always was. Today my computer shut down suddenly. I restarted it and got the dreaded BSOD. My first thoughts were great, Windows 7 seems to be super stable </sarcasm>. I’m still trying to solve the problem but I got to thinking, is it possible that my hard drive is dieing? It would explain why it was so slow before, and why I’m still having problems even after a reinstall.

On the other hand, it could be a driver update that I need, but I can’t even boot into Safe Mode to update them.

Does this seem consistent with hard drive problems, or is this likely just a driver issue?

Nov 14 2010
Need another test post for making my CSS for the Blog

So I was playing iSketch.net with a friend. He draw this. Pretty Awesome.

New Blog on my new Site

Testing out posting some stuff on  my new blog.

Back to WordPress again, but this time on my own domain where I have more control. I found *.wordpress.com to be limited so I tried tumblr, which really seems more focused on microblogging and fights with you whenever you try to do anything serious. The lack of built-in comment support is a huge problem they need to fix if they want people to take them seriously. For now they seem like little more than MySpace 2.0.

Hope you enjoy my new blog :)

Mar 9 2010
XNA 4.0 Annouced! – Details/Features

Today the XNA Framework 4.0 has been announced, with a bunch of juicy details and hints.

The press release on the creators club website has some details, but is somewhat misleading. Many people (myself included) took their wording to mean xna 4.0 was exclusively for Windows Phone 7. Though this has been cleared up by Shawn Hargreaves. (They might want to update the press release, its very misleading)

The feature list we know of so far (from Shawn Hargreaves):

  • New platform
    • Windows Phone 7 Series
  • New features
    • Integrates with Visual Studio 2010
    • Dynamic audio output
    • Microphone input
    • BasicEffect has four new siblings
      • SkinnedEffect
      • EnvironmentMapEffect
      • DualTextureEffect
      • AlphaTestEffect
  • Improved portability and usability
    • Collapsed graphics caps into just two profile levels: Reach and HiDef
    • Many graphics API improvements
    • This involves some breaking API changes
    • Split Microsoft.Xna.Framework.dll into several assemblies, to make it more obvious which pieces are available on each platform

These are some pretty cool features! WP7 support is cool too, but I’m still a little skeptical about how successful its going to be, and if I’ll even want to get one. We’ll have to wait and see.

The Dynamic Audio support does include access to the sound buffers themselves, which is something I’ve been wanting since the beginning of the xna framework. The microphone support is for all platforms which is really, really cool!

Within the next few weeks more information should be released, and more importantly the press release says we might not have to wait very long for the update (“Sometime within the next month”). Though that’s not specific whether its a beta or the actual update. I’ll keep posting new stuff as it comes in, so stay tuned!