Developers' Diary

Item icons in text boxes!

by fetjuel on April 23rd, 2009 20:51 to Code, Development

This was surprisingly difficult to keep from clashing with our line-break-insertion system, because item names can contain spaces. But now, like in so many classic games, we can insert item icons into our boxes, inline with the text! This will work for any Interface object, whether it’s a menu, a dialog box, or a speech bubble.

pastedgraphic

Maths

by fetjuel on April 21st, 2009 19:09 to Code, Development

My work was canceled this afternoon so that people could go outside and enjoy the first really nice day in Seattle this year, but I only got as far as the lobby. I made an iced soy latte and got to work on improving the main character’s movement in Paraplu. The protagonist (or “Ship”, as it’s still called in the code because of Soft Landing) had a pretty naïve way of moving, such that you can run diagonally √2 times as fast as you can run orthogonally. Also, all of the inertia code from SL was ripped out for the time being.

I set about improving the movement algorithms to yield consistent speeds in all directions, and incorporating an inertia system. I tried several complicated methods which failed in colorful ways, before settling on a cleanly simplified but almost precisely correct method. Now, it takes a moment to get up to speed, change direction, or stop, and it takes twice as long to turn around.

We got a whole lot / going on and on and on

by Jules on April 21st, 2009 10:33 to General

Had really good crack at getting some illustrations done last night and something isn’t right. I’m not sure if it’s just normal “hiatus sickness” or my own sensitivity to the environment I am working in (different computer, different application, different hardware, different location). I am having a hard time feeling comfortable drawing, and the machine I have isn’t really powerful enough to properly run Photoshop, which in turn isn’t as nice as OpenCanvas. Despite all that I am a pretty firm believer in the philosophy that you shouldn’t blame the tools for your own shortcomings. Maybe I am just rusty. Regardless, it’s difficult and depressing to spend hours trying to do something you know you can do, only to ultimately have nothing to show at the end of it.
Ugh, here’s hoping I can get through this rough patch quickly and get something back into it. The mind is willing.

On that note, anyone have a powerful laptop they aren’t using? :D

No? :D

Oh well, worth a shot.

Optimization

by fetjuel on April 15th, 2009 1:12 to Code, Development, Paraplu

Well, today I did some serious drawing engine improvement.

We now have a new type of Guy called Scenery, which has a strictly limited functionality consisting of sitting there and doing nothing at all. At the moment they can’t even animate, be transparent, or have a tint. We could add those functions in later if we find that we need them.

We now only redraw the map layer guys when a moving guy passes over them. This means we save a ton of cost that we were expending to redraw every single map tile every single frame. I made an awesome effect to test this; it causes the color of the scenery to fluctuate wildly each time it’s redrawn. (Jules, you can see it by uncommenting line 217 in guys.py.)

I started an experimental algorithmic shadow rendering that I think is kinda neat.

I hope Sofuran isn’t too lonely.

by Jules on April 14th, 2009 10:12 to General

Poor Sofuran.

Welcome home, big bro.

by Jules on April 13th, 2009 14:38 to General

Working on character artwork. I haven’t been drawing for a long time so just trying to work out the kinks right now. Ordered a new, smaller tablet (Wacom Bamboo Small), I’ve always found the GIGANTOR one that I’m stealing/borrowing from hachi to be a little cumbersome, and usually just corral a tiny area in the middle for use anyway. I hope this will present me with more opportunity to do artwork in the later hours of night\wee hours of the morning more frequently.

Seeing Fet’s beautiful work recently and playing the almost unbearably excellent Persona 4 has been immensely inspiring, and I’m feeling pretty gung-ho about making games right now.

Let’s see how that goes!

1D Inventory

by fetjuel on April 9th, 2009 19:36 to Code, Development, General, Paraplu

Goodness, has it really been 8 months since I posted? We have been very busy with real-life stuff, but the Momo Pax spirit continues. For a while I was working on implementing a 2-dimensional inventory grid like in Diablo, but it turned out to be pretty prohibitively complex. In the *getting something done* spirit that started Paraplu in the first place, I scrapped the 2D inventory and whipped up this 1D one in about half an hour.

1d-inventory

Paraplu: Ordered Layers!

by fetjuel on August 11th, 2008 18:22 to Code, Development, General, Paraplu

Whoa, I just completed the ordered layer drawing system. Before, all Guys on a particular layer were drawn in whatever dang order the game pleased. This was fine in Soft Landing, because it had a purely side-on view and it was unlikely to matter which of any given pair of peers on a layer draws in front of the other. But Paraplu has a kind of hybrid top-down and side-on view, like A Link to the Past. So when two Guys overlap, it’s important for the one that’s higher up on the screen to appear behind the one that’s lower down.

Python made this pretty easy with its custom comparison functions for sorting. These ordered layers just use this loop for drawing:

for oneGuy in sorted(layer.sprites(), cmpY):

Instead of this one:

for oneGuy in layer.sprites():

And the cmpY function is just this:

return -cmp(a.rect.bottom, b.rect.bottom)

Super simple! Thanks, Python and Pygame!



Paraplu: Sequential dialog boxes

by fetjuel on August 3rd, 2008 15:31 to Code, Development, Paraplu

It was surprisingly tricky to create a system for a series of dialog boxes that appear one after another. Soft Landing’s novel part is based on conversation scripts for doing just that, but in Paraplu’s running-around-shooting-stuff engine, we didn’t really have any way of doing it. Now the game keeps track not just of whether there’s a dialog on screen to be dismissed, but also what kind of dialog it is, so that it knows whether to bring up another when that one is gone. Currently the only thing that uses this is the “workshop” where you can craft items into other items, but in the future we might want to be able to just load arbitrary lists of strings in there and set up long narratives.

Paraplu: Items

by fetjuel on July 31st, 2008 14:23 to Code, Development, Paraplu

Julian and I both love items. One of the aims of Paraplu is to be delightfully item-rich. You should be excited to discover and collect items, admire their cute little icons, read their descriptions, and carefully consider how you’re going to budget them to craft other items. Yesterday I started in on the item system: enemies now drop stuff when you kill them, and when you collect items they are added to your inventory.

We’ll need to decide on a mechanism for which enemies drop which items. At the moment I’m thinking of a system in which: each item is assigned a rarity; each level is assigned a list of possible items; each enemy is assigned a likelihood to drop items of a each rarity. I wonder if Common, Uncommon, Rare, and Unique, to blend a bit of Magic the Gathering with a bit of Diablo, would be enough.

Event Queue

by fetjuel on June 23rd, 2008 20:29 to Code, Development, General, Paraplu

My friend Nathaniel was just watching me code, and he suggested using the event queue to process input instead of polling for every type of input every frame. To be honest I don’t exactly understand how the event queue is any faster than polling (like, at some level there must be some logic checking every key, right?), but it is much faster. Since most of the controls involve holding down keys, I’ve got a lot of code to go through and rework to use the event queue!

Chipping away at level editor

by fetjuel on June 21st, 2008 23:25 to Code, Development, Paraplu

I’ve been implementing a level editor feature or two each day. Now we have a little display on screen that tells your current tile coordinates, which paves the way for our status display of health, items collected, and so on.

There’s also a neat little blinky cursor that shows exactly where your tile will land if you place one; this is nice because the reticle can actually move one pixel at a time, making it hard to know which tile you’re in at any given moment. I was going to make the cursor its own special item when I realized I could just use our existing particle system: I make the reticle spawn tile-sized square particles every 11 frames, which fade away just as the next one is being created.

It’s great how much of the code for Paraplu is stolen directly from Soft Landing as I need it. Much of the coding is just simplifying and generalizing the existing code. When we return to working on Soft Landing, I’ll copy that code right back in, cleaner and faster and more flexible.

Paraplu: Layered Editing

by fetjuel on May 19th, 2008 21:24 to Art, Code, Development, Paraplu

So Paraplu’s level editor has so far only supported changing the map layer of a level. But there are two other layers in each level: objects and “entities” (meaning enemies or townsfolk). It was surprisingly difficult to adapt the level editor to work on these other layers, because each layer was kind of a special case in itself, and used its own batches of images and such. So I had to rearchitect the way ground tiles and objects are loaded, such that they’re all living in one big list of dictionaries now, with data about what kind of thing they are, instead of being in their own special lists. Now I can use the same logic for editing all of the different layers: when you cycle through the palettes, each one just knows what type of palette it is, and thus which layer it should draw on. If we need to, we can add an arbitrary number of layers on top of the three we already have!

Oh yeah, and Jules drew these gorgeous trees and shrubs and rocks, which is the reason I wanted to get objects working in the level editor anyway. Please don’t let my random level-editor testing style ruin your perception of his source art, though. :D

Paraplu: Drawing this was harder than it looks

by fetjuel on May 15th, 2008 18:56 to General

Paraplu: Text

by fetjuel on April 24th, 2008 19:00 to Code, Development, General, Paraplu

I just transplanted what’s probably the most complicated class in all of Soft Landing, “Interface”, into Paraplu. Along the way I chopped off a ton of messy code that I’m planning on rewriting. This is the class that draws all of our text boxes, menus, health bars, and so on. It’s not gorgeous, but it’s working:

Paraplu: Editor

by fetjuel on April 11th, 2008 19:05 to Code, Development, Paraplu

