Mapping in Darkplaces engine

Discuss the construction of maps and the tools to create maps for 3D games.
Post Reply
Zylyx_
Posts: 111
Joined: Wed Dec 05, 2007 6:52 pm
Location: scotland, uk

Mapping in Darkplaces engine

Post by Zylyx_ »

Hi!

I'm Zylyx, I'm a n00b here, nice to meet all of you. I've stalked this website before for some QC tutorials (even though I'm very lazy these days when it comes to programming, still got that unfinished Pong game lying around....), lol, anyways moving on...


I got hold of this very lovely hi-tech quake engine mod, called Darkplaces, like last year, and now I wanna start tinkering a bit more with it.

The thing is I'm not really used to mapping with the Darkplaces engine, so I have a few general questions that I hope you will be able to answer:

I'm currently using Worldcraft (coz I was into HL mapping, so it kinda stuck with me), and I've patched it up with that Quake Adapter utility (made a few test maps, it works nicely), but now I want todo some more advanced stuff using the Darkplaces engine, so here are my questions:

1. How do I make custom textures?
Basically, I have a few cool hi-res 24-bit TGA textures lying around, and I would want to use them in my map, but how do I go about doing so? I can’t import them into Worldcraft coz the WC Quake wads only support 8-bit BMP textures, so it makes them look like crap? I've read that you have to make a tex dir in you mod dir (like mymod/textures), and put the textures there, but how will the engine know how to find the correct textures for the map? Or do I have to put the hi-res TGA's in the textures dir, then make a copy of them and convert them to crappy 8-bit bmp's in a wad file (keeping the same file names), and map using the 8-bit textures and hope that Darkplaces will know to look in the textures directory and replace them with the hi-res TGA's at runtime? Is there perhaps a simple way of making custom maps with custom hi-res textures in Worldcraft for the Darkplaces engine?


(ok, this next question is a tiny bit off topic, but still relevant)

2. Models...which file format it best to use (HL 1 MDL, MD2, MD3, DPM) and will I have to put the textures in the texture dir like for the maps above, or can they be in the model dir? I know some file format like HL1 MDL embed the textures in them, and I was wondering if anyone here remembers if HL1 MDL supports 24-bit BMP, coz it was ages ago that I did HL1 modeling?


Anyways, those are the problems I'm having trouble figuring out at the moment, and any sort of help or advice would be well appreciated (oh and thanks in advance :) ).


- Zylyx
....noodle...
Zylyx_
Posts: 111
Joined: Wed Dec 05, 2007 6:52 pm
Location: scotland, uk

Ok, I figured it out

Post by Zylyx_ »

Ok, I think I got it working, but I still think it's not the most effective way of doing it. Here is how it goes (my little tutorial, lol):


How to prepare textures and load hi-res textures in Darkplaces using Worldcraft:

Since WorldCraft doesn’t allow the use of anything other then crappy 8-bit bmp textures, certain actions need to be taken in order to use Hi-res 24-bit TGA textures when mapping.

1. First decide what the map is going to be called
2. Then create the hi-res TGA's and place them in the textures\mapname\ dir
3. Then take all the hi-res TGA, and open them up in Wally
4. Create a new Quake Wad file
5. Then Copy and paste each of the TGA's into the Quake WAD (IMPORTANT: Keep the names of the Hi-res TGA's and the BMPS' In Wad file the same)
6. Save the Wad file (name it after the name of the map, such as mymap.wad)
7. Load it up into WorldCraft
8. Build the map
9. Put the compiled BSP into the mymod/maps dir
10. Start up Darkplaces (with the -game mygame parameter)
11. In console type in “map mapname”

The map now shows the hi-res TGA's instead of the crappy 8-Bit BMP textures in the wad file.

Now I just gotta figure out the development pipeline for the models...

- Zylyx
Last edited by Zylyx_ on Thu Dec 06, 2007 12:07 am, edited 1 time in total.
....noodle...
Sajt
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Post by Sajt »

That is the only way to do it. Unless somebody made some Quake Adapter-style batch utility that maps out your textures/ dir and makes/updates a wad automatically.

One thing, you don't have to have a separate textures/mapname/ dir for every map. If you throw ground1_2.tga in textures/, then any map that uses a ground1_2 texture will use it. Much more convenient. The only reason you would use textures/mapname/ is if two maps use different textures with the same name (or if you want to package the map on its own and avoid possible collision with other maps a user might have).

About models...
- HL1 MDL - DarkPlaces does not support this format.
- MDL - This is the Quake format. Notable things are lossy vertex compression*, max of 256 animation frames (I think), and 8-bit textures embedded**.
- MD2 - Like MDL, but uses a different method of vertex compression which is both better and worse than MDL's, but in the end is still crap. It loads textures from external files, so you don't have to use a 'dummy' 8-bit texture.
- MD3 - The best vertex-morph (i.e. non-skeletal) format. Compresses vertices to 16 bits, not 8 bits, per coordinate so it is pretty much unnoticeable. Supports tags***, and multiple textures per mesh (through use of .skin files).
- XYM - Another skeletal format, that is based on the HL1 MDL format (I think) and can be created from one with some sort of tool. I believe this one is generally bad and inconvenient to use, animation wise.
- DPM - I don't know much about it. I don't know how you create them. This format is frame-based so it's convenient for animation (and won't have issues with network culling like XYM did last time I checked).
It also supports UT2003 uncompiled PSK/PSA models for no good reason. Ignore that...

