Author Topic: (For Mappers / Model Makers) - Converting brushes in Hammer to .mdl files  (Read 4685 times)

0 Members and 1 Guest are viewing this topic.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
So... I ran in to a problem today.. I am going to start work again on a gamemode that I started a couple years ago which is a medieval RPG / MMO style gamemode. It was going pretty good last time when I ran in to the same problem.. The maps were too detailed and I had reached sources brush limit.

The only 2 solutions for this problem are:

1. Tone down the map and make it less detailed.. This was not an option for me because the detail was one of the things that made the gamemode awesome. Also I wasn't even CLOSE to done with the map so already reaching the limit was a bit of a let down.

2. Convert some repetitive things into models. This would have worked for me in the past because some of the houses were cut and paste so I could have easily converted these to models and it would have worked great. The only issue at the time was that I didn't know how to do this...

^That all changed.. today.

https://developer.valvesoftware.com/wiki/Propper

This little addon for hammer allows you (with a little bit of tweaking) to take a grouping of brushes and straight up convert them into a model. It preserves the textures and there is no need to retexture the prop at all. The only thing that it doesn't do is preserve the mesh types. So the prop I'm about to demonstrate is made up of wood/glass/concrete and brick. If I would have left these as brushes you would get the hit effects in game when you shot them and the sounds as the different types of meshes. also if you are detecting the mesh types of things in your gamemode, this might be a problem now. You can set a single mesh for the entire prop, but it doesn't separate it for you.

Anyway.. here we go.. demonstration time:

In this image we have the house that I created in hammer. This house is fairly detailed (not really... but sort of) there are 88 brushes that make up this building. As you can see.. it is not even that detailed and is already using 88 brushes.


As a stress test, I decided to copy/paste this house about...... 120 times on a single map to see if it would compile. Not that my gamemode would have 120 houses.. but that was just a good round number to test with.

Turns out I was using about 25x the max amount of brushes.

I started doing some research and found the tool that I linked up above and after some reading on the wiki and playing around with it, I got it to compile the house into a single prop which I then put back in the map as a static prop. (Note: Static props are treated in the game as world brushes but don't count toward the brush count. They can not be manipulated in any way like dynamic props or changed or removed.. the client must still have the model and textures installed to see them though or they will get the red error in it's place)

This is what I got...


Army of houses..

The final map size of the second image was actually about half a meg smaller than the first one. Even though there are about 126 more houses.


Just thought I would share in case anyone else might find this useful! Enjoy.

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Niice! I was running into issues with too much details back when I did my waay old gm_melonball map. Turning parts of the map into models definitely would have helped a ton :P
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Mmm. Melonball. Geez i miss that. NOOOoo. Watch that corner, you're going to fas*SPLAT*
And, what ever happened to the combine ball pylon obstacle course?
THAT should become a game mode, not just a fun prop (though, both would be best..one for just tinkering, one for actual maps)
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming