Search This Blog

Sunday, February 27, 2011

Cop-out post

Did a teensy bit of coding on that content manager stuff but it's not particularly fun and work's been kinda busy so not a lot happened the past few weeks.

But here's a post anyway to show that I still care.

So I was thinking about level design and how to put a unique spin on the game to keep it interesting and an idea popped into my head that I've got a hard time getting rid of.

What if I made Gloom a FPS Roguelike?

Rogue
Think about it! I think it would be pretty freakin' cool, and doable too!

Sunday, February 6, 2011

Wrestling with the content manager

For the most part I think XNA is brilliantly designed. The Content Manager though... meh.

To add a new type of content to a project you need to create a whole slew of classes across multiple projects with specific compiler instructions and links to each other. The whole thing is also very debug resistant - it's hard to put breakpoints in a content processor because it is run during compile time instead of runtime.

I mean I guess it's not super hard, and the documentation is nice, but it's still a chore. Difficult to wrap my head around. I've avoided digging into the content manager so far (even at work), but I'd like to do this right.

The goal is to have a system where artists can just send me images with some extra information and the content manager automatically parses them into a spritesheet to use in the game.

like this

I can already do that, but it happens during the game itself (so the player is treated to a loading bar). With the content manager I could do it in advance and load the spritesheets directly into the game.

Sunday, January 23, 2011

Sprites

Where's Waldo?
I'll eventually need (someone) to make original sprites. For now though I will use the originals. This way I can get a headstart on programming the enemies. I think that if I get a nice playable demo to show to people it will be a lot easier to find interested artists.

You can find most of the Doom sprites online. Unfortunately they usually suck. They'll have no transparancy or the positioning information will be missing.

So I had to man up and find out how to rip them out of the wad file. Luckily this isn't exactly treading new ground and the Doom wiki was again able to help me out nicely.

I've now got a whole list of sprites complete with the pixel offsets for properly aligning them. Next step is to compile those into fancy spreadsheets. We've got a nice tool for that at work, maybe I'll steal it ;)

