Jump to content
The Dark Mod Forums

The Almighty Grid


BEAR

Recommended Posts

I've got a question for anyone regarding the grid.

 

I'm working on some prefab tunnels and I'm finding myself in a bit of a bind with the grid. I want to make each section hot-swappable, so you can just piece them together easily, rotate at will and build a set of tunnels/sewers/whatever fairly easily. So far its going well but I've hit a snag.

 

Problem is this: When I rotate pieces 45 degrees (or to any degree really), things go to hell. What was perfectly aligned to the grid and happy as could be before is now refusing to align to the grid. I have to revert to worldspawn and ctrl-g, which I cant even always do because sometimes it totally warps the thing I'm working on, forcing me to align each vertex occasionally to the grid. So if people want to rotate each piece to X degree it wont fit with anything that isn't at that angle.

 

I was talking with a math nerd friend and we came up with an idea that might would have worked but only if I had incredible control over the exact length and figuring a ratio of length (and it only works at 45 degrees) that will still snap to the grid diagonally (because the diagonals are longer than the sides of the grid squares).

 

The only thing I could figure out what would work perfectly (and only with symmetrical pieces) would be to define the point on the func_static that it rotates on. I thought defining the origin was that, but it still rotates right around the middle of the func_static. Does anyone know how to define the pivot that a func_static will rotate on if you rotate it in editor? The reason I feel this will work is because as long as I can get a corner point that needs to align perfectly to another, the rest of the points can be off the grid. I'm wondering if I'm going about this all wrong, any ideas?

 

Or am I just being too picky? I feel this should be possible, and I'm becoming a perfectionist in some of my things (not in quality exactly, cause I'm not that skilled visually), but I fear if things get off at that level, it will compound possible problems later.

Link to comment
Share on other sites

The only thing I could figure out what would work perfectly (and only with symmetrical pieces) would be to define the point on the func_static that it rotates on. I thought defining the origin was that, but it still rotates right around the middle of the func_static. Does anyone know how to define the pivot that a func_static will rotate on if you rotate it in editor?

There is a toggle in the top toolbar in DarkRadiant, it's called "Rotate func_* entities around origin". Is this working for you?

Link to comment
Share on other sites

There is a toggle in the top toolbar in DarkRadiant, it's called "Rotate func_* entities around origin". Is this working for you?

 

Haha, I never even knew that was there, thanks Greebo.

 

I'm realizing however this still doesn't solve my problem really. When you want to rotate by 45 degrees, it will align on a single corner allowing you to match with pieces horizontal or vertical, but the other corners are still going to be off the grid.

 

I might have to remake them all as squares and find a grid size and length that I can rotate the pieces to 45 degrees and keep them on the grid, unless I can find something else that will do it.

Link to comment
Share on other sites

  • 4 weeks later...

Alright, so I've still not found a good way to make a 45 degree angle. I've realized that the problem is I'm working with a coordinate plane, which doesn't do real circles well. The end result is I can make a perfect 90 and cut it in half, and it looks great, but the radius at the 45 degree angle isn't the same length as the horizontal or vertical ones and I can't for the life of me see a way around that besides a bunch of custom pieces that would just be a pain to use. I can align a corner which allows me to put the piece in the right place and stay on the grid, BUT that doesn't help because it still doesn't fit and no luck making a custom piece to just fit since the other corner isn't on the grid.

 

I might just say screw the 45 degree angle for now (or ever) and continue work on general pieces and let someone who really wants a 45 degree angle figure it out. :D

Link to comment
Share on other sites

Scratch that, need coffee.

 

But: Look at the tunnel in the old mill map, it goes around a bend and yet everything is grid-alinged. Could you use that as an example?

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

@Baal, I'm not sure if that will work or not. I'll upload some screens later to illustrate the problem better. It feels like something that should be possible.

 

@Tels, I'll check into that once I wake up (dear god its 2:30 in the afternoon I am a horrible slob) and get back to you.

 

Thanks for the reply guys.

Link to comment
Share on other sites

