Game Design Philosophy: James Paige

My name is James Paige, and I make games. I also make tools for making games, and occasionally I dabble in making tools for making tools for making games.

I started making games because I love to play them, although now I feel like I am making games simply because I love to make them. Making a game is a lot like any other creative en devour, like painting or sculpting or writing, but instead of the more traditional mediums of 2d space, 3d space, or narrative; game making works in the medium of interaction.

Ideas come to me fairly randomly, and I pursue them fairly randomly. I work on whatever I am currently feeling most motivated to work on. Motivation is a big deal. If I can't get motivated, it doesn't matter how skilled I might be at writing, pixel-art, or programming. Being motivated is the engine that makes all the rest of my creativity run.

The weakness of my design philosophy is that I am not terribly good at finishing projects. But I am darn good at starting them. That used to bother me a lot, but it doesn't really bother me much anymore. I would rather have a heap of unfinished projects and have fun, than to focus on finishing one thing and let it turn into a chore. As long as I am always working on something it doesn't matter what I am working on. To me, the biggest most dangerous threat to creativity is when I think "I can't start anything new! I have to finish all my old stuff first!" That invariably leads me to doing nothing at all. (or at best to working on the "old stuff" no faster than I would have if I was working on the "new stuff" too simultaneously)

This hedonistic design strategy of working on whatever project most pleases me at the moment has worked surprisingly well for me. Crypt of Baconthulhu, Don't Eat Soap, Stegavorto, Customer Service Robot, Bell of Chaos, and Untitled Bob the Hamster Sidescroller are all projects that I never would have even started if I had adhered to my old urges to stick to one thing (Wandering Hamster) and finish it to the exclusion of all others. In fact, I think the progress I have made on Wandering Hamster owes at least partly to the motivation-boost I gained from working on those other projects.

To illustrate my design philosophy, I am going to make a whole new game, just for this article. I have an idea that has been rolling around in my head. My ideas come from various sources of inspiration. For example, Bell of Chaos started with a picture I drew. Originally it was just a drawing, but eventually it grew into a game idea.

Often my ideas are inspired by other games. Recently I have been playing a lot of Words-With-Friends. It is basically the same as Lexulous, which in turn is based on a that letter-tile board-game from large litigious board-game maker who will remain nameless. My desire to make a letter-tile game in the OHRRPGCE stems from a few things that bug me about existing incarnations of the game. One is the big emphasis on double-letter, triple-letter, double-word, and triple-word score boxes. A short word on a special box is worth more than a long fancy word without any special boxes. The second is that the edges of the board quickly cramp the length of words. The third thing is that the game gets a lot less fun when there are only a few letter tiles left.

The other night I was dreaming about a letter-tile game. I do dream about game ideas from time to time. (The entirely of Stegavorto came to me in a dream). I dreamed restlessly about an infinite grid, and an infinite supply of tiles. I dreamed about how to handle a dictionary of valid words within the limitations of OHR plotscripting. And when I work up, I continued to think about it (much more coherently than I had while alseep)

My starting point for this game is to make an RPG file, and a simple script that puts letter tiles on the screen and lets me move them with the mouse. I don't have a super-precise idea of how the finished thing will look, just a general idea of the feel I am going for, so this will be a step-by-step process of experimentation. Over the next few weeks as I work on this article I will expand the game bit-by-bit.

I'm pretty happy so far. Picking up the tiles and dropping them with the mouse works nicely, and was a bit easier to program than I expected. Next to add a tray for holding not-yet-played tiles. The game board is panable with the mouse, but the tile tray should remain static.

I added a tile tray, and I also added code that stops tiles from stacking up on each other. This causes two unexpected fun side effects. One is that if I overfill the tray, the tiles jiggle and jostle around. Second is that if I create a whole bunch of tiles on the game board, they zig zag around trying to find an empty tile. This inspires a whole new game idea, where letter tiles compete in a game-of-life (a-la "Conways") to try and spell out English words. It would be like a self-playing game of words-with-friends, or perhaps it would be an automated crossword-puzzle generator. But that idea is one that I will pursue another day. I am still sufficiently excited about the original idea that I am able to stay on track (for now).

Next is an important part. How do I store a dictionary of words in the OHRRPGCE? Fortunately my dream already answered that one for me. I am going to load them into text boxes using the text box import format. The word list I am going to try is Ubuntu Linux's /usr/share/dict/american-english-large which comes from Kevin Atkinson's SCOWL (Spell Checker Oriented World List). He gives permission for anybody to use the list, but I want to make sure to credit him in the README.txt (and the in-game credits, if I ever happen to make any)

There can be 32767 text boxes, and each one can have 8 lines. If I store the word list one line per text box, that means I have room for 262136 words, and american-english-large is smaller than that, so it should work.

First I have to refresh my memory on what the text box export/import format looks like...