I just finished much of the work on the improved Paraplu level editor. It’s a mode you can enter when you start the game, in which the character is replaced by a translucent square cursor. There are buttons for cycling through the various batches of tiles we have, each with 9 tiles in it. Then you can hit keys to lay down a particular tile in the batch. It’s blowing my mind how quickly we’re making progress on this project; it seems like every time I sit down to work on it, I reach what would be considered a major breakthrough for Soft Landing.

We also have enormously long lists of enemies, items, and recipes, and it seems like every time I go back, Jules has added a few more…

Paraplu: Tiles

by Jules on April 9th, 2008 14:27 to Paraplu

So, I think last night was my major breakthrough that I had been waiting for. I’d like to thank Flight-Plan in particular for inspiring me to re-attempt the style I was originally going for, and to get it right this time. I studied some GBA games they’ve made and it was really useful. Strangely, my error essentially was that I was being too elaborate and ornate. All I needed to do to get my tiles looking right was to take away detail, not add or fine-tune it. With that in hand, I was able to finish all of the tiles I had already been working on and a fair few more on top of that. I’m going to get back to it again tonight and hopefully get this all sorted out.

Fet realised that we haven’t actually written down anywhere what this game is like yet. Maybe we’ll keep it that way, and then no-one will have any preconceptions or expectations. I like that idea.

Paraplu: Collision

by fetjuel on April 9th, 2008 13:47 to Code, Development, Paraplu

Well, Jules and I decided that pixel-level collision is not really going to be necessary. We’re just going to have a kind of rectangular collision mask for each entity and each obstacle, and test against those. Given the tiled nature of the maps, this should work fine. It took about ten or fifteen minutes to implement the whole thing, in keeping with the hilariously quick pace of development so far.

Then I noticed that [pygame](http://www.pygame.org) 1.8 actually includes support for collision masks, which was surprising because I thought that the term (if not the concept) was something Jules and I made up!

Next I need to make it so that entities which are trying to push up against an obstacle at an angle instead “slide” along the edge of it. I thought of a good way to do this while lying in bed this morning.

We’ve been keeping big long lists of items and crafting recipes for Paraplu at [Backpack](http://www.backpackit.com); the lists are growing quite quickly as we both stop in throughout the day to add our wacky ideas.

Paraplu: Enemies

by fetjuel on April 7th, 2008 22:06 to Code, Paraplu

So Paraplu is already at the point where we can have enemies running around the map. I got them in the game today, and have them chasing the player with very simplistic behaviors. There’s a terribly primitive collision detector in there, checking whether they’re running into any solid objects, but it’s bad in that it just samples nine points on each object’s rect, checks whether those points contain solid pixels in both objects, and if so, returns True. Tomorrow I want to write a real pixel-level collision detector.

Paraplu

by fetjuel on April 4th, 2008 12:52 to Development, Paraplu

Soft Landing is an enormous game. When I imagine it in its finished state, it’s like Xenogears, Ar tonelico, Sakura Taisen, and other pinnacles of achievement in gaming, crafted by large teams of professionals working full time. I believe we will finish it, and I believe it will be everything we are wishing for. So far it’s taken four years, and we haven’t got anything to download yet.

Nobody starts out writing by creating an epic fantasy novel. Nobody’s first film project is a feature-length special effects masterpiece. No musician would start out with a symphony. Of course, the reason is because the first stuff you make is going to serve as practice for the creator more than it serves as reward for the audience. Once you’ve got your rudimentary learning out of the way, then you can start impressing people.

But for some reason we thought it was a good idea to start out game creation with our magnum opus, Soft Landing. So we’ve spent four years trying, learning, and starting over. We have a whole lot of rererewritten code and rereredrawn art, but nearly no final in-game content. Perhaps if we were to continue on in earnest from here, we would be done in another two years or so.

But we are in serious need of something we can show. Something we can hold up as a finished product and be proud of. Jules has occasionally mentioned wanting to make some much smaller project, something finishable, something self-contained, and above all, something absurdly cute. I was resistant at first, as I am pretty married to epicness and sentimentality. But for some reason the last time he proposed it, it seemed to be the best thing we could do. Maybe the thought of MOMO PAX finally having a playable product in 2008 won me over.

Nearly all of the code for Paraplu comes straight from Soft Landing, so we’ve got a huge amount of work done after just a few hours. It’s still about moving around the screen shooting bad guys, but at a much smaller scale. For example: the Soft Landing level editor is an enormously complex script that operates on multi-layer OmniGraffle files and has taken as much time and effort as pretty much any other component of the game; meanwhile, the Paraplu level editor runs inside the game and was written from scratch in two short coding sessions.

Hopefully we’ll have something to show you soon. If you’re impatient for Soft Landing, know that this project will give us the same education we’d have gotten by going down blind alleys and grinding away time on SL, but we’ll actually have something to show for it in the meantime. And I’m still concocting the SL story bit by bit as we work on Paraplu.