Effective Level Editing

A few years ago, I completed a project called Dactyl. It was a 2D asteroids-shooter-type game. There were 25 hand-generated levels populated with mines, asteroids of various types, useful equipment, and automated turrets.

dactyl-01

To visualize each level before I implemented it, I used graph paper and a pencil*. Once I felt a level was complete, I plugged the object coordinates into a text file, and then fed the file into the Dactyl engine. And pop, out came a new level.

This approach definitely wouldn’t work in Gateway. The size of each level (up to about 20km!), especially considering the differences between, say, the 10 meter fighters and the half-kilometer battle cruisers, made drawing complex scenarios to scale next to impossible. Making changes to level designs would also be painful: erasing a group of 30 fighters and shifting them over a kilometer would quickly eat away at my eraser and my sanity. Besides, my hands aren’t steady enough for that kind of nonsense.

Dactyl levels were sketched out by hand.

Dactyl levels were sketched out by hand.

The solution for Gateway was to build my own level editor.

I’ll admit that I didn’t spend a lot of time investigating existing solutions. I was (pretty) sure that there was (probably, maybe) some level editor somewhere that would offer the right parameters and would allow me to drag, drop, and configure all of the game entities I wanted onto the Gateway playing field, but I really didn’t feel up to downloading and trying various existing editors only to find that each one was missing a crucial feature.

Ah, yes…implementing things from scratch rather than using existing solutions. I often do this with smaller projects for a number of reasons: (a) I believe in doing everything yourself at least once, (b) it’s often more fun, and (c) I can usually whip up something small in less time than it would take for me to learn to use an existing tool. (I recognize that this is a twisted combination of both laziness and diligence.) I also (d) like to be intimately familiar with the code I use, and this is easiest when it’s code that I write myself. Additionally, my own level editor could be completely customized for exactly what I needed it to do. (Besides, by the time I started considering developing my own, the back burners in my brain had already fired up and began doing the work for me. I think somewhere back there I knew very early that I’d have to write my own.)

I intentionally wanted to keep my editor’s feature list as minimal as possible, since I’d probably only use it specifically for Gateway (although it could be altered without much effort for similar games) and didn’t want to spend too much time adding features that weren’t absolutely necessary. I just wanted the bare essentials for designing levels quickly and easily…so, there were hard choices to make.

C# .NET would be an ideal choice for this project, since I’ve worked with it extensively on a variety of projects. This meant that graphical user interface elements like buttons or text boxes wouldn’t be a problem. The next thing I had to consider was whether or not I wanted a 2D or a 3D representation of the world in my editor. There were pros and cons to each.

Advantages of a 3D level editor:

  • Entities could be moved around the environment and viewed from the player’s perspective
  • Everything could be viewed as it would appear in-game: for example, depth or height would be easier to determine than it would be in a 2D, top-down view

Disadvantages of a 3D level editor:

  • Harder to implement than a top-down representation in terms of entity selection (picking), transformations, etc.
  • C# .NET does not feature built-in 3D support and would require using GLControls or something similar (I wasn’t adverse to this, but it was another layer of complexity I wasn’t sure was really necessary)

Ultimately, I decided to go with a 2D representation simply because the style of the game didn’t place a whole lot of importance on an object’s height or altitude within the game; the flight controls are more like flying an aircraft than a true 6DOF fighter (I did this to make the game simpler and more accessible to players). Thus, the world could fairly easily be represented in a top-down fashion. Of course, objects exist at many different “altitudes” in the game, but not to such a degree that it was critical that this be represented clearly in a level editor intended solely for myself.

Next, there were issues of scale to consider. I wanted to have missions that could potentially be around 20km by 20km in size. I also wanted everything in the editor world layout to be visible all at once without zooming or scrolling. Ultimately, I decided on a layout pixel size of 600×600, with every pixel being equal to 30 meters in real space. That was more than precise enough for my needs and resulted in a playing field of 18km by 18km.

My choice of scale had one unfortunate implication. The smallest unit of size that could be represented in my editor was 30m (1 pixel), but the fighters in Gateway are around 10 meters long, which was one-third of the smallest visible unit in my editor. Cruisers, being around 600 meters in size, could be represented to scale with 20×20 pixel sprites, but fighters posed a problem. I decided to simply make the fighter sprites larger than they would be in real space by several pixels in each direction, to allow easy visualization and selection with the mouse.

