Brainstorming: Hammer Plugins

Any aspects of level design for the Source engine.

Re: Brainstorming: Hammer Plugins

Postby Shrinker on Mon Oct 31, 2011 12:39 pm

I can only say from experience that on a brush ent I had, with "higher" than one unit vertex precision, I was presented with a precision of one unit. But hell, that doesn't matter for me anyway, as I can manage these things in my editor. If you guys can compile them to be represented accurately enough in the bsps, then that's fine :P
Homepage | Bite back
Microbrush all-3D level and model editor v. 2.2.1
  Microbrush 3 Steam group
   Free country my ass. We Germans are not even allowed to buy Quake 1 through Steam, or see violence in any game, for that matter.
User avatar
Shrinker
Been Here A While
Been Here A While
 
Joined: Fri Nov 09, 2007 5:52 pm
Location: Germany

Re: Brainstorming: Hammer Plugins

Postby Mr. Happy on Mon Oct 31, 2011 11:28 pm

Wait, are you making Hammer plugins somehow in addition to microbrush, or is this all about microbrush?

zombie@computer wrote:vbsp doesnt snap to grid at all. Brushes are saved as a collection of planes, using a standard floating point precision, and using some outerworldly algoritm these planes are transformed into a collection of points. Only points < 0.01 (or some other arbitrary number, Valve calles it EPSYLON iirc) away from the nearest gridpoint are rounded (as in, moved towards the nearest whole number coordinate). Don't believe me? The sourcecode for vbsp is given, so you can look it up; you will be searching for clipwinding* functions.
Hammer may round some vectors, i dont know as i dont have its sourcecode (except a very old hammer), but i cant imagine Hammer rounding vectors at random, possibly corrupting every non-cubic brush in the map, for no reason whatsoever (points on grid are in no way rendered or handled faster than points off grid).


I'm curious what happens when you accidentally do something like this: Create a square in top view. Move top left point slightly off grid. Drag top right point to top left, it does not ask you to merge vertices. Reopening map the 'collapsed' face is still in there, the vertices can be dragged away, but compiling there are no errors. What does vbsp do?
Image
-You've just been happified!?
User avatar
Mr. Happy
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Sat Dec 30, 2006 9:20 am
Location: Flyin' thru "da cloud" in the MotherShip

Re: Brainstorming: Hammer Plugins

Postby Shrinker on Tue Nov 01, 2011 4:12 pm

Mr. Happy wrote:Wait, are you making Hammer plugins somehow in addition to microbrush, or is this all about microbrush?

Well I had a look around what people would have liked to have for Hammer to get the inspiration for Microbrush!

Mr. Happy wrote:[...] What does vbsp do?

It silently deletes your adult picture collection, one bit each time :P
Homepage | Bite back
Microbrush all-3D level and model editor v. 2.2.1
  Microbrush 3 Steam group
   Free country my ass. We Germans are not even allowed to buy Quake 1 through Steam, or see violence in any game, for that matter.
User avatar
Shrinker
Been Here A While
Been Here A While
 
Joined: Fri Nov 09, 2007 5:52 pm
Location: Germany

Re: Brainstorming: Hammer Plugins

Postby Mr. Happy on Tue Nov 01, 2011 9:23 pm

So that's where it's going!

Honestly, what microbrush needs is texture and displacement tools ;)


But still, about vbsp,
I am really curious what it does for faces that occur between edges that it rounds in
Image
-You've just been happified!?
User avatar
Mr. Happy
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Sat Dec 30, 2006 9:20 am
Location: Flyin' thru "da cloud" in the MotherShip

Re: Brainstorming: Hammer Plugins

Postby zombie@computer on Tue Nov 01, 2011 10:19 pm

Mr. Happy wrote:So that's where it's going!

Honestly, what microbrush needs is texture and displacement tools ;)


But still, about vbsp,
I am really curious what it does for faces that occur between edges that it rounds in

vbsp doesnt round between faces, only in faces. err, lemme explain how vbsp construct brushes.

1) read brush (bunch of planes: unbound, flat sheet of space)
Image
Each brushside has a plane, ergo a normal cube has six.

