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

I Will Program Small Doom Utilities For You

Recommended Posts

Maes said:

Just a question here, about the BlackRook WAD management libraries:

...

Have these points changed in the latest version, as it seems that some or all of those operations are now possible (from a superficial browsing of the current API, at least)?


The WadFile object is able to open a WAD and its entries without the content itself. You can search/pull entry data by name, index, or name starting from an index (which would be useful for map type detection).

There are static methods in DoomMap that read lumps of map data and return lists (BlackRook Commons Lists) of the desired type. You have to know what format the map is in first, before you call those, though. I currently don't have an easy way to extract just a particular set of data from a UDMF table, but I will add that for the next version (which will be done soon).

I currently do not have a method for stacking WADs in the way Doom does in order to simulate how it reads patch data, however.

Share this post


Link to post
MTrop said:

I currently do not have a method for stacking WADs in the way Doom does in order to simulate how it reads patch data, however.


That is pretty much a killer for basing a source port over the libraries, though, unless of course you drop PWAD compatibility. I suppose stacking could be simulated by using a frontend for multiple WadFile objects, and doing some operations like searching etc. by iterating through them.

I don't know how feasible it is to manipulate the contents of an instantiated WadFile object in order to perform lump merges and insertions at precise point, zero-lump size hacks etc.

Also, do you use simple vanilla-like reverse-index name-based searching or a hashtable mechanism like Boom, which is much faster?

As for the map format, I saw that you have the proper object types, but a source port developer would probably have to make a choice between using your level loading routines and objects (which might be OK, but I don't know how much their encapsulation would end up in cluttered syntax or performance issues, vs using simpler objects), or using his own (Doom and Boom loading routines also do some form of manipulation on the objects they just read, and some structures have different on-disk and in-memory forms.

Share this post


Link to post
MTrop said:

How does Doom, ZDoom/Hexen, and UDMF sound? ;)

Like music to my ears. :D

Share this post


Link to post

1- Doom-format word: By this I mean you can write any word in the same format as doom map titles or small letters with various colors, and then save it as a picture to use for PWADs.

2- Sprite Rename: With this program you can easily name a group of sprites and very fast. For example if I wanted to name the thing SAMP, I need to rename the sprites manually by renaming each one to SAMPA1, SAMPA2, SAMPA3, SAMPC3 and so on. But with this program you can just add SAMP as the base name, and the program will put the names in order you desire automatically.

Share this post


Link to post
40oz said:

could you make like an image viewer program that you can run with wads to look at overhead automap views of maps?

Half-way through this sentence I remembered using a Wolfenstein texture editor to look at porn 64x64 (or whatever) pixels at a time because it was the only image viewer I had.

Share this post


Link to post
Maes said:

I don't know how feasible it is to manipulate the contents of an instantiated WadFile object in order to perform lump merges and insertions at precise point, zero-lump size hacks etc.


When will you need to do actual insertions? Does Doom maintain a virtual image of a WAD in memory (content on disk, virtual data in memory)? I haven't browsed its source code enough to know. If so, that wouldn't be a problem to add. It would take a bit of time, though. Inserting things into a WadFile immediately alters data on disk, which you probably wouldn't want.

Maes said:

Also, do you use simple vanilla-like reverse-index name-based searching or a hashtable mechanism like Boom, which is much faster?


Name lookup is using a hashtable, unless it is "from-index-to-name," which you would need to use for maps (since they would have lumps with reused names; that search is sequential).

Maes said:

As for the map format, I saw that you have the proper object types, but a source port developer would probably have to make a choice between using your level loading routines and objects (which might be OK, but I don't know how much their encapsulation would end up in cluttered syntax or performance issues, vs using simpler objects), or using his own (Doom and Boom loading routines also do some form of manipulation on the objects they just read, and some structures have different on-disk and in-memory forms.


I understand completely. The purpose of the library was for utility writing, not necessarily for runtime. You may be better off using your own structures, anyway.

Share this post


Link to post
C30N9 said:

1- Doom-format word: By this I mean you can write any word in the same format as doom map titles or small letters with various colors, and then save it as a picture to use for PWADs.


Back when I was making Coffee Break, I used a program that did that called "Bitmap Font Writer." I forget where I got the Doom lettering bitmaps, though.

C30N9 said:
2- Sprite Rename: With this program you can easily name a group of sprites and very fast. For example if I wanted to name the thing SAMP, I need to rename the sprites manually by renaming each one to SAMPA1, SAMPA2, SAMPA3, SAMPC3 and so on. But with this program you can just add SAMP as the base name, and the program will put the names in order you desire automatically. [/B]


Are you renaming files, or entries? You would have to tell it the order to rename the files, plus whether to mirror frames or not. Entry renaming would be really easy, however.

Share this post


Link to post
C30N9 said:

2- Sprite Rename: With this program you can easily name a group of sprites and very fast. For example if I wanted to name the thing SAMP, I need to rename the sprites manually by renaming each one to SAMPA1, SAMPA2, SAMPA3, SAMPC3 and so on. But with this program you can just add SAMP as the base name, and the program will put the names in order you desire automatically.

Use SLADE 3 for this. It has batch file renaming, eg
SAMPA0
SAMPB0
rename dialogue:
SAMP**
to
TNT1**
and it renames them to
TNT1A0
TNT1B0

Share this post


Link to post
Marrub said:

Use SLADE 3 for this. It has batch file renaming, eg
SAMPA0
SAMPB0
rename dialogue:
SAMP**
to
TNT1**
and it renames them to
TNT1A0
TNT1B0


Oh, so entry renaming? No prob.


Also, Maes - I may have jumped the gun on a from-index search. There's one for getting data, but not for just an entry. I'll have to add that.

EDIT: Also, on another note, I think I mentioned at one point (in the interview, maybe) that the DoomStruct library had a problem with writing BLOCKMAP data. Turns out that may not be the case, as it writes uncompressed, but valid, BLOCKMAP data. Heh.

Share this post


Link to post

Okay, guys - little bit of an update.

I've set up everything that I need to for programming this stuff, so you should start seeing some things getting released this week.

Share this post


Link to post
Tango said:

how about a program that flips maps upside down, a-la Symphony of the Night? :p reverses floor and ceiling heights, etc. if you could even make it automatically generate upside-down versions of the textures too i'd give you a million dollars

Forgive the hijacking of The Trop's thread, but I wrote a quick DB2 plugin to do this a while back (sans the textures of course). I should probably polish it up and release it at some point.

I suppose if requests are still going 'round, I'd actually love to see a nice "WAD Merge" utility that would allow you to select a bunch of input wads, an output wad, and then show a list of all the maps found in the input wads and allow you to select what map slot they will occupy in the output wad.

The idea is to allow you to one-shot compile a community project where everyone submits their maps as MAP01 or MAP12 or something yet you (obviously) need them to occupy different slots in the final product. Copy+Pasting in SLADE is a bit tedious and potentially error-prone (since map lumps aren't grouped), so this'd help alleviate the pain. Bonus points if it handles accompanying music lumps as well and allows you to 'merge' changes into existing wads (instead of having the output wad be a new wad every time).

Extreme bonus points if functionality to generate map names (both BEX and patches) is included as well, but I'd be content to add this myself if a base tool was done and source was made available. :P

Hmm, now that I've written it out, I'm tempted to tackle this myself. Might try doing it with Qt since I haven't done C++ in ages and could use some practical practice (and perhaps some less redundant phrasing).

Share this post


Link to post
Xaser said:

Hmm, now that I've written it out, I'm tempted to tackle this myself. Might try doing it with Qt since I haven't done C++ in ages and could use some practical practice (and perhaps some less redundant phrasing).


You're welcome to start. I may not get around to it, soon.

Share this post


Link to post

Hey, all.

I've bumped the thread because I have released (into beta) not 1, not 2, but 3 new utilities. Two requested, one NOT requested!

Jump to the release post!

Share this post


Link to post
MTrop said:

Hey, all.

I've bumped the thread because I have released (into beta) not 1, not 2, but 3 new utilities. Two requested, one NOT requested!

Jump to the release post!


what
[running on the win32 w/o java binaries]

Share this post


Link to post

Ugh.

Well, that's why they're beta. Hang on - gonna take the Win32 ones down so I can see what the problem is.

EDIT: I'm pretty sure that the rest will work, by the way. :P

Share this post


Link to post

Okay, looks like it is a lot more involved to actually make these things standalone and it's gonna be a lot more trouble to do so.

Not gonna do the JET thing. Looks like you're gonna need Java. Just disable the browser plugin, if the Oracle Installer installs it - nobody needs that old thing.

EDIT: Also, to make it up to everybody, I just added another program, ThingSpy. Enjoy!

Share this post


Link to post
MTrop said:

ThingSpy v0.9 - Output or search for thing editor numbers by map lump.
Source - Standalone JAR - Win32 L4J

Quick test on a WAD containing well over 100 maps in ZDoomHexen format and it seemed to handle it perfectly. I particularly like the additional switches. The ability to return only the maps with the thing on it will save me a lot of searching time.

I think I may find TexSpy useful too. I haven't tried it yet though. Does it return flats as well as textures? [edit]nevermind, I read the docs. It does. :) [/edit]

Thank you very much for doing this. It's very much appreciated.

As an additional thought, could either of these programs be extended (or perhaps a separate utility might be better) to allow them to make a batch change of texture/flat/thing? ie to change thing# X to thing# Y or texture X to texture Y in all maps passed to the util on the command line. Perhaps a config file or something might be useful so the user could make a list of from and to thing numbers / textures and have multiple changes take place. If not, so be it. I'm delighted with thingspy as it is. :D

Share this post


Link to post
Enjay said:

Quick test on a WAD containing well over 100 maps in ZDoomHexen format and it seemed to handle it perfectly. I particularly like the additional switches. The ability to return only the maps with the thing on it will save me a lot of searching time.


Be honest - it's just to find that pesky DoomBuilder Camera (32000) that we keep leaving in our maps, isn't it? ;)

Enjay said:

As an additional thought, could either of these programs be extended (or perhaps a separate utility might be better) to allow them to make a batch change of texture/flat/thing? ie to change thing# X to thing# Y or texture X to texture Y in all maps passed to the util on the command line. Perhaps a config file or something might be useful so the user could make a list of from and to thing numbers / textures and have multiple changes take place. If not, so be it. I'm delighted with thingspy as it is. :D


You're in luck - I started revamping the utility that I made Xaser years ago, so you just might get that functionality!

Share this post


Link to post
MTrop said:

When will you need to do actual insertions? Does Doom maintain a virtual image of a WAD in memory (content on disk, virtual data in memory)?


Ports like Boom do alter the relative order of certain lumps in memory during WAD loading time, and coalesce blocks of similar-purpose lumps together e.g. for being able to load sprites from a PWAD, they must all be in one contiguous block, as do flats, so any additional sprite block present in PWADs must be merged with base ones, overwriting some in the process (NB overwriting occurs only at the pointer/index level!). In addition, they look for special markers e.g. SS_START and SS_END (Deutex markers for sprite blocks) and FF_START/FF_END for flats, in order to identify any and all blocks of additional sprites.

In the end, the IWAD + PWAD combination that is in memory, if it was to be saved to disk again, would not resemble the original contents very much, but that only happens if you load PWADs along with the IWAD. Of course, the above can also be done by your library (specify optional automatic merging of sprite and flat lump groups during load time).

Share this post


Link to post

Can you make a program that does this:

01 → 12
02 → 13
03 → 14
04 → 15
05 → 16
06 → 17
07 → 18
08 → 19
09 → 31
Basically, changes map 01 to map 12, map 02 to map 13, map 03 to map 14... map 09 to map 31.

Share this post


Link to post

Archy said:
Basically, changes map 01 to map 12, map 02 to map 13, map 03 to map 14... map 09 to map 31.

You can do that in a batch file by making a certain input (%1 %2, etc) equal the level (variable) you want.

if %3==01 set level=12

I use a level variable that is like this:

11 to 19 = E1M1 to E1M9
21 to 29 = E2M1 to E2M9
31 to 39 = E3M1 to E3M9
41 to 4B = MAP01 to MAP11
52 to 5C = MAP12 to MAP32
61 to 6A = MAP21 to MAP30
X1 to X9 = E4M1 to E4M9

(After 9, that is, I use A for +10, B for +11, etc, and the secret levels are in "episode 5" regardless of their 30 something number because they link to it.)

The level variable can then also tell the batch file what executable to use; Doom or Doom2.

By the way, you had asked if I could send you my batch files. I will do so soon but first I wanted to fix and add a few things.

Share this post


Link to post
Archy said:

Basically, changes map 01 to map 12, map 02 to map 13, map 03 to map 14... map 09 to map 31.


So as to play No Rest For The Living in engines without a MAPINFO-like system? :p

Share this post


Link to post
myk said:

You can do that in a batch file by making a certain input (%1 %2, etc) equal the level (variable) you want.

This seems to be beyond my level of knowledge of batch scripting. Have you already created this batch file or are you theoretically telling me how I could create a batch file that would satisfy my above need?

myk said:

By the way, you had asked if I could send you my batch files. I will do so soon but first I wanted to fix and add a few things.

Thank you very much!

Gez said:

So as to play No Rest For The Living in engines without a MAPINFO-like system? :p

Yes, changing the maps isn't a big deal just for one WAD but I'd like to include said program in my zip file in the event that I record a movie run of NRFTL so the viewer can without hassle alter their WAD.

Share this post


Link to post
Maes said:

Ports like Boom do alter the relative order of certain lumps in memory during WAD loading time, and coalesce blocks of similar-purpose lumps together e.g. for being able to load sprites from a PWAD, they must all be in one contiguous block, as do flats, so any additional sprite block present in PWADs must be merged with base ones, overwriting some in the process (NB overwriting occurs only at the pointer/index level!). In addition, they look for special markers e.g. SS_START and SS_END (Deutex markers for sprite blocks) and FF_START/FF_END for flats, in order to identify any and all blocks of additional sprites.


So, in order for me to write something to suit your use case, what would need to be indexed in memory, pointing to WADs? So far, I think it is:

  • Maps
  • Sprites
  • Textures
  • Flats
  • Other (Globals, Sounds, Palettes, etc.)
Which are the types that absolutely need to be sorted? The textures I think, at the very least, should be sorted, since Doom has that "first alphabetical texture is invalid" idiosyncrasy. Sprites and flats as well, I believe.

I'll probably make it dynamic as well (add or remove Patch WADs at will), but that will be slightly more memory-intense.

Share this post


Link to post
MTrop said:

The textures I think, at the very least, should be sorted, since Doom has that "first alphabetical texture is invalid" idiosyncrasy.

What happens is that the first texture defined in the TEXTURE1 lump* is invalid.

Alphabetical order is not a factor. It's just a coincidence because the tool that Id used to build their TEXTUREx lumps sorted them; but you very well might make the first defined texture in TEXTURE1 be named ZZZZZZZZ.

Additionally, the order of the texture patches has absolutely no relevance.


* The TEXTURE2 lump is exempt since its textures are loaded after the TEXTURE1 lump textures. I suppose if TEXTURE1 was empty or missing, then the first TEXTURE2 texture would be invalid, but this is a kinda contrived case.

Share this post


Link to post

Hey, everybody.

Just added MapSwap.

It will move a map entry to another "slot" or map entry, along with associated graphic titles and music if it is a known Doom or Doom 2 lump (but not DEHACKED or MAPINFO stuff - can't parse that reliably, yet).

If the target map entry's resources exist, they are swapped to the first one's place (as well as graphics and music). You can force it to not move graphics or music via switches.

Share this post


Link to post

'Sup guys. Quick update:

TEXtract is coming along, I'm just still hung up on how I'm going to actually do the extraction properly. I'll probably need to write a bunch of helper classes, so that's hindering my progress at the moment.

Also, I've received a request from bcwood16 for a GUI for operating MD2Tool (model tool for Doomsday Engine) so that's gotta go on the list.

Just wanted you guys to know that I haven't forgotten about it!

Share this post


Link to post
MTrop said:

Also, I've received a request from bcwood16 for a GUI for operating MD2Tool (model tool for Doomsday Engine) so that's gotta go on the list.

Nice idea. I'll probably find that useful too.

Share this post


Link to post

Any chance of a utility (discussed here) that can count the number of map markers in a directory, preferably while they're zipped?

Tango said:

if he did i'd really like to see it :D


gggpenis, where are you

Here you go, to the best of my knowledge it's the final version of the map described in this thread.

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
×