Thursday, May 31, 2012

i think i see a light a little ways down this tunnel..

Got the new game working on my EVO 4G last night. I have to say it really fits well with the accelerometer controls. There's a bit of fit & finish I could add in from a previous project, as well as a Unity feature I haven't tried out yet, but I think would help make things look a bit smoother and faster. I still haven't added any collecting of things back in. It's still just a ball “rolling” around a branching maze. I'd like to poke holes in some of the walls to make it a bit more navigable and maybe add back the collect-all-the-noms mechanic. Also, sound. Gotta have sound. I might spend half a day to a day messing around in Bfxr and doing mixdowns in Audacity. Or I might break out the MS-20i to try and get a somewhat more authentic early-80s sound.

Still haven't settled on a name yet. Still undecided on the chasing enemies thing. That will require a bit of prototyping of how the AI would work. I don't think it should present a whole lot of difficulty, but I have been known to be proven wrong, so I'm taking a wait and see approach there. I think there could be other ways of adding tension to the gameplay if that were to go totally wrong for some reason. It should be alright, but it never hurts to have backup plans.

It was really exciting to see the game working on my phone and to have other people play it and start to intuitively get it pretty quickly. I may want to add in maybe one or two lines of instruction for people who've never played a tilt-to-roll-a-ball-type mobile game before. I'll probably also just spend a couple of days just jamming on the basically-complete game and just keep adding more juice and polish to it.

So, given all that, it's starting to look like it could be done sometime next week. The thought of that even possibly being the case is making me giddy. :)

Wednesday, May 30, 2012

an innovative use of the word "traditional"

These are some thoughts and speculation that I have about the "console gaming" "space". Tim Cook referred to this recently as "traditional gaming", which struck me as a rather innovative use of the term "traditional gaming", because I had associated that with things like board games, card games, and running around outside, not sitting in front of the TV with a gamepad making imaginary people made out of colored blocks jump over things. One of the hot questions these days seems to be "what if Apple were to make a games console? wouldn't that be awesome?"

I'm going to go out on a limb here and speculate that what Mr. Cook meant by his statement, and his follow-on answer about TV games in general "that could be interesting" to mean that Apple has no plans to make a games console, but might have plans having to do with video games played on big screen TVs. There's a bit of rumor flying around about Apple developing a smart TV, or "iTV", if you will. If this turns out to be reality, there's going to have to be some way of controlling it. There are several possibilities for this, some of which I'll enumerate as follows in an attempt to appear intelligent:

 - classic Apple Remote - as used on current Apple TV - media-centric, conveniently not obnoxiously large, but more easily losable in beween couch cushions. Built in magnet makes it a little easier to stow, however.

 - iPod Touch / iPhone remote control app - this seems pretty obvious. I haven't checked myself, but this may already be implemented on Apple TV. If the TV device can work as a wireless hub, not only can they eliminate the need for another box in the house (the router in addition to the cable box), but now it has integrated support for using everyone's iDevices not only as remote controls, but as virtual gamepads (assuming API hooks are implemented - can't see why they wouldn't do this).

The latter also opens up the possibility of having games implemented for said supposed TV device to interact with companion "controller" apps written for iPod Touch / iPhone / iPad, effectively enabling it to compete with Nintendo's upcoming Wii U. The Wii U would still have the advantage of actual tactile buttons. These are a bit more important for games played on a TV and controlled by an external device, i.e. gamepad, because the player is not looking at where their fingers are touching. They're effectively playing blind and must rely on tactile sensation in order to effectively navigate the controller.

On a touchscreen device, this actually isn't quite as important, except in cases where input latency is critical. Again, this is all just my own speculation. I have no knowledge of what Apple's actual plans are, and am not intending this as suggestions to them. I'm sure they know quite well what they intend to do in this area of the market and will let the rest of us know in due course. I will now return to my regularly scheduled programming. (perl!)

you'll never get out of this maze

Did some additional refactoring to the core player movement code tonight, revisiting it for probably the first time since I wrote it during the Ludum Dare jam. Being code written under time pressure, it was pretty messy, although not totally unreadable. The vector math for moving the ball around the cube surface turned out to be fairly simple in the end, if a bit counterintuitive in a couple spots.

Removing Debug.Log code and some of the spatial conversions I was making to make things more suitable for debug output really sped up maze generation time. It went from generating a 7x7x7 cube maze in about 4 seconds on my PC (this is with some other optimizations I had done earlier), down to less than two. That data structure I mentioned in an earlier post seems to be really doing its job, because maze generation time appears to not have any exponential characteristics. I was able to go up to 15x15x15 and higher with hardly any additional performance hit.

Of course, this is all on a high-powered PC, and not on any target device. One of the next things to do is to implement the accelerometer code, which shouldn't be much trouble in and of itself; however, I have not tested this at all using accelerometer-based movement. It's all been direction key movement so far, so I may have to do a bit of tuning to get that right.

Aside from that, there's still the matter of are we munching dots, escaping ghosts, finding an exit, or some combination thereof. I'm thinking the testing on an actual mobile device will yield some clues as to what would most make sense as far as the overall theme of the content of the game.  That said, I would like to post an updated version of my Ludum Dare entry, which would still be themed around the idea of “Tiny World”, and would necessarily involve collecting all the dots in the maze –  only this updated version would have randomly generated mazes that could be of just about any size, but given the theme I may just peg it at the smallest one possible and maybe work with that :)

Tuesday, May 29, 2012

rainy day

