On Comments and Discussion

Last week, I had a revelation while I was on vacation. I was five days into a lovely excursion through Newfoundland, completely disconnected, when my phone buzzed. Huzzah! Data! Feeling it would be nice to get a brief update from the world at large, I checked my email, only to be confronted by notification of a new comment on this blog.

Never ever get into video games you are the biggest casual I met in my entire life

First I chuckled at how hilariously he’d missed his mark. He’s about 16 years late with that zinger. But it stuck. And it bugged me. I was on vacation, free of any cares, and suddenly I have this guy judging my entire career with one flippant comment on a blog. But it wasn’t the only one. There was another set of comments, all from a different person. The first praised me for an article I wrote. The second was a vaguely racist rant against Japanese game developers. The third was filled with fallacious arguments and faulty logic which left me angry. On my vacation.

DSC00932

It set me to thinking. There are so many opportunities for good faith discussion on the internet, and so many venues to engage with people directly, why do we even allow comments to exist?

Comments have the lowest barrier to entry when it comes to discussion on the internet. Often it requires very little, if anything, to post a comment. Sometimes you have to use a throwaway email (I’m pretty sure that the quote above from faggot@hotmail.com is not using a real email address). Sometimes you sign up for a blog and it takes a few seconds, and if your account gets closed or your comment deleted, so what? You had your say, and it cost you nothing. With Facebook integration, you don’t even have to sign up, you just post, and it’s a one way thing. Nothing you post from a Facebook login can affect your Facebook account. No barrier, no risk.

Now, one alternative is using moderated comments. But then I am still exposed to the trash that gets posted. Not only that, but suddenly I have to do extra work to make sure that comments aren’t empty trolls or insulting trash? Why should it cost me more to deal with people not willing to put any effort at all into the discussion?

Meanwhile, there are plenty of ways to have a discussion about an article, without using comments. Directly on Twitter is a good one; your Twitter account carries more value than a throwaway comment. If you care about people taking you seriously, then you will act like it and it will be obvious. You could write a post on your own blog; long form discussion is a rarity, but part of that is because it takes more work and effort to actually write a post on a blog. You could start a thread on an internet forum. There are plenty out there with healthy and respectful communities, and if you are a respected member, then you are going to put more effort into anything you have to say. Those also often have the benefit of being moderated such that there is at least a minimum requirement for membership. You can drop me an email, my address is easy enough to find if you aren’t a robot. Alas, that lacks the public spectacle that so many trolls thrive on.

But the other thing I realized is something that I think most people miss: a discussion about a topic does not necessarily have to involve the original author. It is good enough that discussion exists, and if people wish to interact with an author directly, then even better. But I realized that I don’t have to be involved with all discussion about things that I write, I am simply happy if people are moved to discuss a topic that I felt was worth writing about.

So I’ve turned comments off on this blog, and closed comments on all existing articles. No, you cannot comment on this post. But I welcome all discussion.

Super Metroid and The Exclusion of Control Mastery

I love Super Metroid. It is very easily one of my favorite games. I haven’t played it through in a while, but I have easily played through it 50 or more times. There was a time when I would do it as a relaxation exercise; I can beat the game in an hour and a half. Or I could, at some point.

So I am definitely no slouch. I can also rack up a good amount of headshots in random FPS games. My reflexes are pretty good, and my control precision is still as good as it ever was. I think I killed almost every enemy in Bioshock Infinite with headshots.

I spent a lot of time working on Assassin’s Creed 2 exploring the issues of reaction time, control responsiveness, and input lag. I had an entire chart that described minimum speed of enemy attacks so that the player could recognize the attack, and have time to react to it. If you play AC2 on a TV with less than 90ms of display latency, and your reaction time to visual stimulus is roughly average (250ms is a good baseline, and the one I worked from), I guarantee that you will almost never fail to land a counter on an enemy. Because I designed it that way, knowing how people’s reactions work, and how fast people can react. I *wanted* players to be able to perform counters with ease. Mostly, anyway, some attacks were meant to be borderline, or require more attention.

But the point was, it was a research-driven approach which went out of its way to not only be inclusive, but attempt to address some of the common play scenarios that most players would see, and to be at least tolerable even on one of the dreadfully common HDTVs with really terrible display latency. Yet even with this approach, I hit edge cases I had to deal with. For instance, Pat Plourde, the Lead Designer, had slow thumbs. I made fun of him, but it was a very real problem that had to be addressed. Essentially, some of the combat actions had branching paths, where holding a button would have a different action versus just tapping it. These things are addressed by looking at how long the button is down, and if the button is down past a certain threshold, trigger the ‘hold’ behavior. The problematic threshold in this case was 0.2 seconds. Increasing it to 0.3 seconds solved it. He was unable to press and release the button reliably in 0.2 seconds, a thing which had never been a problem for me. And he’s not a bad gamer either. I can’t even come close to his Geometry Wars 2 scores (and god knows, I tried, that bastard).

The reason for all this is that there are certain things that are difficult for some players to do, which are not a problem at all for other players. In some cases, those things can lead to situations where difficult becomes impossible. And those particular control issues are not necessarily related to how skilled a given player is.

Now, back to Super Metroid. Over time, I have noticed that fans of Super Metroid have two distinct camps. One group loves Super Metroid for the exploration, sequence breaking, and power based map unlocks. The other group loves the super-fiddly controls of some sections of the game, and pride themselves on mastering it completely. I certainly fall into the former camp rather than the latter; to this day, wall jumping gives me some trouble here and there, and there’s a few upgrades I can’t reliably get to. But on the flip-side, I can still time a bomb-jump shortcut.

I am quite sure that the second group also loves all the stuff that the first group does. But I think that in general the reverse is not true.

Recently I discovered the existence of Super Metroid Eris, a fan rom-hack that effectively creates an entire sequel to the original game, all based on a hacked Super Metroid rom. As a technical feat, it is an amazing achievement. Unfortunately, the developers seem to be primarily part of group two. In the first few minutes I was presented with difficult control challenges and enemies that did significant damage such that I couldn’t take more than a handful of hits before I died. My enthusiasm for the game was crushed as easily as Samus. They seem to have focused on minute details of the controls in the original game and amplified them. Everything was an edge case jump, every action necessitated a very precise sequential set of controls.

It wasn’t enjoyable.

Flash forward and I am playing Guacamelee. I love it, but some of the control mastery challenges start getting really finicky. The combat is complex, and each challenge room takes me a few tries, but eventually I learn some new method of dealing with large amounts of enemies that I can add to my combat repertoire. Once learned, new encounters become manageable. Intense, but manageable.

