En Garde Team rankings are back

Tuesday, December 10, 2013

I fixed the glitch that prevented the team rankings page from showing. You can see your team rankings now

New Danger Zone v1.08

Sunday, December 8, 2013

Danger Zone is the very first game I ever made in Second Life. Linden Lab used to have an annual games contest, and I entered Danger Zone in the last such contest they had, way back in 2008 I believe. It was one of the winning games, and it launched my career as a games designer in Second Life.

The code is old and creaky, and if I were to do it again there's a lot of things I'd do differently. One of the biggest problems is that I went overboard with the prims. It rezzes prims during the game, and with a full eight players you could see 4 or 500 prims in use. Yikes.

But people do still play it, and one thing I was able to fix was some spammy messages it sends to the game owner, even when it's not in use. So there's a new version you can grab, if you currently have a copy.

And if you don't have a copy, I've listed it on the Marketplace.

Randomness and Games

Monday, October 14, 2013

I like having a little bit of randomness in my games. I view luck as the lubricant of game play. You need just enough to keep a game from getting stale, but not so much that it falls apart.

En Garde is, at its heart, a card game. Before each round, the cards are shuffled and dealt to each player. Whenever a new card is drawn, it comes from the top of the "deck."

That shuffling is as random as I could make it. I'm at the mercy of the LSL scripting language. In particular, I make a call to llListRandomize() to do the shuffle. I hope that that particular API call is truly random. It's not hard to make a good shuffle routine, but then again, it's not hard to screw it up, either. One of my favorite stories is about an online Poker site which screwed up their random shuffle routine, and when some players figured it out, they were able to predict who had what cards and make a bunch of money off the exploit.

I can tell you, though, that there is no intentional bias in any of the card shuffling. There is nothing in the code that gives an advantage to Player 1 or Player 2 (other than the fact that Player 1 has a very slight advantage because he plays first in the first round). So if you think that one side or the other is getting good cards all the time, it's just your mind finding patterns in the random numbers that aren't really there.

Sometimes you get a good hand, and sometimes you don't. The skill in the game comes from making the best of when you have a bad hand.

Back to Normal

Sunday, January 13, 2013

I think I have all the bugs fixed.

For anyone who's wondering, this was all caused by a forced upgrade. I don't upgrade the site often, so it's usually running on older versions of the software. But there was a big scary exploit that had been published, so I was forced to upgrade to Rails 2.3.15.

With that upgrade came a bunch of other changes, and it introduced some incompatibilities in pre-existing code. The last one involved the player game history. Probably none of the Second Life players care about this (except that it's been fixed), but I'll document it here for the benefit of any Rails coders confused as to why their named scopes are no longer working.

To generate the player history, I have a named scope which looks something like this:

named_scope :played_by, lambda { |*avs| { 
      :select => "games.*", 
      :joins => [:plays => [:avatar] ], 
      :conditions => {:plays => { :avatars => {:id => avs} } }

So I could pull up games played by two player like Games.played_by(mark, john). And that worked fine under Rails 2.3.5. But when I updated to Rails 2.3.15, the same code was giving me ActiveRecord::StatementInvalid.

I didn't get an error message more explicit than that, though. So I had to browse through the Rails code to find out more. It looks like sometime between 2.3.5 and 2.3.15 they changed sanitize_sql_hash so that it no longer accepts nested hases. I don't know why they changed that; it was working fine before. But I had to change my named scope to flatten out the nested hash, like this:

named_scope :played_by, lambda { |*avs| { 
      :select => "games.*", 
      :joins => [:plays => [:avatar] ], 
      :conditions => ["avatars.id in (?)", avs] }

And now it works again.

Customer page

Saturday, January 12, 2013

It looks like something on the customer page didn't survive the upgrade. I'm looking into it -- please be patient, it's just me and I don't have a lot of time to fix things like this.

EDIT: 7:23PM SLT The Customer page is mostly back up. If you get an error when trying to connect, clear your cookies (or just your procyon games cookie). The versus listing is still not working -- you can't get a list of all games you've played against someone recently. Hope to have that working tomorrow.

Server issues

Thursday, January 10, 2013

I attempted to upgrade the server this morning, but something went wrong and I can't roll it back. I'm working on getting it back up, until then all server-related functionality is down. No ETA yet on when it will be working again, sorry.

EDIT: I think it's back up now. If you notice problems let me know.