My main computer has been turned off all day today up until about five minutes before I started writing this post (about 3PM). I got up around 7AM because my body just woke up and it just felt futile in trying to go back to sleep when my body was saying “Here I am! I'm up! Let's go!” I spent the morning reading through Learning Perl and working through the exercises, which are starting to actually become a bit challenging. I actually found myself looking in the back of the book on one or two of them because the clever/tricky solution I was supposed to come up with was just not happening with me at that point in time. It really is quite fascinating how a programming language can be in and of itself based around cleverness. Maybe it is just my perception at this point. I can't even really say that I'm learning Perl for any directly practical reason, other than that I do tend toward code-oriented solutions and those necessarily a lot of typing of text and occasionally having to go through and make the same stupid edit on a thousand different lines somewhere. If nothing else, I see it as an interesting mental exercise, a set of interesting problems that require thinking in a slightly different way; and I know from reading about and practicing lateral thinking that that's the sort of thing that can really stimulate mental growth and more habitual innovative thought. Plus, it never seems to hurt for a programmer to know how to write a quick & dirty Perl script. Or so I've heard.. from a friend or two, and maybe a movie.

Anyway, I've got my main machine up now and have all that other stuff taken care of, and even have a blog post pretty much written, too. So about the only thing I have left to do today is to actually get some work done. I noticed that some people bought my earlier game Patience over the weekend, as part of the Because We May promotion, which is awesome (thank you!). I was thinking that maybe it's getting around time to update the game.. seeing as the last update was, oh, last July.. I was playing the game a bit over the weekend after having watching this video on “juiciness” and thought maybe the game could use some of that.  I have a couple of ideas about what to do. I should probably write some of them down.. :) Then again, it might be more fun to just wing it and do it all game jam style. I haven't even looked at the project file yet, so it might be a good idea to let it simmer a little bit longer so I can get some of the ideas down on paper and then blast into it. In the meantime, I can do some of that boring visually-aided debugging I've been doing lately..

Monday, May 28, 2012

i failed at being lazy today

I really tried not doing any work at all today. I read a bit more, slept a bit, went through and organized my stuff a little bit, played some video games.

At the end of the day, I wanted to write some code.

I may have just been the slightly more computer-sciencey nature of the problem at hand in my project (a specialized O(1) add/remove/access bi-directionally associative data structure, if you must know). It might also have been that I would really like to finish this game I'm working on soon, and getting this working is just one step closer to that of probably quite a few steps still left to go.

I've been intentionally trying to scope my projects small enough that they don't really need any sort of extensive planning and can thus benefit from a somewhat improvised approach. I have an idea of what features I'd like to get in, and maybe some idea of how much each of those might cost –  but in all honesty a lot of times the features are things that I've haven't done before either at all or in the specific context in which I'd like to implement them. I try to limit the number of things in any given project I take on that's like that, but there's always something. I'd go so far to say that if there weren't anything like that, the project wouldn't be very interesting to me, and I might not be motivated enough to finish it at all.

Here, in this game, so far, it's been a cube-shaped world, now it's random maze generation, and probably some kind of pathfinding AI. I've done random dungeon generation before (recently, actually – I may still have what I did on the test arcade page), but the whole area of procedural player space generation in general is still a bit new to me, and seems to have lots of caveats and things to get the hang of that maybe I haven't quite gotten the hang of just yet. Of course, once I get the hang of those things, I'll naturally want to move onto more challenging problems in PCG, and I'll be back here again.

In the end, my goal is to make a fun game that a lot of people, including myself, would be able to enjoy and find a lot of value in, preferably in as minimal of a time period as possible so that I can move onto to making more fun games that are just as good, if not better.  The difficulty of the problems I encounter in doing so seems a bit disconnected from this.  On one hand, a fun game is not necessarily very complicated or very innovative, although it very well could be.  On the other hand, a game that's not at all innovative (read: blatant clone) is probably not going to go very far, at least, not without a lot of marketing thrown at it, which even if I was able to do, I wouldn't be very comfortable in doing it. 

So it comes back to this drive I have to innovate, to make new things, new ways of having fun, of enjoying oneself. It just doesn't compute in my mind to throw out the same thing that's already out there, that in almost every case I can think of looks a lot better and is much better known to people simply because the people who made it had a lot more money at their disposal.  I do not have that advantage. I have to work with not having a lot of money to throw at things like marketing and licensing and paying people to do things for me. At least for now. That might change later. But right now it's just me, myself, and I throwing everything I've got at these games to make them fun and cool and worth people's whiles. That's my value proposition, so to speak.

Then again, there are plenty of examples of games that don't use cutting edge technology, but might still be considered very innovative, if not valuable. I'm sure they all still have a lot of hard work put into them in lots of the right places. Maybe that's the commonality of all this. Doing the right work in the right places. It seems like a very vague proposition, but I'm starting to get the feeling that it's more like riding a bicycle, and that once a person learns how to recognize the right things to work on and is able to just motivate themselves to keep working on them, it becomes like second nature. I can't say that I'm quite there yet, but maybe in recognizing what it is, I can move in that direction.

Tuesday, May 22, 2012

Learning Perl.. on a Mac

One of the nice things about Mac OS X is that, because it is a UNIX descendent, it has things like Perl and Bash built into it (at least, I think it is bash..). My inner *nix geek can happily geek out in the terminal window with pipes and shell scripts and whatnot.

I'm starting to use my Mac a bit more because I plan to start co-developing for both Android and iOS. It's a late-2006 model iMac –  one of the last of the white polycarbonate-enclosed iMacs. I bought it way back when I was working at Microsoft in the Windows org, and wanted to at least get an idea for myself of real comparison between Windows and Mac at that time instead of relying on silly TV commercials telling me what to think.  For what it's worth, the iMac has generally performed favorably, especially considering how long it's been in use, so I'd say it was definitely worth the $1200 or so that I spent on it initially. I did have to take it in to the local Apple store to have the screen replaced at one point due to vertical lines popping up all over the place, but other than that, it's aged pretty well. It still works –  a little slower and less powerful than the beefy workstation I do most of my work on, but still pretty usable. And it takes up very little space, which makes it a great secondary computer. Its purpose now is to serve as my iOS build and debugging machine.

