miniDooM: Mocking It Up

It is tempting to dive straight into coding rules and mechanics for a game, but the value of prototyping is often understated.

Now, in order to make simplistic prototypes, I first need to have the basic engine running, which I still haven't completed. But, luckily, there is a sort of prototype of a prototype: The Mock-Up.

Mock-Ups are just models of the final product, built to simulate ho they'll look in the end. In the case of   games, a mockup is something as simple as firing up an art program and drawing a game screen as it should look up.

Oddly enough, I've been doing mockups ever since I wanted to design games. As a kid I often drew, either by hand or on the computer, fake screenshots of the games I imagined. But only recently have I discovered the real power behind properly executed mockups.

Also, props to the Mockup thread at the TIGSource Forums, which opened my eyes about this.

So, without further ado, here is a first mockup of D4K miniDooM:

First of all, ignore the fedora-wearing outline at the bottom-right. That's an attempt at a personal logo... And it's a pixelized edit of the Dick Tracy movie logo, so a placeholder until I draw my very own.

Also, the floor and wall textures aren't mine (Mine look horrible).

Now, more to the point, the objective of this mockup was to show how I intend the game to look and feel, particularly how I envision the lighting system.

So far, so normal, the interesting bit is that, composing the image in GIMP (my chosen image editor, your mileage may vary), I struck upon the idea of attempting to mimic how the game will actually compose the image, so in the actual GIMP file, all the elements are separate (characters, floor, walls, shadows) and assembled in the same manner as I'll do through code.

The idea I've had is to have a "Light" layer laid over each element in the scene (called a mask). This layer is actually black, but it's transparency level is set depending on the ambient light of the surrounding area. In this example, the shadows are 80% opaque.

As for beams of light, they are made by cutting out pieces of the shadow layer. The beam from the flashlight has been down using polygonal cutting tools inside the program, rather than by hand, particularly since that's how I'll do it in the code, draw a polygon and cut it out.

The light projected on the walls is different, as they have a different light mask. The shape cut is a normal circle, rather than an oval, to account for the perspective.

The inner light of the characters is done by having a custom light mask for a given direction. This means that, if the light hits the character from the side, the light map that will be used will be the one that lights the character appropriately. I still need to mockup how it'll look when a character is lit from two or more directions.

Finally, the elongated shadows are just copies of the character sprite being stretched.

Now, originally I was aiming for a much simpler system, ignoring shadow projection, lighting walls differently, or lighting the characters beyond simply darkening the whole thing. But while building the mockup I came up with this idea, tried it, and loved the result. Also loved how I came with ideas for the implementation while doing it.

So, with that in mind, I worked on a more elaborate mockup of the system (click to view):

Now the floors and walls are mine... And it shows. Full disclosure: All this is the first time I've ever set down to do pixel art. I'm learning.

I've also added a first prototype of a monster, but I'll get on about character design in a different post.

In this mockup I've been more careful about light projection, ambient lights, multiple light intensities, and having characters with glowing elements.

This iteration has also revealed a series of issues I'll have with the system, particularly when two light sources meet, and when a character is caught in between two light intensities.

As I posted in the TIGSource Forums Mockup thread:
My idea is to have both ambient light and directional lights.

When under ambient light, sprites get shaded uniformly (except glow areas), and they cast a circular shadow just below. The zombies on the far right and far left are both under ambient light, as well as the red Doomie. The one on the left is at full light (0% darkness), while the one on the right is at 80% darkness.

The point of ambient light is to have areas that are not fully dark, and to save on lighting calculations by ignoring directional lighting when a character is just under said conditions.

Directional light, on the other hand, causes "hit" characters to use their directional lighting mask (as pictured), as well as shadow projection and the "light beams".

Note that the room at the bottom (where the Red Doomie is) has a different light level (50%), I also want light to spill directionally from rooms with greater light intensity into adjacent rooms, mostly because I like the idea of doors opening and projecting light as they do so (The passage to the south area is projecting up into the wall, just besides the Blue Doomie, that's why the Zombie in the middle is lit directionally).

Mixing light intensities shouldn't be a problem, I'll just add the light values in the light mask before applying it. 

The compromise I'll have to make, though, is when deciding the light level of characters moving from one light area to the next. I'm thinking about averaging the light/darkness level of all the lights affecting the character, and applying said average value to the sprite.

For example, if the Green Doomie steps down and stands in between the full bright flashlight beam and the 50% light beam from the south room, the darkness mask shadow and light values would be the average of both (75%). I could even go as far as to calculate how much of the character is in each light, but since the detection of directional light will be a hitscan check, I'll keep that simple. Also, being hit by two light beams would activate two lightmaps at once.

Oh, I've decided to call the main character, the cute version of the DooM Marine, a Doomie. More on that when I tackle character design.

So, that's it for now. I'm working on character designs (I do stuff in parallel, when I grow tired of coding, I go back to drawing, and vice-versa) and will craft a few more mockups once they are ready for prime time.

No comments:

Post a Comment