I loved almost everything about the game, until I acquired the double jump. Because at that point, they started weaving level switch, and double-jump wall jumps together. And that’s the point where the game created a barrier I could not pass.

Up until that point, the majority of the control challenges involved coming up with a well timed sequence of inputs. This is a thing I can do. It takes more tries than I’d like, and sometimes the timing is really tight, but it’s okay because once you get it right, you are done and past it. I’ve even gone *backwards* through some of those sequences, which in at least one case I’m pretty sure wasn’t an expected feat.

After that point, however, there’s one sequence that involves wall jumping many times in a row, using double jump, and switching worlds halfway through each jump in order to phase in and out the walls needed for the wall jump. And then, at the very top, the pattern changes; you have to counter the muscle-memory that set in over the previous six or seven wall jump world switch combos, and switch worlds early, and then uppercut to land on a new platform.

Suddenly, I was 14 again, frustrated at my inability to wall jump out of that pit in Super Metroid. But this time, I’m not 14, and I don’t have the infinite patience required to try again for the twentieth or thirtieth time. And so, for now, I have to set the game aside.

The problem with the sequence is two fold; one, it’s a complex set of inputs. As we’ve established, I can handle that. Two, it is repetition that results in a muscle memory, which then must be counteracted at the very end in order to pass the challenge. If there hadn’t been that repetition, I have no doubt at all that I would have passed the challenge after a handful of tries, but instead I face a brick wall. After ten minutes of trying, my hands ached from the strain of trying and failing.

Muscle memory is an interesting beast, because it’s a hard thing to argue with. When it sets in, it allows for amazing things. I’d imagine anyone who has ever mastered a fighting game knows this. After a certain point, complex inputs are internalized, and there are no buttons anymore, just moves which are magically performed by your hands. But the problem is when there’s no context for that muscle memory, it can be very difficult to break a pattern, especially one based fully on repetition. Your brain doesn’t care how many times a pattern must repeat; it simply goes into autopilot and just *does it* until you decide to stop..

So breaking a repetitive pattern incurs reaction time while the signals transmit to your hands. Perhaps for some people, this reaction time is quick enough that they can break the repetitive action to take a new action. However, in my case it is not.

During the last CapyJam, Renaud and Qiqo made a very interesting game in which the controls were randomized; not only that, but executing a move required pressing three buttons simultaneously. It was an interesting experiment because of how thoroughly it relied on muscle memory to pass the level challenges. With every new game, you had to rediscover the controls, and then train yourself to associate a particular hand movement to represent duck, or jump. The more complex levels required stringing three different actions together in multiple sequential challenges. Where it broke down for most people was not learning to press a random three buttons simultaneously, but in figuring out how to remember three sets of muscle memory actions at once. It was extremely difficult, and communicated well the perils of relying on muscle memory for core gameplay.

In the case of Guacamelee, I am sure that the devs meant well, and that the game didn’t pose a particular hurdle to them, and that it was built with all attention to being the quality kind of game that they love, but it certainly raises the issue how control mastery requirements are inherently exclusionary.

If we go back to Super Metroid, almost all of the extremely difficult control challenges were related to finding optional upgrades. They were never part of the critical path, and even when training you to do something advanced, the game offered an alternate path to escape.

This is because even in 1994, Nintendo knew to avoid exclusionary game design. The reason I, and many others, learned to wall jump, was not because they forced us to tackle an extremely difficult control challenge; it was because we didn’t *have* to tackle the control challenge. But there was something up there, and we wanted to know what it was. It was the carrot on the stick.

When developing a game, it is especially easy to forget how long you have been playing it, and how much all those crazy controls and difficult challenges become internalized. It is natural to then go on to make a game that still poses a challenge, even with those skills. And in doing so, accidentally create a very steep difficulty curve for those players who don’t have the benefit of a year’s worth of play experience.

If that is what the game is about, then by all means. Push it as far as it will go. But if the game is meant to be enjoyable by even those without the particular controller abilities that come naturally to some, it is in your best interest to identify those potentially difficult areas, and keep them off the beaten path.

It is easy to assume that a gamer is either ‘good’ or ‘bad’ at games, but the truth actually varies drastically in between, and on various axes. Making sure game challenges are properly sorted along those axes allows for much more inclusive game design, and can avoid problematic game sections for players like myself, who have a particular quirk which makes very specific things overly difficult.

Challenge is good; just make sure it is in the right place, for the right reasons.

Free To Play and Game Design Corruption

I seem to sow a lot of confusion when I attempt to communicate what it is about Free To Play games I don’t like, and so I felt it was finally time to lay out my thoughts and fears, explain exactly what it is that bothers me, and detail the reasoning which informs my opinions.

There is an implicit contract between a gamer and a game designer, which is that in exchange for the gamer’s patronage, the game designer will do his or her best to make the game as good as possible. The designer will look at every system, every input, and do the very best to make them reflect the game they are trying to make as closely as possible. For some games, this means making sure that every moment is fun and engaging, for others, it means crafting the mechanics such that they evoke an emotion, or an impression. But what is common for all of them is the unambiguous honesty with which the designer approaches the business of designing the game. Call this ‘pure’ game design, if you will.

When a game is provided with no expectation (or method) of remuneration, you know with certainty that the design is pure, and the intentions conscientious. The designer wants to give an experience, or communicate a thought, and there are no other considerations to interfere with the design.

If a game is sold at an up front cost, you know that while the designer may be trying to reach as wide an audience as possible, their goal is still to provide the best experience they can, within the bounds of their abilities and limitations. We can still expect that game design to be ‘pure’. After all, what use would there be to design in any other way, after you already have the gamer’s dollar? The design may stray towards questionable psychological mechanics to keep a player playing, but there is still nothing between the player and the game which would betray the implicit contract.

In politics, an implicit contract between the politician and the public is not enough, so there are rules of conduct, ethics guidelines, and laws. Conflict of interest laws exist because it is not possible to know whether a particular action was one of corruption, or if it was an action that would have happened regardless of the conflict of interest.

If a politician receives a donation to a fund he runs, and eventually awards a contract to a business owned by the individual or business who made that donation, was it corruption? Was it coincidence? Was it actually the best choice? The problem is that we cannot know an individual’s intention, but when it comes to financial gain, it’s not hard to assume the worst. The people involved may swear it wasn’t corruption, but it is impossible to actually know as fact. So rules exist so that we do not have to struggle with understanding a person’s intentions, and we can attempt to curb corruption.

We can see that simply the expectation of corruption is enough to require a modification of behaviors, so that it can not only be avoided, but the accusations of corruption can be equally avoided.

