Archive for the 'Uncategorized' Category

BECOME A GREAT ARTIST IN JUST 10 SECONDS, updates

Saturday, February 28th, 2015

Back in 2013, I made a game called BECOME A GREAT ARTIST IN JUST 10 SECONDS with Michael Brough for Ludum Dare 48. It is fun! You should play it.

In the time since, ARTIST has been featured at Indiecade 2014 as an official selection– here it is being demoed at the Night Games event–

Following which, ARTIST was selected as a finalist at the 2015 IGF festival. If you make it to the IGF festival this week, I’ll be out there demoing ARTIST on the expo floor, and Gamasutra has an interview with me and Michael about it.

One last thing. GREAT ARTIST was demoed twice at the Gamecity event in Britain, both times with custom controllers– once a special trackball version made by Niall Moody:

And once on an honest to goodness arcade cabinet, using a special two-player version of the game:


Image mirrored from rockpapershotgun.com

The two player version was only up for about six hours, but somehow in that time Rock Paper Shotgun managed to play it.

— — — —

If you’d like to try any of the things mentioned in this post out:

  1. Download the original version here
  2. Download the “expo” version here. This is the version shown at Indiecade and the IGF pavilion, it runs full screen and if left untouched for more than 20 seconds enters a “slideshow” mode cycling through artwork by Liz Ryerson.
  3. Download the two-player “arcade” version here, in case you have access to something like a cabinet– this one has special controls, which are explained in the readme.

GREAT ARTIST is open source, and all three of these versions can be found on the BitBucket page.

Open source index, Indiecade

Monday, October 6th, 2014

Hi hi. Two small blog-relevant updates.

  1. It got frustrating to me how hard it is to get around the list of projects on my BitBucket page, so I made a sorted index of all my open source code. The list is hosted on BitBucket and includes all my game projects, including a number I’ve never released.
  2. The game BECOME A GREAT ARTIST IN JUST 10 SECONDS I made with Michael Brough is an Official Selection at Indiecade 2014. The game will be demoed at Indiecade’s Night Games event this Saturday, with this customized keyboard made by Rachel Yonamine:

    GREAT ARTIST keyboard

    Here’s our Indiecade trailer:

Double Union Game Jam recap

Sunday, February 23rd, 2014

Yesterday I cohosted with a woman named Snail a game jam at Double Union, a feminist hacker space in San Francisco. The game jam was targeted at women and gender-nonbinary people and the goal was to reach out to people who might not be participating in SF’s existing indie/gamejam culture. We opened with a class on Twine I taught (my class notes are here)and then ran for about four hours before showing what we’d made. It seemed to go really well! We got about 12 people plus the normal Double Union Saturday crowd, and every single person who stayed to participate wound up making a game.

Here’s some of the games we made– all of them can be played in a browser:

Gina made A Grim Task, a really intense short story about volunteering at a nonprofit.

Haley made “LET ME TELL YOU ABOUT LIL B THE BASED GOD”. The name describes it pretty well.

Wonja made two games:
Lizard Quest, an INCREDIBLY AMAZING adventure game.
Hallway, a, uh… experimental experience.

Kanane made The Huntress, an impressively polished fantasy story.

I actually made a couple small things!:
San Francisco Quest, which I actually made during the Twine class at the beginning as a demonstration of how to use Twine. It’s very very short, probably the smallest a game could legally be without getting into trouble with the Game Police.
I then *tried* to make a Pacman clone, but it took me a really long time to fix some bugs where I couldn’t get anything at all to draw (it turns out C++/OpenGL is a really bad choice for a four-hour jam). By the time I got that fixed, I was out of time, so I couldn’t add anything like interactivity. So I decided the result was Social Anxiety Pac Man, a game where all you can do is stand in a maze immobilized by your choices. (The link goes to an image, not the game. Trust me, it’s the same experience.)

Snail, my cohost, made Another City, a really funny hallucinatory story that to me feels reminiscent of San Francisco Quest only better. She says this link is a “demo” she’ll finish later, some of the paths don’t complete.

Seanna made How To Be Successful. This one is actually really cool, it’s a Twine game consisting of nothing except pictures.

Alicia made the one non-Twine game of the jam, Make the kitties happy!. This one is totally adorable, you have some cats and you have to make them all happy at the same time by giving them what they want. Hint: You can change the tool selected (at the top) by clicking on it. (You may have to run this in Firefox.)

Jenn made Lady Bird and Tiger Bear, a short fairy tale.

And our two last participants, Tyler and Hannah, made complex Twine stories about, respectively, memories you can hold in your hand and a epic struggle to make yourself a sandwich. These haven’t been posted on the Internet yet but I played the sandwich one and it was really good.

Overall I’m really happy with how the jam turned out. We talked at the end and we are planning to do this again at minimum and hopefully expand this into a larger recurring women+nonbinary game making group. There seemed to have been more people who were interested in participating but couldn’t because of the limited space at DU, so we want to give them a chance to do that next time. Our current plan now that the jam is out of the way is to start doing a monthly Twine writer’s group at Double Union, and in a couple months do another game-making-class+gamejam like the one yesterday. Next time we’ll be teaching Stencyl. We should have more details soon, so keep an eye out!

A Game of the Year 2013 Poll: Results

Tuesday, January 14th, 2014