Alright, maybe these pictures will make it make more sense. What I'm doing is creating modular tunnel pieces for a small tunnel/sewer. They are all patch based so are smooth (as opposed to the one in the mill map which looked to have been made with brushes). This has benefits and drawbacks, I can make the pieces much more easily this way but when I do have problems they are harder to fix it seems.

 

I've figured out a way to half-way make this work but I still have a problem. If you look at xy.gif, you'll see part of it. When you make a 90 degree elbow, basically just a copy of the black piece there that goes the full 90 degrees instead of 45 as shown, everything lines up. I've got it subdivided 16 horizontally(or vertically I cant recall which, but you can see). The roof section is in two pieces, each divided 8. The subdivisions line up fine when you do the 90 degree turn, but a 45 doesn't work because its not a perfect circle. This means that the radius that is at the angle (or the hypotenuse if you are thinking about it like a triangle) is not the same length as the base, whereas a perfect circle it would be. I've found (I think) a way to force it to work by sacrificing perfect symmetry(basically manually resize it to match), but the problem is the subdivisions still won't match up, meaning they will be slightly different shapes and there will be glittery spots or just black spots.

 

It seems 45 degree angles are a colossal pain in the ass in the engine, especially because I don't have more control over the brushes (if I were to be able to mathematically come up with a perfect width in terms of the square root of 2 or something it might be able to work). Since I'm basically dragging this out by hand (even if I can control the size pretty well), it makes it hard.

 

The example I have isn't the closest I've gotten, but its what I haven't destroyed or otherwise fucked up. If anyone has an idea how to make these things line up or needs more clarification just say so, otherwise I'll either scrap it (its held me back from making more useful things) or try one more time to make it workable (if not perfect, though it will drive me nuts probably).

post-342-1232248559_thumb.jpg

post-342-1232248573_thumb.jpg

Link to comment
Share on other sites

You think so? Maybe my problem is how I resized the pieces. Now that I think about it, I probably never perfectly resized the two pieces that constitute the top, which might be why they don't fit just right. Either way this is a pain but I want to finish these because I think they could actually be useful to someone eventually, so I'm going to keep at it.

 

Thanks for the input Baal.

Link to comment
Share on other sites

Hah! Take that world!

 

As I've said often when working with patches, my thinking had gotten very uptight. All I had to do was to take my 90 degree piece, while on grid, and rotate it to where the piece that would be flat (butting with the big Y tunnel) was at the angle, which kept the part that would eventually be at an angle was horizontal and lined up with the short tunnel piece that was vertical.

 

Once I had that, it was simple to line up the pieces (like Baal reminded me would work, I figured it would but had given up on it nonetheless). By setting the origin of the respective pieces, they rotate like a charm!

 

So, theoretically it should be possible to rotate these any direction and make it work, but the mapper might have to be aware of the origin and move it to the corner they are going to need to line up (since flipping a func_static fails so miserably). I would prefer if the mapper could just plug and play without having to do any tedious work, so I might end up making more pieces, making it more confusing but easier in the end to work with.

 

Thanks for the help guys! I'll upload what I've got thusfar if anyone wants to have a gander at it (members only obviously). If any aspiring mappers want to see what it looks like just say so and I'll post some screens.

post-342-1232310309_thumb.jpg

Link to comment
Share on other sites

Congratulations. :) Patches can sometimes be very difficult to work with.

 

About my suggestion: There is one problem with it that I forgot. You can only align vertices to the grid. But if the editor had a function to snap one vertex to another that could work. I don't think patch vertices have to be aligned to the grid at all but I'm not sure about that. Does anybody know?

Link to comment
Share on other sites

They can definitely be not aligned. I had to snap most of them to the grid to make things line up, but they had no problem being off the grid, if thats what you meant. What I ended up doing was just snapping both sets of vertices to the grid and then matching them and it worked out fine.

Link to comment
Share on other sites

They can definitely be not aligned.

Yes, but such a function could be added to the editor. I was wondering if the Doom engine requires patch vertices to be aligned to some grid. But I don't think that's the case (I'm still not sure though).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...