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.
Emergency downtime
Thursday, August 23, 2012
Our website was down for an hour due to emergency maintenance. Everything is back up and running now. If you tried to purchase something during that hour and it failed to deliver, please contact me in-world.
New Follow Me v2.2
Tuesday, July 31, 2012
I've released a new version of my Follow Me HUD. It's free to all current owners.
For those who haven't seen it, Follow Me lets you teleport around the grid with your friends. Simply have everyone wear the HUD, and when one person teleports, the others will teleport with them. You don't have to send everyone a TP, it's all automatic.
It used to work by sending everyone a TP link which they could click in their chat history. It still does that, but now you can enable Auto Teleport mode, which uses the just-released TeleportAgent capability to teleport you automatically! No clicks or map popups needed.
There are a couple of caveats. It doesn't yet work with all third-party viewers. And some regions are are different "channels" (eg, Magnum) which don't yet have a working copy of the llTeleportAgent command. But I'm sure all the third-party viewers will soon release updates to take advantage of this capability, and the sims will soon have current software.
So give it a try, and let me know if you can think of any improvements.
New En Garde v1.16
Saturday, July 21, 2012
I've released version 1.16 of En Garde. This is mainly a bug-fix release. All owners are invited to upgrade free of charge.
You can upgrade by deleting your current game, and delivering a new updated copy to yourself, which you can then rez. To get a new copy, you can either
- Use your En Garde Remote. Wear the Remote and say "/8 deliver game"
- Visit my in-world store, and touch the En Garde vendor
- Visit the Customer section of the Procyon Games website, find your En Garde license, and click the Redeliver link
This game comes with a new version of the game HUD. Your players must use the new HUD when playing on the new game (it won't let you play with an old HUD). Everyone can get a copy of the new HUD by clicking on the game and then the Get HUD button.
Release Notes:
- Fixed a bug that allowed the HUD and main game to get out of sync, resulting in "Invalid card played" errors.
- Fixed a bug that would not allow payment to be enabled for some Commercial licenses
- The game no longer says "times's up" when the deck runs out at the end of a point.
- The HUD no longer offers a player the option to Parry an Advance-Lunge, if the player doesn't have any of the appropriate cards
- When doing a Last Second Attack, the appropriate cards are hilited in orange.
- The game gives players a link to click in chat, to see their ranking on the Procyon website