CLICK HERE TO JUMP TO THE PRETTY COLOR-CODED FULL RESULTS

This explanation will look a lot like that of previous years, but:

Every year since 2004 I’ve been hosting this Game of the Year poll for the users of some forums I read. There are a lot of GOTY polls out there, but this one I think is kind of special. Most polls, you’re given a list of four or five options and you’re asked to pick the one you liked best. This poll, people are given a list of a couple of hundred options, consisting of every new game released in the previous year– and asked to rate their top ten or twenty.

This does a few interesting things. First off, we get to see all the information about what people’s second, third etc choices are. Second off, because the second, third etc choices count, people are more likely to vote for the game they want to win, rather than the game they think is likely to win– they’re less likely to engage in “strategic voting”. Finally, because we have all this information, we’re actually able to provide somewhat reasonable rankings for something like the top hundred or so games of last year.

The full results– showing the exact number of voters who ranked each game first, second, third place etc– can be found here. In the meantime, the final results were:

  1. Gone Home (3426) *** GAME OF THE YEAR ***
  2. Bioshock Infinite (3373)
  3. Papers, Please (2506)
  4. Saints Row IV (2497)
  5. Tomb Raider 2013 (2490)
  6. The Legend of Zelda: A Link Between Worlds (2440)
  7. Pokémon X and Y (2423)
  8. The Last Of Us (2263)
  9. The Stanley Parable (2187)
  10. Fire Emblem: Awakening (2161)
  11. Animal Crossing: New Leaf (1924)
  12. Grand Theft Auto V (1721)
  13. Assassin’s Creed IV: Black Flag (1631)
  14. Brothers: A Tale of Two Sons (1554)
  15. Rogue Legacy (1547)
  16. Super Mario 3D World (1393)
  17. Antichamber (1334)
  18. Gunpoint (1302)
  19. Metal Gear Rising: Revengeance (1214)
  20. Kentucky Route Zero (1130)

The numbers in parentheses are the final scores each game got under the poll’s ranking system. Thanks if you voted, and some more elaborate analysis of the results (plus an explanation of the scores) can be found below.

NOTEWORTHY WINNERS

GOTY 2013:

#1, Gone Home

Top-ranked PC Exclusive:

#1, Gone Home

Top-ranked 3DS Exclusive:

#6, The Legend of Zelda: A Link Between Worlds

Top-ranked PS3 Exclusive:

#8, The Last Of Us

Top-ranked WiiU Exclusive:

#16, Super Mario 3D World

Top-ranked Browser Game:

#24, Depression Quest

Top-ranked Mobile Exclusive:

#46, 868-HACK
(OR)
#56, Ridiculous Fishing, if you disqualify 868-HACK because of its PC prototype, “86856527”

Top-ranked Vita exclusive:

#67, Tearaway

Top-ranked PS4 Exclusive:

#85, Resogun

Top-ranked 360 Exclusive:

#104, BattleBlock Theater

Top-ranked XB1 Exclusive:

#124, Killer Instinct

Top-ranked Ouya Exclusive:

#166, Towerfall

Top-ranked Wii Exclusive:

#189, Pandora’s Tower

Top-ranked FPS:

#1, Gone Home

Top-ranked “Indie” Game:

#1, Gone Home

Top-ranked RPG:

#7, Pokémon X and Y

Top-ranked Sports Game:

#45, Divekick

“Cult” Award (see below):

#46, 868-HACK

NOTEWORTHY LOSERS

Best game of 2013 which somehow nobody considered to be their #1 pick: #30, Guacamelee!
Worst game of 2013 that at least one person considered their #1 pick: Three-way tie between three games tied for the #326 slot: “I Hate the Dark”; Wizardry Online; and “Heroine’s Quest: The Herald of Ragnarok”. Each of these games got only one vote, but each of these voters considered it their game of the year.
Worst game of 2013: Two-way tie between the games tied for #402: “Composition 62” and “Ultionus: A Tale of Petty Revenge”. Both of these games scored only one vote each, each from someone who considered it their 20th best game of the year.

There were a whole 57 games on the nominations list that no one voted for at all.

ALTERNATE SCORING METHODS

The rankings listed above are based on a version of the Borda count voting method. Each vote cast for a game gives that game a certain number of points. If someone ranks a game #1, that game gets 20 points. If they rank it #2, the game gets 19 points. If they rank it #3 the game gets 18 points… and so on. I have a script that checks a couple of alternate ways of ranking the same data, though.

For example, if we rank games only by the number of first place votes they got, the winner remains the same but almost the entire rest of the list changes dramatically– a lot more movement than usual this year, it seems like. I bolded entries that are different in the first-place-votes count:

First Past the Post

  1. Gone Home (52)
  2. The Last Of Us (51)
  3. The Legend of Zelda: A Link Between Worlds (38)
  4. Saints Row IV (35)
  5. Bioshock Infinite (33)
  6. Fire Emblem: Awakening (27)
  7. Papers, Please (23)
  8. Pokémon X and Y (23)
  9. Grand Theft Auto V (19)
  10. Dota 2 (19)
  11. The Stanley Parable (17)
  12. Animal Crossing: New Leaf (17)
  13. Kentucky Route Zero (16)
  14. Metal Gear Rising: Revengeance (15)
  15. Tomb Raider 2013 (14)
  16. StarCraft II: Heart of the Swarm (12)
  17. Assassin’s Creed IV: Black Flag (11)
  18. 868-HACK (10)
  19. Super Mario 3D World (9)
  20. Hate Plus (9)