* Lossy vertex compression bad. Each vertex coordinate (X,Y,Z) is compressed to 8 bits (essentially 'snapped to a grid'). This looks especially awful with animation interpolation on.
** You can replace the MDL embedded textures. If your model is 'armor.mdl', make a TGA next to it called 'armor.mdl_0.tga' to replace skin 0, 'armor.mdl_1.tga' to replace skin 1, etc.
*** Tags good. Used for attachments, e.g. guns that a player can hold.
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Zylyx_
Posts: 111
Joined: Wed Dec 05, 2007 6:52 pm
Location: scotland, uk

Post by Zylyx_ »

ok, cool, that's good to know then. It would be nice if there was a little console app or something to handle this conversion between WAD's & TGA's...

Uhm, the DPM modle file format is converted from SMD files which are used to make HL1 MDL files, but the .qc scripting might be different (.qc file used for HL1 MDL scripting, not QC, lol).

It looks like MD3 is then the best file format to use (luckily I got a few Q3 modding and content creation manual lying around on my hard drive), but I'll have to experiment further with this matter.

Thanx a lot for the advice!
....noodle...
Chris
Posts: 79
Joined: Sat Aug 05, 2006 5:31 am

Post by Chris »

MD3 is a nice format, but DPM is the most superior. Mainly due to it's smaller size and every joint on a dpm model is also a tag, whereas md3 you have to specify using a polygon and have a tag_* header I think.

DPM animates in qc on a frame to frame basis (like most others), only model format DP supports that doesn't is the .zym model format, which Nexuiz uses.


Zym has no smoothing groups, and also has some other issues that come along with some of the animation changes. Zym format in QC each frame is a "sequence" of frames in the zym, and are transitioned from frame to frame in a speed specified in the compiler. The positive of this means you can play longer frame sequences quicker without being limited by DP's sys_ticrate, and not spamming the server so much. alternatively you could animate all other formats in csqc but that gets a bit more complex, however would make frame transition limitations nonexistent.

Another note about dpm, frame 0 is the mesh in rest, unless your rigged mesh was in the exact position you want "idle" or whatever you assume frame 0 to be, you'll need to increment everything by 1.

To compile either zym or dpm go to DP's ftp and grab the latest dpmodel or zym(whatever its called) zip and look through the contents. Each model needs at least a reference smd (the mesh file), and then followed are the sequence smd's (the animations) after it. You assemble what you want in a list, do any changes as seen in the script, and if you're on windows just run a dos shell and navigate to that folder, then

dpmodel.exe scriptnamehere.txt

I wish there was a GUI frontend for dpmodel or if it supported obj -> dpm or if DP supported obj itself. But that'll come another time hopefully.

I also had before a md5 -> dpm converter, forget where that got to. Riot I think made it several months ago.

NOTE: For mapping purposes md3 is of course best if you're using q3bsp simply because you can import your md3's into radiant. Whereas dpm of course you can't. You also can take advantage of the .ase format as well for importing into editors like GTKRadiant 1.4.0
Sajt
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Post by Sajt »

I could make a md5->dpm converter if anyone wants it. Right after I finish the MDL/MD2/MD3 stuff for Quaded... :roll:
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Urre
Posts: 1109
Joined: Fri Nov 05, 2004 2:36 am
Location: Moon
Contact:

Post by Urre »

Sajt wrote:I could make a md5->dpm converter if anyone wants it.
I do, Nexuiz does, and I'm sure others do as well. Wanna include md5>zym on it?
I was once a Quake modder
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Post by leileilol »

i'd much prefer a dpm blender exporter instead. MD5 is a horrible exchange format no matter how you look at its bad normals making stuff look crappy in non-realtime light situations (not every light in Nexuiz is a rtlight you know)

SMD is also crappy and we need to reduce the milkshitness of the darkplaces pipelines to a minimum, and provide actual Free open source solutions for a Free open source engine, it's only logical

had to break the 666 post mold you guys didn't notice.
i should not be here
Sajt
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Post by Sajt »

Actually MD5 doesn't store normals at all. I've heard that the Doom3 engine just calculates normals and tangents from scratch every frame after transforming the verts, isntead of storing them for the reference pose and transforming+renormalizing them every frame. I'm not sure about this though, it sounds ridiculous... So yeah, if you like smoothing groups and other whatnot, MD5 is a bad intermediate format.
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Urre
Posts: 1109
Joined: Fri Nov 05, 2004 2:36 am
Location: Moon
Contact:

Post by Urre »

That does indeed change my view on the deal. Blender exporters are all good and fun, but other non-free modeling programs are suffering as well as it is. I'd really love to see tools which convert commonly used/supported formats to DP compatible ones. Especially ones with vertex weights.
I was once a Quake modder
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Post by leileilol »

how about a COLLADA support in dpmodel, that's supposedly the so-called new godsend of exchange formats.
i should not be here
Post Reply