I'm also starting to really dive into Perl, because, well, it's a useful language to know, or so I've been told. I think it might be interesting to write a game in Perl, maybe a text adventure that scours your hard drive for plain text files and mad libs in some of the most commonly used words it finds :) That aside, it's always useful to learn new programming languages with different programming styles to broaden one's perspective. And somehow, I got all the way through a UNIX-based computer science education without learning Perl. Time to fix that.

Since the iMac never really gets turned off, because it's quiet and off enough idling in sleep mode, it's easy enough to just start typing away on it in the morning while I'm reading the llama book. My inner UNIX geek uses VI, so I've put mvim on the system and use that for editing scripts. The scripts I've been writing so far have been building up gradually from the 'hello world' into the basic arithmetic and string operations into lists and arrays and so on –  a familiar sequence and a useful one in relating the specifics of the language to what I already know. 

I've also signed up for the perl-beginners mailing list, and have been getting this daily deluge of mail threads on various questions which, if really beginner level, must mean that I am a total newb at this language and have a lot to learn.

Monday, May 21, 2012

randomly generating mazes

One of the more interesting suggestions I got as feedback on my Ludum Dare 23 entry was to randomly generate the maze that the player must navigate. When I say “interesting” in this context, I really mean “wow that sounds pretty tricky to do but man that would be awesome.” This was one of the earlier comments that came in during the judging period, and I could see how it would definitely add a lot of replayability value to the game, so I went straight to work on attempting to add it.

The first thing I did was look at the entry for maze generation algorithms on wikipedia. The key takeaway I got from this was that this is a bit different than the roguelike dungeon generation I had been toying with earlier, and is really quite a bit simpler, is it there is no differentiation between rooms and corridors. It's just all corridors in a pure maze generator. The different algorithms that can be used basically boil down to some variation of depth-first search. I eventually decided on Prim's Algorithm, as it uses a standard iterative loop rather than recursion – less messy.

The hard part, of course, is making it work on a cube-wrapped 2D map in such a way that the sides all connect together seamlessly. To do this, I'm having to build a system to work with spatial coordinates of the form (face, x, y), where face is an index in the range [0,6] and x and y are within the range [0, size], size being the length of each edge of the cube. These face coordinates get mapped into a 2D array, where each (row, cell) combo maps to a specific location on the surface of the cube. To prevent the annoying situation of having an edge space on one side be open while the corresponding edge space on the next adjacent face of the cube be closed, all such edge spaces share the same (row, cell) location with each other. The corners of the cube are always occupied, as having to work with open corner spaces would be needlessly complicated and would not add much value to the mazes.

With the corner spaces not represented at all and the edges being special case rows in the array, we're left with the the inner (size-2)x(size-2) area of each face. Since the parts of the edges that are not corners are also (size-2) units long, this means that everything can be mapped to a 2D array that is (size-2) units wide. Since each face is (size-2) units high, and we always have 12 edges, we get 12+6*(size-2) rows in the array.

The mapping code to go from (row,cell) to (face,x,y) and back is a bit complicated. I created a suite of test cases using PICT-generated inputs, hand-calculated expected results from those inputs, and a small data-driven test harness class to check just this mapping, as it really comes down to a lot of if/else code that can be highly error-prone otherwise. Using the PICT-generated test cases snuffed out like 95% of the issues I had with this code directly through the test cases themselves, and got me close enough to the other 5% that they were easily visible as I was fixing the other errors in the code. This experience has led me to take a more TDD-esque approach wherever possible, particularly with this mapping code. I'm in the process of creating a distance function to find the surface distance between two points on the surface of the cube, and have created a similar set of test cases using PICT and manually-calculating the results on paper (and Excel).

The actual maze generation code got a bit messy at first. My initial implementation produced these odd-looking mazes that hardly ever would be completely navigable and were thus not very fun to move around, which was disappointing. I took another crack at this yesterday, refactoring the maze generation code using the 15 line rule and the Single Layer of Abstraction Principle (SLAP) into several short, concise functions, and made a little tiny change in what turned out to be the middle layer of abstraction in this former spaghetti mess, and was amazed to find the algorithm generating mazes similar to the ones pictured in the wikipedia article, only wrapped around the surface of the cube.

There's still a bit of work to be done before I can call it a game and release the thing. I'm still debating whether to go the simple find-the-end maze route where I pick an end point and have the player navigate there, or open up parts of the maze, populate with dots, and add enemies that chase the player around, or both. Either way would definitely involve the distance function I'm working on now as a key element.

Sunday, May 20, 2012

the indie gourmet: buddha bowl

My first encounter with the buddha bowl was in a place called Thrive that is in the neighborhood I lived in for several years in Seattle. They made it as a lunch special for like $8 (which is cheap for them), so that's what I tried the first time I went there, and I was pretty damn impressed with how f***ing awesome it was in so many different ways. It was really filling, it was really good, it was not at all greasy or loaded with sugar, and just felt really healthy to eat. Oh, and it is vegan and almost entirely raw food.

Being super impressed with this, though a little sticker-shocked, I went searching online to see if anyone had some recipes to at least approximate what I had stumbled across at this trendy hole-in-the-wall vegan/raw/organic oasis. What I found was a way to make a decent buddha bowl for a bit less than $8/bowl (I'd still drop $8 on the Thrive version, though, FWIW).

Here's the basic recipe that I use:

1) Whole grain starch: brown rice or quinoa, cooked
2) Marinated greens: kale, collards, chard –  the leaves have to be a bit thick to stand up to the marinade
3) Sauteed onions
4) Raw broccoli
5) Raw carrots, julienned
6) Hummus
7) Soy/Lime Garlic dressing –  1 tbsp low-sodium soy sauce, 1 tbsp lime juice, 1 clove finely chopped garlic

Offhand, I'd ballpark this at maybe $2–$3 a bowl, tops. I usually buy/prepare all this stuff in bulk, so that tends to bring the cost down quite a bit.

The marinade for the greens is fairly straightforward. There are lots of different recipes readily googlable, but I like this one that I have since forgotten the source of, but it works and is very cheap to prepare :)