Most years when I look at the first-past-the-post list a “cult” game emerges that received very few overall votes, but where an overwhelming percentage of those votes were #1 votes (I think of this as the “Persona award”); this year the standout was 868-HACK, which managed to grab #18 in the first past the post rankings despite being all the way down at #46 in the overall rankings. Also of note here are Hate Plus, which jumped from #33 to a tie for #19; and DOTA 2, which jumped from #22 to #10; and The Last Of Us, which jumped from #8 to #2 (actually, if it had received one more #1 vote, it would have tied Gone Home for first place).

I also did two more ways of sorting the rankings: an “approval” vote, where nothing is counted except the number of votes a game received (i.e. a first-place and a twentieth-place ranking count the same– all the matters is if the game was on someone’s list); and an instant runoff vote. Usually these two track the main count very closely, but this year, something rare happens in IRV: The first and second place games switch place! If you are qualified to comment on the differences between instant runoff and Borda-based ranked voting, feel free to tell us what that means.

APPROVAL

  1. Bioshock Infinite (223)
  2. Gone Home (205)
  3. Papers, Please (176)
  4. Tomb Raider 2013 (162)
  5. Saints Row IV (157)
  6. Pokémon X and Y (155)
  7. The Stanley Parable (149)
  8. The Legend of Zelda: A Link Between Worlds (144)
  9. Fire Emblem: Awakening (140)
  10. The Last Of Us (136)
  11. Animal Crossing: New Leaf (125)
  12. Rogue Legacy (117)
  13. Grand Theft Auto V (113)
  14. Assassin’s Creed IV: Black Flag (108)
  15. Brothers: A Tale of Two Sons (107)
  16. Gunpoint (98)
  17. Antichamber (91)
  18. Super Mario 3D World (84)
  19. Don’t Starve (83)
  20. Far Cry 3: Blood Dragon (82)

IRV

  1. Bioshock Infinite (223)
  2. Gone Home (205)
  3. Papers, Please (176)
  4. The Legend of Zelda: A Link Between Worlds (144)
  5. Saints Row IV (157)
  6. Pokémon X and Y (155)
  7. The Last Of Us (136)
  8. Tomb Raider 2013 (162)
  9. The Stanley Parable (149)
  10. Fire Emblem: Awakening (140)
  11. Animal Crossing: New Leaf (125)
  12. Grand Theft Auto V (113)
  13. Assassin’s Creed IV: Black Flag (108)
  14. Rogue Legacy (117)
  15. Brothers: A Tale of Two Sons (107)
  16. Gunpoint (98)
  17. Antichamber (91)
  18. Super Mario 3D World (84)
  19. Metal Gear Rising: Revengeance (77)
  20. Far Cry 3: Blood Dragon (82)

FINALLY: PER-FORUM BREAKDOWNS

Okay, so this is where things get… interesting.

When this poll first started, it was run out of the forums for Penny Arcade, and historically, that one forum has totally dominated the results. I traditionally link on a couple more small forums, but these usually only provide a handful of votes– and anyway, most of the forums I tended to target were themselves spinoff from the PA forum community. The final results invariably look almost exactly like the PA-specific results.

Except not this year. This year, for whatever reason, my efforts to promote the poll on Twitter took off like crazy; one of the tweets about it got 51 retweets. The result was a HUGE voter influx, to the point where PA was almost outnumbered– in the end PA contributed about 300 votes, whereas Twitter contributed about 250.

And PA and Twitter voted *really differently*. My vote script tracks “where votes came from”, and lets me run results isolated to votes from a particular source. The tracking isn’t perfect, but ought to be able give us some idea how different internet communities voted. Here’s the breakdowns from the different major vote contributors with their respective color-coded listings linked; here’s what we find:

Penny Arcade Forums (296 voters)

  1. Bioshock Infinite
  2. Tomb Raider 2013
  3. The Last Of Us
  4. Saints Row IV
  5. The Legend of Zelda: A Link Between Worlds
  6. Grand Theft Auto V
  7. Assassin’s Creed IV: Black Flag
  8. Fire Emblem: Awakening
  9. Pokémon X and Y
  10. Papers, Please
  11. Brothers: A Tale of Two Sons
  12. Rogue Legacy
  13. Gone Home
  14. The Stanley Parable
  15. Starcraft II: Heart of the Swarm
  16. Super Mario 3D World
  17. Gunpoint
  18. Metal Gear Rising: Revengeance
  19. Ni No Kuni
  20. Guacamelee!
Twitter (244 voters)

  1. Gone Home
  2. Papers, Please
  3. The Stanley Parable
  4. Animal Crossing: New Leaf
  5. Pokémon X and Y
  6. Depression Quest
  7. Saints Row IV
  8. Kentucky Route Zero
  9. Antichamber
  10. Hate Plus
  11. The Legend of Zelda: A Link Between Worlds
  12. Bioshock Infinite
  13. Fire Emblem: Awakening
  14. Tomb Raider 2013
  15. The Last Of Us
  16. Gunpoint
  17. Rogue Legacy
  18. Super Mario 3D World
  19. Candy Box
  20. 868-HACK
