Monthly Archives: June 2015


Another week on programming this entity’s behavior. A few days in and I was getting close to having it all working when I ran into the dread disease programmitis, bane of programmers everywhere. No I’m not talking about carpal tunnel syndrome. No, I’m not talking about getting a sore butt from sitting in a computer chair all day! I’m talking about the general use case.

Well, to make a long story short, it was pretty easy to create a generalized state machine AI behavior, but it was a lot more difficult to break all of the state code out into individual files, requiring me to separate all the variables used out into each of those classes rather than keeping them all in one central place in a cluttered but easily comprehensible way. It was also a lot of work taking the most general functionality, such as tests to see whether one entity can see or hear another and the code to navigate a path, and extracting that into an EntityTools utility class that I can use for all future entity behaviors.

In other words, all the traditional ways that programmers get sidetracked and waste a ton of time.

Is this time going to be a waste? Dunno! Pretty sure I could have at least done this in a better order, such as finishing getting the entity working, then extracting the general-use code out into an EntityTools class, then generalizing the state machine AI into a reusable behavior. That would have been the smart way to do it, probably. Oh well!

As things stand, if I can focus it should still come together pretty fast and be working within a matter of a day or two. That’s a big ‘if’, though, with the temperatures this week dancing up around the high 90’s and 100’s of degrees and me stuck in a tiny room with no air conditioning. Well, I’ll try to make steady progress, and maybe if I get lucky I’ll even eventually start making fast progress too.

Three years ago this month I started this blog. It was a hot Summer day like this, because that’s how years work, and I’d had a few solid shots of vodka for no reason in particular, but that probably contributed substantially to Problem Machine actually coming into existence.

Three years ago. Fuck me, am I right? Writing more-or-less weekly updates has been a part of my life for three years. I’m 32 now, as of approximately one hour ago, or twelve hours before this article’s time of publication. Some things have changed. I’ve moved twice, I’ve settled into a kind of routine, I’m set up in my own place and live here largely through my own work rather than the generosity of others (though, at all times, the line between the two is never as clear as we’d like to believe). And, for the last couple of years, I’ve been working on EverEnding, which it now occurs to me is exactly the kind of delightfully ironic title a writer with a nasty sense of humor would give a pretentious vaporware title that never manifests. That degree of existential smugness simply cannot be tolerated, which is another reason to finish the game I suppose.

Lots of things haven’t changed, too. I still don’t really feel like I’ve earned a place in the world, though I may have made peace with a growing belief that I don’t think most people ever do. I’m still so incredibly isolated, in some ways more so, finding it difficult to learn to want to engage with the world outside my head. I’m still broke, I still fight to tamp down an unearned sense of arrogance, I’m still essentially non-existent as far as the world at large is concerned, I still feel anxious and depressed frequently enough to trip up my motivation, I still try to push myself to work harder, I still often forget to push and end up spending much of my time doing barely more than nothing.

It’s not bad. It could be better.

It’s been so helpful having Problem Machine. It’s an anchor to hold me in place and a map to tell me where I’ve been. It’s a mind-dog I have to take out on mind-walks once a week, which is a pain in the ass but is good for me. I still want to turn it into more. Four months ago I wrote about my plans for the future and I haven’t done any of that shit, none of it at all. I don’t know what to do about not doing that. Something, presumably.

I just need that nudge. That hot Summer day, that birthday, that shot of vodka, that fear of mortality, than loneliness, that unearned arrogance. I need some yet unlearned alchemical recipe which, once combined, will open the road into my future. I need more error and more trial. I need to seed my world with possibilities, with disasters and with adventure, to knock myself out of orbit, to be in the right place at the wrong time and/or the wrong place at the right time.

I need a problem machine.


I started working on all of the behavioral programming stuff, then I got completely sidetracked for a couple of days when I realized that I didn’t have any centralized document with all of my story content in plain language. Up until now I’d gotten by pretty much keeping all that stuff in my head, and occasionally writing down bits and pieces of it, more often than not in the form of stories which were more metaphorical than accurate to the reality of what’s supposed to be going on in the story. This, I realized, was making it difficult to append to the story and to plan out how I was going to tell it, because I had no centralized resource to refer back to to make sure I wasn’t contradicting myself. It took me several hours to write it all down and it ended up being more than 3,000 words, which is a pretty good sign I should have done it sooner. It’s still somewhat subject to revision, but revisions should be more along the lines of expanding and going into more detail about unclear concepts than changing the specifics (unless I come up with a really good idea, of course).