If a game is Free To Play, and the available game purchases are not informed by game mechanics, and do not influence game mechanics, then you can assume that the design is pure. League of Legends is a good example of this. It is competitive, and F2P, but purchases do not affect the balance of the game. You can buy skins, and you can unlock new champions, but the mechanics do not change, and your purchases do not give you an edge. Being a competitive game, the design must be pure, or it couldn’t be so popular. (You can, apparently, speed up your XP acquisition rate, which allows you to buy more runes, but I have been informed that runes are trivially cheap and that this is not functionality which could give someone an edge).

If you can pay money in order to win at a Free To Play game, either as points in leaderboards, or in direct victory over an opponent, then the game design has implicitly been corrupted, and we need not visit it further. After all, you have enabled a system where a player who pays money will easily triumph over a player who does not. At the very least, this kind of action requires an unbalanced time investment from the non-paying player, which is not honest game design.

However, if a game is Free To Play, and the available game purchases alter the game mechanics, or the game experience, we are in the terrible position of suspecting corruption. Design decisions for the game could be a product of pure game design, or they could be made based on metrics that suggest slowing advancement by a perfect percentage would convert more users to paid players. Like a politician who awards a contract to a donor, we can never truly know if the result was deserved, coincidence, or corruption. A designer has absolutely no incentive to be honest about their motivations, and so we can never know if the game design was pure.

However, it is even more complex than that. We cannot know how much the knowledge that it was a F2P game influenced the designer, even if subconsciously. To go even deeper, I don’t believe that any designer worth the name would ever design a game ignoring what it is supposed to be. So now we are stuck in an unfortunate paradox, where I don’t believe it’s possible for a design of certain F2P games to be pure, despite best intentions, and that even given those best intentions, I cannot help but believe that any game designed with certain F2P methods in mind would have been a better game if it were not designed to be F2P.

I am trying to be fair. Were I in a position of designing a F2P game, I would do my best to design a good F2P game. I would keep my design as pure as possible, but it would still, in all likelihood, be corrupt. My goal with the mechanics, like it or not, would be to encourage the player to spend money as part of the gameplay, instead of just delivering an engaging experience.

One day I expect I will be faced with this problem, and I don’t look forward to it. Until that time, I will continue to make games as pure as possible, and when that time comes, I will be forced to make some very hard decisions. Above all, I believe in games as an art, and I have yet to see art created such that the experience changes with continued addition of money.

Of course, as I mentioned above, there are certain Free To Play mechanics which aren’t corrupt. If a player can identify exactly what he will get, and what value the purchase provides, then it is a much more pure mechanic. Unlocking new play styles, new levels, or anything that doesn’t directly affect the ability to progress in what you already have access to are all equally benign. The gamer can predict the value of what it is they can purchase.

The problem with a lot of F2P games, especially ones where you purchase a special game currency, is that the player cannot predict the balance curves of new purchases and forward progress. 1000 Gamecentz might seem like a lot, when it costs you 10 Gamecentz to build your first few Magic Foozles, but will it seem like a lot when your next few cost 200? If a gamer cannot predict the value he is getting out of his or her purchase, then it is inherently corrupt.

Beyond these issues, there are the questions that F2P games raise in my mind while I play. How can I know that I am not being manipulated? If I am playing the game, but it gets grindy, and there are purchases which will alleviate the grind, what were the reasons for the grind in the first place? Did the designer believe that the grind was the optimal path for the game to be engaging, or was the designer making conscious decisions based on conversion metrics?

I know that Free to Play is here to stay, so I can only hope that developers swing towards choosing pure design methods. But a lot of them won’t, consciously or not. As long as that is the case, I will never be able to shake the idea that when I dislike or grow tired of a game, that it is because of the Free To Play system; that the designer, freed from the need to coerce the player to pay more money, would have made a superior game.

Dark Souls II Wish List

Dark Souls is the greatest game ever made as far as I’m concerned, and I’ve said many times in many venues that I will likely play it until the heat death of the universe. But with a sequel announced, I figured I should delve into the things which could be improved in Dark Souls II, because despite being my favorite game of all time, Dark Souls still has a few flaws which could really use addressing. Beyond that, I have some requests for features which should persist, and minor additions.

So first, the criticisms:

1. Multiplayer Success Rate
Everyone who has played Dark Souls for a serious amount of time is overly familiar with “Summoning Failed!” The multiplayer back end needs a fairly serious overhaul for the sequel. The mechanics can largely stay the same, but it would be nice if the system was more reliable. On that same note, rebalance the multiplayer servers so that you always have a pool of summons to choose from in a given area. It’s frustrating to need a summon for Capra demon and not have any. I get that sometimes other people won’t be playing in that area, but with thousands of people online at a time, it seems unlikely to me that there is ever an extended period where there are no summon signs at all.

2. Let Me Play With My Friends
We’ve been through two iterations of the Souls games now, it’s time to let me play with my friends. Everyone who plays eventually figures out a method of playing with specific people, only it involves jumping through hoops and a ridiculous amount of time investment. The rest of the mechanics can ultimately stay the same, but just have my friends’ summon signs always show up in my game. I can make it happen anyway, but it’s a fifteen minute damper on what should be an immediate and awesome gameplay experience. Keep blocking voice communication though, this doesn’t bother me at all.

3. Performance and Netcode
Must I say Blighttown? Even on the PC version, Blighttown’s performance suffers at times. I love Blighttown as much as I hate it, but I still wish I could run it at a nice and smooth framerate. Some of the boss fights can occasionally chug the framerate too, and that’s just not good for anyone. The netcode is pretty terrible both for PVP and Coop. It would be great to see a big improvement in that area.

4. Provide Clearer Statistics.
One of the metagames in Dark Souls is the extreme level of stat optimization. So please, let me see some numbers that are very clear about how much damage a weapon does relative to other weapons. It would also be nice to have a direct readout of how much weight you have left for the various encumbrance levels. I have to do so much math when optimizing my equipment weight. It’s tiring!

5. Make All Upgrade Paths Worthwhile
The upgrade system provided by Dark Souls was vastly better than Demon’s Souls, so keep it up. In Dark Souls II, I’d like to see all upgrade paths be worthwhile to pursue depending on your build. For instance, boss weapons and drops make for great play, but it would be worthwhile if there was a reason to stick with Divine or Magic/Enchanted paths. Did anyone ever use Raw for anything other than an achievement?

6. Learn From Your PC Mistakes
Make sure that the PC version properly supports PC features out of the box. Yes, the excellent PC community can fix your mistakes, but they shouldn’t have to. I am grateful for the contribution of people like the guy who made DSFix and the community which maintains it now, but I would be more grateful for a game that worked immediately on purchase.