Box 2
Size: auto
Position: 0
Text Color: 0
Border Color: 0
Backdrop: 0
Music: 0 (None)
Restore Music: NO
Sound Effect: 0 (None)
Stop Sound After Box: NO
Show Box: YES
Translucent: NO
Good day, stranger. I am a traveler.
I wander from place to place for
no good reason.
In my travels, I have found that the
best way to avoid enemies is to stick
to the roads.

But of course all I care about are the lines of text, so I can reduce it to

Box 2

Now I have to write a simple python script that reads the american-english-large file and outputs it in text box import format. My secret confession is that I love writing python scripts. Python is such a fun language that I enjoy it even if I am not writing a game.

That gives me 18804 text boxes. But wait! Isn't it going to be way too slow to search 18804 text boxes every single time you drop a tile on the board? Yes, that will be much too slow. A quick test shows that it takes 25.4 seconds to run through all those text boxes with the "string from textbox" command. So is my idea dead in the water? Nope! My dream answered this one too (and I probably could have figured it out awake if I thought about it long enough).

Since I can sort my wordlist in alphabetical order, I can do a binary search. I keep dividing my search area in half, and I can narrow down my search alphabetically, finding the word in no more than a couple dozen string compares, rather than 18 thousand.

After implementing the binary search to detect a word, I had to figure out how to get the word from the current tile placement. Given a starting tile, I can count tiles left (or up) until I find an empty space, and then count back to the right (or down) appending the letters to a string. Then I search for the word in the word list, and if it is there, I loop through the word's tiles again and change its color. When I do this for every tile, it goes a bit too slow, so I use the slice extra data to track whether a tile had already been checked, so it could be skipped. That way each tile only needs to be checked twice, once vertically and once horizontally. It is still actually a bit slow, but then I realized that for actual gameplay, the word-checking only has to happen after you confirm your turn, not after every single tile move, so it is okay.

Now that I can arrange the tiles and see the words, I notice that there are way too many 2-letter abbreviations in the list, so I update my python script to filter them, and re-do the import of the word list. I also update my random letter tile creating code to produce tiles at a frequency that matches how common they are in the word list (with the help of another python script)

It also occurs to me that I need to update the word-detection code to only accept a tile as being part of a word if the word is valid both horizontally and vertically (I currently have it horizontally OR vertically). This means that a lot of the code I just wrote to detect words has to be changed. That sort of thing happens a lot when I program, which is part of why I try to break my code up into a lots of small simple scripts. When code is broken into small scripts (small functions) it is a lot easier to change and rearrange than when it is written all in one script with big complex if/then/else clauses.

Now word detection works the way it should, so next I want to make separate players who can take turns placing tiles. Each can have their own tray of tiles, but only the currently active one will be visible.

Now it is possible to take turns, but you can still rearrange the words placed by the previous players, so I have to introduce another bit to mark frozen tiles. Also of course I have to make it so you can't end your turn unless all the words you played are actually valid. Then I have to figure out scoring. I want a scoring system that heavily rewards long words. The scoring scheme I have in mind is this. Each letter will have a point value. Common letters will have low values and rare letters will have high values. When you complete a word, the letters that you played will be added up. You get no points for letters played in previous turns. Then the total is multiplied by 0.5 times the word length - 1. That means that 2-letter words are worth half the face value of the tiles. 3-letter words are worth the full face value. 4 letter words are worth 1.5 times the face value 5 letter words are worth double the face value, and so-on. A twelve letter word like "ZOROASTRIANS" would have its score multiplied by six. Letters played in previous rounds would count towards the word-length-multiplier. I already have code that checks for words, and I don't want to re-write it for scoring, so I am going to add an optional scoring mode to the existing word checking code.

Next I want sound effects, to make the slicking crunchy and satisfying, and after spending about an hour reading documentation about how to compose tracker music, I gave up in disgust and decided to just use some music for the stock OHRRPGCE collection of free MIDI. I also want more polish on the turn transitions. Maybe a meter showing your score counting up, and a confirmation for whether or not you really want to end your turn.

And next I need to make it actually possible to win. I have this idea that when somebody wins it will say something like "Blue Player Wins!" and there will be all these random words whoosing by in the background. I am pretty sure that the whooshing can be handled easily, but I am not sure how fast I can look up random words from the dictionary without creating slowdown.

But at this point I get a little bored with all this, and I go and fix some bugs in Bell of Chaos instead.

But am I going to be able to finish the ending screen before the month ends and I need to wrap up this article? It would be almost inconceivable! I guess I will call it done enough!...

Actually, although I value doing what seems most fund as a way to motivate myself, there are times when it is important to buckle down and finish project. This is such a situation, so I scrape together a few more hours, and make a victory screen. Yay! NOW it is finished.

[Download VocabMosaic]