FallingTown- Postmortem

Posted by
September 2nd, 2009 7:22 pm

I probably should have written this closer to the end of the contest, but I wanted to finish a small puzzle game (The Knight’s Tour) I had started the week before for release. As a result, my recolection of some of this may be a little hazy.

I’ve added a zip containing my project directory to my game’s page… it’s complete except that I had embedded the font ‘Arial’, and you’ll have to add your own copy of arial.ttf to the font’s directory in order to get it to build.

I. Genesis

(*** Note: Nothing in this section is meant as a disparaging remark about anyone elses entry, but is intended as a depiction of my thought process at the time, with respect to my entry only. ***)

When the theme came out, I really had no idea what to build. The first thing in flash space that comes to mind for me when you say ‘Caverns’ are the cave fliers, which I didn’t see much space for innovation in, or platformers where I knew I wasn’t going to be able to compete. I was pretty stuck for an idea.

Since I don’t know much about caverns I looked up cavern on wikipedia . :) The article calls a cave or cavern a natural void– which in my mind ruled out mines. I tried to come up with an idea that related to cave formation, but thought while I could write a neat simulation I wouldn’t have much of a game. The article also mentions sink holes… and at some point early in the compo someone twittered (I think) a comment like: ‘Make a board game!’

I remember playing a game as a kid, Cathedral where the idea is to place buildings on a grid to capture space. My idea stemmed from that– the buildings would have weight, and if too much weight was concentrated in a space, they would fall through to the cavern below. I guess it’s a reach to say this was connected to the theme, but it’s what I ran with. The size of the grid and being 4 players were arbitrary decisions for me.

II. Development

I knew roughly what I wanted to do, but didn’t know how the buildings would interact with each other in practice, so I needed to get an interface up and running fairly quickly. Unfortunately, I did not do much on-paper design work and just winged everything as I came to it. As a result, there are about 6 or 7 2-dimensional matricies which hold information about each cell. This isn’t an inherrent problem, but because I was making stuff up as I went, some of them are 40×40, some 41×41, some 42×42, and the grid which records stress is either 80×80 or 100×100-I think at one point I switched, but I’m scared to look now. :) To make matters worse, some of the grids are indexed [row][column] and some are [column][row]. As a result, the majority of my time in writing code for the game was spent trying to fix offset discrepencies. (Why is a house placed here, stressing something way on the other side of the board? Why is that building being displayed in the right place, but when it falls through it fell over there? Why didn’t my overlap checking prevent that placement?)

Another problem I had is that when I coded the interface originally, I tied all of the legal move validation to the mouse click… but when I came to the AI’s, I wasn’t sending mouse clicks I was sending cell coordinates. I was feeling a lot of time pressure by that point, so I just hacked in new validation methods.

Because I wasted too much time early on trying to get an application together which would let me place buildings, and see the stresses I never really got around to developing a game. My ‘first best guess’ for things like building weight, cost, rent became final constants. The only real gameplay decision I made were the points… I knew needed an incentive to place the smaller buildings and supports, so the player had to be penalized for losing a building, and that penalty had to increase with building size. But once I had that penalty, I then had to go back and give a reason to place the larged buildings. Again, ‘first best guess’ became a final and I was left with the system in place now.

II.a. If you don’t know how, fake it!

I’m sad to say, that cool as it looks, my stress map does not reflect actual physical stresses on a surface caused by weights being applied. Each building had a weight (supports had negative weights) and when the stress is calculated, if a cell had a weight it’s weight was added to all nearby cells by the incredibly complex formula: Weight = BuildingWeight/(Distance+1). This made pretty pictures, so I called it good enough. :) If I was going to take this to a ‘worthy of release into the internet flash game space’ I’d probably replace this with an actual stress calculation based on integrating moments or something like that.

Along the same lines, I didn’t have much time for AI. One of the players is totally random. The other mostly random player has a 25% chance of placing a random support. The green player queries the board to find the human player’s largest building and then places houses within 10 squares of that building. Eventually, unsupported that building will collapse and then the green player chooses another building. That’s the only behavior that’s the start of a bonafide computer player. Had I had another day, much time would have been spent creating more realistic behaviors. If the computer players appear to be thinking at all, that’s because I added a delay to their moves, because otherwise I’d have no idea what they were doing. 😉

II.b Player Reaction

I think the general comment trend of ‘cool idea, but not very fun’ is pretty much correct. I think it could have been fun, but I didn’t pull it off.

II.c. Summary

The big major takeaway for me, is that once I get the urge to start hacking at code, I need to stop and figure out why what I’ve done so far can’t be extended the way I want. If I had used one consistant grid.. or heck, if I had used many grids, but they all had their origin at the same point and were all addressed by [row][col] life would have been easier and I think I would have produced a better game.

III. Other Cool Stuff I Learned (but which you probably already knew)

You wouldn’t know it, because I didn’t put any effort in gussying up my index of development versions, but Flash Develop has .html and .php templates, and functions as a html or php editor, with code completion! I’d been doing all my wordpress maintenance (on my site) via notepad. This will help me a lot.

I’d seen passing references to sfxr before, but seeing it used in other entries I finally got up off my butt and downloaded it. It’s great and will reduce my dependence somewhat on royalty free audio sites for my normal games.

GiMP can draw straight lines! You have no idea how many hours I’ve wasted placing lines pixel by pixel because I thought it couldn’t. :)

That’s it. I’m enjoying playing everyone else’s entry.

Leave a Reply

You must be logged in to post a comment.

[cache: storing page]