I haven't the time yet to make a video of how I make these, so let me just give a rough draft so you know.
I start by using the GMAX line tool. To create a base box, I first place my border verts using that line tool. One click at each 10m mark around the outer edge. * I'll discuss an alternate method later.
After my border points are plotted, I adjust those point individually to make sure they are at the proper locations. I ignore the actual position of the object, and focus more on making sure the points are at the proper locations. I can adjust the pivot later.
If you would rather fix the points via code, you can use this function on the selected object:
fn roundNearestInteger n = (
(floor(n+0.5))
)
fn fixTileBoundaryPoints obj = (
local n = numKnots obj 1
for v = 1 to n do (
local vert = getknotpoint obj 1 v
vert.x = (roundnearestinteger (vert.x/500.0))*500.0
vert.y = (roundnearestinteger (vert.y/500.0))*500.0
setknotpoint obj 1 v vert
)
converttosplineshape obj
)
fn massFixTileBoundaryPoints = (
for obj in selection do (
fixTileBoundaryPoints obj
)
)
massFixTileBoundaryPoints ()
Simply place the code in a new script window. Select the object to be fixed, and then run the script on that object.
*Alternately, you can create a plane object, with the proper number of cells (cols and rows) equal to the number of finished tiles you will have in this group. Position the shape where you need it, and verify the width and height is correct. Now with the shape selected, on the modifier panel, set to edges level, push the button that says "select open edges", and then click "create shape from edges". This will create a secondary object, so you can delete the first plane.
With your border shape created, make sure it is planar, and I also suggest aligning it to world zero Z. If you don't do this, sometimes the auto-fill mechanism will try to target the wrong verts, making some really strange shapes.
Now you are ready to draw your shape. Select the line tool again, and start drawing. I don't suggest making smooth curves, as this substantially increases the poly count, and generally makes a mess with later parts of this process. Be sure to close the spline shape. If you accidentally don't finish the shape, you can also merge splines, or weld line edges, to complete the spline. You can also continue the spline from inside that object's modpanel.
This first shape should be your outer wall. Use it like you are drawing your walkmesh, or otherwise the general shape of your floor inside your outer wall.
Now you can start drawing other shapes inside your first one. I use this region to draw the pits and raised sections. Again, simply draw closed splines, making sure not to cross segments with previous splines.
By the end of this step, you should have a general layout of your tile group as if you are looking at a pencil drawing. If your third level of splines is actually multiple objects, you should bind them into one object by using the attach command. If you don't do this, you will need to do a lot of work later.
Now, to create a 3D representation of that line set, select all the splines of your group, except the outermost border box. Clone all those shapes and leave them right where they are.
Select your outer border spline. On its modpanel, under "Interpolation", set the "Steps" to 0. This makes it so any smooth curves you might have accidentally made are reverted to point-point-lines. YOU WANT THIS.
Now with your border spline selected and fixed, attach a single copy of the next inner spline, and convert the combination to an editable mesh. This instantly fills in the space between the two splines without throwing faces outside the region.
Repeat the process as before, except select first the second copy of the second spline, and attach a copy of the next inner spline. Remember, you should have previously bound any level 3 splines into one spline previously. If you had not, then all additional splines will be covered over when you convert this region to a mesh. Don't forget to set your Interpolation steps to zero with each spline pair you convert to mesh.
Now that you have 2d objects created from your drawing, you need to attach them together. If you have not already done so, now might be a nice time to slip in a trick to adjust the actual location of the group. To do the trick, simply make another object and place it at your desired location. On a 3x3 tile group, I choose the centermost tile center position. So make a box or plane or something at that position. Then attach all the shapes you created from the splines. Now delete the element representing your position fixer object. Now all your shapes have that cheat object's position as their base coordinates. You'll still need to fix a bit of this later when you slice the tiles.
With all your shapes connected, switch to vertex mode and weld all the verts with threshhold 0.1. This will turn all your shapes into one continuous object, with each region being a selectable polygon.
To create your 3D structure, first select the outermost polygon region. This should be your outer wall section. Now extrude it up, locally, by whatever your intended wall height will be. If you find that extruding it up bends the wireframe inward or outward, you can use a more specific extrusion method by supplying this code in the listener:
fn extrudeAllFacesStraightUp obj d:500.0 = (
local faceList = #{1..(getNumFaces obj)}
meshop.extrudeFaces obj.mesh faceList d 0.0 dir:[0,0,1]
)
extrudeAllFacesStraightUp selection[1] d:500.0
*Note: to make this work on only selected faces, you need to modify this script slightly. I'll update it later.
This script forces the vector of extrusion to be exactly world-up. To extrude straight down, change d to -500.
Your second shape region should not need to be modified in this way. So select your third region and determine if you intended to go up or down with it. Run the script again, or use the mod panel to extrude the faces up or down.
If you want to create a cave tile which is similar to mine, use this to-do list:
- select all the polygons in your shape
- move them to position Z 1000
- select everything but the outer wall shape
- extrude down 750
- scale selected shapes to 105%
- extrude down another 250
- scale selected shapes to 85%
- select individual pits regions separately
- extrude down 500
- scale selected shapes to 90%
- repeat step 8 for all pits
If you scale a shape which does not have an average center of the tile group center, your scale will translate toward the average center. You can either use this to your advantage, adding noise to the finished product, or you can write a script to fix it if that is not what you want. I will tell you right now, if you are not scaling a perfect box, it will go skew, as mentioned.
If you scale a shape, like that on a 6x3 tile group, the long side will scale down or up much faster than the shorter side. If you don't want that, you can use a FFD box instead. I'd suggest just using a 2x2 and modify your wall change manually to your liking. Repeat for any extruded shape. I don't bother, and instead use these numbers for 6x3 tile groups:
- First extrusion down: 102% scale
- Second extrusion: 92% scale
- Third extrusion(s): 90% scale
I find that those numbers also look good on 6x6 and 5x6 tiles. Anything not to your liking can be manually modified later.
Ok, now you have a basic 3d shape of your tile group. Next, you want to fix your edges. I suggest making your object a middle gray color. Now select all edges on the shape and make them visible using the modpanel command. Flip all the edges which might cause problems later, such as:
- self clipping edges
- too many edges from the same vert
- two or more edges sharing almost the exact same path
- regions where if you manipulate the shape just slightly, the edge will self-clip, or otherwise flip to point a face downward
I tend to use the outermost points on the mesh to calculate exactly where I want my edges to go. If I end up with a shape that a child could easily paint by numbers, then I am happy with it. No slivers. No thin long shards. The closer your triangle is to 90*45*45 the better.
To reproduce my smoothing techniques on your model do this list:
- select all edges
- on the edges modpanel, push Autoedge with a threshold of 15
- weld any verts which are nearer than 50cm
- weld verts where your pits touch or nearly touch the outer wall
- select edges at the lip of your pits, excluding those that are also wall edges
- chamfer selected edges by 50 (or 100 if you want a wider transition)
- check edges for self-clipping and adjust as needed
- select edges around the outer wall base, excluding those that are also pit edges
- chamfer selected edges by 50
- check edges for self-clipping and adjust as needed
- smooth all faces to group 1
- select the outermost polygon (top of the wall)
- smooth the wall top to group 2
- Select all edges
- redo Autoedge with threshold 15
Now your floor should be a single selectable polygon. Other portions of your tile group should also be easily selectable. You can now manually modify regions, such as under a bridge, or areas you want to trail off into darkness at the edge of a tile.
To get the whole thing to be one texture like I showed above, use the UV Coordinate Modifier : *MapScalar. I don't know if this is available on all max versions, but it shows up on my GMAX with NwMax installed.
I'll detail how to build walkmeshes from this setup further down. It has do do with that first set of vertices you built on the outer rim. Don't lose those verts.