How about really effective GoldSrc BSP decompiler? Created 5 years ago2018-12-10 16:16:43 UTC by Qwertyus Qwertyus

Created 5 years ago2018-12-10 16:16:43 UTC by Qwertyus Qwertyus

Posted 5 years ago2018-12-10 16:16:43 UTC Post #341417
Hello, guys!

As you probably know, all existing GoldSrc BSP decompilers are not really effective. The result of a map decompilation is generally awful - a lot of brush pieces, leaks, texture problems, so you mostly can use that MAP file you're getting after decompiling only as reference for creating a new map, but can't compile it back in properly working BSP. But there is an opportunity to change this situation. Unkle Mike (the creator of Xash3D and different effective GoldSrc utilities, including his own map compilers) is currently working on Doom map decompiler (he called it doom2gold). While working on it, he greatly increased his understanding of effective map decompiling methods and eventually realized, that it will be possible to create a corresponding map decompiler for GoldSrc BSP format.

As he thinks, he's able to make the GoldSrc map decompiler, which can preserve the whole map geometry, texture aligning and give a very close brushes' layout to initial MAP file, which mapper used for compiling a map. So you will be able to compile the result of decompilation again without a painstaking map remaking. But while doom2gold is the thing which is personally interesting for Unkle Mike, new GoldSrc map decompiler is just an idea yet. Unkle Mike is not going to spend his time on its' development unless the community can motivate him for this.