2) consider the nth plane (e.g. Top)
3) Create a brushside of infinite size (some arbitrary size like 64k*64k): this basically is a list of four cornerpoints:
(-64k, 64k, a) (64k, 64k, b) (64k, -64k, c) (-64k, -64k, d) : where a-d are Z values that move the cornerpoint to somewhere ON said plane.
4) For each other plane in this brush
Using lotsa mumbojumbo (im terrible at vector maths so its mumbojumbo to me, it incorporates lotsa dotproducts and normals and such), calculate intersection points and substract from the brushside. (If we were considering our Top plane, all other planes except the Bottom plane will substract one side of this 'infinite' brushside). If our Top side was at z=10, and we were considering our Front brushside at (y = -10) our Top brushside could look like this:
(-64k, 64k, 10) (64k, 64k, 10) (64k, -10, 10) (-64k, -10, 10).
after considering the Left brushside (at x=-20):
(-20, 64k, 10) (64k, 64k, 10) (64k, -10, 10) (-20, -10, 10).
etc.

I'm sure you can imagine slanted faces intersecting this plane could increase the number of vectors/cornerpoints, making these maths so difficult. You may even be surprised at how inaccurate the calculations are. One would expect a perfectly square grid-aligned brush will generate perfectly rounded cornerpoints, this is not the case! Rounding errors up 0.01 will occur even then!

5) Our brushface is nearly done! It should have nearly our finalised shape. So now iterate all vertices in our brushside and round them to the nearest whole point if they are less than 0.01 unit away from a whole point.
6) Remove duplicate points. After the Front and Left plane intersected and substracted from our infinite plane, rounding errors (usually caused by the limited precision of the floating point datatype), and/or after rounding them, we may be left with two vectors at the exact same place. This is unwanted, so remove these
8) If our brushside has zero points left (ie after all other planes substracted from it there is no plane left) remove plane.
9) if any of the infinite points remain, throw an error (e.g. brush coordinates outside map!)
10) Go to next plane (goto 4)

As you can see, brushsides are built up seperately. Rounding or even removing vertices only has effect on said brushface.

Whatever would happen in your case might be conducted from the above 'algorithm', i havent tried. :P
When you are up to your neck in shit, keep your head up high
User avatar
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Oss, netherlands

Re: Brainstorming: Hammer Plugins

Postby Shrinker on Tue Nov 01, 2011 10:29 pm

Mr. Happy wrote:Honestly, what microbrush needs is texture and displacement tools ;)


Yes, yes. But first things first: Total programmability right out of the box!

About the brush algorithm stuff: I think I may have to look into a way of allowing the user to modify the vectors that define my planes. In Mb2 there was no way to do that and there was also no tool to "clean" that up. But it's really just intersections of half-spaces defined by one point on the plane and two spanning vectors each for being precise enough. Blahblahgoodnightfortonight :P
Homepage | Bite back
Microbrush all-3D level and model editor v. 2.2.1
  Microbrush 3 Steam group
   Free country my ass. We Germans are not even allowed to buy Quake 1 through Steam, or see violence in any game, for that matter.
User avatar
Shrinker
Been Here A While
Been Here A While
 
Joined: Fri Nov 09, 2007 5:52 pm
Location: Germany

Re: Brainstorming: Hammer Plugins

Postby Mr. Happy on Sat Nov 05, 2011 10:59 pm

Wow thanks so much for that explanation zombie, I've read it a few times and I think I understanding whats going on.
That's more complicated than I'd imagined, I would have thought step three was unncessary since hammer also stores planes but I see that's in a different format. It seems like vbsp building the brushface at such a huge side would make the angled face intersections more accurate than the way Hammer constructs brushes on load..maybe they are the same but it seems like hammer doesn't take that step to extend. I think that microfaces that don't degenerate would create duplicate verts during step 4, at least thats how it seems when I visualize this happening.

I guess brush splitting and plane merging, the interactions between brushes and not just the interactions among an individual brushes planes, happens first?
Image
-You've just been happified!?
User avatar
Mr. Happy
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Sat Dec 30, 2006 9:20 am
Location: Flyin' thru "da cloud" in the MotherShip

Re: Brainstorming: Hammer Plugins

Postby joe_rogers_11155 on Sat Nov 05, 2011 11:44 pm

zombie@computer wrote:...(epic explanation of vbsp working)...

