Monday, December 29, 2008

Board game simulator

To create a board game from stratch there seems to be several basic steps.

1) Idea!
2) Create board, "borrow" pieces from other games, and design the rules.
3) Play test
4) Goto Step 2, tweaking to make the game better.

Play testing involves playing your game over and over looking for issues. A user on bgdf.com wrote up a quick summary of how to play test. Many of the things listed are things you can only do in person, but something I have been pondering is how you often here the hundreds of times designers have played games. One game I got for christmas Agracola someone said the designer played it more then 500 times before the first production run. Part of the reason a designer play tests is to make the game as good as possible and to find the flaws. Even simple things like the first player can always win could take several games to discover. As different strategies are noticed it would be nice to be able to quickly apply them in a computer in hundreds of runs of the game to see if the game has a flaw and how tweaking rules would help or hinder. Rather then spending two hours playing a game with a fundamental flaw it would be nice to be able to discover that automatically and use the two hours to play good versions of the game. This would hopefully reduce the total number of play tests.

There are a few board game software programs on the internet, but they seem to be leaning to helping you visually see a board game on a computer, or setting up some website where users can play a board type game on the web (such as a quick and dirty flash movie tie in game).

So the idea would be to create a simulator (doesn't even need graphics) where after creating a game and inputing different strategies you can have the computer run the game many times over. Every game would be fully recorded so they could easily be compared. With the computer playing thousands of versions of the game it should help to discover flaws that make the game unbalanced (and thus unfun). It should help spot that a player who does action X ends up always winning/loosing a game. Or even something as simple as the first player always wins. Try tweaking rules and re-running the simulations to see what changes. Or graphing parts of the game such as victory points to notice that the game is mostly over half way through and last few rounds don't matter. All this information would be to help guide and maximize the time consuming real world play testing.

The simulator could not say if a game is "fun", but it could help to discover that the player who doesn't buy "item X" before round 4 will never win the game and even worse will be so far behind that at they will go bankrupt/loose/starve only half way through the game. Then one could tweak the rules so everyone can get a chance to buy item X before round 4 even if there are 5 players.

Of equal, but different value would an online version of this that people can play test the game. All games are completely logged. There will be way less games played, but you can see how often they reference the rules, how long they wait between turns and notice new strategies that are taken. The logged information can be inputted back into the system to more accurately determine play times, statistics and even base simulated game play upon what real players do such as with Bayesian filtering.

Disclaimer: I have never designed a board game nor done much research into this hobby. I have only thought about it from time to time as it seems like something fun to do and having a tool like this would be helpful. If you design board games please feel free to point out why this ideal is silly (or might even be useful) in the comments.

Saturday, October 18, 2008

lossy javascript compressor targeting gzip

There is a website that compares various popular JavaScript compression utilities. The goal is to reduce bandwidth. Looking at the results though you see that just turning on gzip compression will give you the biggest win for your effort and reduces the size of the data that is sent to ~40-20% and beyond that the best compressors seem to only half that getting down to ~15-7%. So it should be a given that you will turn on gzip compression on the server. Looking through the compressors that compress variable names you see variable names such as a,b,c,d,e etc. What if you used a, aa, aaa, aaaa, etc? Because the goal is to produce lossy compression why not tune the javascript compressor to not return a file that is small, but to return a file that can be highly compressed by the algorithms used by gzip? Some ideas to re-write the code so the same behavior occurs include:
- Use a, aa, aaa, or maybe thisthis, thisthisthis or limit yourself to the most common letters used f, o, r, e, t, n, etc Need to test out what would work best.
- Always adding an else statement so the pattern }else{ would always appear
- Making sure spacing is consistent (I think most do this already)
- all if statements use {}
- There is always a ; before a } I noticed that some of the compressors removed the ; after a return because you technically don't need it, but that makes two types of } blocks, those with a ; and those without.

Update: ticket filed on the YUI compressor http://yuilibrary.com/projects/yuicompressor/ticket/2527980

Saturday, June 7, 2008

book vending machine