scale issues

Without some changes, the fighter sprites would absolutely be too minuscule to determine orientation, select with the mouse, or even see properly.

Next on the list was to decide the kinds of features I wanted to support in terms of building worlds. Tools like selection, translation, and rotation were essential. A ‘snap’ functionality would be immensely useful in terms of both moving (snap to grid) and rotating (snap to angle). Since I’ve used Blender a lot, I decided to support Blender-style keyboard shortcuts (which often don’t require modifier keys like shift or control) to make things familiar and faster: ‘A’ to toggle selections, ‘G’ for grab, ‘R’ for rotate, etc.

After about two weeks, I had a fully-working editor. It only had a minimal set of features, but that was all I needed.

sundial_screenshot

Level-building in progress. The player and a few wing mates are spawned far away from the action. The editor is just as much fun to use as it was to implement!

Team colours are represented by the highlights around objects. A grid in the background is used to determine distances. A few other tabbed panels are used for scripting music, dialogue, etc., and basically just contain multi-line text boxes.

Developing a level editor has been a very interesting and exciting experience for me. If anyone has experiences or stories working with level editors (including their own), I would love to hear about them in the comment section below.

GN


* As a side note, I have entire sketch books full of old game level designs from way back when. Maybe I’ll post some.

July 26 — Where I’m At

Well, here we are so far. A lot of work has been completed since the last progress report.

  • Voice recording and mastering is all done. That’s right. Every single line has been edited and made to sound like it’s coming over radio, so it’s all campaign-ready. I really enjoyed working with the individuals who were nice enough to offer their voice acting talents. (Finding enough actors was something I was initially concerned about, but many people were very willing to spend a half hour or so working with me to bring my characters to life. I’m very grateful for that.) There were a lot of bloopers filled with jokes and curse words. It made the editing process (which took hours upon hours) very entertaining.
  • The first 3 campaign missions have been built. These are shorter missions intended to gradually introduce features and familiarize the player with the controls, and are thus fairly simple. The remaining missions will be longer, but will probably be built quicker as I develop momentum (and gain familiarity with my own game engine…funny how that works). I have to say, it is incredibly exciting to see the action and hear my characters come to life in the way I imagined.
  • Various game play improvements. The targeting system has been improved, the computer players are smarter, bugs are being squashed…the list goes on.

Currently, my priority is getting the campaign finished. Building the missions not only advances the game towards completion, but also reveals bugs in the engine and helps identify game play issues.

Here is a screenshot from the third mission, Incursion, where a simple assault goes awry and the player’s forces are ambushed by the Coalition.

The player provides support during a mission to destroy a series of enemy network satellites.

The player provides support during a mission to destroy a series of enemy satellites.

Until next time.

GN

July 5 — Where I’m At

It’s only been a week since my last update, but there’s been a lot of good progress. I’ll keep this quick since there’s a few other things I’d like to tackle this evening. So, here we go:

  • Voice recording is nearly, nearly done. Unfortunately, I didn’t reach my goal of having all of the recording done by the end of the weekend. A lot was done this week, but I’m still looking for an actor for the last part (Admiral Banks). All of the other parts have been recorded, though, which means that I can go ahead and build the first eight missions.
  • Improved the cockpit. I decided that even my meager art skills couldn’t excuse the poor quality of the existing design. I spent a few days building and texturing a new cockpit model, which is shown below.

shot-1

  • Improved the missile system. The new system requires players to be smarter about how they launch their missiles; launches that are made too close to a target or not facing the target enough will only result in wasted ordnance.
  • Addressed a number of outstanding bugs and gameplay issues. All minor things, but there’s nothing like a quick demonstration to a colleague to make you realize there’s a lot that needs fixing. (“oops, that shouldn’t happen”, “still gotta fix that”, “that’s boring so I’ve left it until later”, etc.)

GN

June 28 — Where I’m At

Okay, this is a big update. A lot has been accomplished over the last while!

The campaign script has received the final go-ahead from my editor/military consultant. His feedback has resulted in cleaner dialogue with a militaristic feel, which is definitely what I’m going for. Voice recording is proceeding, although much slower than I would like due to the time this takes. I’ve begun mastering the parts that have been recorded. All of the dialogue takes place over radio and is filtered to sound like it.