Platformers.net (32 voters)

  1. The Legend of Zelda: A Link Between Worlds
  2. Fire Emblem: Awakening
  3. Bioshock Infinite
  4. Rogue Legacy
  5. Pokemon X and Y
  6. The Stanley Parable
  7. Gone Home
  8. Far Cry 3: Blood Dragon
  9. Papers, Please
  10. Cookie Clicker
  11. Shin Megami Tensei IV
  12. Metal Gear Rising: Revengeance
  13. Animal Crossing: New Leaf
  14. Super Mario 3D World
  15. Salty Bet
  16. Phoenix Wright: Ace Attorney
  17. Brothers: A Tale of Two Sons
  18. Grand Theft Auto V
  19. Assassin’s Creed IV: Black Flag
  20. Saint’s Row IV
Tigsource.com (22 voters)

  1. Papers, Please
  2. The Stanley Parable
  3. The Last Of Us
  4. Path of Exile
  5. Brothers: A Tale of Two Sons
  6. Shelter
  7. Save the Date
  8. Monaco: What’s Yours is Mine
  9. Jelly No Puzzle
  10. Risk of Rain
  11. Don’t Starve
  12. SUPERHOT
  13. The Wonderful 101
  14. Starcraft II: Heart of the Swarm
  15. Dota 2
  16. Metal Gear Rising: Revengeance
  17. Towerfall
  18. Samurai Gunn
  19. Far Cry 3: Blood Dragon
  20. Dragon’s Crown

Looking at these breakdowns, the most pronounced difference between the big two voting blocks– Twitter and Penny Arcade– is how they treated the top two entries from the combined results: Twitter put Gone Home at #1 whereas PA put it at #13, and Bioshock Infinite was voted #1 by PA but ranked down at #12 for twitter. One thing that might have hurt Bioshock here is that although Twitter voted overwhelmingly for Gone Home, the PA bloc did not vote for Bioshock Infinite nearly as solidly; in fact, going by “first place” votes alone, PA actually preferred The Last Of Us (39 first place votes to Bioshock’s 23).

The voting differences get even more interesting when we compare the Twitter results to the Tigsource results– the Twitter results seem to show a very heavy influence, and Tigsource is an indie community, but these are apparently slightly different parts of the indie community because a few of the games that made strong showings on the Twitter list (in particular, Gone Home and Depression Quest) didn’t rank at all among Tigsource’s 20 or so voters.

Anyway, that’s it, thanks so much for voting and I’ll be doing this again next year!

Game of the Year 2013: Vote Here

Sunday, January 5th, 2014

Hello anyone out there: I’ve got this Game of the Year poll that I run on some web forums I frequent. The way it works is that you rank your favorite games of the year– up to 20, though vote for as many or as few as you want– and the script will sort out the top 200 or so out of everyone’s votes. Here’s last year’s results if you want to see what this looks like (or previous years here). I will run this poll script for one week and then post the results. If you’d like to give it a try:

Vote here

When one week is up (Jan 12) I will delete this post and post the results here on this blog. Thanks!

Player Piano

Tuesday, November 19th, 2013

For my submission to the SHARECART 1000 project, a simple FM synthesizer/sequencer. When installed with other SHARECART 1000 games, Player Piano will allow you to listen to your SHARECART save files as music.

Note that auto-save on quit will only work if you quit by pressing “ESC”.

Download

How do I figure out the original git revision of a GitHub zip I downloaded?

Sunday, October 20th, 2013

This is a problem I ran into today: Awhile back I downloaded a copy of a project hosted on GitHub, using the “Download Zip” button on the project page.

A few months later I came back, and I needed to know exactly which git revision it was I downloaded. Given this zip file, how does one “go backward” and figure out what revision it was? (The GitHub zips contain just a folder containing a single revision; there is no .git directory in it, so command line git can’t do anything.) I got some help on Twitter (thanks Robert!) and eventually figured out how— but I couldn’t find an explanation anywhere Google had picked up, so here’s a quick summary for future generations.

Method 1: Zip comment

This one’s pretty simple: There’s a thing in the headers of zip files called the “zip comment”, and apparently GitHub stores the original revision hash in there. You can get this out using the command line zip tool and the “unzip -z” flag:

If you’re using Windows, the makers of the WinZip tool claim they display the comment automatically when you open the zip in WinZip.

Method 2: Dates

Maybe you’ve lost the original zip, and you just have the folder? We still have one piece of useful information: the “modified” dates. If you look, all the files in the unzipped repo will have their created/modified dates set to the same date and time:

In fact, this is the date and time corresponding to the exact timestamp on the original Git commit. So we can just go look through the git logs until we find a revision with that exact timestamp:

By the way: If you download a zip from BitBucket, they helpfully actually put the exact revision hash into the name of the downloaded zip, so you’re unlikely to run into this problem. Just so you know though BitBucket git repositories do work with both the “zip comment” and the timestamp rules above. BitBucket mercurial repositories don’t have the “comment” in the zip file, but they do contain an invisible file named .hg_archival at the root level of the unzipped directory which contains the same information and then some.

Exacto: How to copy scenes between Stencyl files

Sunday, June 2nd, 2013

Warning: This has only been successfully tested in one specific case and it could potentially leave Stencyl files unusable. Only use it after backing up the Stencyl projects involved.

So this is a tool with a pretty narrow application, but, I made a thing. If you’re familiar with the (generally pretty nice) game-making tool Stencyl, you may be aware of a curious limitation it has: It is not possible to copy a scene between two Stencyl files. You can import and export assets, or scripts; but not entire scenes. My friend Liz wound up getting stuck on this hard when she was making her game Problem Attic (it’s really good, you should play it); she had split her project file into two, and was experimentally making levels in each. Then she went back to merge them and found out Stencyl won’t let you do this.

To unstick Liz, I wound up making a Python script that just goes behind Stencyl’s back and copies scene data between games. You can find the script, named Exacto, here; click “Download”, or look under “source” (it’s the only file). From our testing, the script appears to work— it was used to make the final version of Problem Attic.

Caveats

The script copies all the data related to a Stencyl scene that I am aware of. There are two problems here though. First off, it’s possible there’s some data I’m not aware of, and which the script therefore misses. Second off, the script does not even try to copy things which are global to the game— such as actors, or assets like tilemaps. So if you want this script to work, you will need to copy those things over first. You will need to separately load all the assets used in game A, into game B.

There’s one more, even more awkward thing though. Remember I said above our test programs were two versions of the same game? Well, all the assets have “ID numbers”. You can’t see them while you’re making the game, but they’re in the game files. I’m not sure, but it’s possible that if you copied between two *very* different games, and you used a lot of assets in the scene you copied, and both games contained the same assets *but* the “ID numbers” were different, then my script might get the ID numbers confused and cause Stencyl to use the wrong actors or the wrong assets or tilemaps after you copy the scene. I’m not sure; I haven’t had a chance to try this. Because Liz again was just working off two versions of one game file, I expect the ID numbers would be the same in both for her anyway.

I’m going into all this technical detail for a simple reason: Stencyl does not deal well when it sees something it doesn’t expect in the game file. Stencyl expects it will only see game files it made and that people like me won’t be mucking around behind its back. So if you copy something into a game file that Stencyl doesn’t understand, it might just crash, or freeze, or maybe you’ll think the copy worked but afterward you’ll find certain windows in the interface just refuse to open. (This is why I am making such a big deal about backing up your files.) So I’m wanting to warn about places where my script might confuse Stencyl, and the assets/asset ID thing is the biggest danger point I know of.

By the way though— if you *do* find a case where running this script left Stencyl unable to work on your game file, I’d be curious to talk to you. If I had more examples to work with, I’d be able to make the script more resistant to bugs.

Usage

Download the exacto.py script from the above URL. If you are using Windows, you’re also going to need to install something called “Python”. Go here and download the “Python 2.7 Windows Installer” or “Python 2.7.5 Windows installer”— it doesn’t much matter which you pick as long as it has “2.7” in the name and not “3.0”. (If you are on a Mac, you already have Python.) Run that installer.

Close Stencyl, and open up a command line window— on Windows this is “Command prompt” in the start menu, on the Mac this is Applications->Utilities->Terminal, but if you don’t already know how to use the command line this next part might not make much sense to you anyway. Cd to the directory you downloaded exacto.py to. Here’s a few examples of using Exacto– things you can type into the command line:

python exacto.py --help

This has Exacto print out exactly how to use it. There’s a couple small features it lists in the –help but which I don’t document in this blog post.

python exacto.py -i ~/stencylworks/games/gameFROM list

This prints out a list of all the scenes, and their “Scene ID” numbers. By the way, where I say “gameFROM”, put the name of your game.

python exacto.py -i ~/stencylworks/games/gameFROM -o ~/stencylworks/games/gameTO copy "scene one" "scene two" "scene three"

This is what you actually want to do to copy scenes. You’ll want to put the name of the game you want to pull from instead of gameFROM after the -i, the name of the game you want to write into instead of gameTO after the -o, and at the end instead of “scene one” “scene two” put the names of the scenes you want to copy (in quotation marks). Once you’ve run this command, you can open up Stencyl again and see if it worked.

By the way– maybe you run “list” and realize the names are kinda complicated or messy to type? You could also just use numbers. Say you ran the “list” command and you saw the scenes you want to copy have scene IDs 6 and 8. You could say:

python exacto.py -i ~/stencylworks/games/gameFROM -o ~/stencylworks/games/gameTO copy --raw-id 6 8

Notice all these examples are for the Mac command line. If you run on Windows, you want to write it a little different. Instead of saying “python” you want to say “C:\Python27\python.exe”, and everywhere I wrote “~/stencylworks/games/” above you’ll want to say “%APPDATA%\Stencyl\stencylworks\games\”. (The point with this “stencylworks/games” folder is that you need to find the place where stencylworks stores your game’s *directory*– the thing containing the game.xml. The script doesn’t work on .stencylworks files.)

TODO

I’m not sure if I intend to do any more work on this— it depends on how much interest there is. But some things I think would be worth exploring in a future version of this script:

  • It’s probably pretty easy to make a Windows GUI so you don’t have to do all this downloading-Python/command line junk. cx_Freeze or something.
  • Fix for the “ID numbers” thing I’m worried about above?
  • It’s probably possible to copy assets and actors and stuff! I just haven’t looked into it. At least, it’s probably pretty easy to *check* if the assets are present in the destination file, and if they aren’t, complain and refuse to copy, instead of just going ahead and breaking stuff.
  • It would be pretty easy to be able to operate on .stencylworks files, or even make new .stencylworks files. They’re just zips.