* 1 bunch stiff-leaved greens: collards, kale, or chard work well IMOE
* 2 TBSP olive oil
* juice of 2 fresh lemons
* 2 TBSP low-sodium soy sauce

Wisk the olive oil, lemon juice, and soy sauce together very well in a bowl. I've found that beating it against the side of the bowl like beating eggs helps to mix everything together with the oil.

1) Wash the greens thoroughly.
2) Strip the leaves from the stems.
3) Arrange the leaves on top of each other in little piles.
4) For each pile of leaves {
 a) roll the pile up into a tight roll
 b) slice across the roll in very thin increments so that you get these little discs of rolled up leaf ribbons
5) Put the sliced leaf ribbons in large flat dish suitable for marinating (i.e. it can hold liquid and can be covered easily)
6) Pour the marinade mix over top of the ribbons; mix it around well with a spatula or spoon
7) Cover the marinating dish and let it sit in the refrigerator for 6–24 hours

Makes about 6 buddha bowls worth of greens. Keeps in the refrigerator for about a week or two.

I'll remind myself to take some pics to add here the next time I make this (maybe tomorrow)

Friday, May 18, 2012

oblivion vs skyrim

I've been playing The Elder Scroll IV: Oblivion over the past couple of days. I got the PC version on Steam even though I already have the game for XBox360 because

1) I've heard on several accounts that the PC version is the best one on account of having higher resolution, more memory to play with, more hard drive space, and a much more open modding capability, along with an ever-maturing collection of mods available for the game.

2) I'm lazy when it comes to playing video games, and would rather play one at my desk on my high-powered Core i7 PC with 20GB RAM and terabytes of hard disk storage than go out to the living room and play one on a five year old console with the computing power of an obsolete Macintosh.

3) On my PC, I can play a game fullscreen on one monitor in one window and have, on the other monitor in another window, any of the following: the help guide for the game, Twitter, Facebook, or the thing I'm actually supposed to be working on, which I can shift to during pauses in the gameplay and sometimes think about while I'm playing.

With these in mind, I now find myself a little puzzled as to why the focus for Skyrim was apparently shifted over to the console versions. While I'm not going to deny that the game has been very successful in the marketplace, the PC version didn't do too badly, and I've read that there has been a significant amount of (mostly technical) trouble with the PS3 version.

Anyway, so I was playing the PC version of Oblivion, and noticed a few interesting things about the game. The game obviously lags behind Skyrim in terms of graphical detail, the quality of most of the voice acting, the leveling system, among others. What's interesting is that there are a few areas where it actually seems to be subjectively better than Skyrim: the landscapes are more colorful, the cities are bigger and more populated. The Thieves Guild quests have a much greater emphasis on actually stealing things and is more like Robin Hood vs Skyrim's mafia-esque thieves guild that is largely in the employ of the rich and underhanded. Oh, and spell crafting can be pretty awesome.

This isn't necessarily to say that one game is better than the other, and to give BethSoft credit, there is quite a bit more to like about Skyrim for the millions of folks out there who just want to play a fun game and maybe get lost in it for a few days. Where Oblivion still seems to shine, to me, (at least after a few hours of playing the PC version) is a certain depth to the game world.

Maybe “depth” isn't the best way to put it –  but it does seem like there are more people who attack you in Oblivion that actually have names and maybe even a bit of backstory to them –  kind of like Star Wars, in a way, where practically ever character that appears on screen has some kind of story behind them, even if it is never explicitly referred to it the movies. There are quite a few instances in Skyrim where the player is fighting named opponents –  even some of the dragons are named. In Oblivion I've been getting the impression that this is happening a bit more at the lower level, like even some of the grunts you fight have names.



Tuesday, May 15, 2012

porting to iOS

One thing I've been meaning to do for a while, but have kept putting off is starting to make games for iPhone and iPad, and porting the one game I have released so far on Android Marketplace, as well as the one I'm working on now to the iTunes App Store.

In order to do so, I would need, at a minimum, the following:

* An Intel-based Mac running a recent version of Mac OSX (Lion or Snow Leopard)
* The most recent version of Xcode that I can run on the version of Mac OS X running on this Mac

To get the latest version of Xcode would require OS X Lion, which requires a Core 2 Duo Intel Mac. The iMac that I'm using is an earlier model Intel Mac, and only has the Core Duo. It works fine, albeit a little slow, but only has OS X 10.5. I just put in an order with Apple for 10.6 so that I can install Xcode 3 with the iOS SDK. Once that arrives and I get it installed on the machine, the plan at this point is to go ahead and get the Unity iOS Pro license added onto my existing Unity Pro license and start porting my Android game Patience over to iOS.

The actual porting process may just be a simple re-compile, a bit of smoke testing to make sure it doesn't crash, as well as getting the right-sized icons and screen shots ready for the App Store submission. It might, however, involve a little bit of debugging, which feels a little scary to me right now, because I have no idea how that's going to turn out, if it is even an issue. The only iDevice I really have in my possession right now is a second generation iPod touch. I have no idea if that's going to be able to handle the game or if I'd have to require a newer generation iPod Touch / iPhone / iPad. I may need to enlist some beta testers (please e-mail me if you might be interested in participating in this) to help me identify any issues in the iOS build of the game, device-specific or otherwise.



Monday, May 14, 2012

Feedback from Ludum Dare 23

The judging/feedback period for Ludum Dare 23 ended last night.  I had put off any serious effort at rating games until the end, but still managed to get in 93 ratings, many with comments that I hope will be helpful to the developers of those games. The game I made, which I so creatively titled “Tiny Cubic Maze World” did ok relative to the entire 330 games submitted for the jam, but still not terribly great. Here are the scores I got:

#116 Innovation(Jam) 3.00
#129 Fun(Jam) 2.75
#136 Humor(Jam) 2.24
#164 Overall(Jam) 2.79
#180 Graphics(Jam) 2.72
#196 Mood(Jam) 2.29
#201 Audio(Jam)1.36
#226 Theme(Jam) 2.22

Quite frankly, I'm surprised I even got a score for audio, which was lower than my score for theme, which had a lower rank overall. I scored a bit on Humor, probably just from the “YOU ARE WIN!” message displayed at the end when all the yellow dots are collected. Innovation was the highest raw score and the highest ranked score, which is not unexpected, considering that I can't think of any other game where the game world is wrapped around a cube that rotates each side into view as the player moves from one to the next. Apparently some people found that fun, which is awesome.

Of course, these scores definitely indicate that there is a ton of room for improvement in the game.  Here is a condensed and prioritized listing of the feedback on got on the jam entry of the game:

1) Make the maze more complex / harder to navigate / more meaningful

2) Add pac man ghosts (or some kind of AI-controlled enemies or obstacles) to keep it challenging

3) Too short ; make it longer

4) Add additional levels of increasing difficulty / challenge

5) Randomly generate mazes and other obstacles

6) Add timer / some sense of urgency

7) Ending a bit anticlimactic

8) Add some atmospheric music

9) Add sound


Sound would probably be the easiest thing to add. Bfxr is very good at generating arcade-style synth noises and iterating on them very quickly. I may even have a few sound effects laying around my hard drive that would be already useable.

I would love to add random maze generation. I've even spent much of the last three weeks working on a prototype maze generator. The end result wasn't much fun –  the maze it generated was more of the classic get-from-here-to-there type maze than one where you'd collect a bunch of things and avoid enemies. My implementation might have been a bit buggy, as found myself unable to explore the entire open space of the maze, so some parts must have been totally blocked off, which would not have been by design. I did however get the start of a serialized map data format that maps from a 2D array to positions of blocks around the surface of a cube, which may very well prove useful still.

The AI enemies, i.e. pac man ghosts, seem like the big low hanging fruit here. The trick is to make them work across sides of the cubes. Failing that they must at least be able to move around each side of the cube in a manner that challenges the player. There's a great article here that dissects the behavior of the ghosts in pac man that I did start to read earlier at some point, and might re-read a few more times to get some inspiration on how to do this AI. Whether I stick closer to the original pac man model or work in some good ol A-star or something else is still being debated in my head.

Failing entirely randomly generated mazes, staticly designed mazes would still be a very good option to pursue, and would lend themselves especially well to some kind of story or theme wrapped around the whole game. I could stick with the “tiny world” theme, although not necessarily since the Ludum Dare jam is well and over with now, but it's certainly a good option. If I lean more towards classic pac man style gameplay, with increasingly challenging AI each level, then a large number of different levels might not be entirely necessary. That said, it doesn't take a terribly long time to create a given level –  the level in the jam version was created in less than an hour. So, let's say I put in three hours per level, then I could, in theory, do about 8–10 levels in three normal working days, possibly more if I do another crazy LD48–style jam just focusing on making additional levels. Adding one or more themes on top of that would definitely help guide the creation of those levels and also address some of the other comments, too.

Music of some sort would be good. Maybe an ambient/atmospheric style. I might decide to go with some a little faster paced, given the other feedback about adding a sense of urgency.

One thing that might not be entirely obvious from the jam version of the game is that I ultimately would like to release this on mobile devices –  Android and iPhone/iPad to be specific. The controls were intentionally limited to just directional keys for this reason, as I think this maps pretty directly to accelerometer controls. I didn't do an Android version for the LD48 as I felt that would involve some extra porting work that wouldn't really add much value to my entry, although I noticed a few people did make Android games and did get some kudos from people, myself included, just for submitting an Android game. The original idea for this game was to have it played on a phone or tablet device and the player would control a ball rolling around the surface of a cube that had a maze built around it.

So that's pretty much the feedback I got on the game so far. Sorry to end the post a bit anti-climactically, but there you have it. My thinking is that if I can address most or all of these issues with the jam entry, then I'd have something worth releasing.

Saturday, May 12, 2012

new power supply smell

I didn't realize there was such a thing as “new power supply smell”, but when I opened the box of the ThermalTake TR2 600W power supply I got today to replace the Rosewill RP600VP2–S-SL power supply that burned out last night, there was this very apparent chemical odor escaping the inside of the box.

The computer just lost its juice last night. I was playing Skyrim, which may have been putting some increased strain on the power through the video card, but it's obviously never been a problem. I googled the issue and found a post on a forum (don't have link handy) saying that something called “dirty power” is a fairly common cause for power supply burnouts.

Dirty power is the reason why we plug computers and monitors into surge protectors. It is electrical current that varies by more than 10% from the usual 120 volts coming out of the wall socket. It can fry your hardware, which in turn costs money to replace and time to repair. What I think gets taken for granted –  what I took for granted – is that any old power strip will do. This might be the case in areas where there are few, if any, thunderstorms, i.e. Seattle, but definitely not the case in a place where the local hockey team is named “Lightning”.

So I made sure to get a real surge protector today at Best Buy along with the replacement power supply. I went to Best Buy because this was sort of an emergency purchase. I need to have this computer working this weekend because it is the final two days of the Ludum Dare 23 judging period, and I plan to play and rate as many games as I can before the time is up. So waiting until Monday for a shipment to come in from Newegg was not an option.

By “real surge protector”, I mean one that actually lists how many Joules of protection it provides, and lists a pretty big number –  the bigger the number, the more surge protection. One nice bonus feature the one I got came with is four outlets that are spaced further apart to allow for AC adapters to be plugged in without obscuring the adjacent plug. The limited warranty built into the product doesn't hurt, either. In any event, a real surge protector is one that takes its surge protecting business seriously, and is no mere run-of-the-mill strip-o-plugs.

