Category: Best Of

Simple GameMaker performance throttling

Here’s a quick tip for performance throttling in GameMaker.

Say you’ve got some code that you need to execute frequently, but if the game starts slowing down too much, you can live without executing this block of code.

Like, for example, say you want to spawn a new instance of some object very frequently, such as in the Step event, but if performance starts to lag you can skip it. You could try to test out how many instances the game can handle without frame rate dropping to an unacceptable level, and cap the number to something somewhat below the maximum. The problem is that this number will vary depending on the hardware. Someone running your game on an older, slower machine will not be able to sustain the same performance that someone with a brand new, high end machine. There really isn’t a true, one-size-fits-all number that works for every situation.

What you really want to do is base the cap on the current performance of the game as it’s running right now. To do that, wrap it up in an if statement like this:

if room_speed < fps
{
 //keep doing the thing that will eventually cause performance issues
}

The way this code works, as soon as fps drops below room_speed, it will stop doing the thing that contributes to the performance problem. This technique does not guarantee that fps will never drop below room_speed, but it will cause performance to stop degrading by not contributing to the problem once performance has degraded to the point that the conditional check takes the “false” branch.

If you don’t want ANY noticeable performance degradation, you may want to make the conditional check be something more like

if (room_speed + 10) < fps

instead; this will give you a little buffer to keep the fps enough above room_speed that you should not see any noticeable performance problems. Or, substitute the calculation room_speed + n with the literal value that you don’t want fps to drop below. Use this to ensure a safer margin of acceptable GameMaker performance.

Game review: Javel-ein by Daniel Linssen

I loved Javel-ein when it was first released as a Ludum Dare 28 Jam entry. It’s been expanded into a “Full Game” — I put this in quotes because, other than perhaps a lack of background music, there wasn’t anything about the Jam entry that felt incomplete or less than “full” to me. TL;DR: it’s a great game, it’s free, and if you run Windows, you can play it.

Get Javel-ein.

Game Play

You’re a guy armed with a Javelin, jumping and running through a 2D platform world of caves and lava pits. There are dangerous creatures, which you’ll need to kill with your Javelin. Once all the creatures are destroyed, you need to find the door to take you to the next level. The twist is that you only get one Javelin, and you have to retrieve it each time you throw it, leaving you temporarily defenseless. (more…)

7 Lessons from the Flappy Bird fallout

When .GEARS announced that Flappy Bird would be removed from the market, I had a hunch that it wasn’t a solution to any problem, and would result in many unintended consequences. It was a pretty easy call to make.

  1. The attention that Dong Nguyen didn’t want wouldn’t go away. People would switch from talking about how the game was popular to the decision to remove it from the market.
  2. Removing the game from the market wouldn’t remove the game from devices where it was already installed, so (if we believe Nguyen’s stated reason for removing it) the people who were addicted to it would continue to be able to play it.
  3. The game would still generate ad revenue when it was played. So critics who felt the game’s earnings were undeserved wouldn’t be satisfied.
  4. Opportunistic individuals who had the game installed would try to sell their devices at panic prices.
  5. And the evident demand for a game that plays like Flappy Bird, combined with the absence of the official Flappy Bird, would bring a flood of me-too games to the market. It turns out a lot of them are malware vectors.

What can we learn from this?

  1. Small entities who experience phenomenal success are in for a wild ride and probably more problems than they could ever imagine.
  2. Running away from the problem won’t solve the problem, but it will probably create even more problems.
  3. Exiting the market doesn’t un-release a product.
  4. Once a product launches, if it attains “critical inertia”, it will continue to have momentum, even if the vendor stops pushing.
  5. Once the idea of a product is widely known, the sudden removal of the product will create a void that will quickly be filled by others.
  6. Any popular product will automatically generate a satellite industry of leeches who will try to cash in somehow.
  7. Without the vendor’s push steering a product along a particular vector, these external forces can cause the product or brand to break up, fragmenting it in many directions, many of which in hindsight will seem predictable.

The Flappy Bird Flap

Flappy Bird: the Justin Bieber of indie mobile games?

