Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Drule

Could someone explain to me the structure of a WAD and its resources?

Recommended Posts

Hey guys.

I'm an indie developer, and I'm having a go at making a custom zDoom-based game similar to of Harmony or Urban Brawl. I've done a bit of Hexen and Doom mapping before, but I've never cared to delve into the deeper workings of the engine or its game resources.

So far I'm pretty confused by the structure of the game resources. I've asked for help on IRC, but I felt I only understood half of the responses regarding PNAMES, textures, lumps, patches, TX_STARTs and TX_ENDs, so maybe someone here could help me understand the basics of Doom resource handling?

First off, I've downloaded Doom Builder 2 and SLumpEd. I guess Doom Builder 2 is used for map editing and SLumpEd for WAD editing. What I'd like to know is exactly what I need to do in order to make a custom WAD from scratch, and include some custom-made textures to be used in Doom Builder. So far I've got an empty WAD with two nodes called PP_START and PP_END. Now what?

Thanks in advance.

Share this post


Link to post

Don't just post a link to a collection of arbitrary Doom information that I could easily have found myself through Google when I'm asking a specific technical question

Share this post


Link to post

First of all, I understand how to utilize these resources and explain their use, but I can't give you too much info on the why.

If you're using a ZDoom branch, a lot of lumps from the original Doom engine are deprecated and ought not to be used.

There is no formal order for placing lump names in a wad (as far as I know). The general rule is that you must place a resource between two markers (like PP_Start through PP_END, etc.) In ZDoom, they can be used for organizing resources.

For example:

TX_START
MyTexture.png
TX_END

MUS_START
MyMidi.mid
MUS_END

I'll add some more later. But this should be a place to start

Share this post


Link to post
Drule said:

I'm an indie developer, and I'm having a go at making a custom zDoom-based game similar to of Harmony or Urban Brawl.

Then: http://zdoom.org/wiki/Using_ZIPs_as_WAD_replacement

About PNAMES, even if you go with the WAD format, you shouldn't bother with them. They're more of a hassle than anything else. ZDoom lets you use a text lump instead of the rigamarole with PNAMES, TEXTURE1 and TEXTURE2.
http://zdoom.org/wiki/TEXTURES

For textures that do not need compositing, you can just include them within TX_ markers in a WAD, or in a Textures directory in a ZIP/PK3. But for all compositing operations (including stuff such as mirroring, right angle rotations, color translations or blending, etc.), TEXTURES is an invaluable tool which can mean a lot of space saved.

Share this post


Link to post

You can find all you need to know about lumps here. More information about ZDoom features can be found on the ZDoom Wiki.

If you want to add a patch do the following:

  1. Create the PP_START and PP_END markers. (you already did this)
  2. Load a new lump from a file - this can be done by clicking the New Lump from File button - L on a piece of paper with a green arrow above it.
  3. Locate the image file you would like to add and choose Open.
  4. If the image is not in one of the ZDoom's supported image formats, right click on it and choose Convert ToDoom Gfx
  5. Right click on the imported lump and choose Add To TEXTURE1, if you want to convert it directly to a texture, or Add To PNAMES, if you want to use it as a part of a multi-patch texture.
If you want to add a flat do the following:
  1. Create the FF_START and FF_END markers.
  2. Load a new lump from a file - this can be done by clicking the New Lump from File button.
  3. Locate the image file you would like to add.
  4. Right click on the imported lump and choose Convert ToDoom Flat.
If you want to add a PNG image do the following:
  1. Create the TX_START and TX_END markers.
  2. Load a new lump from a file - this can be done by clicking the New Lump from File button.
  3. Locate the image file you would like to add.
Note that PNG's will be converted in the Doom palette in ZDoom.

If you find this too hard you should consider using ZIPs as a WAD replacement.

EDIT: Spelling

Share this post


Link to post

Thanks for all the information. I decided to go with the ZIP approach since zipping a bunch of folders and dumping resource files into them seems like the easiest approach. Does this mean I'll be able to place PNGs and MIDI files in corresponding folders and instantly use them in-game? Or will I have to define them somehow.

Share this post


Link to post

Drule said:
I felt I only understood half of the responses regarding PNAMES, textures, lumps, patches, TX_STARTs and TX_ENDs, so maybe someone here could help me understand the basics of Doom resource handling?

That's because you ask impractical questions with broad answers. If you aren't even willing to point out what you have learned up to now, or to point out specific points you need help with, why should anyone bother to help, potentially repeating what was said in other places? Following your example, they'll just link to a wiki and tell you to help yourself.

My suggestion, not just to you but to anyone starting off and feeling kind of lost, is to pick up editing tools (done, according to your post) and try to put something together, using existing references (The Doom Wiki, the ZDoom wiki, forum posts here or at the ZDoom forums.) When you can't find something or it doesn't make sense, you ask a practical question that gives you specific replies, optimally quoting and referencing what it is you didn't understand, or specifying any issues or errors you get while following descriptions or instructions. Let yourself be driven by what you need to do specifically, instead of trying to absorb a bunch of data you likely don't need to start off and that is usually best gathered little by little through experience.

Like, for instance, you could start by adding a new piece of music into the game, for the first level, or based on a level you made using stock resources, add floor tiles you'd be using in your new game. Start bit by bit so that you can learn each task required to finish a whole game... which is quite a lot!

Share this post


Link to post
Drule said:

Does this mean I'll be able to place PNGs and MIDI files in corresponding folders and instantly use them in-game? Or will I have to define them somehow.

You don't have to declare them; if they're in the proper folder (or a subfolder of it), they'll be there.

However, the game is not its own editor. A patch still needs to be composited into a texture. A texture still needs to be placed on a wall. A music still needs to be associated to a level in MAPINFO, or played by an ACS script. And so on.

An exception: sounds. You can not refer directly to sound files, you need to give them a name in a SNDINFO lump and use that name.

Share this post


Link to post

myk said:
[stuff]

Well, what I'm trying to say is that I do have experience with Doom mapping and could probably implement a lot of the things you mentioned very easily, but I've found little information about how a WAD file is actually structured and what Doom or zDoom needs from a WAD file to be able to load it as a full game.

What I want to make is a very basic executable game as a base so I can work my way up from there, but it's hard to start out with nothing when you don't even know what the game needs in order to run. I don't see how I'm going to get this information by experimenting with map design, because it still wouldn't teach me a whole lot about the obscure data that is implemented into a WAD file beyond what is needed within a custom map. I was hoping someone here could either explain how it's set up or link me to relevant documentation that isn't a 19-page long TXT file or the home page of a very general Wiki.

I hope that is specific enough.

Share this post


Link to post
Drule said:

What I want to make is a very basic executable game as a base so I can work my way up from there, but it's hard to start out with nothing when you don't even know what the game needs in order to run.


Making your own workable iWAD takes a lot of work. You might want to start building on the Doom iWAD. If not, you could use The People's DooM as a kind of 'blank' iWAD. If you want a somewhat more complete free iWAD you could check out FreeDooM

Share this post


Link to post

Drule said:
I don't see how I'm going to get this information by experimenting with map design, because it still wouldn't teach me a whole lot about the obscure data that is implemented into a WAD file beyond what is needed within a custom map.

Much of the info you need is the same as for any custom WAD, and a practical step by step approach should work for those. The stuff you might want to concentrate on more generally at first is those lumps that let you organize the game, such as DECORATE to create new decorations, monsters and items, MAPINFO to organize the relation between the game levels, and how ACS scripting works, to customize the game. There are various other "general controlling" lumps as well, in ZDoom, such as one for the status bar and HUD, and one that sets the standard key bindings for your game.

If you want to do an independent game from scratch, one thing you'll have to take care of at the onset is the 256 color palette for all the graphics. You could use DOOM's, but it may be (copyright) derivative and you'd have to stick to the colors the DOOM developers chose, when other colors might suit your game's style better. You could also use GZDoom instead of ZDoom, relying on OpenGL to use any colors in the graphics.

Share this post


Link to post

@Drule: Read this, this, this and this.

Drule said:

I was hoping someone here could either explain how it's set up or link me to relevant documentation that isn't a 19-page long TXT file or the home page of a very general Wiki.


You should get used to reading documentation. You have to learn the basics to understand advanced topics, it's just the way it is. Nobody is going to hold your hand through the entire game making process. It is something you should do on your own, and invest a lot of your time into it. Get familiar with The Doom Wiki and The ZDoom Wiki. If you will be developing the game for ZDoom, register at their forum, where you are more likely to get a fast and accurate response on any technical problems you may encounter. That forum also has a search feature (that's how I got the above links), so use it before asking anything. Same goes for the ZDoom Wiki - use it.

Share this post


Link to post

Thanks for the informative replies.

Xtroose said:
You should get used to reading documentation. You have to learn the basics to understand advanced topics, it's just the way it is. Nobody is going to hold your hand through the entire game making process. It is something you should do on your own, and invest a lot of your time into it.

I guess this approach works for some people, but I consider it a waste of time to read a long WELCOME TO DOOM MAPPING guide when I'm really just interested in a very specific step in the process. I'd compare it to learning something by book vs. learning something by example, and I personally find the latter to be more educating, interesting and time-saving. I also think the WOW DO YOU THINK WE'RE GOING TO WALK YOU THROUGH EVERYTHING?! answer to a single technical question is kind of condescending and not really that logical.

Bottom line is, I kind of expected there to be a "Make your own Doom game: Setting up your WAD" guide for advanced users somewhere, but I guess not. I didn't know it was that big of a deal to make.

Share this post


Link to post

There are to my knowledge only five different indie games based on the ZDoom. They are Foreverhood (unfinished), Action Doom 2: Urban Brawl (the first was a Doom mod rather than a standalone game), Chex Quest 3 (CQ1 was a transparent TC of Doom, CQ2 an addon for CQ1), Harmony and the Wolfenstein 3D TC. Later down the line, HacX 2.0 might join them.

So you can tell it's not a very common endeavor.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×