Chris Gomez

Development topics for the indie programmer

Philly.NET - The New Web: Stateful, Realtime, Programmable

Thanks to everyone who came to see my talk about the tools we have to make the web realtime, stateful, and programmable.

Slides download - The New Web Slides

Code download - TheNewWeb.zip

This download includes the NuGet packages (I didn't enable NuGet package restore).  You should be able to open the GameServer in VS2012 and start it before opening and starting the MapClient.

Remember that you'll want the latest Firefox or Chrome or Internet Explorer 9/10. 

And a live demonstration of the code is online at http://spaceshot.net.  Open two browsers and move tokens around right now!

CMAP Fall 2012 Code Camp - The Stateful, Realtime Web

Thanks to everyone who attended my talk about the Stateful and Realtime web.  It's a little bit more than "another SignalR" talk, as I am focusing on building a game state server that your web client connects to so players can see updates in real time.

Code and Slides

Presentation Slides (PowerPoint 911KB)

Code (2.0MB)

Notes on the code download: My goal was that you could download this, run the GameStateServer and let it start, then run the MapClient and you would be up and running.  The solutions are VS 2012 solutions with my source control bindings removed.  The NuGet packages are not in here so NuGet Package Restore should pick them up for you on your build attempt.  IISExpress should launch for MapClient.

 

Here are links to many things we discussed in the talk:

Single Page Application Layout

Steve Sanderson's Blog - I liked how this looked and worked and for someone new to hardcore CSS, I understood what it was doing to divide and subdivide "rows" and "columns"

HTML5 canvas "engines" or "toolkits"

EaselJS - part of CreateJS. Designed to implement a "game loop" and ease your using a raw canvas

KineticJS - HTML5 Canvas framework

ImpactJS - Focused on game development using canvas. They support iOS and Win8 JS too.

Realtime Web Frameworks

SignalR - Of interest to the ASP.NET developer because it is about to be officially part of ASP.NET. Open source and supported.

node.js - Javascript runtime with massive community support (via Node Package Manager). Should be able to use socket.io and nowjs packages to do what SignalR does.

Javascript Engines

Noesis Javascript.NET - Exposes the Google V8 engine via .NET. Does require MS VC++ runtime. Fast and thorough. Simple to use.

Jurassic - A .NET implementation of ECMAScript. Not as fast. Also not as simple to use, but isn't wrapping a C++ implementation, either.

Jint - Javascript Interpreter for .NET.  I got this implemented, but it would not run the basic script you see in my "immediate window". I gave up trying to figure out why.  YMMV.

Hosting languages in .NET

Dynamic Languages 101 - Ted Neward discusses hosting several dynamic languages like Lua, Scheme, Prolog.

Hosting C# using Roslyn - Compiler as a service is coming.  Maybe you'd like to just keep writing C# or VB?

Store passwords the right way in ASP.NET

Code Download: Hash Winforms project (10 kb)

The web attacks against sites like Gawker, the Sony Playstation Network, various Sony sites, and even the FBI-affiliated Infragard made some big headlines.  Just this month, Anonymous has released passwords of BART officers online.

My frustration with these attacks was how quickly the attackers were able to post credentials online of the users.  This should have taken much longer and quite possibly been impossible to accomplish, even with stolen data.

Your users, whether they should be or not, might be using the same user name and password on several key sites like Facebook, Twitter, their bank (checking or credit card), or a government site.  Maybe your state’s DMV is creating user accounts now and someone could request a new ID card using the name and password reused on a simple blog.

Defense In Depth

This post and the follow-ups do not claim to be the end-all last word on web site security.  It is merely the beginning.  I am going to take a small piece of this larger world and explore it with you.  Do not think this is the end of the story.  You should be defending your servers, your databases, and your code using all means appropriate for your needs.

Today’s Example and Assumptions

So for purposes of today’s story, we are going to assume the database with all of your user’s login credentials (username and password) has been copied and stolen.  I’m going to use this as an assumption because, just in the last year, we’re seeing passwords recovered again and again so the raw data is being stolen.

The thief is now staring at your database in, let’s say, SQL Server Management Studio.  Do you want the thief to see this?

plaintext database

More...

Philly.Net Users Group – Code and Slides

I spoke at the Philly.Net User Group in June and I want to thank the group for hosting me and for the enthusiasm from the folks who came to see how to build games using XNA.

I had some problems with my web server and provider so I’ve had to do some rebuilding here at my blog.  But here is where you can find the code and slides for the game we made during the meeting.

Code and Slides on SkyDrive

Public Github Repository

We now know that XNA will be one of the supported development frameworks for Windows Phone 8.  It won’t just be that old Windows Phone 7 SDK games will be supported. The new SDK will have XNA games as a supported project type.

Bouncing on a Trampoline

I often get hung up on explaining how I make my clown “bounce” on a trampoline in the Circus game that I use in my XNA presentations.  I know I introduce some basic trigonometry that we’ve all long since forgotten.  Considering my lack of engineering degree and poor grades in trig, I always assumed that everyone else in the room would just get it and I could easily move on.

I’ve not always found that to be the case, however.  It turns out, what I am doing seems a little magical to some people and the whole point of my talks is to make game development easy to understand and take the mystery out of it.

So let’s look at how we make a clown a bounce on a trampoline.

More...

Start With the Game State Management Sample

Most presentations on XNA, including my own, start at File > New Project.  There are tons of great ones around the web.  Right now I would suggest Bill Reiss’ Intro to XNA tutorial, which is on Part 5 as I write this post.

The tutorial may seem focused on Windows Phone, but the technique of drawing a sprite, handling input, and playing sounds are key to all games, so it’s a good start and I’ll try to continue filling in the gaps for the questions I am hearing at my presentations.

If you have tried looking at my Circus sample that I use in my XNA talks, you’ll see I started with File > New Project, but this isn’t REALLY how you will want to structure your game.  Use this wizard when you are getting started with XNA and just playing around.  But when you decide you want to start looking at something with more features of a full game, start with the Game State Management Sample.

The Game State Management Sample drops you off at essentially the same place, with a game loop and a CornflowerBlue game screen that you simply start adding your code to, but it has all the basic structure of a game that you’ll want to at least consider when you’re thinking of publishing.

More...