GoldSrc Map2Prop

Half-Life HL
GoldSrc Map2Prop by Erty
Posted 9 months ago2023-07-13 01:54:11 UTC • Unfinished • Half-Life
Loading...
Screenshot Thumbnail
Name
GoldSrc Map2Prop
By
Erty Erty
Type
Application
Engine
Goldsource
Game
Half-Life
Category
Unfinished
Included
EXE
Created
9 months ago2023-07-13 01:54:11 UTC
Updated
2 months ago2024-02-16 21:57:39 UTC
Views
2043
Downloads
315
Comments
24
Rating
5.00 (4)

v0.8.6 beta

GoldSrc Map2Prop is a tool for converting .map, .rmf and .jmf files, as well as .obj files exported from J.A.C.K, to GoldSrc .smd file that can then be compiled into a GoldSrc format studio model without the hassle of using an 3D editor.

Github.io page for the project


Notice:

It has come to my attention that Windows Defender will flag the executable as a trojan. It seems to be a common issue with the bundler I used, and could also be due to me not having used code signing on it yet. I'm working on fixing the latter. (I'm just a webdev who's just starting out making desktop apps, still got a lot of figuring out to do!)

All I can do is promise I haven't put anything nasty in my code, but you should of course not blindly trust a stranger on the internet.
If you're unsure, just come back later when the issue is hopefully fixed. 🙂

Installation

No installation required, simply extract the .7z archive into your folder of choice.

Supported platforms

Map2Prop is currently only supported on Windows.
Linux support is planned for a future release.

How to use

For most basic use you just need to ensure all required textures are in the same folder as the project file, or make use of automatic .wad extraction (explained further down). Then simply drag your project file onto the executable.

You may also use the CLI interface. Run Map2Prop.exe -h to list all available options.

Automatic .wad extraction

Map2Prop is able to read and extract textures from .wad packages found in a wad list defined in config.ini or by command line, from a game/mod defined in config.ini, or within the project file's directory, prioritised in that order. The application will automatically do this for all texture files not found within the project file's directory.

Smoothing

Smooth shading and the angle threshold for smoothing can be set in config.ini and/or command line, but may also be set by suffixing the file name with _smooth{x} where {x} is the optional parameter for angle threshold. Leaving out the threshold parameter or setting it to zero will smooth all edges of the model.
Example: mymodel_smooth60.rmf will have smooth shading applied to all edges less than 60° apart.

Skip faces

Neither input format does any "inside face" culling. I'm not talking about backface culling, but rather the faces inside of objects.
I recommend covering all unseen faces (as well as any other faces you want to skip) with NULL texture as these will be stripped out during the process.

Why is the Sven Co-op studiomdl.exe required for compilation?

The reason for requiring the Sven Co-op studiomdl.exe for compiling these models is because of how map textures work, i.e. they may tile or otherwise extend beyond the UV bounds. Legacy studiomdl.exe compilers will clamp UV coordinates which is no good for this. Don’t worry, the compiled model will still work perfectly fine in vanilla Half-Life.

Issues / bugs

Please post any issues/bugs you find as a comment here or as a private message to me. 🙂

I'm currently investigating a small discrepancy in the UV map. So far it looks to me it's just a rounding error or floating point precision error, but won't know for sure until I find the cause of it.

Special Thanks

Thanks to Captain P for all the help and advice, as well as showing me the .rmf/.jmf parsing code from MESS, and thanks to Penguinboy for the tips and being very helpful with any questions I've had!

Alpha Testers

Many thanks goes out to the kind people who helped me test this program and provide useful feedback and suggestions during its alpha stage:
  • SV BOY
  • TheMadCarrot
  • Descen

24 Comments

Commented 9 months ago2023-07-14 20:21:54 UTC Comment #105397
Earlier today I was thinking about trying the maps to models process and low and behold I see this.
I haven't had a chance to try the tool out yet, but I am endlessly grateful that you're working on it! :heart:
Commented 9 months ago2023-07-15 08:34:33 UTC Comment #105400
I'm glad to hear that ^^
Commented 9 months ago2023-07-15 15:37:26 UTC Comment #105401
我最近很有可能有体验的机会,十分感谢您的工作和爱。爱来自中国。
I am very likely to have a chance to experience it soon, thank you very much for your work and love. Love comes from China.
Commented 9 months ago2023-07-15 19:34:25 UTC Comment #105402
Thank you too, I hope you find it useful! 😊
Commented 9 months ago2023-07-17 17:41:59 UTC Comment #105405
This is a very cool tool, thanks for sharing!
Commented 9 months ago2023-07-17 21:44:17 UTC Comment #105407
Looks very good! Theoretically you could use this for 3D modelling?
Commented 9 months ago2023-07-18 07:39:47 UTC Comment #105408
Definitely! It basically lets you use your level editor to create models.
I hope it's useful to those that don't want to learn to use a 3D editor but still want to make model props for their maps. ^^
Commented 9 months ago2023-07-19 06:26:15 UTC Comment #105413
System Error

The program can't start because api-ms-win-core-path-l1-1-0.dll is missing from your computer. Try reinstalling the program to fix this problem.

That's on Windows 7. Why is the executable so massive?
Commented 9 months ago2023-07-19 17:10:33 UTC Comment #105417
It was compiled on Win10 so it's possible it might not work on Win7 (it not being supported and all that).