Anyway

Anyway, good luck, and if you try this script out, I’d be curious to hear how it went (whether it works or not!).

The Best Game

Sunday, May 12th, 2013

Ian Snyder this weekend is hosting #objectjam, which challenges us to create games which instead of running on computers or game consoles run on “everyday” objects such as walls or chairs. I couldn’t think of anything myself, but I realized:

Java, our Shetland Sheepdog, actually invented a game you play with a piece of rope. He invented this game when he was about four and taught it to us by repeatedly forcing us to play it. I don’t know what Java calls this game because I’m not completely certain he has an internal concept of “language” or “names” so I’m calling it The Best Game because that is how he seems to think of it. If he were allowed to, Java would play this game and nothing else forever.

I hereby submit this game to #objectjam on Java’s behalf. Here is how you play.


Java, AKA Player One.

The Best Game requires:

  • A short piece of rope, say a little under a foot, preferably with one or more knots in it.
  • Two players. Player Two has to be a human because they need to have hands. Player One can be anybody.

The game is played in three phases, which repeat:

Phase 1: Keep-away. Player One starts with the rope (Java holds it with his mouth because that is how he holds things). Player Two has to try to get it. Player One should stand as close as possible to Player Two (this is not a hiding game), but if Player Two tries to grab the rope immediately dodge out of the way.

Phase 2: Tug-of-war. Player Two has now grabbed one end of the rope. However, Player One still holds the other end. Player One should hold on as tight as possible to prevent Player Two from taking it away.

Phase 3: Fetch. Player Two, now that they have the rope, must throw the rope as far as possible, so that Player One can run really fast and go retrieve it. Player One then returns the rope to Player Two’s position, at which point Phase 1 restarts immediately.

Tips for playing: Sometimes, people may not realize they are playing the game, or might think the game is done. In this case, Player One can try dropping the rope in Player Two’s lap; when they pick the rope up, Player One can immediately re-grab the other end of the rope at which point Phase 2 begins immediately. (This means you skip Phase 1 but this is okay because it’s a good way of teaching Player Two the game. You can ease in Phase 1 as they get the idea.) If Player Two doesn’t immediately react to having the rope dropped in their lap, maybe they didn’t notice you put it there. Try picking the rope up again and dropping it 3 or 4 more times.

How to mod my games

Saturday, May 11th, 2013

My games (ever since “Markov Space”) are set up to let any part of the game be modded with just a zip file, and come with some mod-assistance tools built in. I never got around to documenting any of this. I guess I should do that. I’m gonna do that now.

If you’re not fascinated by technical details, I suggest jumping down to “An example: HOWLER?” below.

Overview

Any game based on my Polyconsole tools has a set of hidden developer’s features, mostly there to support my own debugging but also useful for modders (and sometimes players). Some of these features are not user-accessible in the release versions of my older games, but you can still get at them by either building a debug build yourself or in some cases brain-transplanting the media.pak file out of one game and into a more recent one.

Things you can do with these features:

Change the screen resolution
(Present since at least: The World Hates You)

By default, Polyconsole games use the whole screen and current screen resolution. However at startup they read a file named “settings.xml” that can be used to change this. If you open up Notepad (or whatever), paste in the following, and save as “settings.xml” in the same folder as the game .exe or .app:

<?xml version=”1.0″ ?>
<settings fullscreen=”false” width=”800″ height=”600″ />

It will set the fullscreen/windowed mode, height, and width as appropriate. You can of course change the specific width and height numbers how you like, or change fullscreen “false” to “true”.

Get a debugging console
(Present since at least: The World Hates You)

Polyconsole games also check at startup for a file named “debug.xml”. Actually, they don’t care what’s in this file. They just want it to be there. If the file is there, the game enters “debug mode”. There are three things that are different in debug mode.

First off, in debug mode you can access a Lua console at any time by hitting “tab”. Any syntax errors in the game code get printed to this console, and you can type lua code as commands here (for example, print() calls).

Second off, and maybe a bit more usefully, in debug mode hitting “esc” at any time reloads the current “room”— the current stretch of game, basically. This is very useful if you’re changing Lua on disk while this is happening. (In a few games the magic key is “F4” instead of “esc”.)

Third off, in debug mode the constant “_DEBUG” is true. In some games this changes behavior slightly.

By the way, when you save these .xml files— settings.xml or debug.xml— make sure you really are saving them as .xml and not as .xml.txt.

Create a mod
(Present since at least: Markov Space)

With Polyconsole games, the .exe or .app is basically just a projector that usually contains very little “game”. The actual “game” (all the resources, shaders and Lua code) is stored in an innocuous-looking file named media.pak. You can find this in the Internal/ directory on Win/Lin and inside the app package on Mac. The “.pak” file is actually just a misnamed zip file.

When Polyconsole loads files out of this .pak file, it “shadows” them by looking in two additional locations:

  • The contents of “mod.zip” in the same directory as the .exe or .app
  • The files inside of a folder named “mod” in the same directory as the .exe or .app

The mod.zip is laid out the same way as the media.pak, and the mod folder is laid out as if you’d placed the mod.zip into the “mod/” folder and then unzipped it.

If the finds a file inside either the mod zip or folder (and it prefers the mod folder to the zip) it acts as if the file in media.pak is replaced with the mod version of the file. This allows you to overwrite any resource or code file the game uses.

Oh, and by the way: I only added loading from the “mod” folder/zip support around The World Hates You somewhere, however all the way back to Markov Space you can still do a mod just by renaming your mod.zip to “media.pak” and replacing the media.pak that’s already there.

Take a screenshot
(Present since at least: Sweet Nothings)

Press F8.

Another by-the-way: some graphics programs don’t seem to be able to open the screenshots made by Polycode. I find if I open it in a program that *can* open it (Preview on the mac works) and then save it again, the problem is fixed.

An example: HOWLER?

Let’s walk through doing this with HOWLER?, which is a little art toy where you push some colored discs around the screen and they warp and deform space around them. HOWLER? makes images that look neat, but they’re all a little same-y— what if we replaced the discs with some other, more interesting objects?

To start off with, you can download HOWLER? here. You’ll see:

In the screenshots I’m gonna do this on the Mac, but things will be about the same on Windows.

We wanna start just by making the files that tell the game to go to mod-editing mode. We want to make three things: A file named settings.xml, a file named debug.xml, and an empty folder named “mod”. You can make settings.xml and debug.xml in Notepad using the instructions I give above, OR you can just download a settings.xml I made here and a debug.xml I made here. You should now have:

Now we need to find the “media.pak” zipfile— that’s where all the game resources actually live. On Windows and Linux, this is easy— just look in the “Internal” folder. On the mac, you’re going to have to hold down “control”, click on the HOWLER app, and click “show package contents”. This opens up the app to let you see inside. media.pak is in “Resources”, inside “Contents”.

You want to COPY, not move, media.pak from that Resources directory (or on Windows, the Internal directory) and into the “mod” directory you just made:

Now we want to unzip it— the media.pak is actually just a disguised zip file. You should be able to just rename media.pak to “media.zip”:

Then double click it. You should now have a folder named “media” inside of your “mod” folder. We’re done with the “media.zip” file now, so go ahead and delete it.

If you look in the “media” folder, you’ll see, well, the whole game:

Right there you’ll see all the “color wheel” images from HOWLER?, plus an “audio” directory containing the soundtrack oggs. You’ll also see some other maybe-mysterious files. In order of descending importance:

  • A folder named “overlay”: The game’s source code files (Lua scripts) are in there— you can just open those up and edit them in Notepad.
  • A folder named “material”: The “shaders”, if you know what those are, are in there; in HOWLER?, the screen-warpy effect is in a file named FilterShader.frag. Like the lua files, you can edit the .frag just fine in Notepad.
  • “init.txt”, “game.txt”, “exit.txt”: These are the game’s three “rooms”. I’ll come back to this in a moment.
  • Several files with names ending in “_classes.txt”: These are just needed for Polyconsole to work; you should just ignore these. (Or you can delete them, and it will load the originals out of media.pak.)
  • Several files with names ending in “.svg”: These actually aren’t part of the game at all, and I apparently packed them in by accident!

Let’s go ahead and make a simple change to the game. Start by opening it up and letting the game start:

Because of the settings.xml file, the game is running in a window. And because of the debug.xml file, another thing changes: If you press “F4”, the current screen will reset itself. (In most of my other games this debug-reset button is ESC, but here it’s “F4”.)

Let’s leave HOWLER? open, and back in our “mod” folder open up “colorfull.png” in an art program. In this picture, all I did was pixelate the PNG a bit, scribble on it, save it again, then close and reopen HOWLER?:

So far, seems to be working! (Though, two little quirks I notice. First off, I *EXPECT* that pressing F4 to load the scene should have caused my newly-saved “colorfull.png” to be instantly loaded into the program. It didn’t, it reloaded the scene but left the textures as they were. I guess that’s some sort of bug. But that’s okay, because all I had to do was close and reopen the program and it loaded right. One other thing: You might notice I scribbled on “colorfull.png” with white, but in the screenshot— here’s the zoomed in version if you can’t see it clearly— it looks black. This is because the specific screen-warpy visual effect in HOWLER? doesn’t work well with images with semitransparent “alpha”, which the pen in this particular art program always uses. Annoying; I’ll have to make sure to use a different program for this next step.)

Anyway, this is a start. I keep going, and I make new graphics for all four of the orbs: colorfull.png, colorblue.png, colororange.png, and colorpurple.png.


Now it looks like:

I’m not sure if that’s an improvement, but it’s different! Playing with it though, I notice something weird— the images are now little squares, but they bump up against each other like they’re still big circles. This is because although the images themselves are stored in these PNG files, their “shapes” in a physics sense come from the source code.

We can fix that. Let’s edit the source code, to make the squares act like squares. If we go back to our “mod” folder, it’s time to look inside that “overlay” folder:

Each of the subfolders here is what I call an “overlay”— a hunk of scripts that go together. I split my games up into “rooms”, and each room is made of 3 to 5 “overlays” that combine together. “Overlay” and “room” are just words I made up, I don’t think any other game engine uses this exact terminology. Anyway this particular game has three “rooms”, the intro screen (“init.txt”), the outro screen (“exit.txt”), and the “game itself” (“game.txt”). If you look inside any of the “room files” back up in the media folder, you’ll find each one is just a list of names of overlays from the overlay folder.

