Categories
Uncategorized

An Incomplete Adventure

So, in late March, after not posting here for two months, I made a post called “Breaking the Silence“. “I’ll try not to let quite so much time go without a post again,” I said in the last paragraph of the post.

And then I went silent for four months.

Urgh. I’m sorry. The last few months of the school year were very busy, and then as soon as the school year ended I got swamped with studio teaching work; and I had lots of other things to catch up on, and… yeah. I really wanted to get back to working with Unity, but it’s been a tough time.

I even registered for the latest Create With Code Live Learn course, thinking it had been long enough I could use a refresher, but then with my teaching schedule I was unable to attend any of the sessions (and with my overall time crunch I didn’t get a chance to follow along offline either). But… after school ended I did manage to attend one brief “Power Up” session, and there I heard about the upcoming Create With Code Game Jam.

I’d tried participating in a Create With Code Game Jam once before, but ended up working the days of the jam and having little or no time to work on my game, and ended up not getting much done. This time I had those days completely free (or so I thought), and could concentrate on the jam (or so I thought), and things should go better.

And, well, it did go a little better. But not as well as I’d have liked.

The theme of the game jam was “Modernizing a Classic”. I decided almost immediately on what I’d do—a 3D version of the classic Atari 2600 game Adventure, a favorite game from my early childhood. I didn’t commit to this right away; I did try for a bit to see if I could come up with a better idea; but no, I ended up going with my first concept.

Except that I admit I had a hard time really focusing on it. I hate to say this, but… I didn’t really want to do it. I do want to get back into Unity, but I… just wasn’t feeling it that day. Maybe it was just the stress of knowing how much else I had to do that I was behind on—these were really the first free days I’d had in months, and maybe a part of me was thinking a game jam wasn’t the best thing to spend them on. (Maybe that part of me was even right.) But for whatever reason, I couldn’t really throw myself into the game jam like I wanted to.

Oh, that’s not to say I got nothing done. I did browse the Asset Store and get most of the assets I needed—castles, keys, a sword, a bridge. I gave a lot of thought to how I was going to implement the bridge, which was going to be tricky… the bridge in Adventure lets the player pass through walls, and in the 3D version I wanted it to basically create a hole in the wall so the player could see what was on the other side. What I eventually settled on doing was having the bridge detect collisions with appropriate walls and generate a shape above it with a texture that showed the output from a second camera; that camera would be at the same position and angle as the main camera, but would differ in that it didn’t show the layer that the walls were on. As for letting the player pass through the wall, the bridge would detect when the player was on top of it and would turn off the colliders in the walls the bridge traversed.

I can’t say for sure if this method would have worked as I’d hoped, though, because as it turned out I ran out of time and didn’t get a chance to implement the bridge at all. (Which was especially vexing since the bridge model was the one asset I’d actually spent money on; all the other assets I was using for this project were free.) But more on that later.

So anyway, that’s all I got done the first day of the jam. Gathering assets, and a bit of planning. That’s not nothing, I guess, but it’s not nearly as much as I should have or could have got done had I been able to focus on it better.

Then the second day… I was unexpectedly called into a studio teaching job. So I didn’t have that day to work on the game after all. Or at least I didn’t have the whole day; I did manage to get some work done. I got the basic player movement working, and the functionality to let the player pick up and drop objects. And I set up the game map, including the maze, which was another tricky thing to implement. The maze in Adventure, you see (or mazes if you’re on level 2 or 3, but I only got time to implement the one), doesn’t really follow regular geometry; it warps around and connects with itself in weird ways. I got this working by having segments of the map move around as the player entered them, along with all the neighboring segments and other parts the player could potentially see from where they are. Because of the way the maze worked, from some parts of it the player could potentially see the same other segment in more than one direction, so to get that working I created duplicate versions of those parts of the maze that would be shifted into position in the distance. This all worked pretty well, though there was one special case I didn’t get time to address: if there’s an object in the duplicated part of the maze, that object wouldn’t show up in the duplicate. I had an idea for how to fix this—I’d create duplicates of those objects as well, and place them in the duplicate maze segments when their originals were in the duplicated segments—but again, I didn’t have time. (This is something that’s not too likely to come up in any given playthrough, though.)

I also spent more time than I should have figuring out how to texture a Unity cube. By default, any texture you give the cube is just duplicated on all its faces. I wanted to give the maze walls brick textures that… didn’t work that way. But I couldn’t see a way to alter the UV mapping of the Unity cubes to allow that. What I eventually did was just create new cubes in Blender that had the UV mapping I wanted, and import them. And then it all ended up being a pointless waste of time because I didn’t get time to do the textures I wanted to anyway, and all the walls just ended up having solid textures anyway.