The size is mostly due to a library I used for a lot of the math functions, and I agree it's unnecessarily large. Been working on refactoring out that bloated library since last week and should have a new version ready pretty soon. 🙂
Commented 9 months ago2023-07-19 21:45:37 UTC Comment #105418
(Oh right, that new version mentioned above is out now)
Commented 9 months ago2023-07-20 16:08:57 UTC Comment #105421
What's new?
Commented 9 months ago2023-07-20 16:43:17 UTC Comment #105422
On the outside it's mostly just a smaller filesize for the executable. A bloated library was refactored out to make that happen, and a lot of the math functions it provided were replaced with standard library ones or rewritten by myself.
Also found and fixed a bug related to reading .obj files with ORIGIN brushes.
Commented 9 months ago2023-07-21 07:54:37 UTC Comment #105423
After trying it I gotta say it is incredibly simple to set-up and use.
The models look indistinguishable from their brush counterparts.

Amazing job with the program <3
Commented 9 months ago2023-07-21 15:25:35 UTC Comment #105427
Good program, haven't experienced any issues so far.
Commented 9 months ago2023-07-22 13:29:59 UTC Comment #105434
Thanks both of you. I'm glad to hear it's working well for you ^^
Commented 9 months ago2023-07-22 18:36:50 UTC Comment #105435
Haven't tried this yet as I've been out of my mapping streak.

This program is a step forward to make goldsrc propmaking workflow better, for sure. For one, it eliminates the need to use Blender+plugin for the obj to smd conversion.

I really hope you explore the possibility of extracting compiled .bsp models as .objs, which you can feed into the toolchain, as the lightmaps can then be baked into the textures of the props, suitable for larger props e.g. 3d skyboxes.
What this would make possible is a single compile workflow: csg, bsp, vis, rad, bsp2prop.
Again, this tool being at the end means it has rad's lighting information to work with.

I know unrealkaraulov's newbspguy fork has this exact feature, but it's not accessible in the CLI (in fact his fork's CLI is completely broken) and he's been on radio silence as of late.
Crafty can export .bsp as .objs as well but only the whole .bsp. Again, UK's newbspguy comes in a clutch with its ability to export individual brush model as a standalone .bsp, which you feed into Crafty. But again, the problem with these programs are that they have no command line interfaces.
Commented 9 months ago2023-07-23 02:09:35 UTC Comment #105436
Wow, nice tool! thanks for sharing.
Months ago I had the desire to create a script/tool that would allow me to do that, but I abandoned it. It's good that you made it possible.
The idea i had in mind was basically converting the brush in an entity called "brush_model" with some keyvalues. Then during the compiling process (before zhlt tools process) the script/tool would convert the "brush_model" entity to mdl (using external tools) and then automatically inserting it into the map as a cycler_sprite. I never got around to implementing it, i just coded a few lines to parse the .map file in a basic way.
Here concept map of the idea:
User posted image
I was planning to use many external tools as possible to make the code easier and avoid having to code complex tasks like extracting wad textures or converting to smd, since my knowledge of programming is very basic.
Commented 9 months ago2023-07-23 10:49:32 UTC Comment #105437
@kimilil I will consider that for the future. Even after I finish v1.0 of Map2Prop I still have two mapping projects I'm working on I want to finish first before starting a new project.

@cindor That sounds similar to the concept Kimilil was talking about.

Someone in the Discord came up with the idea to use custom entities that would be turned into models and put back in the map. I guess one could call a program at the start of the compile process that'd extract these entities from the .map file and run Map2Prop on those (once I finish the .map format support) and then replace these entities with cycler_sprite or whatnot (possibly give it a CLI argument) before overwriting the .map and let the rest of the compile process go as usual. It wouldn't have Kimilil's baked lightmaps, but could been an alternative way of doing this.
Commented 7 months ago2023-09-15 19:11:04 UTC Comment #105560
A few more ideas:
  • Implement smoothing groups via brush entities
  • Implement mesh tying to bones via brush entities, with the origin brush as the bone position. This would open the door to animating or adding bone controllers with qc.
My end goal is to be able to turn a porta-pottie with its door into a model (you can guess where this is going...)
Commented 7 months ago2023-09-16 14:47:13 UTC Comment #105563
I wonder what happens if you feed this program a Quake II or Quake III JMF. Been meaning to try, for the lulz.
Commented 7 months ago2023-09-18 08:17:44 UTC Comment #105567
@kimilil I'm already working on using the ORIGIN brush as model origin override, besides it wouldn't have enough information to make a skeleton chain.
I'm thinking instead of using a custom point entity (info_bone) that can hold a name and parent, and have it skinned to the vertices of any brushes grouped with it (or even radius around the entity, could use a keyvalue for that as well). Might look into it after the full release.

@SirYodaJedi I think it'll work fine, unless you use any Quake III curved surfaces. Just looked at the code now and realised it doesn't handle the curved surface array in each solid, which will corrupt all other solids after the first one. Already fixing that now 🙂
Commented 3 months ago2023-12-31 08:54:09 UTC Comment #105819
这很好。这是两个世界的桥梁。
That's fine. It's a bridge between two worlds.
Commented 2 months ago2024-02-25 22:43:08 UTC Comment #106013
Awesome. This is now being used for some of the more complex brushwork in The Core. No complaints so far. You have been added to the credits. :)
Commented 2 months ago2024-02-26 09:31:06 UTC Comment #106014
That's really exciting to hear! Looking forward to seeing it! 😁

You must log in to post a comment. You can login or register a new account.