So, what can you say? Is the thing like properly working GoldSrc map decompiler interesting to you? Could you donate some money for development of such tool (if Unkle Mike decide to begin it)? It's just a question yet, because Unkle Mike wants to know if this kind of program is meaningful for community or not. So please tell what you think about it.
Posted 5 years ago2018-12-10 16:57:29 UTC Post #341420
I for one am glad that you can't recover a 1:1 CSG representation of a BSP map.
The only reason you should do this is to take reference of some interesting brushwork or something that helps you learn to make something similar to what you see represented in game yourself thus improving your overall skill as a level developer/artist.
Having non perfect tools gives somewhat of a protection from blatant copies, you have to put hours of work into polishing something when decompiling with bsptwomap or whathaveyou and your average script kiddie (couldn't come up with a better name :) ) usually does not have the patience for it.
rufee rufeeSledge fanboy
Posted 5 years ago2018-12-10 17:35:06 UTC Post #341422
Best of luck to him. I think a better use of time might be to encourage people to share their source files, since the root of this problem is cultural, not technological.
Oskar Potatis Oskar Potatis🦔
Posted 5 years ago2018-12-10 20:49:52 UTC Post #341423
I think GoldSrc map decompilers will never have 1:1 results, since all the decompiled brushwork will always be the decompiler's guess. GoldSrc BSPs have faces that form one big mesh, and .map files have plane intersections that form individual volumes. It's all a big guess and approximation.

Although, it would be nice to see if we had smarter decompilers. The ones I've used didn't care for face subdivisions and they left it like that. There's also one decompiler that turns every solid entity face into a 1-unit-thin brush. Ew.

And I agree with potatis_invalid. The root of this problem is cultural (not sure if I'd call it a problem, but I guess it is). If a mapper doesn't want to release their map sources, it's their decision. It's their work, they can do what they want with it.

I'm definitely not against an effective map decompiler (I'm for it). I'm just afraid it's going to induce more laziness and potentially a more efficient way of stealing maps or parts of them.
Admer456 Admer456If it ain't broken, don't fox it!
Posted 5 years ago2018-12-10 23:10:38 UTC Post #341424
Some of my thoughts:
1. Sometimes mappers can lose map sources, and this can be a problem for mapper himself. I know real examples when losing sources demotivates mod authors from continuing their work at all.
2. Sometimes author is not against of using of his work, but he doesn't have map sources already, so he can not share them with anyone.
3. Sometimes people want to change a couple of things on a map just for their own needs, not because they want to steal someone's work.
4. A lot of things on any map still can be changed via entpatch editing, decompilation just allow to work in common map editor instead of using less handy utilities.
5. A lot of map sources are released already and mostly this didn't cause using them for creating of "blatant copies", so just relax, OK? From the other side, the absence of map sources doesn't prevent people from creating different remakes and such, if they really interested.

What about other questions.
1. I didn't say that decompiler can give you 1:1 copy of map sources, but very close results of general map layout are possible, with proper geometry and texturing. Map lighting is one of those things which is nearly impossible to recreate 1:1 with decompiling, so this part will require some manual work with map anyways.
2. It will not be very easy to do, and of course it will require a lot of testing and bug fixing, so there is a question: is someone really interested in this, or it's better do not try at all.
3. The project will not be started if Unkle Mike decides that there are not enough reasons for this. So currently I just asking about your opinions, nothing more.
Posted 5 years ago2018-12-11 06:54:21 UTC Post #341425
True, data loss happens, but this should not be an excuse for actual backups. Certainly takes less time to copy a few map files to a flash drive than to decompile.
Some people do not want to share sources and I don't see any problem with that, everyone has their reasons. If you are willing to take the time to fix up a decompiled map that is OK with me and tools already exist for it however imperfect they may be.

I would rather put money into better and faster compile tools.
rufee rufeeSledge fanboy
Posted 5 years ago2018-12-11 07:06:20 UTC Post #341426
Perhaps this person could be encouraged to document their ideas on decompilation techniques so somebody more motivated can attempt it? Instead of this weird "holding knowledge for ransom" vibe that's going on in this thread (intentional or not).
Penguinboy PenguinboyHaha, I died again!
Posted 5 years ago2018-12-11 19:53:29 UTC Post #341427
I think QuArK once intended to support .bsp editing but I too think it's not needed. Interestingly one day i tried this Quake 2 decompiler and it gave a way too perfect .map which seemed like the original .map file, brushes stuck inside one another and all that.
Posted 5 years ago2018-12-11 23:23:13 UTC Post #341431
Quake II does BSP differently as far as I've heard, so I wouldn't be surprised. It's either storing BSP files with complete brushes, or storing faces with an extra lump for the original brush data. Can't quite remember what exactly.
Admer456 Admer456If it ain't broken, don't fox it!
Posted 5 years ago2018-12-12 01:37:23 UTC Post #341433
Yeah, it looks like the Quake 2 format stores the actual brushes in the BSP alongside the regular CSG mesh. The brushes are used for collision physics but conveniently they can be used for decompilation as well. This is the same reason Source BSPs decompile nicely.
Penguinboy PenguinboyHaha, I died again!
Posted 5 years ago2018-12-12 06:46:48 UTC Post #341434
Seems to work well with GS maps too, certainly better than bsptwomap. Logic behind it seems to be to create a brush from existing faces and extend the back of it until it hits another brush or the farthest point in the mesh thus making the map look like a rectangle box with the playable part carved out of it. Textures are applied nicely and most brushes seem to be damn close to the original.

I'm not sure if you would be able to derive the texlights from the lightmap.
rufee rufeeSledge fanboy
Posted 5 years ago2018-12-12 13:03:26 UTC Post #341436
That's awesome. Which means all Quake 2 maps have a source file. As for texlights, the only way would be to guess the compile tools and the parameters used and then doing some automatic trial and error until you get a match. Although that's going a bit far.
Posted 5 years ago2018-12-12 13:09:10 UTC Post #341438
Texlights are only possible if you have the original lights.rad, since lightmaps contain lighting data from multiple sources. You might be able to determine which textures were given a texlight value based on lighting values emitted near instances, and approximate the values but it's never going to be as accurate as you want it to be.
Posted 5 years ago2018-12-12 13:33:31 UTC Post #341440
dont forget info_texlights
Posted 5 years ago2018-12-12 13:43:15 UTC Post #341441
That's right, those entities aren't removed from the entity data after RAD's done.
You must be logged in to post a response.