JoshJers' Ramblings

Infrequently-updated blog about software development, game development, and music

Posts tagged “mop of destiny”

One Year Later

It’s done! Finally, after over a year since its completion, Mop of Destiny gets its own webpage!

I had a really difficult time trying to figure out what the webpage should even look like, so I just kept putting it off, until last night when I was almost asleep, I had that “eureka!” moment immediately before dozing off. Luckily, I remembered my idea in the morning!

Also DrilNES 1.10 is released. I fixed up a few very minor emulation issues, added support for all of the 6502’s “undocumented” opcodes (i.e. the opcodes that just happen to work even though they’re really not supposed to), and modified the display a bit.

Now you can even make it look like a crappy old TV, if you choose! For, uh…nostalgia’s sake.

Enjoy!

Woo!

WOO!

(2024 blog port note: this was once a link to Mop of Destiny winning first place in the gamedev.net 4e5 competition, but alas that page has long since vanished)

Historeez

For those who missed it:

Mop of Destiny Soundtrack MP3s!

On Power Outages (And Other Weird Things)

They suck. Our power was out for 9 days. For someone as hopelessly addicted to the Internet as I, it was like not having legs. Legs that could span the globe in an instant. Or at least under a few seconds.

The power came back on, predictably, about 2 hours after we had left for the airport to go home to Indianapolis for the holidays.

Thus, the tally of weird things that have happened in the 6 months since I’ve moved to Seattle area and started work at Microsoft is:

  • My car (Which already had $3800 in hail damage) has been involved in 3 accidents, 2 of which were definitely not my fault and the third of which I can make a pretty good case for
  • Approached by a guy with a knife near Pike Place Market. He didn’t threaten me with it, he just wanted to sell it to me for $5.
  • Almost punched by an angry chauffeur in a stupid-looking suit at the Sea-Tac airport because I had the absolute audacity to try to help him out and tell him that the name on his little sign wasn’t visible.
  • There have been floods and even a (mild, for Indiana) snow storm
  • 9-day power outage

Life: Always entertaining.

(Breakdown of Mop of Destiny’s development after the fold)

Mop of Destiny: Last Words on Code Development

For the three (at most) of you that’s actually been waiting for the remainder of the info on Mop’s development history:

After getting the gameplay test done, I got around to actually loading level data. I ended up using TinyXML to load level data from an XML file.

Side note: Initially, each level was going to have a separate XML file, but that kinda got scrapped somewhere along the line. That’s why there’s 1 xml file named level1.xml in the game directory.

After that, I added fonts. I used a 3D modeler to make a 2D poly set of font characters, and then wrote a font loader to load them in and separate them out.

Essentially, the font interface allows you to request a string, where it then builds a vertex/index buffer set (a mesh) and hands that back. Simple and easy. And still no textures.

After that, it was adding animation code (simple: just different meshes for different frames of animation), the life meter (using a custom vertex shader to bend the meter partially around a circle), enemies, the knockback from getting hit, mesh-based instead of bounding-box-based collision, post process effects, ogg streaming, and spawners and enemy types.

At this point, I made a decision that would drastically alter my timetable, though I didn’t know it at the time:

I decided to make the enemy artwork while making the enemies.

The trick to this is that, in my initial plan, enemies were going to be coded as just boxes and the art would be added later. Not long into this process, I realized that having boxes was a terrible representation of the enemy, so I started doing the art, as well.

The enemy art was the second-hardest art-making process in the game (first being creating the main character). I had chosen shadow creatures partly to hide my own general inability to draw very well…with shadows I could simply draw an outline and some red eyes. However, it quickly became apparent that it was hard to create any INTERESTING shapes out of just outlines and red eyes.

Thankfully, I was able to do so. While I tried to keep to my inital development timeline, I didn’t really notice that I had moved alot of the art process into the “coding” block of schedule. Which meant that the schedule once I hit the “Art” portion was considerably lighter. Though I didn’t know it at the time.

Extra, Extra! Gameplay Complete! Game Still Ugly!

At last, I finished coding the bosses (which were the last enemies to be coded) and had the levels laid out (using solid blocks as backgrounds). The enemies looked cool, but the game looked ugly. A before-and-after, if you will:

(sadly the “before” image is lost to time due to I accidentally linked to my now-defunct gamedev.net journal instead of copying it over)

