Unnecessary Gamemode Convolution, Triangles, and Hammer

Discussion in 'Mapping Questions & Discussion' started by Atasco, Aug 29, 2019.

  1. Atasco

    Atasco L1: Registered

    Messages:
    44
    Positive Ratings:
    10
    This is a bit of a ramble, I'm sorry. Tl;dr, I need math help and references for staying on-grid with strange rotations and shapes, but the ramble is a tale of woe specifically about why I got myself into this mess in the first place.

    I've been messing around with a map idea I've had in my head for a while that I was considering calling ctf_Schism. I've spoken about it before, but I've had the idea ever since learning about the way ctf works under the hood. Essentially I was inspired by learning this: where the intelligence spawns, and the actual capture point, are entirely different things. But all official maps ignore this, and have them both in the same place. Naturally, I thought of conditions where separating them would make sense. I thought of a sort of "neutral zone" branching off from the middle/no-man's-land that the intelligence(s) would get delivered to (represented in my head as putting them in the backs of team-colored trucks which would drive off at the end of the round. The losing car would explode, purely for visual effect and my own amusement). With this in mind, I reasoned that the simplest way to make this would be a triangular central point, with the sides/spokes being the team bases and cap point. I have provided an incredibly shitty MS Paint diagram of the general idea:

    schism_diagram_01.png

    As you can see, that is not a rectangle. The Source engine is not happy about this in the slightest. I've already resigned myself to the fact that the midpoint is going to be Visleaf Hell regardless of what I do with it. All the gamemode logic is done and out of the way, that's not what I'm having trouble with, it's literally the shapes themselves that are the issue.

    See, my initial hope was to make the central triangle equilateral, for balance (as everything should be). However- I discovered after some vertex fiddling, head-scratching, several rotations, headaches, and confused google searches... that I was doomed from the start. Apparently, the shape I was trying to create was mathematically impossible. You see, you're totally unable to create an equilateral triangle with points that align to a square grid, because of complicated math shit. So "Great, okay, fine," I think, "I'll just make it an isosceles triangle and set the odd length-ed side as the cap points" so it can at least have mirrored symmetry.

    Once I figured that out, that's when I ran into another problem... I have no idea how to approach this. I have a general idea of what to do: make the Red and Blu bases instances so I can construct them on-grid while simultaneously having them rotated with skip brushes, figure that basic stuff out and then fine tune the layout from there. My problem is this: how do I do all this friggin math?? Has anyone else ever done stuff like this before and wrote it down so I could get an idea of what I need to do? Can the off-grid lines of an isosceles triangle have an on-grid length? And if so, how do I calculate that? Much like Soldier, I am a victim of the American education system, and can't do math shit beyond simple algebra to save my life. I had to google how to find the area of a triangle just to make the mid-point have a similar area to other ctf maps while not being a square. The diagonal lines of the isosceles triangle in my test vmf have a ratio of 2:1, and that's nice and all, but I have no idea if that's good or not, or how to use that information to help me.

    And that's where I am now, folks. The most frustrating part about this to me, is that I've made the Red and Blu bases of this map at least twice already, and lost them to computer hardware failure. All I have left right now are people better than me who may have done geometry like this in Hammer before.
     
    Last edited: Aug 29, 2019
  2. HOI

    HOI L2: Junior Member

    Messages:
    53
    Positive Ratings:
    8
    The lengths of diagonal sides aren't typically something you should worry about, but it is important you keep the vertices on-grid (easier for you to edit & easier to optimize).

    E.g. dividing a cube in half diagonally through opposite edges leaves you with a triangular prism that is on grid but has diagonal edges of length cube_side_length * square_root_of_2, and trying to get an integer (or even rational) diagonal side length is not possible without having the same problem with the other side lengths. There's nothing wrong with doing this to a cube, so you can ignore side lengths and only worry about vertex placement.

    If you still want isosceles triangles with integer side lengths you can put 2 copies of a right angled triangle with integer side lengths back-to-back.

    Having large walls at angles that aren't north-south or east-west introduces minor issues (wallbugging, worse explosive jumping) and should be avoided where possible. If you look at popular maps from above you will see that these walls are very rare.

    The ctf concept you are describing is interesting and should be explored without having large diagonal walls. You could have a similar initial layout using a rectangle instead of a triangle which would separate the 2 team bases from each other at the top (probably a good idea).
     
  3. Idolon

    aa Idolon the worst admin

    Messages:
    1,764
    Positive Ratings:
    5,301
    You can also achieve that diagram without using diagonals by just being a bit more creative with your geometry. Lots of 5cp maps (Snakewater, Reckoner, Process, Badlands, etc.) have an overall layout in the shape of an S but achieve it through mostly orthogonal geometry.
     
  4. Atasco

    Atasco L1: Registered

    Messages:
    44
    Positive Ratings:
    10
    After some rumination and procrastination, I think I agree with both of you :0 I feel a bit disheartened, but I ought to shelve the triangle map idea. It seems like this concept hasn't been made into a map for very good reason, hahaha. ctf_Shism will now only have one gimmick instead of two >u<

    I'll keep thinking about the triangle idea, but I doubt I'll be skilled enough to execute it well enough anytime soon, especially with the inherent problems with it. I actually wasn't even aware of the bugs associated with large angled walls, if I'd known that beforehand I may not have even considered the idea :0

    I'll get to work on the more (looks up at the previous comment) orth og onal map!
     
    • Like Like x 1
  5. Atasco

    Atasco L1: Registered

    Messages:
    44
    Positive Ratings:
    10
    I have now created a new incredibly shitty MS Paint diagram of the new plan:

    schism_diagram_02.png

    I'll go break a leg on it! I'll see y'all in 14 years
     
    • Like Like x 1
  6. henke37

    aa henke37

    Messages:
    2,022
    Positive Ratings:
    487
    Remember that you can use instances to work with on grid geometry that is rotated in the actual map.
     
    • Like Like x 1
  7. Itspice

    Itspice L1: Registered

    Messages:
    48
    Positive Ratings:
    5
    I'm no expert at all and I'm just spitballing here but possibly it would be simpler to replace the triangle with a tapering rectangle kinda like uh
    == __
    ==/■\
    =/■■\
    /■■■\ this
     
  8. Maid of Heart

    aa Maid of Heart Common and Garden Maid

    Messages:
    117
    Positive Ratings:
    178
    To achieve the triangular mid, you would be able to use Pythagorean Triples to make sure that your side lengths are integers.

    An isoceles triangle is just two right angled triangles facing away from one another, so if you split your central triangle down the middle you end up with these two triangles. Make sure the two with-grid sides with the right angle between them match up in a ratio to a pythagorean triple, and the diagonal side will have an integer length.

    Here's all the primative pythagorean triples with all integers > 100:

    (3, 4, 5), (5, 12, 13), (8, 15, 17), (7, 24, 25), (20, 21, 29), (12, 35, 37), (9, 40, 41), (28, 45, 53), (11, 60, 61), (16, 63, 65), (33, 56, 65), (48, 55, 73), (13, 84, 85), (36, 77, 85), (39, 80, 89), (65, 72, 97)

    Choose one of these, and make the two perpendicular sides of each right-angled triangle the first two lengths multiplied by a common length, which should ideally be something like 64 or 256, a power of 2.

    For example, using (3, 4, 5), your central isoceles triangle could be 2*3*256 = 1536 in base and 4*256 = 1024 in height, meaning that both diagonal sides (hypotenuses) are 5*256 = 1280 in length.

    Be sure to use rotated instances for the two bases. To find the angle at which you need to rotate your instances, you can use trigonometry.

    In the above example, you can use inverse sine with 4/5 = 0.8 (opposite over hypotenuse) to find the angle (I used this website), resulting in 53.13010235°, which you can pump into ctrl-m's rotation mode.

    Hope this helps!!! And be sure to ask if you need any more help.
     
  9. Atasco

    Atasco L1: Registered

    Messages:
    44
    Positive Ratings:
    10
    Oooh interesting… so maybe it's doable after all :0 I might try this for a small one, like a koth map. I may walk back on my resignation of the idea if I can manage to get the math right
     
    • Like Like x 1