7. Improve the AI
It would be great if in Dark Souls II, you couldn’t simply circle around every enemy and backstab them. I’m not asking for all enemies to be excruciatingly difficult, but it would be nice if it felt like I earned a chance via an enemy mistake, and less like I can simply move freely around them.

8. Tweak Covenants
Some of the covenants in Dark Souls are borderline non-functional, and it would be nice for their gameplay systems to be balanced such that every covenant is of more use. There shouldn’t be covenants that everyone avoids because the mechanic for levelling up in them is effectively broken. It would also be nice for every covenant to have perks at all levels. I’m still not sure what the benefit of higher levels in the Forest Covenant is.

Now, on to things which should be kept:

1. Keep the Bonfire System
This is probably one of the most interesting additions I’ve ever seen to a game, and I absolutely love the kind of gameplay it fosters. It strikes the perfect balance of allowing people to learn, minimizing frustration and difficulty, and negating the benefit of turtling through the game.

2. Keep the Seamless World
The continuity of the world in Dark Souls is one of the most impressive things I have seen in recent history, and it allows for a ridiculous amount of immersion. Whenever I take a moment to breathe and look at the scenery (PRAISE THE SUN!), it always amazes me that I can see other parts of the game, and to know that the game isn’t cheating in some fashion.

3. Continue to Embrace Sequence Breaks
The amount of sequence breaks in Dark Souls, and the fact that none of them break the game, including the spectacular one in Duke’s Archives where you can skip the first encounter with Seath, and the entire jail escape sequence at the same time. That the game carries on without breaking is amazing, and allows for so much player agency and wonder. It also kind of blows my mind how many bosses I can simply skip when I have a particular goal in mind. Taurus demon? Does anyone even fight him anymore?

4. Keep to Passive Storytelling
It is refreshing to play games where the story isn’t flung in your face at every turn. It’s also nice to have a story which is enigmatic and requires a lot of community effort to decipher. I think it’s very cool that the complete back story to the game is only now being hashed out by fans.

5. Don’t Break the Combat
The combat system is the best I have ever encountered in a game, and I largely feel there’s not a lot of mechanical improvement to be had. Everything works great, and the mechanics are flawless. Sure, it could use some extra variety in kill animations, but that’s minor and won’t affect the gameplay itself. It also might be worth exploring what would happen if riposte and backstabs didn’t make you invulnerable.

And finally, some general improvements which would make an already great game better:

1. Make the Environment Even More Important
Dark Souls allows for some brilliant use of the environment, from causing armored boars to fling themselves against a nearby fire, to dropping gates on enemies, or luring enemies near a height advantage for drop attacks. It would be great to see even more of this, perhaps even allowing the player some limited climbing abilities and playing even more with height variations in some levels. More traps that can be used for or against the player. It would even be nice to have combat involve the environment, with slamming enemies against walls, or the player being bashed against them, could allow for some interesting dynamic elements.

2. Allow Communities on PC
One of the biggest problems with the PC community for Dark Souls is the amount of hacking going on. It would be nice if you could set up specific communities, where all match making would pull primarily from that community, so you can control who you play with on a slightly higher level. At the very least, allow for some kind of blacklisting mechanic so that the community can police themselves against hackers.

3. More DLC!
I love Dark Souls and the DLC for it was fantastic. Ultimately I would love if there were regular large DLC updates to expand on the world and allow for even more gameplays and strategies over time. Frankly, I am of the opinion that we don’t even need a Dark Souls II; From Software could simply have released DLC forever and I would have been happy. I hope they make use of that route in the sequel.

4. Even More Variety
Sometimes Dark Souls feels like that joke picture of the Swiss Army Knife with one hundred functions, and that is what I love about it. More! More! More weapons, more armor, more flexibility within those groups. It would also be nice to have even more spells, and spell functionality. More flexibility with area of effect attacks would be nice, as would more utility spells.

5. Bring Back World Tendency
This one will be controversial, but I loved the world tendency system in Demon’s Souls. However, I felt that its biggest problem was being difficult and tedious to manipulate. I would love to see it return, but I would prefer for tendency to be largely driven by either developer controlled events, or tied to something cyclical, like day of the week or time of the year. It wouldn’t hurt if it could be influenced by mass player actions as well. Just make sure that it doesn’t rely on playing flawlessly or killing yourself repeatedly, okay?

That’s my Dark Souls II wishlist. I guess I should add: Can I please have it for Christmas? I’ve been a good boy.

Oh, and one last thing. Don’t market the game based on how difficult it is. It is not a difficult game, in the common sense of videogames, and marketing it that way just chases off potential fans. I know a lot of people who won’t even play games they consider hard who have put hundreds of hours into Dark Souls because they love it so much. There’s no reason you should be lying to people and telling them the game is something it is not.

Vote With Your Dollar: Dark Souls PC

I am absolutely thrilled to be playing Dark Souls on PC. For what it is, it’s amazing that I’m doing that, and that it runs so well.

But obviously there are issues with the visuals and PC settings. However, those have been mostly fixed by the community. And wow, what a fix it is.

I’ve been using this fix myself, and while I haven’t played enough to know that it won’t introduce issues, I’m fairly confident the’ll be solved at this rate. But while I appreciate the original author’s work in creating this fix, I would hope that rather than just donating money to him, people would take this time to tell From Software exactly how much we want official support for this kind of thing.

So this is what I am proposing for myself, and I hope other people follow.

If From Software provides an official graphics patch for Dark Souls PC, I will buy and gift a second copy of the game to someone who might not have purchased it otherwise, in the interest of telling From Software with my wallet how much I want support for this kind of thing on PC.

 

Maybe those of us who love PC gaming can make the combined effort to show From Software how much we would appreciate proper support for these kind of things, in such a fashion that they will sit up and listen.

I’m not about to start an online petition for this, but I do hope word gets around enough that From Software will take note.

Dark Souls PC Controversy Follow-up

There seems to be a lot of misunderstanding of what I’ve written about Dark Souls PC, so I’d like to clear things up.

1. I don’t know that any of this stuff is applicable to Dark Souls PC. I’m simply speaking from experiences I’ve had in 15 years of game development.

2. I’m not saying any of these things are necessarily even reasonable; simply that I have seen them argued by people in positions to make decisions in the past. It applies because it’s possible that someone at From Software may have made any of these kinds of decisions for either technical or artistic reasons.

3. This is not a defense of the final quality of the PC version. Frankly, I’m as disappointed as anyone else that I won’t get an awesome PC version. I have a monster gaming PC and I love to use it. But I’m still going to play this game until the heat death of the universe, and a PC version facilitates that much better than the console version. Assuming the port even *runs* on my machine. After all this hullabaloo I don’t even know if it will.