So I sent it out to a bunch of playtesters, none of which were particularly enthused about the game because of its inherent blockiness. Oh well. One person (thank you, PfhorSlayer!) played through the entire game, as punishing as it was at the time (you think it’s hard NOW? You should have seen it then).

Anyway, I did a bunch of tweaks, and started on the background art. That pretty much catches up to the journal-at-present.

From that point on, it was art, scripting, music, sound effects, voice, credits, the manual, some bug fixes, the installer, and a last-minute save state feature addition. All in the span of 14 days. It was, as they say, a whirlwind.

I’m really happy with the music. Excluding the first 2 pieces (Piano of Destiny and Theme of Destiny), which I spent a few days on (Because I had the melody in my head for so long, and I wanted to do it justice), the remaining music was done in two day’s time.

I used FL Studio as my editor of choice, using a bunch of sample libraries, notably Vienna Instruments.

Anyway, I plan on doing a full-on post-mortem as my next journal post.

In the meantime, TO THE XBOX 360!

Finishing Touches

Alrighty. The gameplay, graphics, art, music, and sound are all complete. I have a few finishing touches to put on it:

  1. Some of the background music has a different average level than the others, so I’m normalizing that all out
  2. I want to add the credits
  3. I need to provide a manual, so I’ve got to write that. Shouldn’t take long

But effectively, Mop of Destiny is complete, and should be showing up sometime tomorrow evening (Tuesday, PST).

Scripting

Scripting’s done. And I use the term “Scripting” lightly.

All “scripts” are hard-coded into the game. For instance, a sample short script would look like the following:

Add(new StopMusicPoint(m_audio));

// Whistler fades in.
Add(new CreateEntityPoint(this, m_audio, m_renderer, m_world, "Whistler", "Whistler", Vec2(14,1)));
Add(new LerpEntityVarPoint(this, "Whistler", "alpha", 0, 0.5f, 50));

Add(new DialogPoint(m_audio, m_renderer, 0xFF7FFF7F, 20, "Sound\\3-1.ogg",  " 'Nuther seal down, Jack?  Good for you!  Man, you're sweatin' like a pig...you look like you could use a towel."));
Add(new DialogPoint(m_audio, m_renderer, 0xFF7F7FFF, 20, "Sound\\3-2.ogg",  " Silly me for leaving home without it.  Arthur Dent would be so disappointed."));
Add(new DialogPoint(m_audio, m_renderer, 0xFF7FFF7F, 20, "Sound\\3-3.ogg",  " Who?"));
Add(new DialogPoint(m_audio, m_renderer, 0xFF7F7FFF, 20, "Sound\\3-4.ogg",  " Just a...nevermind."));
SkipTo();

Basically, that creates an entity named “Whistler” given the entity type “Whistler”, lerps its alpha value from 0 to 0.5, plays a bunch of dialog (the dialog point both plays the ogg dialog sound file and displays the text), then ends.

The SkipTo lets the script know that this is the point that it skips to when the user skips a cutscene. I’m not using it to make unskippable sections, it’s just a quick hack because I’m also using scripts to set up the background music at the beginning of each music zone, so I don’t want the player to be able to skip THAT.

Anyway, a couple of screenshots to tide you over. The first shows a script that’s running (along with the shopkeeper, Whistler P. Higgins), and the second shows the game running in wireframe (That’s right, I’m not using textures! For anything!)

Anyway, I hope to finish up the history details in an entry soon…I haven’t had much time to do so!

The Clocktower

The art for Mop of Destiny is now 100%.

Here are some shots from the final level of the game. Yes, you can jump on the gears, and yes, tracing the clock face took a very long time.

Today, I will start the cutscene work.

Shadow Realm

Level 4, the shadow realm. If there’s one thing that Super Mario Brothers taught me, it’s that all enemy fortresses HAVE to be made out of bricks.

I’m not happy with the brickwork in the palace (it’s a bit flat)…I’ll fix it later if I have time.

ON WITH THE SHOW!

Moving on to level 5!

Lava Is Not My Favorite

Escape!

That is the goal of the fifth level. I have one screenshot that’s fairly representative of what the level looks like (there is no boss of this level).

Only one more level to go.

Caves and Stuff

Didn’t quite finish level 3 last night, I got fed up of drawing all of the bevel borders on the rock platforms (it’s all hand-done). Finished it up this afternoon. Moving directly on to level 4.