Book vending machine in a hospital. nuff said

Thursday, May 29, 2008

Side Scrolling Game Tools

Construct a suite of applications that provides the means to easily create fun side scrolling games. The point of this project should not be to create a side scrolling game, but to enable other people to be able to build them. I have seen various level editors for side scrollers, but they are always very limited and very tailored to the game they were built for.

The biggest part of this is the level editor. Way beyond a grid editor the level editor will provide an experience similar to many iLife applications. Simple, easy to use and helps you rapidly create whatever you want without bogging you down with details.


  • Level wizard: Rather then starting with a blank level a wizard should help you out by generating a world for you from a set of presets. On the ground, underground, in the sky, in water, short, long, easy, hard a good set of defaults should get you started.


  • Drop play: When building a level you want to try it out to see how it works. You should be able to just right click and drop in the player right there in the level and start playing, hitting a key to exit at any time. The level should be running the engine and there should be absolutely no lag between modifying a level and being able to try it out. Most level editors out there I saw seem to require you to compile the level, start the game, goto the level and play all the way through it just to see how it plays. That feedback loop is horrible! The faster the loop is the more that designers will try out new things and the faster they can tweak the level to make it more fun.


  • play paths: The game should record every time that a user plays a level. The level editor should then be able to play these games back and load the path of the character in the level editor to be able to quickly spot problems such as places where people never go, guns, ammo and bonuses that are missed and more. The level play of users can be obtained by them submitting them for high score. Play paths of users (not the designer who played it 50 times) is very important. With user reports you can even find the level that half of your players can't get past and stop playing the game because.


  • Molding: Rather then having to place each and every square on the grid you should be able to grab objects and resize them. If the pipe sticking out of your mario level isn't tall enough just select it and pull it to make it taller. The editor should automatically figure out what to do. But it doesn't just have to work on a rectangle. Another mode would let you grab any surface such as the ground and let you pull up on it to create a little hill. The editor would automatically move up the ground and on either side add diagonal parts. Having a fluid way for level designers to easily create levels should allow designers to make richer and less rectangular levels in less time then the old way of placing each tile.


  • More then tiles: Going with the idea of molding there should be an easy way to paint titles. Rather then having to place each tile for a pipe on the level there should be pre-constructed objects made up of tiles that can be dropped on the level. For the set of tiles that make up a ledge it would ideal if you could just select the set and start drawing in the level and the editor would automatically use the correct tiles from the set for the different sections. Pretty much the editor should facilitate getting ideas down as quickly and easily as possible. Want to move a big chunk of the world higher up? Want to add a ledge, pipe or hill? The editor should provide the means to easily and quickly do the most common operations.


  • Tile sets and themes: You would think that this would be a fundamental feature of level editors and engines, but it seems like a lot of primitive ones don't have it. Changing themes should be as simple as clicking a drop down editor to switch your level from the day tile set to the night set.


  • Misc: The editor of course should let you zoom in/out on the fly, let you script objects, have multiple layers, spawn and respawn points, exits, let you place bad guys, ammo, guns and any object in the game.


  • Warnings: Have a tool that can run through the level and detect many simple errors such as edges that can't be reached, to many enemies with to little ammo and many other things. An AI could play through the level and find hotspots that might be unfun for players such as jumps that are missed too often.



Various other tools that would be built include:
- Story editor, make it _very_ easy for users to add story to their game such as cut scenes between levels.
- Tile theme editor.
- Animation editor.
- Character generator: similar to the mii generator let users easily create something unique and not part of the stock set of characters included.
- world editor: similar to mario 3 and many other games, the place that connects all of the levels.
- export: simple one click to create packages that can be distributed to your friends or online.

More then a tile editor these tools should all attempt to provide a means to easily create a fun side scrolling game and provide feedback when a game is not fun. Given such a tool it should let you rapidly create side scrolling game with a very small team. With production costs so cheap the games could be sold for very cheap or even given away to promote things like new movies.

Update:
A Mario style level generator using markov chain http://github.com/mackstann/markovio/tree/master