Jump to content
The Dark Mod Forums

Manually Splitting Patches


AluminumHaste

Recommended Posts

The tutorial is up on the wiki, click here for the link.

 

This image shows what can happen if you follow the tutorial.

I was kinda stuck when editing my current FM, because I had created the cave over a year ago, and didn't have the heightmap anymore to recreate the patches in smaller pieces. So I started poking around the map file and found a way to split up the patch.

 

splitpatches.png

 

Which is exactly what I wanted. The patch on the right was manually split into two patches, which I moved over to the left. If anyone would like to know how I did it just post so, as I said I'm not sure how useful this is or if this has already been discussed.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

Post it! Everyone wants to know how to split patches.

 

Yeah okay, but it will take a little while to throw a guide together. I'm not 100% sure I understand what I did, but I'll try my best.

 

EDIT: BTW, this is done using a text editor to manually edit the .map file. This isn't in the editor........yet

EDIT 2: Also I just realized that there are limitations. You can't split a 3x3 patch mesh, as 3x3 is the minimum size for a patch. But you can split a 5x5 into two 3x3s, and a 5x3 into two 3x3's etc.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

Yes that worked. What's patchdef3? Different format?

 

Slightly, it's similar but when I tried the method outlined in the guide, it split the patch horizontally

 

 

 

* a patchparams3 is

Code:( #cols #rows #horiz-subdivisions #vert-subdivisions junk junk junk )

where "junk" is an integer that is ignored.

 

So I'm not sure why, maybe the columns and rows are opposite from the patchDef2

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

I've not forgotten this but not had time yet. :)

 

Yeah no problem, thanks for your help. I was thinking about this last night; the only reason that the in game patches vertex points match up with their representation in the map file, is because the patch hasn't been rotated yet. If you, for example, rotate 90 degrees to the right, splitting the patch vertically, will split it horizontally in game, and so on and so forth.

What I was thinking was that we have a GUI in DR that will re-orient the patch so that it's vertexes match up with the map files' matrix, then we can pick a vertical or horizontal split, and DR does the cutting and pasting for us.

I know Greebo is very busy but this could be useful.

 

EDIT: Also, once you've split a patch down to the minimum 3x3, you can still split it even more. You just have to go to Patch->Insert->Insert 2 Columns(or Rows) at the Beginning (or End), and this will give you a 5x3, or 3x5, or 5x5 or whatever you want to increase it too, then you can split it again.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

In the guide to avoid confusion and clutter I would get rid of the room and anything else completely and only list the patch def. I would also remove the copy from quake thing completely and just add a reference link at the end of the article "see also..." or similar. So I'd show it something like this for clarity. Remember many mappers have no knowledge whatsoever about data structure so I would have a pre-summary something like:

 

A patch definition (see below) has the rows and columns in brackets eg, (5 5 0 0 0) then rows of point coordinates, one on each line. We shall be simply making a complete copy and paste of the patch, deleting the last two lines in the first one and the first two lines in the last line, then changing the number of rows in the (5 5 0 0 0).

 

Version 2

// entity 0

{

"classname" "worldspawn"

 

 

//START OF THE PATCH DEFINITION=========================

// primitive 0

{

patchDef2

{

"textures/darkmod/metal/detailed/bars_rivets_steel"

( 5 5 0 0 0 )

(

( ( -344 0 320 0 0 ) ( -344 0 560 0 -0.9375 ) ( -344 0 800 0 -1.875 ) ( -344 0 1040 0 -2.8125 ) ( -344 0 1280 0 -3.75 ) )

( ( -144 0 320 0.78125 0 ) ( -144 0 560 0.78125 -0.9375 ) ( -144 0 800 0.78125 -1.875 ) ( -144 0 1040 0.78125 -2.8125 ) ( -144 0 1280 0.78125 -3.75 ) )

( ( 56 0 320 1.5625 0 ) ( 56 0 560 1.5625 -0.9375 ) ( 56 0 800 1.5625 -1.875 ) ( 56 0 1040 1.5625 -2.8125 ) ( 56 0 1280 1.5625 -3.75 ) )

( ( 256 0 320 2.34375 0 ) ( 256 0 560 2.34375 -0.9375 ) ( 256 0 800 2.34375 -1.875 ) ( 256 0 1040 2.34375 -2.8125 ) ( 256 0 1280 2.34375 -3.75 ) )

( ( 456 0 320 3.125 0 ) ( 456 0 560 3.125 -0.9375 ) ( 456 0 800 3.125 -1.875 ) ( 456 0 1040 3.125 -2.8125 ) ( 456 0 1280 3.125 -3.75 ) )

)

}

}

//END OF THE PATCH DEFINITION=========================

}

Link to comment
Share on other sites

In the guide to avoid confusion and clutter I would get rid of the room and anything else completely and only list the patch def. I would also remove the copy from quake thing completely and just add a reference link at the end of the article "see also..." or similar. So I'd show it something like this for clarity. Remember many mappers have no knowledge whatsoever about data structure so I would have a pre-summary something like:

 

A patch definition (see below) has the rows and columns in brackets eg, (5 5 0 0 0) then rows of point coordinates, one on each line. We shall be simply making a complete copy and paste of the patch, deleting the last two lines in the first one and the first two lines in the last line, then changing the number of rows in the (5 5 0 0 0).

 

 

 

Alright I guess, I just thought that since the mappers are going to be editing the data structure, that they should have some understanding of it. After all, after the tutorial, mappers might want to do this in their huge maps, and might have a bit more trouble navigating the map file.

 

But your changes make sense, I'll update it again.

 

 

EDIT: Okay uploaded new version. It might be faster if we just threw it up on the wiki and edited it there as everyone has write access.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

Yes, good idea. Going also on what you said it might be a good idea to tell them how to find a particular patch in their own map. For example, click on a patch in the editor you want to split. In entity inspector it just says worldspawn. But click on menu > map > find brush and it shows the number under 'brush'. Copy that, say 10038, and search in a text editor for // primitive 10038. Then the definition goes from that up to the next // primitive.

Link to comment
Share on other sites

Yes, good idea. Going also on what you said it might be a good idea to tell them how to find a particular patch in their own map. For example, click on a patch in the editor you want to split. In entity inspector it just says worldspawn. But click on menu > map > find brush and it shows the number under 'brush'. Copy that, say 10038, and search in a text editor for // primitive 10038. Then the definition goes from that up to the next // primitive.

 

Actually I was going to request of Greebo to add the entity number in the Entity Inspector right under "Classname". I guess I'll add that to the tracker right now. Okay it's a feature request on the tracker now.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

Yes, good idea. Going also on what you said it might be a good idea to tell them how to find a particular patch in their own map. For example, click on a patch in the editor you want to split. In entity inspector it just says worldspawn. But click on menu > map > find brush and it shows the number under 'brush'. Copy that, say 10038, and search in a text editor for // primitive 10038. Then the definition goes from that up to the next // primitive.

 

Okay done, check it out here: http://wiki.thedarkmod.com/index.php?title=Patch_Splitting_-_Basic_Tutorial

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

hmm, I was really hoping there would be a wsiwyg way of doing it, using the gui rather than modifying script/s

 

Hmmm I think you should go read the tutorial again, there's no script modifying. I think I did mention that you have to do it manually unfortunately.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

will do, when I saw all the code I got the wrong idea etc..:blush:

 

Well once you look at the map file (a small one room map file is best to learn), you will see how it works pretty quick. It looks complicated, but it's as simple as; copy/paste, delete, delete, save and done. Really it's that simple. It's just that the first time takes a little getting used to.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

  • 6 months later...

Mmm... I think I'm gonna need this for my tablecloths. I can't see any way of reducing a length apart from laboriously deleting columns then manually re-dispersing the ones remaining evenly. The menu option doesn't seem to do what I think it means. I can't even think how to do that manually very easily. The only other option is to completely start again for each size.

 

Oh well, I'll finish my big cloth then look at this tutorial again.

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

    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 3 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 7 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
×
×
  • Create New...