An in-level screenshot, and a shot of the boss.

‘sall I got.

Ruins! Blocks! Ruins Made From Blocks!

Again, not much energy to say stuff. I remember what sleep was like. I remember it fondly.

Level 2 is not quite as varied in appearance as level 1 – it’s a bit narrower in focus.

Here are a couple screenshots. Jack’s standing on a falling block in the second shot.

Side note: Keep in mind, when viewing these screenshots that I have a strict “NO TEXTURES” policy. Every detail is a polygon. The idea was to have total resolution independence. There are a lot of polys in my little 2D sidescroller. …In retrospect however, maybe I should have just had textures.

Level 3 tomorrow! I hope to have the background art done by the end of the weekend.

…then all I have left is the cutscenes/music/sound. It’s a bit of an uphill battle to finish, but sometimes those are the most fun battles.

Trial By Fire.

15 days left. The gameplay is done and in “test” (a bunch of friends are playing through it). Thus, I had that terrifying moment where you send out your creation to the world and hope that it works.

…then someone reports that there’s a serious bug which you quickly fix.

That’s how it goes.

And now, TO THE WAYBACK MACHINE!

The Gameplay Prototype

So when last we spoke, I had set my schedule. I had just a few short weeks to get a complete gameplay prototype running. So I started where every game developer seems to start: With the graphics.

I mentioned before that the graphics were simple. Polygonal, no textures. Writing that took about a day (very, very simple code). I checked it in on August 12th.

Next up: Input. No sense in gameplay if you can’t PLAY it. I took the input code that I wrote for my old NES emulator and modified it slightly for my new uses. That gave me automatic keyboard/joystick control.

Side note: Never initialize DirectInput after initializing Direct3D, because it does bad, bad things to the window interface. DirectInput subclasses the window, which Direct3D doesn’t like, so D3D doesn’t like to restore the state of the window correctly after doing a Reset (i.e. for switching between fullscreen/windowed).

Blah blah blah, wrote a bunch of stuff, got the gameplay test done. Only a few days behind schedule, on September 4th.

A Note on the Art Path

So, my original “art path,” as it were, was amazingly complex.
It kinda went like this:

  1. Create object in AutoCAD.
  2. Export from AutoCAD to .3ds
  3. Use a 3D modeling package to import the .3ds
  4. Manually fix up the incorrectly exported colors
  5. Export to .ase
  6. Run custom converter from .ase (an easily parseable ASCII file format) to my own mesh format.
  7. Profit!

This eight-hojillion step process was a pain and, moreover, had one fatal flaw in it.

Check out step number 3. AutoCAD was incorrectly exporting the object colors.

As it turns out, AutoCAD has the ability to set truecolor values to objects, but it also has a built-in 256 color palette (likely left over from the olden days). Now, when ACAD would export, instead of exporting my delicious true colors, it would export the nearest match in the color palette. Consequently, I had to fix them up later.

This became a problem when I tried to do my first test background – Fixing up all of the colors was way too time-consuming, so I had to find a better way.

FIRST I tried to import the DXF directly into the 3D modeler. However, it ALSO screwed up the import.
SECOND I tried to write my own DXF reader. As it turns out, the object that I’m using as my building block (the REGION) is one of the only TWO types of ACAD object that are encrypted in the DXF. Which is stupid.
THIRD I found a third-party program to convert REGIONs into PolyLines, which I WOULD be able to read. However, this program also dropped the same color information I was trying to preserve, thus ensuring that every last person in the universe has screwed up the color import/export with ACAD files.

The Solution!

I found out that AutoCAD has its own API for writing plugins called ObjectARX. Essentially, I downloaded it and wrote an export function from AutoCAD directly into my mesh format. It does the following things: Scan the scene for regions, and for each region it finds, triangulate it (using ear clipping) then write that to the file.

So now, my art path has become:

  1. Create object in AutoCAD
  2. Export directly to my mesh format, with correct colors intact.

Much better.

MEDIA!!!

I don’t have any new screenshots. What I *DO* have are two of the songs from the game.

The first one is the song that will play during the main menu on game startup. It’s the piano version of the main theme.

Piano of Destiny

The second is the first-level music, which IS the main theme (thus, both songs have the same melody).

Theme of Destiny

Anyway, it’s amazingly late and I work tomorrow, so that’s all I have time for today. Backgrounds truly begin tomorrow!