The game development community has been buzzing with controversy over a game called Flappy Bird since the weekend, in an incident that has even gotten headlines in the mainstream media.

As of Sunday, the game has been taken down by its creator, Dong Nguyen, in response to harassment and even death threats, due to all the negative attention the game has received in the wake of inexplicable sudden popularity of the game.

Allegedly the game had been earning $50,000/day in ad revenue in recent weeks, since becoming the most popular download in the iOS and Android stores. There’s a certain amount of professional jealousy about this success, considering how undeserving the game is. As well, there is a great deal of resentment that the game’s art style appears to be borrowed from Super Mario Bros, and seems to ride the coattails of Angry Birds, and directly rips off the play mechanics of a variety of similar, earlier games, none of which has been anywhere near this successful. Since the takedown a slew of imitators have flooded the app stores with play-alike games, some of them parodies, some seemingly earnest ripoffs. Even crazier, a few people have put their iOS and Android devices with Flappy Bird installed on eBay for a ridiculous markup.

The combination of the game’s popularity, and lack of originality or quality makes a Justin Bieber analogy seem apt.

After hearing about the game for the first time on Friday night, I had to try it if I was going to have an opinion on it, and my impression is that the game is indeed not very good, yet it does undeniably have an addictive quality to it. Flappy Bird is starkly simple, lacks depth, and brutally difficult. In terms of “finish”, it is only rudimentary in it’s polish — there is a (apparently broken) leader board, and the graphics have a few color scheme variations, but beyond that there’s nothing. It has the feel of the first or second project of a newbie game developer, and tried to build a game imitating another game, without originality or polish, using ripped art assets and a derivative title that rides the coattails of both Super Mario Bros. and Angry Birds. No wonder the game development community is howling. Yet, apparently this minimalism has struck a chord with many players who appear to genuinely like the game.

Success is an enigma… an aggravating, annoying enigma

It’s seemingly inexplicable that this game should be super popular, and therefore curious. I suspect that the popularity is not accidental, but rather arose out of a perfect storm of factors.

First, it seems likely that the Mario pipe graphics account in part for some popularity, as it makes players curious about the relationship between this game and the Mario world. This might serve to entice would-be players to download the game and try it out. As well, the word “Bird” in the title probably contributes to curiosity as well, due to the popularity of Angry Birds.

Further, I speculate that the game inspires people to talk about it, either about how bad the game is, or how aggravatingly difficult it is. Some players may play it for the sake of irony, or to laugh at it. I downloaded and played it just to see what all the fuss was about, and to develop an informed opinion so I could write about it, and to see if there just might be something there that I could learn from to make my own games more popular.

Even so, for the game to have so many downloads, it must have some genuine appeal that keeps players interested after trying it. It seems unlikely that the game could generate the type of advertisement revenue we’ve heard it has if people were only downloading it to play it a few times and laugh at it. It seems that a substantial number of players actually like the game, or perhaps play it out of a sort of perverse masochism, hating the game’s rage-inducing difficulty as they try again to beat their high score, while hating the entire experience for being so utterly basic, so unvarying, so stupidly hard and unforgiving.

The simplicity combined with the difficulty probably accounts for the game’s appeal, whether people genuinely like it or hate it with a passion. And the controversy over the rip-off aspects of the game probably only added fuel to the publicity fire, resulting in this weekend’s climax. The game had been out for several months before suddenly catching on, though. What was the event that triggered the sudden spike? I’m sure every game developer is dying to know. Was it “organic” or engineered? Was it an accident or is there genuine merit to the design, hidden to critics and game developers, despite their scorn?

The fact that Nguyen has taken the game down, walking away from a $50,000/day paycheck may be the most remarkable development in this story. The pressures of all the attention, so much of it negative, must be incredible for him to shut down such an income stream. Of course, he may already have enough money in the bank that he’ll never have to work again. And there may be a few battles over that revenue to come from the various IP holders who feel wronged. But it seems like Nguyen may have been most sensitive to the criticism of the quality of the game itself. This is a most un-Bieber-like plot twist.

Flappy, we hardly knew ye

I don’t yet know what to make of all this, but it seems to point to a business strategy of making very simple, unoriginal games, rather than auteurs striving to craft high quality, original games that innovate. I guess it depends on what motivates you as a developer. But if I had even 1/100th the success of Flappy Bird with my games, I’d be set up to quit my day job. One tenth, and I could be free to make whatever games pleased me, to whatever standard of quality I wanted, for the rest of my life, regardless of whether any more of them were popular. It seems worth pursuing, then, to explore this apparently untapped “shitty games” market to see if setting my sights lower could bring greater rewards. The risk involved in a game that can be developed in 2-3 days, compared to the potential reward, seems far more attractive, compared to spending months or years building a labor of love that may or may not have an audience beyond the author.

Topology of Metropolis in Superman (Atari 2600)

One of my favorite games on the Atari 2600 is Superman (1979), designed by John Dunn, and based on the program code from Adventure by Warren Robinett. This game has stayed with me to this day as one of my favorite games. I started playing it again recently, and began thinking about the different aspects of it that make it such an enjoyable game to play again, even 35 years after its release.

While it might appear to be a very basic game to a modern eye, in its day Superman had many innovative features. I won’t give it a full review here, but the one that I find most interesting is the game map. The world of Superman is much larger than most contemporary games of the era, most of which took place on a single, non-scrolling screen. The way the Superman’s map is laid out is confusing and non-intuitive, making the game very difficult for a new player, but once you start to gain a sense of how the different screens that make up the city are variously interconnected, it becomes possible to navigate very quickly through a number of methods which can be memorized with some effort and repetition. First-time players can take 15, even 30 minutes and up to win, while an experienced player who is familiar with navigation can often beat the game in under 2 minutes.

(more…)

Great Artists Steal (and so do shitty companies)

Last week I became aware of a controversy surrounding King.com Ltd, makers of Candy Crush Saga and other games, and an independent developer, Matthew Cox, aka JunkYardSam, his game Scamperghost, and a blatant ripoff called Pac Avoid, which King has since pulled from the market.

King’s actions with regard to this situation are particularly distressing. According to JunkYardSam’s version of the story, he had been in negotiations with King about licensing his game, and after another company (MaxGames) offered him better terms, he broke off negotiations with King, at which point King approached a third-party developer, Matt Porter (who appears to have been innocently manipulated by King), to commission a blatant ripoff of the game and attempted to bring it to market before JunkYardSam’s game was released.

I’d never heard of Scamperghost until this story broke, and I still have not played it, nor have I played Pac Avoid (and I guess it’s likely I never will). In the wake of JunkYardSam’s revelatory blog post about what went down, the blogosphere and twitterverse exploded, and enough has been said about the specific incident that I can’t hope to add anything of value at this point.

It’s obvious that King know how to market popular, addictive games with polish, as the success of Candy Crush Saga demonstrates. It’s also obvious that King doesn’t concern itself with making original games. Candy Crush Saga is the umpteenth variation in the match-3 genre, a ripoff of PopCap Games’s mega-successful Bejeweled series, which started in 2001, and was itself not an original concept, having been inspired by a 1988 game called Shariki, and directly descends from games like Shariki (1988), Columns (1999) and Dr. Mario (1990).  Zoo Keeper (2003) is another notable title in the genre.. The match-3 genre is a sub-genre of the “falling block” genre, which was created by the 1984 classic Tetris, which itself has a famous history of its creator Alexey Pajitnov’s original creation being stolen and sold by various corporations without compensation.

I’m not going to rag on King too much, because even their business model of ripping off other game designs isn’t original. Everyone knows they were in the wrong, they know it themselves, and their lame open letter on their approach to IP really doesn’t read to me like an apology at all. Although they admit that they were wrong to produce Pac-Avoid, taking it down doesn’t go far enough — rather than take it down, they should have left Pac-Avoid up, provided a link to the real Scamperghost game, and promised to provide JunkYardSam with all the profits the game had ever earned. That would have served them right. I’d like to think that if JunkYardSam could afford a good enough lawyer, that’s exactly what he’d be entitled to. And attempting to trademark common words like “Candy” and “Saga” would stop happening. And King would not infringe on Namco’s Pac Man trademark by creating a ripoff game called Pac-Avoid. If I read their Open Letter right, King hasn’t quite understood their position in the market, doesn’t value originality in terms of crediting and compensating its sources, and is just another money-grubbing corporation. They clearly have the resources to create solid, fun-to-play games; they just choose to do so based on established successes and other people’s ideas that they wish they’d thought up, but didn’t. And that means that they can make enough money to pay rent and salary, perhaps, and not expose themselves to risk by developing truly original products or innovating.