Installing the new power supply was not too much of a hassle. I just had to make sure everything plugged into the motherboard and the hard drives correctly. I did have to mess around with some BIOS settings when I got the computer running again, as they must have reset at some point between the old surge protector blowing out and being powered on again with the new power supply. I totally forgot I had Ubuntu installed on one of the drives of this machine. I might've went ahead and started using that if not for my dependency on Windows-only applications and games. Some day I will have to enter a 12–step program for Windows users. Does such a thing exist?


Friday, May 11, 2012

landscape vs portrait screen orientation

I posted about my dual monitor + virtual desktop setup on Facebook and Twitter yesterday, and a couple of Facebook friends mentioned using portrait orientation for coding. I've seen and used this myself before, and have found it useful. I made a conscious decision this time around to just have both monitors be landscape, though.

There are a couple of reasons behind this:

1) Fullscreen games and movies designed for a widescreen format will letterbox pretty severely when played on a portrait screen

2) I don't have a seperate gaming machine. My dev machine is also my gaming machine, which I don't really have too much of an issue with as games are my business. I'm able to chalk up game purchases as business expenses on my taxes, so I don't see any harm in running them on the machine I use for work.

3) Dual-monitor screen capture and recording, tends to work better when the entire screen area is a regular, convex quadrilateral, so having one screen as landscape and one as portrait, as I've done before also, won't work.

4) There's a shelf going across the desk about a foot and a half above the main part of the desk. If I were to make one or both of the monitors portrait, I'd have to move this up a few inches, which would involve taking an allen wrench and unscrewing the shelf and re-screwing it in at the higher position. Not a completely insurmountable problem, but not something I'd do casually.


And really, I probably should have emphasized the greater leverage provided by the virtual desktops, as that was the real revelation that I had yesterday when I started using that –  on Windows, no less, where this kind of thing isn't exactly provided natively. Not only do I have eight screens worth of screen real estate now, I effectively have four taskbars across all the desktops – so the desktop with my Unity IDE and code editing up doesn't also have a bunch of Chrome windows with Twitter, Facebook, e-mail, etc. I don't have to close those to get them completely out of view, either. I can just move them to another desktop and forget about them for a while.

Having the double-wide-widescreen monitors is actually kinda nice in and of itself, FWIW. I have more of my peripheral vision focused on my computer screen at any given time.

Thursday, May 10, 2012

productivity level up

Today I spent some time clearing all the stuff off my desks, dusting everything off with a bit of rubbing alcohol and paper towels and screen wipes, and re-setting up my main development machine on what used to be my main desk with my former dual monitor setup.

I had been using a single monitor setup for a while on the notion that the restricted screen space would allow me to focus on one thing at a time more, and discourage me from multitasking too much. I suppose it did, to some extent, but I also found myself having to work with restricted-sized windows when I would be doing things that necessarily involve having more than one app open at a time, like, say, debugging a Unity app, or working with a 3D model to be imported into Unity.

Lately, I've been reading through The Productive Programmer, which I got a few years ago, way back when I was still working for Microsoft, and had started to read through it, but must have gotten distracted by all the things going on at work at the time. And, also because maybe I was working on this thing called Windows 7 which wasn't entirely 100% compatible with everything the book was talking about, and in some cases, may have been working toward superceding in some respect. Since Windows 7 is now definitely out there and has had plenty of time in the open air to bake with the development community, I thought I'd give the book another go, and in the cases where the information is a little outdated, I'd just do my own homework via Google. I suppose if I were still working at Microsoft, I'd use Bing, but whatevs.

One of the things recommended early on in the book, in the chapter on Focus, which I would say is a pretty key element to being more productive, is to maximize one's screen real estate. Two things to do this are to 1) use multiple monitors, and 2) use a virtual desktop manager.

The first part, the multiple monitors, was a fairly straightforward (albeit messy) process of rearranging my office so that I would have enough room on the desk that I'm using for my dev machine to have a second monitor running. I have two desks in my room: one has one large deskspace, with a smaller-but-equally-long shelf space up top; the other has a smaller main desk space, with three 1 sq ft shelves off to the side. I had my single monitor setup on the latter desk, with the first desk having my iMac and a smaller TV with a NES on it, along with various piles of things. All of this stuff got cleared off. Much of it is now on my bed. The basic essentials –  my dev machine, printer, TV, NES, and iMac –  are either set up or at least placed where I'd like them to be. The remaining 10% of stuff is in piles on the floor. I'll have to spend some time cleaning the rest of this up so that I can actually go to bed later. My desk, though, is refreshingly clear of distractions.

I also brought back my old executive office chair that I had put aside for a while. I had forgotten how nice the extra height and lumbar support of this thing is. I had brief fleeting thoughts of some day splurging on an Aeron. This will do for the time being.

Part deux, the virtual desktop manager, is something that might take a couple of days to ensure everything is working properly. I first tried the SysInternals Desktops tool, but found the Explorer process separation between the virtual desktops to be problematic, particularly with web browsers, which would try to re-open the user profile on each different desktop, causing a permission failure. Next, I tried VirtuaWin, an open-source virtual desktop manager, and am so far finding it a bit easier to use. The jury is still out, though, on how well this works with the automated screen capture tools that I use to record my daily work progress.

My iMac is over on the second desk, now, where it seems a bit more at home. The keyboard and mouse even all fit into the little pull-out keyboard tray. The TV is on the middle sq-ft shelf of that desk, with the NES and a Sega Genesis arranged side-by-side up top, leaving the lower sq-ft shelf for storing games and a single pile of books that I plan to definitely read.



Wednesday, May 9, 2012

the indie gourmet: ramen & vegi soup

One thing that has gotten me into trouble in the past was spending way too much on food, particularly “healthy” food. For a while I was a real health nut. I was working out almost every day and religiously eating a healthy, balanced diet. This would cost me something like around $400 per month between all the fresh organic this & that, protein supplements, etc –  which is fine if that kind of money is rolling in easily, and there's no one else to support but oneself.