4. Some of the arguments against my theories don’t take into account that From Software is doing a port with very little time, resources, or experience; most of these points wouldn’t apply to a larger studio with more time/money/resources. They definitely don’t apply to *any* studio that has done PC development at all in the past. People making PC games have solved all these problems decades ago.

5. I would not personally choose to limit framebuffer/framerate for any reason other than “It simply breaks the game in a way we cannot fix.” I am simply shedding light on some concepts that may have influenced their decisions. I think point 8 and 9 definitely have the potential to land here, the rest not as much. But they are still things that may have influenced their decision overall.

6. People who don’t think Dark Souls is one of the greatest games ever made are in the same category of people who wouldn’t be able to appreciate a fine vintage of wine, or who think it’s okay to put ketchup on hamburgers.

Dark Souls PC Controversy: An Analysis

UPDATE:

Please read this post before proceeding: http://www.bluh.org/?p=273

——–

UPDATE UPDATE: Fixed some basic math errors. Oopsies.

——–

There’s a lot of anger going around the internet from PC gamers upset at the announced technical limitations of Dark Souls for PC. Mainly, the locked frame buffer resolution, and the limited framerate.

While I understand why gamers are upset at these limitations, I don’t feel that they will impact the actual quality of what I feel is one of the best games ever made. Being a developer, I also appreciate why From likely made the decisions they did, and would like to share some of my guesstimations of what may have led to those decisions.

But it makes me very angry when I see gamers write off any game for a superficial reason, and when it comes to the size of your pixels, I can’t really think of a much more superficial one. So the tone of this article is one of anger, and for that I apologize up front. But I want From to make a hojillion dollars off of Dark Souls so they can continue to innovate, take risks, and make these crazy awesome games.

One thing to keep in mind is that the Japanese develop for console in such a focused fashion, that their entire pipeline is generally built around them. We’re talking about people who, until this current generation, wrote their own compilers in order to make games. That comes with their own dialects and quirks in whatever their starting language was, which is why you’ve seen almost no ports of PS2 games from Japan.

In North America, most development happens on PC entirely. Even console focused games have maintained PC versions which most developers use, because it’s not worth $3m to give every developer their own dev kit. But in Japan, it often happens entirely on console. Most of those devs never have a version that can run on PC at all.

So when you compare western PC development to japanese, it is immediately unfair because western developers are starting from a much stronger base. It’s not a simple matter of From Software being ‘lazy’ or doing a ‘half assed’ port job. Especially when you consider how easy it is to change framebuffer size, and to change screen resolution. I mean, the game does support changes in screen resolution, it’s just the internal framebuffer that’s different. Why would one assume that testing different framebuffer resolutions wasn’t one of the very first things they tried?

So this article will delve into why it may have been technically difficult or visually undesirable to have higher framebuffer resolutions or framerates. As a bonus, I’ll likely throw in other stuff they dealt with which might have impacted their decisions on rendering related changes. I will also rate each independent point with two 1-10 scales, the first representing how much PC gamers would complain about it, with 10 being the Whiny Entitled PC Gamer Who Chooses Not To Buy It Because It is a Total Deal Breaker, Man, and the second representing development cost, with 10 being “To hell with it, bin the project, it costs too much.”

It’s worth noting however, that I am not saying that any of these are THE REASON why they made their choices. Obviously I cannot know that. Nor am I saying that it is a reason that I would choose. I am just giving some insight into what can happen in game development which might result in particular decisions being made. Some of these things are more technical, and I’ve seen them come up as issues on a coding side. Some of them are more artistic, and I’ve seen them come up on the art side. But they are all real issues that can and have happened many a time in game development, and all of them could possibly contribute to the decisions that From Software has made.

1. UI.
This one is low hanging fruit. But if you know exactly what resolution your game will be, often it is significantly easier to build all of the UI in such a fashion that it just lands on screen where you want it. This means all the game UI could in theory be on one large texture that’s just slapped to the screen and that’s that. Even if they didn’t do that, the resolution is guaranteed to be perfect, and the positions are close to guaranteed to be hardcoded. Meaning that if they were to up-res the framebuffer, you would have huge chunky blocky UI that would be immediately at odds with the rest of the game’s high resolution. To fix it would require rewriting a large part of the UI system to either properly scale everything, or properly position relative to screen edges, and having the artists completely redraw all of the UI such that it would look good or better at higher resolutions.
Complain: 7
Cost: 4

2. Texture mapping (including normal maps).
Given the game’s internal low resolution, the look of their art was probably balanced such that the artists knew the target resolution. Given the rough size of enemies on screen, and the graphical look of the game, I’m expecting they made heavy use of low res normal maps in order to get the level of detail they wanted on characters and enemies. Were you to upres the framebuffer without creating new normal maps, it’s possible for characters to suddenly look like they are all wearing outfits made of small colored bathroom tile, as a single pixel of a normal map would map to significantly more screen space in a roughly square fashion.
The textures will also be nearly the same resolution as the texture maps, because if they are too drastically different they’d look absolutely terrible.
Complain: 5
Cost: 7 (10 if including the game world in these considerations).

3. Low polygon models
The game world is large and open enough that the character and enemy models are likely quite low res, only you can’t notice it at their target framebuffer size. Clever use of texture mapping and normal mapping is what generally lets them get away with this. But at a higher resolution, the magic disappears and suddenly you are looking at blocky models. Which is especially apparent if they have low resolution textures.
Complain: 4
Cost: 10

4. Fill rate.
A lot of the really interesting and cool effects they have for a lot of the enemies, bosses especially (Sif immediately comes to mind), use a ton of fill rate by massively layering transparent polygons or particles. The cost for these kind of effects increases exponentially with render size in pixels. Fixing it would require remodelling, retexturing, and likely redesigning the problem models so they don’t look completely terrible, and don’t drop the framerate to single digits when they suddenly take up the entire screen.

Some math (assuming Sif has about 8 layers of fur, which seems likely from the screens I’ve examined):
Frame buffer at 1024×720, wolf fills the screen:
This means it has to draw 1024x720x8 pixels in a worst case. That’s 5.9m pixels. Per frame, of course. So at thirty FPS it’s trying to use about 177 megapixels of fill rate.
Frame buffer at 1920×1080 (cause if you are a pc gamer, I’m sure you have at least this, otherwise what are you complaining about?):
1920x1080x8 pixels in a worst case. 16.6m pixels. Per frame. That’s 498 megapixels of fill rate.

Of course, videocards don’t measure pixel fill rate, they measure texture fill rate, and when 3d rendering, nearly everything counts as a texture. Lighting? Check. Shadows? Check. Textures, normalmaps, spec maps, alpha maps… check check check. You get the idea. That 500 megapixels very quickly becomes 3-4 gigatexels. For a single character.