that almost makes the long compile times forgivable. almost.
"Day breaks, but decay soon follows." - Ava Winona
Image
Currently developing in radio silence... 99 Bolts
Here's another project of mine... Assault on Overwatch
Are you new to Source SDK? VDC
User avatar
joe_rogers_11155
Veteran
Veteran
 
Joined: Wed Oct 08, 2008 11:11 pm
Location: United States

Re: Brainstorming: Hammer Plugins

Postby Starving Hobo on Fri Nov 11, 2011 11:01 pm

A way to make it possible to code into the map! So you could have custom player models for just one map, and things like that... Instead of needing to create a whole mod or a mod for servers which not all servers will have etc.
Starving Hobo
Regular
Regular
 
Joined: Sat Apr 10, 2010 4:28 pm

Re: Brainstorming: Hammer Plugins

Postby Gary on Fri Nov 11, 2011 11:36 pm

Starving Hobo wrote:A way to make it possible to code into the map! So you could have custom player models for just one map, and things like that... Instead of needing to create a whole mod or a mod for servers which not all servers will have etc.


Code is loaded before the map...
Have a question related to modding or something I posted? Something that needs staff attention? PM me or message me on Steam(link below)

User avatar
Gary
Interlopers Staff
Interlopers Staff
 
Joined: Wed Dec 16, 2009 12:40 am
Location: USA, FL

Re: Brainstorming: Hammer Plugins

Postby Starving Hobo on Sat Nov 12, 2011 12:36 am

Gary wrote:
Starving Hobo wrote:A way to make it possible to code into the map! So you could have custom player models for just one map, and things like that... Instead of needing to create a whole mod or a mod for servers which not all servers will have etc.


Code is loaded before the map...


Is there no way for a map to be able to override the game code to give everyone different skins and stuff like that without the need for server plugins or mods?
Starving Hobo
Regular
Regular
 
Joined: Sat Apr 10, 2010 4:28 pm

Re: Brainstorming: Hammer Plugins

Postby Gary on Sat Nov 12, 2011 12:45 am

Well, if you want to override textures, models, animations, sounds, and/or materials. You could try storing it in the same directory and with the same name as the content your trying to replace.

Like:
Default.GCF: sounds/weapons/ak47_fire01.wav
ak47_fire01.wav being what ever is default which you can't touch

Your.BSP: sounds/weapons/ak47_fire01.wav
ak47_fire01.wav being your replacement


I completely made up these directories and names for the example.
Have a question related to modding or something I posted? Something that needs staff attention? PM me or message me on Steam(link below)

User avatar
Gary
Interlopers Staff
Interlopers Staff
 
Joined: Wed Dec 16, 2009 12:40 am
Location: USA, FL

Re: Brainstorming: Hammer Plugins

Postby Shrinker on Sun Nov 20, 2011 10:49 pm

My main menu is now a plugin to the application.

:)
Homepage | Bite back
Microbrush all-3D level and model editor v. 2.2.1
  Microbrush 3 Steam group
   Free country my ass. We Germans are not even allowed to buy Quake 1 through Steam, or see violence in any game, for that matter.
User avatar
Shrinker
Been Here A While
Been Here A While
 
Joined: Fri Nov 09, 2007 5:52 pm
Location: Germany

Re: Brainstorming: Hammer Plugins

Postby gtamike_TSGK on Mon Nov 21, 2011 4:49 pm

Shrinker wrote:Hey guys,

how do you imagine good plugin support for Hammer?

I'm looking for a bit of inspiration.


https://developer.valvesoftware.com/wik ... e_Requests
HL2DM 1v1 8)
http://goo.gl/o2Vx3
http://goo.gl/lgiJX
Image
Mapper since 2007
User avatar
gtamike_TSGK
Regular
Regular
 
Joined: Wed Sep 01, 2010 12:24 pm
Location: UK

Re: Brainstorming: Hammer Plugins

Postby stukabomber44 on Fri Dec 02, 2011 10:57 pm

I agree with Ich666 with 3dsMax or Maya... simple exporting plugin for props, prop type, skins, ahh that would be the wet dream of any mapper/modder
stukabomber44
Regular
Regular
 
Joined: Sun Nov 14, 2010 7:33 pm
Location: Canada
PreviousNext

Return to Hammer Editor Help

Who is online

Users browsing this forum: No registered users