Page 1 of 4

[tutorial] plant altar - from idea to model to game object

Posted: Tue Aug 06, 2013 4:41 am
by Ryeath_Greystalk
1. Introduction and Build Base and Top in Blender

Hello fellow Grimrock modders.

Anyone that has followed msyblade's wonderful post on getting models into Grimrock has probably witnessed my bumbling attempts at learning how to make a custom item for LoG. In that post msyblade suggested that if I finally get it figured out that I should write a tutorial while it is still fresh in my head. Well here is my attempt at an original (hopefully) game item complete from start to finish.

First I must say I feel completely inadequate to write this, as everything I am doing is stuff someone else has needed to explain to me. I am not bringing up anything of my own other than the item idea. I suppose one good thing about my tutorial is not as likely to presume a certain level of prior knowledge as one written by an experienced modeler. With that said, credit must go where credit is due,
SpoilerShow
msyblade - for getting me started and helping along thee way
John Wordsworth - for the GMT and helping along the way
Isaac - much of Isaac's help has been through PM's and not visible to the public
germanny - for ton's of help in the texture and UV area.
skuggsavienn - for his wonderful video
manus - for scripting input
Remma - for pointing out Skuggs video and other input
ARdTRu - for help with textures
(I'm sure I have missed someone and anyone I missed will e added accordingly)
With no further delay ----- the plant altar tutorial

(this is a lengthy tutorial with a lot of images so it may take a few sittings to complete. All comments are welcome so feel free to chime in at anytime, just know the product my not be finished at the time of comment. I plan to include all my mistakes and guesswork.)

Concept - the idea is to make an altar that will be a drop in replacement for the standard Grimrock altar. By drop in I mean it will not have special properties, just look different. The altar is going to have a base like a rectangular shaped planter with a number of plant stalks supporting a flat slab which will serve as the altar surface. I will be using Blender Ver 2.66, paint.net, and the GMT to make and import the item.

To begin I am going to take a basic cube and scale it into a thin rectangle to start my base. To scale the cube I use the S key (for scale, which will scale in all directions) immediately followed by either the X, Y, or Z key to limit scaling along a single axis. Then I will use the G key (for grab) followed by the Z key to move the object along the Z axis until the bottom of the cube rest at 0 on the Z axis (so it will rest on the floor in Grimrock) I will then extrude the top face multiple times, each time scaling a bit larger than the previous. To extrude press the E key and then drag the mouse. In this case I will press Z after the E key to extrude only along the Z axis (If the blue line appears after pressing "E" then it is already going to extrude along the Z axis, no need to press "Z"). Once I get the base shaped close to what I want I will extruded the top once more without moving it, scale it inwards to create the lip (press "E" then immediately press enter which will make a new face at the same location. Then press "S" to scale and move the mouse towards the object to make it scale smaller). That will leave a face I can translate (move) downward into the center of the base making the area for the dirt. (At this point I had a picture but accidentally overwrote it :x ) Also note at this point don't worry about scale, just go for a good shape. It will be humongous when moved into GMT anyways.

Next I will open a second layer in blender (blender can use up to 20 layers and they are selectable just by clicking the square boxes in the middle of the 3D header on the bottom of the 3D window. Note they are only selectable in object mode) and add a plane mesh, which I will extrude up a couple times while scaling to create the top slab to serve as the altar surface. The scaling just created a small channel around the edge to give a little definition the top. Use shift key to select both layers and you can then position the top centered over the base a little higher than the base. So far I have,
SpoilerShow
Image
At this point I will make a file in my blender folder called plant alter to keep all my saves and other information in.

I will break for now and be back in a bit to continue (and I want to make sure the images are working ok)

Re: [tutorial] plant altar - from idea to game object

Posted: Tue Aug 06, 2013 5:28 am
by Ryeath_Greystalk
2. Build Dirt and Stems in Blender

Next I'm going to make the dirt. I'm going to do this by opening a third layer and adding a plane. I then extrude it up ("E" followed by "Z" to extrude along "Z" axis) to make a thin rectangle, and scale it in to make the top slightly smaller than the bottom. I will then subdivide the top face and pull the vertices up to different heights to create the topology for the dirt (select the vertices and use "G" to move the vertices up and down). Use shift key to display only the base and dirt layers and move and scale the dirt so it fits just inside the base a little ways down from the top. Make sure it comes as close as possible to touching the base without clipping through it. It should look something like this,
SpoilerShow
Image
In a fourth layer I will add a cylinder mesh. (Note: I am using different layers so I can work on objects without the other objects getting in the way) I will open only the cylinder layer and the dirt layer and scale the cylinder until the circumference about the thickness I want for the vine base. I will then duplicate the cylinder three times for a total of four vine bases, rotate and move them so they appear to be coming out of the dirt. Like earlier place the stems as close to the dirt as possible without clipping through.
SpoilerShow
Image
Next I will take each stem and methodically change the angle of the top face (use "R" for rotate) and extrude it out creating the vine shape. About every two or three sections I will scale the top face inward a small amount to make the vine gradually taper to a point. At the top I will merge all the vertices in the center to make a pointed end. While doing this I am consistently displaying and hiding the altar top so I have a target to aim for. I want each of the 4 vines to pass right next to the lower edge of the top piece as close as possible while not clipping through it.
SpoilerShow
Image
Save my work again.

Re: [tutorial] plant altar - from idea to game object

Posted: Tue Aug 06, 2013 5:58 am
by Ryeath_Greystalk
3. Build Leaves, Place and Join with Stalks, Link Everything Together (Parent / Child)

In a new layer I am going to make a leaf (don't worry this is the last layer :D ). To make the leaf I am going to add a mesh, doesn't matter what, then delete it (in vertice select mode, press "A" until all are highlighted, then delete key (or "X")). This is because there must be an object to work with even if the object has no vertices. I will then free hand a leaf shape by adding vertices using ctrl - left click. Once I have all the vertices connected in a leaf shape I will add a line of vertices down the center to create the middle vein and then extrude them to give the leaf some depth (Extruding is not needed and will make the modeling easier as germanny will point out a couple posts down from here). Then I shape the leaf by moving vertices around and make the faces.
SpoilerShow
Image
Then I will make a bunch of copies of the leaves. I then took each leaf copy, scale and rotated them and placed them near the stems. Once I got all the leaves where I wanted them I joined each leaf to it's stem using the join objects function. I then basically deleted some faces and edges on both the stem and the leaves base and created faces to work the two meshes together. In retrospect, as I will point out later in the tutorial, I wish I had opted not to join the objects together. But at this point I now have a base, with dirt and 4 stems with leaves sticking out, supporting the top base.
SpoilerShow
Image
You may also note that at some point I went add squared up the top rim of the base and added a small indent to the top, just to clean things up and add a bit more detail.

At this point I am going to join all the objects together, not by using the join function as with the leaves, but by using the parent child relationship. I am going to parent the dirt with the 4 stems and the top (so the stems and top will be child objects of the dirt) and then parent the dirt and base so the dirt is a child to the base. This way if I need to do anything to the altar such as scale or move it, it will effect all the objects the same as long as I do it to the base. To make the parent / child relationship, select the items to become related using shift - right click then press shift - "P". The last object selected will become the parent.

So now the basic modeling part is done and it is time to work on generating some UV maps for it. (Don't ask me what the UV stands for, I don't know). At this point I am going to save the file under a new name just in case something goes horribly wrong in the unwrapping process I will not have lost all my work.

Re: [tutorial] plant altar - from idea to game object

Posted: Tue Aug 06, 2013 6:39 am
by Ryeath_Greystalk
4. Overview of UV Mapping and Unwrapping the Dirt, Base and Top Objects

Onto the UV mapping, and a big thank you to germanny who gave me a clear cut explanation of this in mysblades post.

I will need to unwrap each object at this point, so I will start with the dirt object as it would seem the simplest to do. To start the unwrapping process you will need to select the object to be unwrapped, in this case the dirt object, and go into editing mode, and go into edge select mode.

***In this case I should point out it is a good idea to go through and rename all the objects. This can be done in the upper right hand corner of the default screen layout and will help out quite a bit when you get the model into GMT. I named my objects base, dirt, top, NW stem, SW stem, NE stem and SE stem. (incorrect - these names are not transferred to GMT)

In the editing mode go through and select the edges to form the seams. (Basically if you take a 3D object, grab a pair of scissors and cut it apart so it would lay flat on a table, the seams would be where you made the cuts.) Once the edges are selected you can select mark seams in the mesh tools (on the left in the default view. If the mesh tool bar is not displayed use the mesh menu in the header at the bottom of the 3D viewport). The marked seams will appear red in color. The seam marking can also be done in stages so you don't have to worry about marking all of them at once. You can also unselect a marked seam by selecting clear seam (or clear them all by selecting all the seams with the "A" key and select clear seams).

For the dirt I am going to select all the edges around the outside edge of the dirt object, which will make two parts in the UV map. Once the seam is marked I am going to go into UV editing mode. In the very top header in blender you should see a place where it says default. If you look at the pull down menu you should see an option for UV editing. Select that and the screen will change to a split screen with the 3D view on the right and the UV view on the left.
SpoilerShow
Image
Once in this screen, and you have your seams marked you can select unwrap from the mesh tools, just below the mark seams, and then select unwrap from the options it pulls up. In order for the unwrap to work you must have all the edges selected so use the A key select all before unwrapping.

Once unwrapped the UV map should show up on the grid in the UV editing side on the left.
SpoilerShow
Image
At this point you can select the UV menu from the UV header (bottom of UV window) select export UV layout and blender will save the picture of your UV layout as a PNG file. If I understand correctly this so you can hand paint a texture onto it later. It is not needed for the project I am doing but a good habit to get into I suppose. (Edit - I will eventually use this UV map at the very end of the tutorial, so go ahead and save the UV layout for all the objects.)

If you look at my UV map and notice the bottom section, it has a strange jog to it. I envisioned it would be perfectly square / rectangular but the unwrapping process put the jog there. I tried to remove all my edge faces and rebuild the object but it just made it worse. I eventually ended up just reloading the saved file and going with the UV map as is. It seem to be working fine.

At this point save and move onto the next part which will be the top and then the bottoms. Follow the same procedure, mark the seams, unwrap the object, make sure nothing funky is happening then save the work
Here are the base and top UV maps
SpoilerShow
Image

Image


That is all for tonight. I will continue on with unwrapping the stems and start on textures tomorrow.

Re: [tutorial] plant altar - from idea to game object

Posted: Tue Aug 06, 2013 9:50 am
by thomson
Excellent tutorial! Very helpful for folks like me, who use blender only sporadically. One thing that I'd like to ask you is to describe specific commands you use (or key shortcuts). Thanks a lot for doing this.

Re: [tutorial] plant altar - from idea to game object

Posted: Tue Aug 06, 2013 3:01 pm
by Ryeath_Greystalk
thomson wrote:Excellent tutorial! Very helpful for folks like me, who use blender only sporadically. One thing that I'd like to ask you is to describe specific commands you use (or key shortcuts). Thanks a lot for doing this.
No problem Thomson. I am only using the very basic commands. I got the first post edited with more info and will get the rest caught up later today.

Re: [tutorial] plant altar - from idea to game object

Posted: Tue Aug 06, 2013 7:59 pm
by germanny
Fine, Ryeath. For your leaves:

It saves you a lot UV space if you make them as a plane - without volume. So you dont need to texturing the underside.
And it saves you LOT modeling time and lowers polycount..
A little prob is that - if you look towards the underside´s direction - the leaf is invisible.
To avoid that: Set the attribute "Doublesided" in the grimrock material settings.

doubleSided = false,
to
doubleSided = true,

Used the technique with the dmcsb pack:
Image
And notice you can use multiple uv´s on one Grimrock model, for that you can set different mat options in grimrock.

Re: [tutorial] plant altar - from idea to game object

Posted: Tue Aug 06, 2013 9:09 pm
by Ryeath_Greystalk
Thanks for the information germanny.

I was contemplating not using a bottom on the dirt object because it would never be visible but was unsure if just a simple plane would work or if it would cause an error, so I made it a real short rectangle. But knowing now in the future I will try to stay aware of places a single plane might work.

By "using multiple UV's on a model" do you mean if I wanted a red book and a green book and a blue one I could use the same model with a different _dif.dds file? Would you just make a new definition for each model linking to the different files?

By making this tutorial I am hoping to learn more from other's input, and already it's paying off. Thanks again.

Re: [tutorial] plant altar - from idea to game object

Posted: Tue Aug 06, 2013 11:40 pm
by germanny
Ryeath_Greystalk wrote:Thanks for the information germanny.
By "using multiple UV's on a model" do you mean if I wanted a red book and a green book and a blue one I could use the same model with a different _dif.dds file? Would you just make a new definition for each model linking to the different files?
Thats usable, too.
But i meant you define in blender parts of a model with another texture, or define separated models with different uv-textures and join them together afterwards.
Then try to export out of blender with aaahm.. ;) .. by material.. setting (forgot the real name now).
In gmt you come up with a model that has more than one texture slot.
In that way you can change parts of your model, say some parts are transparent or glowing.. etc.
You can set each texture with diff. log material settings.

In Blender, select two.. three.. . meshes (shift-rclick) and then ctrl-J. Then they are connected as one object. Then export.
Make shure to apply rotation and scale before that and check the normals direction(recalculate normals or flip)!

The tip with normal direction is important - especially if you make a plane mesh without volume - could be tricky ;)
In editor win, press N for mesh menu, there you can enable the normals direction view.
If you use doublesided, this is not soo important, but to create a consistent model - it will.