But wait! You say. Modern video cards are much faster than the consoles! BZZZZT. They are, but it doesn’t tell the whole story. Console video chips have specific optimizations based on how developers tend to use them. As such they can do things like transparencies and FSAA for free. Or nearly so.

Oh you wanted some kind of AA on Sif? Well on PC that just doubled or quadrupled your frame buffer. So now you are using somewhere between 10 and 20 gigatexels of fill rate.

Complain: 9 (I can’t fight sif! the game slows to a crawl!)
Cost: 9

5. Shader Languages.
This is where they take the biggest hit on the port, and where they have likely focused most of their work. Because they have a 360 and PS3 version, they obviously have some kind of shader abstraction going on. But the problem is, when you hit PC, different videocards support different things when it comes to shader languages, and using the wrong thing at the wrong time can take a 60fps game down to nothing. On 360 and PS3 this isn’t an issue but on PC? You bet it is. In fact, it’s something you can’t ignore, despite the cost of testing, debugging, and profiling on a ton of video cards. On a modern engine? This has been done for you (or mostly). But on the one they used? It’s only there as a rough helping hand.
Even when making simple PC games nowadays, you’ll find features you take for granted that just don’t work on common videocards (Love2d’s canvas support comes to mind). Locking the framebuffer resolution may have allowed them to take shortcuts for problem graphics chips.

Complain: 10
Cost: 7

6. Online Stuff
A lot of noise has been made about Games For Windows Live, but the reality is that making your own online system is a large amount of work. Especially when matched with the infrastructure required to support it. Going with Games for Windows Live meant they could pretty much reuse a lot of the system they had in place, rather than making their own, which would have allowed them to have some actual time to focus on other things.

Complain: 9
Cost: 10 ( Non-GFWL ), 2 (GFWL).

7. Animation Quality.
Animation can take up a lot of space, especially when you have multiple skeletons (they have unique skeletons for everything in the game as far as I can tell), and when there’s a lot of bones per skeleton (oh, there is). One way people get around this is by using very high rates of animation compression. Well, that’s what you do when you can’t use a single skeleton (which is what a vast majority of games these days do).
What animation compression does is reduce the size of the animations in memory, but it also introduces a jittery aspect to the motion. Ever seen a character’s feet float around on the ground when they were standing still? Animation compression.
Using a lower framebuffer can hide some of that jittering, which would otherwise look fairly terrible.

Complain: 4 (6 if you have crashing due to running out of memory from less compressed animations).
Cost: 2 (reduce animation compression), 7 (change animation compression algorithm), 10 (try and change skeletons/reduce raw animation cost).

8: Timing Calculations
For those of you who don’t know how to make games, every frame the game takes a rough count of how much time has passed since the last frame, and calculates a new game state. That’s moving things, rendering things, animating things, etc.

The problem with Delta Time, or DT as we call it, is that if you are working such that you always have a known or high DT (High being lower framerate), there’s a ton of code bugs that will never get seen. From particles that don’t work (It normally looks like fire! But now it looks like a laser beam into the sky!), to physics that freak out (When I kill that enemy he stretches to infinity!), to things that to the layman simply don’t make sense at all (My attacks don’t hit anymore! I fall through the world! The enemy only ever turns left!).

Finding and ironing out all these issues after the fact? It’s close to impossible. Especially when some of those issues may have to do with fundamental architecture assumptions.

Complain: 8
Cost: 10

9. Single threaded game updated.
Given the PS3 only has one general purpose CPU, it’s not irrational to think they may have a single threaded game update. Depending on choices they made, that same game update may have to wait for the frame render to complete in between updates. If this is the case, then, given the fact that we already know their AI eats up a ton of CPU, it’s likely that in this case they have to keep the render costs extremely low in order to have a playable framerate at all.
The reason I think this may be the case is that traditionally japanese developers have worked this way in order to target their games for a locked 60 frames per second. But they are also used to building games with very little update logic (AI and such), so they could traditionally keep CPU costs for things other than rendering low.
But I’ve seen how poorly modern games can perform in these scenarios, so if they did build it this way, they’d have little choice in these matters.

Complain: 8 (poor framerates)
Cost: 10

So yeah. In conclusion, I can’t really get worked up that the greatest game made in recent history, if not ever, has a locked framerate and a low res frame buffer. Plus I already played it on my PC monitor (thus upscaled from the 360 to 1920×1080) and it still looked pretty damn great.

I think that at the end of the day, if you are willing to write off a game of this sheer quality, then you should be ashamed to call yourself a gamer. If you’ve already played it on console and are going to skip the pc version because of this? I don’t blame you. Certainly there’s no reason to believe that the PC version will be any better at this point. But again, remember that it’s a version that wouldn’t even have existed at all if From Software didn’t care about gamers.

So please, try not to give them reason to ignore us in the future.

How Not to Make an iPad Game: Final Fantasy Tactics

First, a preface: I have been waiting for Final Fantasy Tactics on iPad for a long time. It’s hard to imagine a better platform for turn based strategies than a system in which you can scroll, zoom, spin, and touch. Originally due for fall 2011, fall came and went with nary a word.

Which probably should have been my first warning. But then, last week, it gets released! Wow, $18. But I’ve been waiting for it for so long, and I have this $25 iTunes gift card gathering dust… why not, right? So I grab it.

And it turns out, Final Fantasy Tactics is a perfect example of how not to make an iPad game.

First, obviously, is the price. $18 has got to be close to the most expensive game on the App Store. It is $3 more than the iPhone game, which is something I can’t explain. However, I can highlight how ridiculous it is that SquareEnix didn’t just make the iPhone game universal. Nope, if you want to play on both devices, it’s actually a $32 game. Ouch.

But the price is only the tip of the iceberg. The interface is where the true insult comes. It’s hard to imagine a worse, more buggy and non-intuitive and non-ergonomic interface for an iPad game. I would have to actually try to make something more terrible than what SquareEnix has done with Final Fantasy Tactics.

Well Known Platform Gestures? Not in This Game!

One of the most common things you do in Final Fantasy Tactics, and any strategy game, is to move the camera around and survey the battlefield. Panning, rotating, and zooming should all be simple, easy, and intuitive. In the original, the triggers served this function by providing rotation, a toggle zoom, and a camera tilt. Panning was controlled simply by moving the selection cursor around the map. Functional enough for the time, and easy to adapt to and use.

Luckily, the iPad has a set of multitouch conventions that make these operations both fluid and intuitive. So, surely Square Enix made use of them, right? Right?

Wrong:

Instead you get two ‘modes’, one for panning, one for rotation, and then you get a token effort with pinch to zoom. Which, taken as they are, work well enough. Except, there’s no reason to have rotation and panning be separate modes, one could very easily dedicate the edges of the screen to rotating, and the center area to panning. Or alternately, it could pan by default, since that’s the most common action, and then a simple short hold of a touch could switch to rotation mode. Both methods eliminate this weird concept of modes, and removes those two ugly icons from over top of the game screen.

Pinch to zoom works okay, except because it happens instantly, it is rather fidgety. The original only supported two zoom steps, so it would have made more sense to simply use the pinch gesture to change the zoom level between steps, so that it was a smoother and more polished experience. Also they could remove the terrible view percentage widget altogether.

Menus: A Strange Mix of Touch, Virtual Buttons, and Clever Concepts

Final Fantasy Tactics on iPad does one thing I will give it credit for: adding ‘scroll anywhere’ to the menus, so that you can very easily navigate and use the legacy menus. You are able to touch the screen anywhere, and if you slide your finger up and down, it will move the menu selection. This is pretty clever, and it works really well. And then you can simply tap to select your highlighted entry. It works well! Of course, that is exactly where it ends. Why? Because there’s no way to cancel a menu, except to use the ‘CANCEL’ virtual button. Which, if you look at the UI, is to the left of the OK button. So you end up with a redundant OK button which is closer to your thumb than the cancel button. On top of that, if you are holding the ipad with both hands, on the corners, the cancel button is uncomfortably low and far inwards. And I have large hands!

They could have easily allowed a touch on the opposite side of the screen to represent a cancel, and then simply removed the two awkward buttons on the lower right.

Beyond that, you can actually just tap directly on a menu item in order to select it. Which is great, if you are playing with the iPad on a table, or your lap, but again, it kind of suffers from that same issue of having to go all the way to the bottom right for that cancel button.

Will it Touch?

The most egregious violation of the iPad’s touch interface, however, is the times when the game expects you to touch something, like, say, a character, or a square on the ground. I truly wish I could capture video of my iPad screen, because I’m not sure it’s possible to understand how truly bad it is except in video. But I will try to explain.

First, the game doesn’t seem to understand where your finger touches. I’ve tested, and as often as not pressing my finger perfectly on a terrain tile will pick an adjacent, but wrong, tile. If you hold your finger down too long, you get some weird kind of virtual stick that moves your selection, only it has a really wide area (probably close to three inches across). If you press and hold on a random place on screen, you move your selection relative to the starting point of the original selection. Confused? Yeah, so am I, and I have the game sitting right here with me. It also seems like if you try and use the weird virtual stick on some parts of the screen, it has no center zone and the selection starts flying all over the place.

Sometimes selecting something by touch immediately confirms the selection, like when choosing your facing. Strangely enough, if you slide your finger as if the facing arrow is a menu, it will cycle through them. The downside? If you accidentally tap the screen, ANYWHERE, it confirms whatever facing is currently selected, with no way of correcting it afterwards.

My favorite broken part of the touch interface though has to be when you are placing your starting characters. It is so nonsensical and confusing, that it took me… much longer than I care to admit, in order to figure it out. In the end it is simple, but it is *so contrary* to modern UI design that you just don’t think to use it the way they intend.

When at that screen, touching a square moves the square highlight, but nothing else happens. Touch the square again, and the character jumps to that square. Using the arrows at the top to select a different character doesn’t appear to do anything at first. You touch a square, and still, nothing happens. You have to actually touch the same square two times to place a character. What? And then to make things even weirder, if you hold your finger down on a square, the square selection animates above your finger, and then you can scroll around to select a square. Only, this is one of the few instances where touching a square properly selects it. So why even give you that weird selection virtual stick thing?

The more natural thing, of course, would be to touch a square to drop a guy, and then be able to drag him to move him around. Touching a new square should move a selected character on the first touch, as there’s no reason to require two.

It May Have Made Sense Once, But…

If for some reason you walk away from your game, and are away long enough that the game doesn’t instantly resume when you launch it, when you come back and hit continue, you are greeted with this prompt:

I never understood these prompts originally, and they make even less sense now. Yes, please, I would like to continue where I left off. Why even ask me? If you cancel, you get dropped at your standard game load screen, which won’t actually load you where you were. If you hit okay, which seems rather ominous, you continue roughly where you were. But if I’ve been gone long enough, I don’t know what’s what, I just want to continue my game. This prompt should have been removed, and this version should have just transparently kept that save and let you open it whenever you hit continue, by default, without worrying about these prompts.

Just Because it’s a Port, Doesn’t Mean you Don’t Need a Graphic Designer

If you’ve looked at any of the screenshots here, you’ve probably thought to yourself “Boy are those ugly UI elements.” I agree. In fact, I still don’t know what the one button is. AT? AI? They really seem to have found the worst font I could possibly imagine. And the horrible blue borders and programmer art have not done their game any favors. I’ve provided a bunch of ways that most of those things could be eliminated. I think they all could be, eventually. Please, hire a graphic designer any time you are adding new UI elements. Programmer art is *never* good enough, and I say this as a programmer.

And really, what’s with the top border? For the first while I assumed it was giving me some kind of in-game time. After all, it’s in 24 hour format, and nothing on my iPad is set to use 24 hour format. Of course, the battery icon clued me in, but here’s an interesting thing. Go back up and look at the screenshots. What percentage of battery life would you say it represents? 60%? 70%? Nope. 26%. They don’t map battery life *at all* in the same way that iOS itself does. So why bother? It’s just confusing, useless, and ugly.

In the End…

At the end of the day, this game does do one truly great thing: It makes an excellent case for why the App Store should allow returns. App Store apps are wrapped in DRM, they can remotely remove them from my device, so why not give me a way to avoid this horrible buyer’s remorse? $18 could have gone to much better iOS developers, who are making new and interesting and quality games, instead of to a large company who doesn’t seem to care at all for the quality of their titles, and instead looks to profit off of decade old goodwill, based on widespread adoration of a classic title. Goodwill which, I might add, is rapidly fading.

Now, excuse me while I go write a one star review on the App Store.

 

 

 

Soapbox: Congratulations, Double Fine, You’ve Changed Everything.

If you aren’t aware, Double Fine put up a Kickstarter project last night with the goal of reaching $400k of funding in just over a month. Within 9 hours they hit their funding target. As of my writing this, they are at $580,000.

This action by Double Fine is historic, and 5-10 years down the road, will be seen as a major turning point for the game industry. Why? Because any high profile creative person in the game industry right now gets to sit up and say “Holy shit, I could make a game on my own terms without a publisher!”