But! We don’t need to worry about most of that, because HOWLER? is a pretty simple game, and almost all the important code is stored inside of “onLoad.lua” inside the “game” overlay. Let’s open up that game/onLoad.lua file in Notepad (or, well, I used TextEdit because I’m on a mac).

We want to change how the game treats our PNG files it loaded, right? So let’s look inside the lua file for the PNG file names. Sure enough, there they are:

Uh… well, that certainly isn’t very clear code! Did I mention I made this game in a single day? But if we know a little bit of Lua— or even if we don’t— we can see we’re calling this “makeAt” function four times with different numbers and the names of our four files. So what’s “makeAt”? Apparently it’s somehow making the four orbs on the screen. And if we poke around in the file we can find the code for makeAt, too:

If we look at this, we see a couple things. First off, one of the numbers being passed in to this function is named “scale”— it’s being used to set the size of the image. If we go back and look, it’s being set to 1.0 for the “colorfull” orb, and 0.5 for the others. If you go back and look in the original game, you’ll see the big rainbow orb is twice the size of the others— this is why. You’ll notice another thing in this code snippet here: All the orbs are being created as ENTITY_CIRCLE shapes. That made sense in the original game, but now three of the four shapes are squares.

Let’s make a few changes. I made the bits I changed bold and blue so you can see them more clearly:

Here I change the makeAt function so it takes one more argument— “circle”. Circle is either true or false, if it’s true, we make the object we’re making a CIRCLE, otherwise we make it a RECT (…angle). I’m also going to need to change the place where we call makeAt:

I added a “,true” for the “circle” argument on the one orb that’s still a circle, and I changed all those 0.5s to 1.0 so the pictures won’t be weird and shrunken anymore.

I reopen HOWLER? (or if I’ve left it open, I can just hit F4— the bug we saw before with textures failing to reload doesn’t apply to code) and here’s what I see:

Okay, now that’s actually getting kinda interesting! I think this is becoming something I can call a “mod” with a straight face.

I’m gonna change a couple more things before I call this done. First, just for the heck of it, I’m gonna redo the music. I make some quick loops using Drumcircle and Audacity, and save them over the oggs that are in the media folder now:

For some reason this only works if I save the oggs as stereo. I’m not even going to try to figure out why.

I’m also going to change the title screen (to note that I modded something) and the “exit” screen (since the Liz Ryerson music credit is no longer accurate). If you look in “init.txt” and “exit.txt” (remember, the txt files define the game’s three “rooms”) you’ll see those screens live in the “pre” and “post” overlays:

I go ahead and dig the around in those for the string to change:

I think my mod’s done! Now what? Well, now I probably want to show it to someone. Fortunately, if I want to let someone try out my mod, I don’t need to send them the whole big “mod” directory. The game will also accept one file named “mod.zip”. To make this, I zip up the “media” dir– notice, I’m zipping the “media” dir, NOT the “mod” dir:

This creates a file named “media.zip”, which I then rename to “mod.zip”. I can now clear out the settings.xml, debug.xml and my “mod” folder and put this zip in the folder with HOWLER.app or HOWLER.exe by itself:

And my mod now works in all its glory!

If you want to download the final mod.zip to try out the mod I’ve been putting together in this example, you can download it here. Again, just place the .zip file in the same directory with the HOWLER program (don’t bother unzipping).

(A license disclosure. The picture of Tunde Adebimpe I use in this mod is a GDFL image from the Wikipedia Commons, so that means this zip is GFDL and if you reuse this zip, you also have to follow the GDFL rules. If you replace colororange.png with something else tho this no longer applies.)

Some extra notes for modders

The above basically covers basic mods (change images, datafiles, constants). If you’re going to be doing any serious rewriting of the Lua in these games, though, here are some random things it might be useful to know:

I posted a writeup of Polyconsole some time back that explains most of how the basic engine works; there’s exhaustive but currently-out-of-date documentation of the “bridge” object and my lua util functions there, for example. The games are of course all written against the Polycode API and using its object system. I usually store constants in a table named “km”, room-specific variables in a table named “gm”, whole-game-global variables in a table named “fm”, and sound effects in a table named “au”. The ubiquitous a() and r() functions are part of my memory management, they cause the targeted variable to be deleted at the end of the frame or room respectively. The “startup” and “shutdown” overlays are also for memory management and you probably shouldn’t touch them. The main overlay for the game is usually named “game” and the library functions are usually in “pregame”. If there’s a title screen overlay it’s often named “attract”. In a couple of cases (Markov Space, for example) there’s at least some Lua hidden inside .svg files but I stopped doing that quickly. Scene() and scene() generally do something different, as do Screen() and screen(), the uppercase versions are constructors whereas the lowercase versions grab a shared room-global object (if it exists). Sometimes if there’s an error in onLoad.lua it doesn’t get printed to the console on first run, but it appears if you open the console and hit the reload button (esc or F4). The print() function in Polyconsole can pretty-print tables.

Anybody still reading?

Did you follow any of that? Either way, here’s one last cool thing for making it this far. Here’s one more HOWLER? mod I made. Place this zip file in the same folder as the HOWLER? app or exe and enjoy.