As an indie game developer in the “developing” category of “earning adequate monthly income”, corners have to be cut. Of course, it is best if these corners are not cut at the expense of one's health, without which one could not live (or make games for that matter).

I think it is an important part of being independent to be self-sufficient in all walks of life, and food, being one of those mandatory base-level needs, is one such thing.

The problem with eating healthy, though, is that a lot of the “healthy” food being peddled these days is way too expensive and/or too complicated to prepare for most people to eat on a consistent basis, and so I've noticed the tendency is for this inverse correlation between “convenient/cheap” and “healthy”, as well as “tasty” and “healthy” to emerge, which I don't see as a good thing for society on the whole.

Anyway, one question I occasionally hear or read floating around the indiesphere is what to eat, so I thought I'd share a few of these culinary shortcuts on this blog. The first and probably the simplest and cheapest of these is ramen and vegi soup.

I'll fix a bowl of this in the afternoon or late at night sometimes. It's not the most filling thing in the world, but it's enough to tide me over until dinner or bedtime, respectively.

Here's the recipe, in case you haven't already guessed:

1 pack of ramen noodles, with flavor packet
1 cup of frozen mixed vegetables
2 cups of water (preferably clean/filtered) [use whatever amount specified on ramen package]

Boil the water per directions, then add the frozen vegis with the water and continue cooking.

(Pro Tip: You can add other stuff to it too, like tofu, chicken, hot sauce, etc)

So, considering that ramen noodles go for something like $.50–$.75 per pack, and, last I checked, a 16C bag of frozen mixed vegetables is about $1, I'd say this is pretty cheap (<$1). The most expensive part might be the tofu, if added, which, depending on how tofu-friendly your area is, can be anywhere from $3–$4 a pound. I always get the high-protein tofu –  it is still much cheaper than meat and has almost as much protein. So, let's say we add 4oz of cubed tofu, that's $.75–$1.

So, $2 for a bowl with a serving of vegis, a serving of protein, and (debatably) a serving of carbs.

If you're watching your sodium, as I have to do sometimes, you may want to consider replacing the flavor pack with something with less sodium, maybe a low-sodium soy sauce or broth boullean cube.

Tuesday, May 8, 2012

daily blogging habit

I've started making more of an effort to blog daily after seeing a couple of people I know do it themselves for various self-development reasons and also reading in a couple of places that it can be useful for taking responsibility for one's own thoughts. Having just admitted yesterday (earlier today really) to blowing most of my weekend on playing Skyrim when I should have been working on my own game or at least playing some of the other Ludum Dare 23 submissions might be one example of this.

Because I'll be writing every day, and because blog posts are better when they form some kind of complete thought, I may jump around in topics from time to time. While I plan to mostly focus on video games and video game development, I am also at the moment studying various productivity techniques and philosophies, learning Perl. I may also at some point, probably at least a couple of months down the road, start reading The Art of Computer Programming and then The C++ Programming Language after that for what I would estimate would be something like a months-long computer science refresher.

I keep my reading habit to about 30–60 minutes in the morning, after breakfast, with coffee, and 30–60 minutes at night, just before bed, and after I've closed everything down for the day.

Some days, I might relate something from my reading that I thought was interesting, and some days I might just be talking about making games, and some days I might just talk about whatever game(s) I blew the day playing. I don't expect any one of these sub-topics to, on its own, form a complete blog on the topic, as I don't expect to be that completely focused on any one thing in my blogging. If this were to be all strung together into a book, it might be called The Diary of a Journeyman Game Programmer.

did i mention i play skyrim way more than i should?

I spent entirely too much time playing Skyrim yesterday and the day before. I built up this rather interesting assassin/thief character with the idea of minimizing actual combat while still being quite deadly. As usual with such a character, Sneak was a primary focus early in the game until it got maxed out around level 27 or so, at which point the focus has shifted more towards crafting skills, mainly alchemy and enchanting, as well as the more utilitarian thief skills like pickpocketing and lockpicking. The other main skill being used is Illusion magic, particularly the Fury spell, which is nicely useful for thinning out herds of powerful enemies. Calm is also good for getting the large wilderness creatures to just leave you alone - which honestly I think should, along with Fear, be built into the A.I. for when the player is obviously vastly more powerful.

The idea I had wanted to pursue with this is to see how a more stealth-action spin on the game plays out at the mid-higher levels. The character is something along the lines of what's called a "nightblade". My thinking with this one was to eventually go the whole nightingale route with the armor and ability and all that. Actually getting those is way too easy in the game - it's really just a matter of going through the thieves' guild questline. Actually playing the role of a nightingale is a somewhat different set of skills to be built up from the beginning.

So I started by just being generally sneaky everywhere, not being shy about stealing things, and preferring to use the Fury spell to get herds of enemies to kill each other rather than to engage them head-on. I took over Anise's Cabin early on in the game, which has this cellar that's great for crafting. I've been deliberately avoiding anything having to do with the main quest. Instead, I went through the Dark Brotherhood questline, and then went around collecting the Stones of Barenziah when I was done with that. It's really just been mainly a mix of Sneak, Illusion, as well as lots of potion, particularly poison crafting. Now the character is doing some work for the Thieve's Guild, cashing in on the Stones of Barenziah with the side jobs as well as the radiant quests from the Night Mother.

Crafting poisons as well as healing potions would really save my bacon in the rare battle where I'd be forced to fight an enemy head-on. After a while I started to get good at crafting invisibility potions, which, combined with a high sneak skill and the Assassin's Blade perk, is pretty much a battle-ender. I also found the Sanguine Rose to be very useful for unavoidable combat situations, especially in the draugr dungeons where both poisons and illusion magic are useless.

So the character is basically leveled up to what I'd call the "mid-game", around level 28-30, where there's at least one questline finished, one skill tree is pretty much mastered, and the character is starting to move up one or more other skill trees. For this character, it means shifting from a more purely assassin play style over to more of a traditional thief.