If I were in upper management at EA, Ubi, or Activision right now, I would be shitting my pants. And if I was any of those people who recently left those companies to start up side projects… I’d be writing up my Kickstarter page as we speak.

You see, the issue is not that this will kill AAA games. Or even allow the funding of AAA games. What it is going to do is accelerate the already rapid brain drain that the game industry is experiencing right now, as the most creative developers flee first and second party studios, and avoid third party entanglements. AAA games will get worse, because all the people who truly love making games will bail in order to have creative control, input, and the ability to do something more than a GTA or CoD clone.

The game industry is already suffering from a dearth of creativity. This action by Double Fine is a clarion call to all developers who are passionate about games that they don’t have to suffer the ministrations of a middle manager with an ego in order to make games.

Code: The Diamond Square Algorithm

I’ve been interested in procedural generation in games for a while, so when Notch’s entry for Ludum Dare 22 (Minicraft) was released, along with the source code, I went spelunking. I’ve always been intrigued by Minecraft’s world generation, and this gave me a chance to peek behind the curtain at a 2D version (which, in all honestly, is more inline with my sensibilities).

I isolated the core algorithm. It looked vaguely familiar, almost like some of the pixel upsampling algorithms I’d looked at in the past. But I wanted to know if this was something known, or if Notch rolled his own. So I immediately went to my favorite question and answer site: Stack Overflow, where I asked about it. A quick response pointed me in the right direction.

So now that I knew what it was, I hit up Wikipedia, which wasn’t all that helpful. I hit up a few related links, and found a bit of random information, but nothing so clear as I would have liked. So I set about rebuilding the code from scratch in my own project to see how it worked.

The first interesting thing I learned from Notch’s version, was to modify my point accessor functions to implicitly wrap. This has the side effect of allowing the terrain to wrap perfectly across the edge of the generated texture. Which is great if you are using it to generate a game map!

public double sample(int x, int y)
{
    return values[(x & (width - 1)) + (y & (height - 1)) * w];
}
 
public void setSample(int x, int y, double value)
{
    values[(x & (width - 1)) + (y & (height - 1)) * width] = value;
}

These functions let us safely index off the edge of a texture, since it will wrap the data.

Now, we start building our data. Step one is to jump around the texture and initialize a stippled pattern. These are our pure random seed values, which will be interpolated across the texture in order to generate the terrain. The granularity is up to you, but what the spacing accomplishes is a rough control over the ‘size’ of the various features of the terrain map.  If you set your initial step size to the size of your texture, you will usually end up with a large mountain, or basin, depending on how you choose to look at it.

double[] values = new double[width * height];
 
for( int y = 0; y < height; y += featuresize)
    for (int x = 0; x < width; x += featuresize)
    {
        setSample(x, y, frand());  //IMPORTANT: frand() is a random function that returns a value between -1 and 1.
    }

You’ll note that we actually index off the side of texture; but that is okay since we build our sample functions to wrap.

Now comes the meat of the algorithm. We have two functions we use to set a new sample in the texture.

public void sampleSquare(int x, int y, int size, double value)
{
    int hs = size / 2;
 
    // a     b 
    //
    //    x
    //
    // c     d
 
    double a = sample(x - hs, y - hs);
    double b = sample(x + hs, y - hs);
    double c = sample(x - hs, y + hs);
    double d = sample(x + hs, y + hs);
 
    setSample(x, y, ((a + b + c + d) / 4.0) + value);
 
}
 
public void sampleDiamond(int x, int y, int size, double value)
{
    int hs = size / 2;
 
    //   c
    //
    //a  x  b
    //
    //   d
 
    double a = sample(x - hs, y);
    double b = sample(x + hs, y);
    double c = sample(x, y - hs);
    double d = sample(x, y + hs);
 
    setSample(x, y, ((a + b + c + d) / 4.0) + value);
}

These two functions do most of the heavy lifting. They take an average of a set of points around the given pixel, and store it back into the data.

Now, the core algorithm.

void DiamondSquare(int stepsize, double scale)
{
 
    int halfstep = stepsize / 2;
 
    for (int y = halfstep; y < h + halfstep; y += stepsize)
    {
        for (int x = halfstep; x < w + halfstep; x += stepsize)
        {
            sampleSquare(x, y, stepsize, frand() * scale);
        }
    }
 
    for (int y = 0; y < h; y += stepsize)
    {
        for (int x = 0; x < w; x += stepsize)
        {
            sampleDiamond(x + halfstep, y, stepsize, frand() * scale);
            sampleDiamond(x, y + halfstep, stepsize, frand() * scale);
        }
    }
 
}

So now we go over all the data, and fill in the middle points. We do so by creating new samples with the given pattern, and adding in a random value. I’ll get to scale shortly, ignore it for now. It may seem strange at first, but remember, our goal on one pass of the algorithm is to fill in all the midpoints, so that we can run the algorithm again, with successively smaller step sizes, until the texture is filled in completely. We sample the square once, and then do two diamond samples, in order to accomplish this. I’ve made some really bad programmer art images to highlight this (with apologies to any colorblind readers).

This is our starting state, assuming a 32×32 texture, and an initial feature size of 16. Note that since it’s a power of two, we’re relying on our earlier wrapping behavior heavily in order to get the desired sampling.

After running the sampleSquare loop, we end up with this:

Numbers have been added to show the order in which they are placed. Remember, each new pixel is sampled with a random variance from the neighbours that form a square. As you can see, we don’t have enough data in here to run our diamond square algorithm again. So now we fill in the diamonds:

You should be able to see why we do two diamond samples. The first set gives us the yellow pixels, the second set gives us the green pixels. The numbers in the image are backwards, so the pixels marked 2 are done first, followed by 1. I’d fix the image but I made it on a trackpad and it was hard enough already. Note that this step is relying heavily on the wrapping behavior — it is wrapping backwards around the texture in order to complete the diamonds.

Now that we have all the individual points filled in, we can now complete our algorithm and build a full terrain texture.

int samplesize = featuresize;
 
double scale = 1.0;
 
while (samplesize > 1)
{
 
    DiamondSquare(samplesize, scale);
 
    samplesize /= 2;
    scale /= 2.0;
}

We successively shrink the scale, so that the random variance added to each sample is diminished with step size. The result of this is smooth ‘hills’ and ‘valleys’. We run the algorithm while our sample size is greater than one, and successively shrink that as well, so that at a sample size of 2, we fill in the last step, completing each pixel in the texture.

Below is a completed texture at a size of 128, with a feature size of 16:

There you go! You can now generate 2d terrain to your heart’s content. I’m just mapping the floating values to a color lerp between black and white, but you can very easily use the value as a z component instead, and make yourself 3d terrain instead!