After that I went back to programming the behavior of these entities, and I found that both my production planning using Trello and the detailed story breakdown of the last week or so of work came in very handy, since I immediately found myself breaking down all of the behavioral specifics that had been confounding me into a set of relatively easy-to-manage behavioral states. Thus, rather than trying to think of the behavior of these enemy types as an impenetrable wall of if-then statements, I can parse this behavior much more readily as a set of simpler behaviors that switch to other simple behaviors based on the input. So, for instance, I can have a patrol state that does nothing except walk forward, and then have it switch to either an idle action state at random intervals, a turn around and patrol the other direction state if it hits a wall or the edge of its patrol radius, or a pursuit state if it sees the player. At that point, all I have to do is write the 5 or 6 lines of code that control each state and the entity should work.

I have the basic version almost up and running, but the code to handle when and how to attack is still a bit tricky since it deals with the specifics of positioning which vary from attack to attack. All of the movement stuff is pretty much there, though it will inevitably require some debugging, and I still need to generate the timing info for things which rely on a timer (attack recovery, patrol delays, alert time, etc.) I think I can finish up the basic behaviors tomorrow, at which point I go back and do all the prototype animations needed to fully animate those behaviors – after that, I go back in and add all the code in for another version of this enemy, such as the scout or rider variants, and then I make the animations for them – and so on, and so forth, until they’re all done.

Making future enemies should be quite a bit easier after this, since I think these will be by far the most complex of any non-boss enemy in the game. Even for cases as intricate as this, in the future I’ll have these guys as a template to work from, so I expect any future problems to be quite a bit more approachable.


It’s useful knowing what team you’re on. Red vs Blue, Shirts vs Skins, Us vs Them: In game design, we try to make that difference obvious on first glance, we make the shapes different, tall and thin vs short and bulky, add distinctive hats, make everyone on one team red and everyone on the other team blue. It’s convenient, a visual short hand, telling us who is a friend and who’s an enemy.

Convenient shorthands can be dangerous. Our friends aren’t always our friends, our enemies aren’t always our enemies, and very seldom is the division clearly demarcated. And yet, many people want to believe that that isn’t the case.

Many people still see the world in black and white.

I don’t want to trivialize real-world violence by making a video game analogy here, but the same kind of convenient shorthand we use in game design to denote friend and foe is easily harnessed towards darker ends. It’s so easy to frame a worldview in us vs them, and even easier to draw that line along racial boundaries, leaving the heroes and villains color-coded for our convenience. It’s utterly stupid and evil, but I can still understand the appeal.

I don’t think the thought process is as simple as “they look different, therefore they are an enemy”. There’s a sophisticated dance of explanation as to how everything is someone else’s fault, carefully musical-chaired around until the blame falls on the desired group of undesired people. I don’t think it’s a simple problem, but I do think that it exploits a simple hole in the mental defenses of the average human being: We hate being confused. We hate nuance, and complexity, because it means we don’t know what to do. It means we’re lost.

It’s so much easier to believe that we’re a soldier in a war. It seems so simple. And for there to be a war, there needs to be an enemy – and for there to be an enemy, there needs to be a line of division, some clear point of difference between One Of Us and One Of Them. There are lots of lines people like to use, sexual orientation, gender expression, religion, nation… but race is the most convenient, the most easy, the most popular, because it means the enemy comes color-coded. Red vs blue, black and white, and like chess pieces we each have our role to play, like chess there is a strategy, a master plan.

Once we recognize that, though, once we understand that there are many people who see those of other races as an enemy and will resort to violence to win their war, what do we do next? Can we wage war against them ourselves? Who would we even be fighting against? Obviously something must be done, but to frame it as a war is to doubly inflict the logic of violence, domination, and supremacy upon ourselves. The war can’t be waged on those we see as separate from ourselves, but on the lines that divides us.

We’re not playing a war game, here. We’re playing war solitaire. And we’re losing.


I’ve kind of been bouncing back and forth between making animations for this entity, trying to refine and build out the behavioral code, and going back and building out a production schedule. Animation-wise, I created a looking-around idle animation, a crouch animation, an attack animation, and a very rough jumping animation. I redid the running animation a bit as well because I decided I didn’t like the motion of the arms. I’m just now realizing that I’ve neglected to make anything for the entity turning around, which is why I should probably try to put together a list of what I need before I put this much time in, but whatever.

MaskCrouch00 MaskIdleLookAround00 MaskRun003 MaskAttack00

The behavioral code is starting to come together to the point where I can probably get something at least semi-functional up and running tomorrow, at which point I can see about getting all of these animations implemented into the entity itself. Upon reflection, some of the variations of this entity would probably be better represented as altogether new entities, and I’m starting to question the assumptions which had me fold them all into one meta entity in the first place, but I can hash all that out as I go, though it may be a bit confusing at times.

I’ve been feeling like I haven’t been putting in enough work, but have also been having a hard time focusing enough to put in more hours. I think there’s a number of reasons for this, but a big one is confusion as to what exactly to do next, so I’ve started trying to break down a complete task list for the project so that I can start scheduling out what needs to be done. I popped open the Trello outline of the project I created a couple of years ago, and found that many of the assumptions I’d made while making it were no longer useful. I’ve been deleting entries that seemed to be backwards in their approach and replacing them with new ones aimed more directly at breaking down the specific challenges I expect to deal with regarding the construction and polishing of entities and levels.

Next week should be more of the same, on all fronts. As mentioned, I still need to make a couple more prototype animations at least for this entity, and once those are done I need to start in on the other versions for different variants of the entity. The behavior is starting to come together, but even once I get it running I’m probably going to need to spend a while tweaking it before I really like it, and there, again, I’m going to need to start adding stuff on for the different variations. And, finally, for the production break-down I’m going to break it down more and more until I can’t possibly create smaller or more approachable tasks. Once that’s done, I can see about scheduling them out, one after the other, until I have some kind of a timeline for creating the game.

When in doubt, it’s useful to attack a problem from several different angles at once. I think I can get all this figured out.



Cinder Blocks

One appealing aspect of religion is that it lets us presume our world is crafted with the same care and intent that we put into our art. The difference here isn’t a matter of intelligent design vs unintelligent design – to the contrary, the ingenuity of happenstance tempered by selective force frequently outdoes our cleverest solutions – it’s a matter of design which we understand as intentional versus design which exceeds what we can comprehend as intent.

Games are made by people. It’s reassuring. Games are made to be engaged with, explored, and usually completed – also reassuring. When the game designer closes a door, we know she opened a window for us somewhere else, or that the door is otherwise unimportant. Everything happens for a reason, it’s all part of some design plan. The designer can make a rock so big even she can’t lift it, and then she can make it liftable.

My point is not that we want from our games what we want from our religion, nor that we want from our gods what we want from our designers, though to varying degrees those may be true. My point is that we find it much easier to understand human intent than natural probabilistic occurrence. The anthropomorphized roles we make for our gods are a way of reassuring ourselves that this understanding of the world is useful and accurate even when it is clearly neither. The god that is envisioned in this manner is just a person made large, someone with small concerns and small ideas relative to their stature, more mundane than divine.

If there is a divine creator, its desires and designs must surely be so far out of our reckoning as to be indistinguishable from the whims of natural selection. It isn’t a person, and to address it as such, to assign it sex and gender and class and culture derived from our society, I can’t imagine as being anything but grossly insulting.

So we keep playing, and finding for ourselves tiny and manageable gods whose motivations, whether or not we agree with them, we can understand. We find in games places that were created for us. Sometimes those places are safe, sometimes dangerous, sometimes simple and elegant, sometimes byzantine and weird, but always created by someone like us and for someone like us, a human being with human concerns.

At the same time, we want more, and we want realer. We want to see the reflections and the pores and to see the pulse bump on the wrist. We want bigger and more complex, and as the designer harnesses systems that get bigger and harder to understand these spaces may begin to grow away from our intent again, and become another world like our own – infinite, incomprehensible, devoid of human intent, and tinged with the divine.

And then, too, we will make art there, a world cut down to size, where everything is in its place and has its role.


All the pathfinding stuff is in a place where it’s basically functional, just needs tweaking to make it look nice. This is really just as much an aesthetic and design problem as it is a programming one at this point, trying to make the entity navigate the path in a way that looks smooth and intentional, while making sure it doesn’t stray from the movements it’s calculated to take it where it wants to go.

At this point, I’m kind of tackling this at both ends, which is an image that makes absolutely zero physical sense but oh well. I’m going back and forth between tweaking the entity’s movement code, to make it move more safely and intentionally, and working on some prototype animations which will also help to sell the illusion of this as a creature with intent. The animations I have now are serviceable for the time being, though I’m going to need to make a lot more of them (crouch, attack, looking around) before I’ll be able to fully animate this entity – and this is the most basic version, with additional animations having to be created for the other versions.

It’s going kind of slow, but all of these pieces I’ve been working on for the last month or so are starting to come together to form the first fully featured enemy of the game. Once this guy is done, I can start building the first couple of areas of the game, the first foray into building actual content – I feel a bit frustrated only getting to that point after a couple of years, but heck it’s better than never getting there at all – and who knows what new things I may discover about the game, and about myself, once I get there.