Meanwhile those who do strive to innovate and create original games often struggle in the market, only to watch established “me too” shops like King who know how to polish an idea and bring it to market effectively take home all the bread. It’s an efficient business model. Why pay full time developers, when they can buy ready-to-market games that look promising from starving people who make games, for far less than a full time salary would cost? Or when they can’t, just commission someone else to make a knockoff of the game for you.

Update: Apparently, King also ripped off another game, CandySwipe, which came out a full 2 years before Candy Crush Saga.

Enough said about King.com, Ltd.

I thought it would be a good idea to talk about creativity, freedom, ownership, and standing on the shoulders of giants. Because, like it or not, creativity and success depends on being able to use ideas that someone else came up with.

Here’s some terms we should all be familiar with:

Rip Off

A rip off happens when a creator’s work is appropriated and exploited by another without compensation, usually by imitation, occasionally through unscrupulous contracts or outright theft of IP.

Clone

Clones are games which blatantly copy the play mechanics of another game, while adding no or almost no. What changes there are are often negligible cosmetic differences only. Often the graphics are made nearly identical as well, but not always.

Counterfeit

A counterfeit is an exact clone, attempting to be passed off as an authentic copy of the original game. The player thinks they are playing the real game, but they aren’t, and any revenue generated by it never reaches the creator. The counterfeiter deliberately deceives the player into thinking that they are the author.

Homage

An homage may be a fan game, using the graphics and game engine to create an unofficial sequel, or it may be an original game which is strongly influenced by an earlier game. Homages almost by definition must happen long after the peak popularity of the original, and are a nostalgic look back at a forgotten style of game, and the best offer a re-examination and deeper exploration of the play mechanics and features that made the original successful, or in some cases explore unofficial/alternative storylines, or mashups with other games.

Extension

Some games are made to be extendable, while others are reverse engineered to be extendable by fans who have the necessary skills. Plenty of FPS games, and others, are open to modding, and invite enthusiasts to extend the game in some way, creating a community, or sometimes a small industry, around the title. Modding is a gift the developers give to the community that is created by the market around a game. And modders return the gift to the original developers by keeping interest in the original game alive. Most modded games require the original game to be purchased in order to make the modifications to it, so they help sales. Some extensions are the result of the game engine being officially licensed by a third party developer, who may make wholesale changes to the rest of the game, and sell it as a new title. Many mods are simple graphics and sound replacements, or new levels, enemies, or weapons. But sometimes mods result in an entirely new game.

Sequel

In game development, a sequel is when a creator re-uses its own IP. The resulting game may or may not be better than the original. Quite often, a game is first rushed to market in a “minimum viable product” state, and the sequel is the version that matches the full original concept, with features that were planned for the original but had to be dropped, or implements technologies that were not yet ripe during the development of the first title. Companies with a successful IP will ride it as long as they can, creating sequels and ports of a popular game to make it available to as many markets as they can.

Genre game

A genre game is considered “original” enough to stand on its own, even though it bears strong similarity to many other games that belong to its genre. Nearly always a genre is inspired by a wholly original game that was a big enough hit to establish the genre. As time goes onward, genres tend to become more refined, then more stale, and new genres become increasingly rare and unlikely. Occasionally a grenre is reinvigorated by an inspired new variation that puts a new spin on what for a while was though to be tired and played out. A genre-founding game is both original and nearly always close to perfect. Later games may exceed the genre founder in some or even many capacities, yet may not attain the aura of the founder, and tend to be judged on how well they are executed and how well they innovate new features. Genre games that simply offer more of the same must be well polished, or risk being derided as derivative, and a lot of genre games are sequels or earlier examples from the genre and may get by as much on expanding the world or plot as by improved graphics or innovative features and game play mechanics. But genre games are generally considered legitimate games (if they tend to bore critics after a while) as long as they are of a high quality and try to offer at least something new, even if it’s an experimental feature that doesn’t end up getting picked up by future examples in the genre, and represents a dead end in the family tree.

As well, there are many examples within a genre of clones, or simply uninspired “me too” games produced by lesser studios that aren’t as well designed or polished as the industry leaders, and do nothing as well as the original or the current leader, being cheaply made imitations put together by people of lesser talent and vision who don’t understand the game design elements that made the original great.

That said, there are certain ripoffs that have been equal or even superior to the original. For example, Grid Wars, a blatant clone of Geometry Wars, is an excellent game, if a slavish imitation of the original. Space Invaders spawned a galaxy of imitators, many of which were clones or unoriginal derivatives, but it also spawned the entire shooter genre, and even games like Galaxian which was a very popular game in its own right, might be considered a knockoff.

Conclusions

In short, there is good and bad copying when it comes to creative endeavors. Good copying takes a good idea and does something new and better. Bad copying is a lame attempt to cash in on someone else’s good idea, and can be detrimental to the original, paradoxically especially if the bad copying results in something that is, in its own right, pretty good.

If you’re going to copy… ha ha, “if.” We all copy. But when you copy, unless you’re merely copying solely for your own edification, to learn how to do something you haven’t done before by imitating something in your world, don’t just do the same thing you’ve seen. If you’re creating something with the intent that it be consumed by others, take things from all around you, transform transform somehow, and make it something worth the effort of copying.

Reflections on Mortal Kombat

Mortal Kombat came out in 1992, the year before I graduated from high school. It’s 2013, which means that MK is old enough to drink. Last weekend, I met it at a bar and caught up with it for old time’s sake.

I first saw Mortal Kombat at the local bowling alley in my hometown. The graphics looked impressive, the photograph digitally sampled sprites and rotoscoped animation giving the game a lifelike feel that no other game had. Yet, somehow I felt turned off. I wasn’t really interested in playing it at first. It looked like it was trying to be too hardcore, and the blood and violence felt more like gimmicks to me. Plus, it cost $0.50 to play.

It wasn’t until I went away to college that I first played it. The student center building at my college had a bowling alley in the basement, and there were a few arcade games there, one of which was a Mortal Kombat. There weren’t that many options, and it seemed to get a lot of play from the other guys who hung out there, so I gave it a try. It wasn’t long before I grew very well acquainted with that machine, and I probably dropped over $100 into it by the time I graduated. It was the first videogame that I ever played that I felt was worth two quarters to play.

Mortal Kombat was mega popular in its day, and notorious for its blood and fatality moves. Frequently cited by social critics who tried to call for censorship of games, it was a game parental groups hated, and it rode the publicity to the top. But all that controversy masked that the gameplay was solid, and the game was a lot of fun to play, offering tight balance, considerable depth, and a learning curve that took weeks if not months to master.

I got pretty good at it, but always felt like a second-rate player compared to some of the other guys I played against. I could hold my own against anyone using Scropion, but I secretly felt ashamed, like he was an entry-level character, certainly the first one I tried with any success, with easy to learn moves that did a lot of damage and were easy to land a high percentage of the time, and I felt like my victories were cheaper when I used him, though I never would have admitted it.

I got to like the cheesy Bruce Lee ripoff character, Liu Kang, and, to an extent, Raiden, who seemed to have been ripped off from the cheesier (though great) Big Trouble in Little China —although, due to an unfortunate leg-sweep vulnerability, bug he was a broken character.

But there were two players at my local arcade who were definitely better than me all around — who knew the moves of all the characters, not just three of them. I watched them play, and tried to learn the moves and the timing, and with a lot of practice I developed skill, which was what caused me to respect the game. Mostly I tried to play the single player tournament mode, where I had a decent chance of lasting a few rounds, but when they were around, I’d inevitably have to face their challenge. I got my ass handed to me a lot, but eventually I got good enough with Scorpion that I was pretty evenly matched against anyone.

Still, I never managed to beat the single-player tournament. I got to where I could get up to Goro, occasionally on one credit. But beating Goro was a seriously difficult feat, which I might have managed a handful of times. And then Shang Tsung, seemingly a weaker boss than the underboss, was somehow deceptively able to beat you before you knew what was happening. I had a rule about playing, I would never let myself spend more than $10 at a time, so if I couldn’t do it for that much, I had to walk away.

Last weekend, I was at 16-Bit Bar in Columbus, where they have a lot of great classic arcade games on free play, and I got to give Mortal Kombat another run. It’s been a good 15-16 years since I put my last quarter into it, and at first I couldn’t remember Scorpion’s fatality move. Embarrassingly, I lost a round in the second fight. I continued a lot. But it was on free play mode, and it started coming back to me.

Somehow, this time I managed to beat the single-player tournament. I’m not sure how I managed to do it. Somehow, it didn’t feel as difficult as I remembered — despite having noticeably diminished skills, I just kept trying until I got to the next level. Oddly the game felt slower than I remembered it — probably, I think, because of how later fighting games have gotten progressively faster over the years. Also, I started to notice what worked and what didn’t, and figured out timing and spacing that would enable me to land the powerful attacks that normally get blocked. Instead of going in headstrong and aggressive like my old playing style, I took a more methodical approach and picked apart the AI’s defense. I don’t know how to explain it, but it felt to me like I was able to see the weak points in the AI, and exploit them with predictable certainty.

I actually wondered whether the old game I used to play was set to a higher difficulty level — it’s certainly plausible, although I hope not. The endurance matches took several rematches, and it took a bunch of rematches before I beat Goro. I worked my way up the ladder, and knocked Shang Tsung off the top. I felt elated and accomplished for hours afterward. Taking 20 years to beat a game that has taken your measure is pretty indescribable.

And yeah, when I did it, I screamed “Mortal Kombaaat!!” like in the movie soundtrack, and felt every eye in the bar directed at me for a few seconds before turning back to whatever it was they were doing. Let me tell you, it enhances the experience, even more than you’d think it would.

 

 

Pretentious Game 3 proves that narrative matters in games

Tonight I played through a short, but very memorable and thoughtful puzzle platformer, self-deprecatingly entitled, Pretentious Game 3. I have yet to play the first two installments, but shall seek them out forthwith.

What would otherwise be a fairly challenging but mostly nondescript puzzle platformer is elevated to a touching experience though the thoughtful application of narrative and a simple, but emotive piano piece.

The game’s simple mechanics and puzzles are made memorable by the narrative bits, which make literal the metaphors in the prose, imparting greater meaning to both. The simple geometric graphics, with their absolutely abstract nature, invite the player to impart their own life experiences into the game, reliving key moments in your own life, mapping them onto the episode presented in each level.

This is ingenious minimalism, with the beauty of a black and white silent short arthouse film. The effect is magical.

Ninja Baseball Batman: OMG BEST GAME EVER

I was at a local bar called B-Side, which recently installed an arcade full of classic videogames and pinball tables. They have the first Pinball2000 game, Revenge From Mars, and a Star Wars pinball table. They have a good selection of arcade classics from the 80’s and 90’s, from Galaga, Defender and Centipede to Contra and NBA Jam.

But I was absolutely blown away by a game called Ninja Baseball Batman, which I’d never even heard of before. An Irem-produced side-scrolling beat-em-up from the 1990’s, themed with what can only be described as Japanese wackiness taken about as far as it goes. You play a member from a 4-person team of superhero robot ninja baseball players, each with their own statistics and special moves. This game is so chock full of WTF, you initially go “what the heck IS this??!?” but pretty much right away you get into it and go with it. You fight a menagerie of odd robots and monsters made out of junk, vaguely reminiscent of mega man enemies, but (mostly) baseball themed, with some casino-themed monsters and some halloween-themed robots. Nothing makes any sense at all, but that’s the point. Just go with it and have fun. There’s even living hamburger monsters that you can eat for a life bonus after you defeat them. I can’t even describe this game, you have to see it. Fortunately, there’s YouTube:

The gameplay is absolutely fantastic. I beat the entire game on $2.75 — I don’t know if it has an easy mode, but it felt pretty easy, but it was so fun. The game is generous, not a quarter-sucker, takes no cheap shots, and is a pure joy to play. The movesets for each player are extensive, and I couldn’t get over how fluid the fighting system was. It felt similar to the Konami beat-em-up Ninja Turtle and Simpsons Arcade games, but with unmarketable characters with no built-in audience. But it was so incredibly surreal and awesome, I couldn’t help but fall immediately and utterly in love with it.

Having done so, I must evangelize it. It is worth hunting down and playing. Go do so. Now.

Here’s a bonus Angry Video Game Nerd review:

I agree COMPLETELY with every word he says in this video.

Apparently only 43 arcade cabinets were ever imported to North America, making this game ultra-rare. I feel incredibly fortunate to have found this at B-Side.

GameMaker Tutorial: Password systems 1: password entry

In old school console games, especially for the NES, it was common to enter a “code” or “password” in order to resume play where you had left off previously. Back in the day, memory was extremely expensive, and very few games implemented a battery backed RAM solution that allowed the player to Save and Restore a game.

Instead, a system of encoding the game state data into a long “password” was often used in lieu of a real save system. In addition to encoding the game state, these password systems often had some kind of validation built into them, so that not just any arbitrary input would be accepted. For fun, sometimes games would have special, secret codes that would enable cheats. For a few players, cracking the encoding system to enable you to configure the gamestate to your exact wishes was a kind of advanced meta-game, excellent for budding young hackers. There is great nostalgia value in these systems if you are into old school retrogaming.

Password systems (general overview)

If you want to build a password save system, at a high level there are a few things you need to do:

  1. Password Entry
  2. Validation
  3. Encoding/Decoding GameState
  4. Password Display

This article will cover Password Entry, while future articles will cover the other topics.

Get the input

For simplicity’s sake, let’s assume a four-character code will encode all the information that we need. In practice, most 8-bit NES games used much more than this, but for a simple input demo this should be sufficient.

The easiest way to enter a string in GameMaker is the get_string_async() function.

save_pw = get_string_async("Enter password", "");

Since get_string_async is an asynchronous function, it does not return a value immediately. We need to add an Async Event to catch the return value when the function calls back to the main program. The correct Async Event to use for this function is the Dialog event. The get_string_async() function doesn’t simply return a string value, though; rather, it returns a data structure called a ds_map, which contains 3 values: an id, a status, and the result. The result is the string that was entered by the player, the password that we are looking for.

We can put the following code in the Dialog Event to handle the return callback:
Dialog Event:

var i_d = ds_map_find_value(async_load, "id");
if i_d == save_pw{
 if ds_map_find_value(async_load, "status"){
 password = ds_map_find_value(async_load, "result");
 }
}

The interface that get_string_async() provides is not very satisfying, aesthetically, but it works well enough for now. (We’ll explore a few other methods later that will more faithfully replicate the “password entry” screens from old NES games, in a future article.)

Right away, we have a few problems with simply getting a string:

  1. Because get_string_async() allows the player to enter any string they want, the player may enter a string of arbitrary length. For our demo, we need them to enter a string that is exactly the right length.
  2. The get_string_async() is not constrained in the characters it will allow the player to enter. Passwords for NES games varied in their alphabets, but many would allow A-Z, a-z, 0-9, and often spaces and special characters. Some games would allow only capital letters, while others would allow lower and upper case. One serious flaw with the old password systems was that the letters were displayed in fonts which often made it difficult to differentiate certain characters, like 1 and l, or 0 and o, etc. Later NES games sometimes corrected for this by using a more distinct font, or by omitting the ambiguous characters from the alphabet entirely.

There are many ways to constrain the allowed characters, but we don’t need to get super fancy with it for our demo.

In the next article, we’ll demonstrate how to decode the password — that is, to translate the password value to game state information. Finally, we’ll demonstrate how to generate and display the password when the game is over (or paused, or at a save point, or whenever it’s appropriate for your game), so that the player can write it down and enter it the next time they play to resume where they left off.

Part 2