So it was the third and last day of the game jam that I spent the most time on. I built the castles; I got the keys working with the gates; I made the chalice that had to be returned to the gold castle to win the game. (I didn’t use an asset from the Asset Store for that; I just made the chalice in Blender.) And then I did some things with textures to emulate the original Adventure. The chalice’s color would continually change, and after the player won the game the color of walls of the final room and of the player cube itself would change along with it. Before that, the player’s color would change to match the walls of whatever map segment they were in. This, at least, was something new to me—I don’t think I’d dealt with changing textures in code before—though it turned out to be relatively simple.

What I think I spent the most time on was implementing the dragons. That was the one thing I didn’t have an asset for yet, and I had to do a bit of searching to find a suitable dragon in the asset store that met my needs. The needs were fairly simple; I wanted it to have a death animation, and I wanted it to have a flying animation. (The dragons in the original Adventure didn’t have visible wings, but they could pass through walls, which wouldn’t be fair in the 3D version since you wouldn’t be able to see them coming; I’d decided to have them fly over the walls and descend when the player was near.) I eventually found one and put the dragons in the game, and then got to coding their behavior… getting them to wander randomly about the game map; getting them to die when touched by the player’s sword. (The random wandering has a pattern that may not be immediately obvious; in each step the dragon usually chooses one of four points in its current map segment to move to, but there’s a chance that instead it will choose to move to an adjacent map segment, in which case it will move to the center of the border between the segments.) The last thing I did with the dragons was get them animated; they came with animations, but they were never activated by default. My recall of how animation works in Unity was a bit rusty (and I don’t think it was something I’d ever been totally comfortable with), but I managed to get it working.

(There were a few minor glitches—the dragon’s attack animation didn’t come till after it had already caught the player, and once it did the player ended up carried below the dragon instead of inside it—but again, I didn’t have time to fix these.)

After uploading what I hoped was the finished game, I did a quick test and found that there was a serious problem… the black key didn’t open the gate to the black castle. That problem turned out to be fairly simple, though, and easy to fix; each object in the game that the player could pick up actually existed as two objects, the one on the ground and the one carried by the player, and I’d set the trigger for the black castle’s gate to be the uncarried key instead of the carried one. So I made the fix, rebuilt the game, and uploaded the working and winnable version.

There was still a little time left, so I put in a few more things I’d been hoping to do. I added some simple sound effects. I put in in-game instructions. (I also wanted to follow an optional “diversifier” about the game being “Language Independent”, so the instructions were entirely pictorial, with no text—aside from the letters on keys. Though I’d intended to include in the instructions the goal of the game (by showing a picture of a chalice, then an arrow, then a picture of a gold castle), and I forgot to do that. Oh well.)

So I did get a complete, workable game done this time… but it wasn’t nearly as much as I’d hoped to get done. Like I said, I didn’t get time to implement the bridge. Or the magnet (an item in Adventure that drew other items to its position.) In fact, originally I’d hoped to implement Adventure level 2, with three mazes, three castles, and three dragons… but only got a chance to implement the simpler level 1. Had I been able to focus on the jam like I should have all three days, would I have had time to get all that done? Probably. But I didn’t. I do hope to eventually keep working on the game and implement the features I didn’t have time to do before the deadline (may as well not let that $15 I spent on the bridge go to waste), but I’m not going to do that right away…

Anyway, I’d say that at least the jam got me back into the groove with Unity… except that it didn’t, I guess, because the jam ended two and a half weeks ago and I’m just now posting about it and haven’t really touched Unity since. Ugh. I just have… so much to do. I do want to learn more about how to use Unity, though, and there are so many things I want to create with it… I really have to get back into it.

The Create With Code Jam showcase is starting on Twitch right now as I type this (part of the reason I finally got around to making this post), and I created a Twitch account just for that, so… I’m going to go ahead and post this now, though I may edit it later and add more images; I was kind of in a rush to post it before the showcase. (I’m not really expecting them to play my game in the showcase; I’m sure there were a lot of more interesting submissions.) But… yes, the last few months have been hard, but I really have to get back into Unity…

Oh… and if you’re so inclined you can play the game here.

By March Miskin

Hi, I'm March Miskin, and this is my blog, so if you want to know more about me... read the blog, I guess.

Leave a Reply

Your email address will not be published. Required fields are marked *