Re: [tutorial] plant altar - from idea to game object

Posted: Wed Aug 07, 2013 5:04 am
by Ryeath_Greystalk
germanny wrote: But i meant you define in blender parts of a model with another texture, or define separated models with different uv-textures and join them together afterwards.
Then try to export out of blender with aaahm.. ;) .. by material.. setting (forgot the real name now).
In gmt you come up with a model that has more than one texture slot.
In that way you can change parts of your model, say some parts are transparent or glowing.. etc.
You can set each texture with diff. log material settings.

In Blender, select two.. three.. . meshes (shift-rclick) and then ctrl-J. Then they are connected as one object. Then export.
Make shure to apply rotation and scale before that and check the normals direction(recalculate normals or flip)!

The tip with normal direction is important - especially if you make a plane mesh without volume - could be tricky ;)
In editor win, press N for mesh menu, there you can enable the normals direction view.
If you use doublesided, this is not soo important, but to create a consistent model - it will.
germanny, thanks for clarifying that. I am doing it close to what you say. I am using different UV maps for different parts and using the parent child relationship to join them together, with the exception of joining the leaves to the stems where I used the join function (ctrl - J). One thing I am unsure of (as you will see a bit later in the tutorial) is if I need to "physically" join the objects by connect vertices and making faces, or does the join function make them one object even though there is not a "physical" connection. I just need to spend some more time exploring different options in blender.

back to the tutorial.