Wanted: artist to draw +/- 1000 sprites for Doom clone :(

Monday, January 10, 2011

What's in a name?

Good news, everybody!

As fellow L4D enthusiast and future level designer mr. Van Beuzekom has so conscientiously pointed out, the name Gloom has been used before. In fact, it is the monicker of a 1995 Amiga game, which also happens to be a Doom clone.

Conflicting!

However, having grown attached to the title, I decided to investigate. After a troubled journey through many dead links and wikipedia stubs, I ended up on the website of the developer of Gloom 3. So I asked if he was okay with me using the name. And here's what he said:
Im not sure if anyone would care really!
Hurrah, I guess!*

So it is with great pride that I present the new logo for XNADoomClone:

Beautiful, isn't it? I made it myself!
Thank you, thank you.

I've also been sniffing around for some sprite and texture art. This investigation is ongoing.

In other news: Christmas happened! And even though I haven't got nearly as much programming in as I had planned to, I did manage to squash some very annoying bugs. Observe:

prefix
postfix
Happy new year, everybody!

*Technically the then-publisher Guildhall UK has the rights, but since they seem long dead I feel due diligence has been exercised.

Monday, December 6, 2010

1000 Watt

That's right, bitches
After what can only be described as an odyssey of disappointment and waste, the personal computer is finally operable (knock on wood). I have somehow been suckered into buying a power unit sporting twice the capacity that is required for my rig. The sound of fans desperately trying to keep this beast's temperature under control (a high pitched harmonic whiz coupled with intermittent low hums) will surely please my flatmate.

Absolutely no progress has been made coding-wise, but luckily my musical friend mr. Brannan has not been so apathetic. Feast your ears on these!

Peter Brannan - Something Twisted


Peter Brannan - Detonator


Peter Brannan - Speedy (All)


Will this lull have destroyed all motivation, thus leading to the eventual downfall of the entire project or will regular updates continue as before? STAY TUNED!

Tuesday, November 9, 2010

In lieu of an actual update

I liked this


Meanwhile, technical difficulties are still in full effect.

Sunday, October 31, 2010

PC Borked

Development on Gloom has been temporarily put on hold as my PC is broken and will reside in the shop for a few weeks.

Also eating my free time: Codeglue's moved to a new office!
See you in November!

Monday, October 18, 2010

Collision Detection

Small update for this weekend.

I've put in some collision detection and have made a video of this. It also shows the new lighting, the WAD level loading and a bunch of glitches that still need to be ironed out.


Sunday, October 10, 2010

Lights

An important part of Doom is the lighting. Even without dynamic shadow volumes or per-pixel illumination, Doom's lighting gave the game tons of atmosphere.

In my last post I called my lighting scheme "a bit flat", figuring that a few tweaks here and there would be enough to fix it up. Let's look at that screenshot again:

map01 in Gloom
Not bad. But compare this to the same view in Doom:

map01 in Doom
Yikes! Just look at that contrast! You can really see the light growing progressively brighter on each step. In my game the difference is hardly noticeable (you can see it on the ceiling if you look closely).

Unfortunately, while The Internet is more than happy to divulge exactly how the renderer in Doom works, the lighting algorithm seems to be a lot less exciting. So I went on an investigatory adventure past various blogs, lots of in-game testing, map editing, shader writing and even the Doom source code itself.

Now, while I'm still not completely sure how things work, or what *dest = dc_colormap[dc_source[(frac>>FRACBITS)&127]] means exactly, this is what I've gathered:
  • Each sector in Doom has a brightness value between 0 and 1. A brightness of 0 means it's black and a brightness of 1 means it's fully lit.
  • Actually, each sector has a brightness value between 0 and 2! Anything with a brightness of 1 or more is completely lit.
  • If you move away from a sector, the brightness gradually decreases. The maximum distance modifies brightness by -1.
  • So: sectors with a starting brightness value of more than 1 will never go completely dark, no matter how far you move away from them. A sector with an initial brightness of 2 won't ever go dark at all!
How does this look in-game, you ask? Well, have a look:

nailed it!

Implementing this system meant that I had to chuck BasicEffect and write my own vertex and pixel shaders. Luckily XNA is great at providing templates and integrating shaders into the logic, so it wasn't as difficult as I had feared. Plus, in the end, we all learned something. And that's all that matters, right?

Sunday, October 3, 2010

Where is All the Data?

In my previous post I showed how the level editor can load vertices and edges from the original Doom wadfiles. I´ve since completed the holy trinity of Doom map data by loading sectors!

Sectors have proven to be the single most difficult thing in this game so far. I´ve already discussed my troubles dividing them into triangles, and that remains a problem area. To get the Doom levels working properly I had to expand my algorithm to account for sectors inside of other sectors, which included creating fake extra lines to connect them and treat them as a single polygon.

I´ll probably do a separate blog post to describe the whole process of creating triangles out of sectors after (if?) I fix some last niggling issues. I also read an article by Carmack about how he did it for the iPhone port of Doom, and he just used a 3rd party library. What a hack!*

Small issues aside, the level loading already works pretty well:
Top left: Gloom, Bottom right: Doom
What brightened my day when I tried this is that my assumptions turned out to be correct: the whole level renders super smooth, without any optimizations at all! I just brute force draw every wall and floor, regardless of whether it´s actually visible or not, and the game runs without a hitch.

After all that I had to go all the way, so I spent some time fixing the lighting in my engine, found a set of original Doom textures online (they´re also in the wad file but stored in a weird way) and added those, as well as lighting information, to the level loader.

I think the result is quite nice:
MAP01: ENTRYWAY
It still needs a little bit of tweaking (the lighting is a bit flat, the textures aren´t offset correctly and there´s still some sector problems).

At this point, though, I think it would be a lot more interesting to get some collision and physics in there so we can actually walk around in this thing!

*Carmack is not a hack

Saturday, September 25, 2010

Connect the dots

Can you guess what this is?
dots
How about now?
connected dots
And if you're still unsure:
and here's one we made earlier!
With special thanks to the excellent Doom Wiki!

Saturday, September 18, 2010

Metal

stealth edited on 19-9 with slightly newer song
and then stealth edited again on 20-9 with even newer song

No youtubes today, but instead an auditory preview. Musical mastermind Pete Brannan has graciously offered to write some original tracks for Gloom.

A few years back Pete astounded me with a top notch soundtrack for Revenge of the Evil Aliens*. I had decided to put that game up for sale which meant replacing all the music which consisted of (unlicensed) tracks of some of my favorite artists such as UNKLE. I handed him the soundtrack and said I wanted something that "sounds like this", not expecting much. Imagine my surprise when he came through with some great sounding tunes that have even been noted by reviewers as a high point of the game!

But enough flattery, here's a first draft of what a Gloom song might sound like:

Peter Brannan - Metal1


And for reference of how a completed song sounds, here's the final level for Evil Aliens:

Peter Brannan - Revenge of the Evil Aliens (Stage 3)


*available now FREE on personal computer and CHEAP on xbox live indie games!

Monday, September 13, 2010

Check out what I can do!

If you're not familiar with the limitations of the original Doom engine then the following might not impress you much, but check this out:



Yeah baby, rooms above rooms!

Check out how wonky that looks in the editor:

Hax
I'm not sure if this trick will work once I put in collision detection and physics, but if it does I'm totally going to make a tower level!

Monday, September 6, 2010

Gloom Does Undo

 "Repeatedly adding and removing nodes, lines and sectors doesn´t look like much, so I won´t make a video out of it."
I lied.

Saturday, September 4, 2010

Post holiday update

Gamescom 2010
Had a great couple of weeks of vacation, spent going to Gamescom, Lowlands and Berlin, and reading Kevin Smith´s diary cover to cover.

Unfortunately I didn´t get to do as much coding as I´d have liked to, but still managed to get a couple of days of solid work in.

I noticed, especially after taking a short break from the project, that the code was getting messy. I was using the same classes in the game as in the editor, so stuff like 3D rendering was living confusingly alongside 2D editor drawing. I´d also put a lot of editor UI code directly in the classes that dealt with the actual editing, so they were busy changing the level and updating the screen at the same time, leading to more muddledness.

So I cleaned up! I now have a nice layer between the level and the editor (aptly called EditableLevel) that exposes whatever data the editor needs to change but hides all of the hardcore engine stuff. While I was in there I also improved on a bunch of other stuff, among which a move to the new XNA 4 framework (potential winphone support yo!).

I´m pretty happy with the results!

Using the new architecture I´ve put an undo-list in place. Repeatedly adding and removing nodes, lines and sectors doesn´t look like much, so I won´t make a video out of it, but I assure you it´s pretty neat!

In other news, I´ve asked the talented Pete Brannan (of Evil Aliens fame) if he´d be interested in doing the soundtrack and he´s into it! This guy´s great and I really hope we can make it work. If so, I´ll be sure to post some tune previews!

Saturday, August 14, 2010

Short update

Haven't had much time to work on XNADoom this week (Starcraft), but I did manage to get saving and loading working, so here's a video of how the level I made in the previous post looks in-game:



(soundtrack subject to change)

QuakeCon Steam Sale

Speaking of Doom...

I'm a bit late with this, but Steam is offering all Doom related products with a 66% discount for Quakecon. I bought the Doom pack! Will need those wads to see if I can get my game to load original maps (wouldn't that be sweet!)

http://store.steampowered.com/sale/QuakeCon

Sunday, August 8, 2010

Evolution of a level editor

I've been working on the level editor for a while now, here are some images of how it's evolved over time.




The first version is just a visualizer. It shows the hardcoded standard level that I've been using for testing. I was pleasantly surprised that the .net drawing libraries have some nice built in ways to handle zooming and panning.




Here I've added a status bar and a top-menu, and the ability to actually edit the level. It's shoddy as hell and doesn't actually save, but it looks better :)




This is a pretty neat component, a property grid. It automatically fills itself with the properties of an object, so all I have to do is point it to the currently selected sector (room), line or node, and the user can set stuff like position, textures, or height. Fancy!




Here we see an output panel added. There's also a lot of functionality upgrades going on under the hood. One of the trickier parts of making this editor was automatically constructing sectors. Basically you can create a room (like the orange one in the image) by drawing lines. You then right-click inside the created shape to turn it into a sector. That last bit, detecting if you clicked inside some shape and finding it, is not trivial at all! I remember the Doom editor I used back in the day having a lot of trouble with this. Now I know why :)




And here's a first attempt at an actual level. It's roughly based on the first map in Doom 1: the orange sector is a little lower than the rest of the room, and the four squares to the left make a staircase that goes up to a raised balcony. 

Note how the orange sector has lines connecting it to the right wall, that's because I haven't figured out how to do sectors inside other sectors yet. That's going to screw up both the sector detection and the triangulation, so I'm postponing it for now.

Now to save this thing and run through it in 3D!

Saturday, July 31, 2010

Walls II

Allow me to elaborate...

A square room (top down view)

Ok so this is a square room. It consists of four lines (walls). So in-game, we draw four quads (one is behind the camera so we can't see it):

Square room in Gloom: three walls are visible

Alright. So let's say we have two connected rooms:

Two rooms!

What we do now is we connect the rooms by cutting a hole in the far wall, based on the difference in ceiling- and floor heights between the two rooms.

Back wall now has an opening in it to connect the rooms
The interesting thing is that these two are the only possibilities: a wall, or a wall with a hole in the middle. Yet you can build very complex and interesting architectures using this system. Just look at the maps in Doom!

Walls

Here's what that previous scene looks like with walls (and a gun sprite) added in:



Almost like a 15 year old FPS! :)

Like I said, walls are pretty easy to make. A Doom level is basically a top down line-drawing, where each line is a wall. So to generate the walls you just create squares from floor to ceiling at each line. If the line divides two rooms then you punch a hole in it (like the little window in the video).

PS: Apparently Gloom is already a game, and it's a Doom clone as well. So I need a new name. Maybe "Mood"?