Getting a func_instance on grid?

Discussion in 'Mapping Questions & Discussion' started by Shanghai, Mar 25, 2013.

  1. Shanghai

    Shanghai L6: Sharp Member

    Messages:
    394
    Positive Ratings:
    217
    So I've got a very large instance on my map (my entire point B) and it's rotated on a 45 degree angle. Everything seems fine, except that because it's an instance, it's a bit off-grid. This poses a problem, because I can't get a seamless transition between the regular map and the instanced stuff. I might be able to just work around it with a bit of ugly brush overlap, but it would be better if I could just line it up. Ideas?
     
  2. Little Dude

    Little Dude L4: Comfortable Member

    Messages:
    172
    Positive Ratings:
    54
    Could try using crt+b and crt+shift+b to get it on to grid. Are the brushes alined to the same scale in the instance vmf as they are in the map vmf?
     
  3. Idolon

    aa Idolon the worst admin

    Messages:
    1,538
    Positive Ratings:
    4,417
    You're trying to pair up 1hu-based measurements to ~1.41hu-based (diagonal of a 1hu square) measurements. Since the square root of 2 is irrational, your grids will literally never line up. There's probably a way to cut 22.5 degree angles into two same-width hallways and line them up, but I can't tackle the math required. I'd look into the technique described in the koth_roundhouse thread and try and devise your own methods, but you might be best off just remaking point B as on the grid, diagonally.
     
    • Thanks Thanks x 2
  4. Shanghai

    Shanghai L6: Sharp Member

    Messages:
    394
    Positive Ratings:
    217
    The scale is the same, I think it's the rotation that's the issue. The whole func_instance entity is on-grid, it's just that the brushes within it aren't anymore (again, probably because of the 45 degree thing). I've just done the overlap for now; it's not very noticeable, and only exists for less than one HU.
     
  5. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,532
    Idolon is right, you would need to shape and cut the instance's brushes in such a way they'll match up to the rest of it. The same as if you were to make it not instanced.
     
  6. Empyre

    Empyre L6: Sharp Member

    Messages:
    293
    Positive Ratings:
    141
    Would it work if you instanced the bulding but not the ground? You would probably have to have a small flat area around the building. As long as the instance is level, I think the alignment should not be an issue.
     
  7. Fish 2.0

    Fish 2.0 L6: Sharp Member

    Messages:
    324
    Positive Ratings:
    116
    Yeah, Pythagoras says that a hypotenuse on a right angled triangle (45o as you said) has to be the biggest length in the triangle.

    That means that if you have a line that is 1 unit high then when you rotate it to be the hypotenuse it /has/ to be bigger or else it can't actually be on an angle to form a triangle.

    a^2 = b^2+c^2

    so

    if your A length is 1 and your B length is one then your C length (hyp) needs to be 1.41421356237.

    Solution - scale the section up by 1.41421356237. However you will note that that size is rather large so you could scale your section down till it fits on the grid, rotate it then scale it back up and it should be about the same size and on the grid. After testing it I found that scaling by 0.75, rotating then up scaling by 1.41421356237 just unscaled it a bit.

    This might not work but it worked when I tested it.
     
    Last edited: Mar 26, 2013
  8. Spacek531

    Spacek531 L4: Comfortable Member

    Messages:
    162
    Positive Ratings:
    60
    I don't know if it's possible in this situation

    but

    you can rotate by arctan(3/4) or arctan(4/3) then the hypotenuse is 5, which is an integer hu
     
  9. nightwatch

    aa nightwatch

    Messages:
    640
    Positive Ratings:
    446
    These people seem to have all the answers.....

    When I had this problem before I was fortunate enough that only one side of the instance had to connect into another building. My solution was to move my instance into one quadrant of the map, lining the corner up with the origin. This allowed the sides near the origin to mesh perfectly with anything in the real map, which will work for you as long as you don't need to connect both sides.
     
  10. Pocket

    aa Pocket func_croc

    Messages:
    4,489
    Positive Ratings:
    2,219
    You never said what sort of structure we're talking about here. Since it's only on a 45 degree angle, it might have been a better idea to simply construct it on-grid already rotated, like in Double Cross and Foundry. Instancing is really better for stuff that's impossible to build on-grid, like the shed by BLU's spawn in Mountain Lab/Mann Manor that's on a 30 degree angle.
     
  11. Empyre

    Empyre L6: Sharp Member

    Messages:
    293
    Positive Ratings:
    141
    Nobody commented on my idea. Maybe I didn't explain it clearly.
    I think you can bypass the whole alignment issue by building the ground in the main map with flat areas slightly larger than the building(s) in the instance. Then you plop the instanced building(s) in place, and things only have to be on-grid on the vertical axis, and it won't matter that things are off-grid in the horizontal plane.

    EDIT a day later: Re-reading this, it sounds like I am rather arrogant. This was not intended. Please interpret what I said as awkward wording, not a bad attitude.
     
    Last edited: Mar 27, 2013