I have to say it was a bit of a hoot going through the Treasury House in Markarth picking everyone's pocket, "borrowing" those extra rings and necklaces they had on their persons, and then just sauntering up to the vault behind the front desk, crouchy-crouchy-no-one-can-see-me, and grabbing a whole bunch of silver ingots, leaving only an iron ingot because it wasn't worth carrying around and the gold, because there seems to be some kind of bug where stealing any amount of gold corrupts the rest of your gold and shows it as "stolen" in your inventory, although I haven't really had any guards take it when I'd pay off my bounty in a town.

Eventually, of course, it's all going to play out, and this will just be yet another playthrough of Skyrim with yet another character build. I guess I do find it interesting that it is possible to play the game from this variety of perspectives, even if the do for the most part converge into either killing things with a sword/axe/blunt object, killing things with magic, or killing things by sneaking up on them. Maybe the reason I found this character a bit more interesting is that being an assassin is really a bit more of an honest take on the gameplay itself, rather than try to befuddle it all up in all of this "honor" business. Sorry, I just don't empathize with computer data quite as much, no matter how beautifully rendered it is.

Sunday, May 6, 2012

making this fun again

I made a few tweaks and adjustments (read: ugly ass hacks) to the implementation I had for converting the 2D buffer format I created for storing generated maze data into actual objects that appear in the game. It looks like this part of the system is working fine now, but the mazes generated still seem like they could use some improvement.

For one, the algorithm itself assumes that we're generating a maze with a set starting point and ending point, which isn't really the case with this game. We just want something to navigate around that has some twists and turns and isn't just straight corridors all around. It does need to have plenty of alternative pathways to get from point A to point B, because we're really navigating to a set of randomly-determined points where macguffins will be placed.

The other thing, and perhaps if this alone were cleared up, then a more straightforward maze setup might even be interesting enough on its own, is that even if there were a start point and an end point, it would likely be impossible to navigate between them, probably due to some bug in my implementation. So working this out is going to be top priority. Once that's done, then we'll see about adding some things to collect and maybe revisit the idea of adding some AI-controlled things-to-avoid.

Saturday, May 5, 2012

a maze

For Ludum Dare 23, I decided to have another try at a game I had attempted to make early last year, in which you navigate a maze wrapped around a cube that rotates as you cross each edge so that the side you would wrap around to flips up to face the viewer. At the time, I had tried a few different solutions to the flipping-around problem, none of which worked at all, and usually involved the cube catapulting the player off into infinity.

In Patience, I ran into a similarly perplexing issue with rotating this cube-of-cubes around in 3D space and still maintain some kind of intelligible structure so that the game knows which cube you're pointing at with you touch the screen. The problem is really that the cube is rotating around in 3D space, and so the real positions of the various points on the surface of the cube are just all over the place and require a bit of 3D math to normalize everything into a neat and usable structure. So I decided to just make it all static - the cubes don't actually rotate or move around at all. It's really the camera orbiting around the cubes that's controlled by the touch-drag input.

So for Ludum Dare 23, in the spirit of making some kind of "tiny world" (the community selected theme), I thought "well, if I were to take a maze and make a sort of planet out of it, that might work." And making things that are normally round in real life into boxes and cubes seems like a fashionable thing to do in games. So I went and revisited the maze-on-a-cube idea, with this camera-orbiting-around-the-cube idea worked in.

I should mention that I only decided to do the maze idea after going through a few other ideas which I was just getting way too ambitious with. A maze with dots, i.e. pac man without the ghosts, but in 3D, seemed like the right combination of coolness and simplicity.

Even with this simplified concept, the edge-flipping mechanic still gave me a lot of trouble. I spent the majority of the time I had for the jam just getting this right. As usual, the solution turned out to be much simpler than the various attempts that preceded it. There's a concept of "face local space", and if you go beyond certain boundaries within this space, you're off the face, and you're moved onto the adjacent face. The rest is really just keeping track of which faces are adjacent to each other, rotating the player's world-space movement around, and slerping the camera over.

The overwhelming feedback I got from this was that it is too short, which struck me at first as a little ironic for a theme of "tiny world", but ok, point taken. So I started working on a way to randomly generate mazes that wrap around this cube, because the alternative to building this out into a more complete game would be to make lots and lots of maze levels, make a level editor, and so on. Generating the mazes, in the end, requires less manual effort per unique maze generated - and, given that some kind of a mapping is needed to generate the maze data anyway, it doesn't require much of a stretch to simply be able to serialize that data into a file format. The only other thing aside from that to build an editor into the game would be to add a mechanic similar to the one in Patience where tapping interacts with the cube (i.e. toggling a wall space on/off) and dragging moves the view around.

The editor might come later. There's also the matter of simply getting the serialized data in and out of the game and onto some kind of permanent storage, which on mobile devices is not quite as straightforward as it is on PC. There's usually some kind of cloud sync-y type stuff involved, which would be completely new territory for me as a developer at this point. Which would be cool, no doubt, and I'm sure that's something that we'll be seeing in neocade games at some point if not soon - so.. who knows. I haven't really thought about that much just yet. When I do it, I'd like to do it right.

Anyway. For the sake of making this a complete game experience that's worth a buck forty two, I'm working on a system for randomly generating the maze each time the game is played. This way, you're always getting a fresh thing to navigate around, and we don't have to go through all the pomp and circumstance of writing hundreds of levels. Just generate the mazes and be done with it. Pretty simple. Still thinking through whether it should still be 'collect all the noms to win' or just 'find your way to the exit'. Collecting stuff needs a somewhat more open labyrinth, rather than a maze with a definitive start and end point, which is what the maze generation algorithms I've looked at generally do. Modifying one of them to make a more open structure seems easy enough though (fingers crossed)

As I said before, the capabilities do exist for this to grow into something a little more user-editable, so if there's enough of a demand for such I thing, I will most definitely see what I can do.