In addition to the campaign, I wanted Gateway to offer options for customizing and playing your own space battles. This “instant action” game mode is now entirely complete, and marks a major milestone in Gateway‘s progress. Certain parameters are randomized to give a slightly different feel to each battle, but the most meaningful per-fleet parameters (size of fleet, types of spacecraft and gates present, pilot skill level, technology, etc.) are fully configurable. Up to five different fleets of any size can be present, meaning that space battles can be as epic or as personal as you’d like. (They’re also very useful for quickly testing various aspects of game play.)

Featured below are some screenshots from scenarios generated by the instant action engine.

An enemy fighter tries to make a desperate escape.

An enemy fighter tries to make a desperate escape.

Exploding wingmates rock your fighter as two fleets collide.

Explosions rock your fighter as two fleets collide.

Alien cruisers unleash a storm of high-powered ordnance.

Marauder cruisers unleash a storm of high-powered ordnance.

Friendly fighters rush to assist in the defense of New Earth.

Friendly fighters rush to assist in the defense of New Earth.

Currently, my to-do list mostly consists of things like “fix cruiser UV issue”, “fix laggy menu widgets”, “finish new marauder fighter gate”, etc. There are also a few minor game features here and there that need to be implemented. Of course, there’s still the campaign to finish, but I don’t want to proceed until I have all of the voices ready to go. I hope to have them all recorded by the end of next weekend.

There’s still lots to do, but it’s as fun as it always is! And that’s the point.

GN

Some Case Studies

Game programming is something I’ve been interested in since I was about 11 years old. I started by making simple programs and games in Visual Basic. Shortly afterwards, I made my bumbling way into the world of 3D game development, and I completed many projects using DarkBASIC. All of my games were very simple, but this is the reason I finished them: they were small and built on well-established mechanics such as jumping, collecting treasure, shooting, or racing against time.

Featured below are a few of my favourite completed game projects from way back when. They were all made for my own amusement, and are all from a time when I could barely program to save my life. Or make game art. Or anything.

Goblin Stoppers

goblin-stoppers

Jump from platform to platform as you try to escape the lava-filled cave. Home to baby dragons hungry for their first taste of goblin flesh, the cave is also rumoured to hold treasure that renders the finder completely invulnerable…

I consider this to be my very first fully-playable computer game. Its simple mechanics, combined with a small map size, made this project a reasonable first.

Space Havoc 1, 2, and 3

space-havoc-1space-havoc-2space-havoc-3

Fight for your life in open space against skilled pilots determined to prove their worth.

The first version of this space-based combat game was incredibly simple, and started to grow in complexity as the project matured. It spawned a total of three titles. There were a few attempts to make a much more complex fourth title, but these designs eventually became part of Gateway.

Cavin’ In

cavin-in

Fight against time to collect all the treasure in a maze from which no one has ever returned. Lava flows around every corner, while fire goblins lie in wait for their next meal.

The idea here was to navigate through a dark cave in search of treasure, avoiding lava and catching glimpses of scary fire goblins while a lightning storm raged outdoors. Again, this was a very simple game with a simple goal: run through a large maze collecting items as you go, before time runs out and the cave collapses.

Space Fire

space-fire

Use an assortment of weapons in a deep-space duel to the death. Only one of you will survive.

This was a two-player game, where each player had an assortment of weapons (laser bolts, laser charges, and missiles) with which to kill each other. Players could also take cover behind the asteroids (which could be destroyed, too). Unfortunately, no one ever played it with me more than once, because I was too good at it.

Shufflespace

shufflespace

A twist on a classic sport, Shufflespace puts a 23rd-century spin on a well-known game.

The goal of this game was to aim and shoot a laser from the far end of a shuffleboard, and take down all of the miniature aliens at the other end. The alien formations could be customized, and the game even supported something called “live mode”, where the aliens would walk around at random, making them more difficult to hit.

Cavern

cavern

Lost in a frozen maze, you find yourself attacked by vicious monsters that have made the cavern their home. Armed with only your wits and an ice-spewing gun that freezes everything it hits, only tenacity will ensure your survival.

This game didn’t have any time limits, but there was one important constraint: your gun had limited energy and depleted quickly as you fired. Energy crystals found within the cave would help to replenish its reserves, but most of them were guarded by the locals.

Water World

water-world

While not technically a game, this partially-submerged cavern was a good way to test various environmental effects and AI behaviours. Rumour has it that deep within the depths of the stone fort inside, mysterious life advice lies scrawled upon the ruins.

GN