Concept of Destiny

So, the Four Elements V contest was announced in June. The rules are simple: Create a game, include the four elements:

  • Europe
  • Emblem
  • Economy
  • Emotion

Have it done by November 30th.

That said, I thought “well, those elements sound hard, screw that.” And I went along my merry way. Sometimes after that, I moved cross country and started a new job. But I had been watching the forums, and I noticed a few things:

Everyone seemed to go “I can do that! I’m making a…” followed either by “RPG” or “Strategy/Simulation game.” I began to think about what I could do that would be DIFFERENT from anything else in the competiton. It took a week or so before I came up with an idea, but I did:

Mop of Destiny: Lead the Palace of Westminster’s Caretaker, Jack Scroggins, on an epic battle against the advancing armies of The Shadow. It’s essentially a 2D action/platformer, along the lines of the original Castlevania games.

The four elements were as follows:

  • Europe – I set it in (and beneath) the Palace of Westminster, with the final level being a frantic climb up the turning gears inside of the clock tower colloquially known as Big Ben.
  • Emblem – At the completion of each level, Jack must touch the Emblem of Light. Each emblem is a seal on the gate to the Shadow Realm, and must be re-activated by Jack.
  • Economy – Again, at the completion of each level, a spiritual shopkeeper will appear, allowing the caretaker to purchase (or sell) special weapons and healing items using the souls of enemies vanquished along the way.
  • Emotion – Instead of being able to physically harm Jack, the Shadows can only cause him to become more afraid. As he becomes more afraid, his perceptions of the surroundings change (the world becomes a bit less colorful), and he recoils farther and farther in horror. If he becomes TOO afraid, he loses his sanity and becomes a shadow himself, and the game ends.

Since I was moving, I did not really have computer/Internet access, so I spent alot of time jotting notes and drawing concept sketches of various worlds. Initially, there were to be 8 levels (though this has been pared down to 6 for time), starting in the Palace of Westminster, taking Jack through the caves leading to the gateway into the Shadow Realm itself, then on a quick, frantic escape from the Shadow Realm, and finally up the clocktower to do battle with the Shadow King himself.

I determined what the big “problem areas” of gameplay would be, and decided to frontload most of them, to ensure that I knew that I had a chance of finishing. The main problem area had to do with the final level: Jumping from gear to gear would require some crazy collision detection and platform motion response. So that became the first goal: to get a “Control Test” working. This would have a bunch of platforms for the main character (represented by a fantastically drawn rectangle) to jump around on, including horizontal/vertically moving platforms and a spinning gear.

By this point, it was near the end of July, and I knew I had to get started. I initially started working on a basic level editor. I made a decision early on that the graphics would be 100% polygonal. Excepting the render targets, there is not a single texture in the entire game. This made the graphics code easy (all of the major graphics code was written in about a day), and made level editing easy (each vertex is a 2D position and a color). However, the level editor soon proved to be very complex – an interface that would allow me to do what I wanted would be a real pain to design.

I did some tests with some 3D modeling applications, and none of them were as simple to use as I’d like. However, my wife is an interior designer, and has AutoCAD, which proved to be amazingly simple. It was exactly the type of 2D model/level editor that I needed (with one major exception that I’ll talk about in a later post). Thus, I scrapped the whole editor I’d been working on and switched over to using AutoCAD.

By this point, it was mid-August. I needed to really get started, and I needed to get started fast; my design was very ambitious, so I needed to get working. My schedule was set as follows:

By the end of August, I wanted to have a gameplay test, complete with moving gears and working controls.

By the end of September, I wanted all of the major subsystems done. Sound, music, fonts, levels, animation, enemies, the HUD, the ability to walk to the next zone in the level, stuff like that.

By the end of October, I wanted to have the entire game playable (only no art assets would be done). You’ll see in a moment that this didn’t entirely happen (I ended up doing all of the character art in October, because making the actual enemies would have sucked without their art).

then, finally, it had to all be done by the end of November.

Currently it’s November 14th, and I have just completed my first complete playthrough of the game. None of the background art is done, and only 2 of the songs are done, but the game is playable. I have 16 days to do all of the art (I’m not an artist, really), and the music (I am, however, a composer), and the voice acting (which I can do), and the sound effects.

It’s going to be rough, but I think I can do it.