Showing posts with label organic. Show all posts
Showing posts with label organic. Show all posts

Thursday, August 1, 2013

Using Sketchup to Design Game Models

Disclaimer: I'm not an industry veteran or 3d instructor. I'm merely sharing my set of experiences to anyone who is interested.

Purpose: I've been noticing a distinct pattern of misinformation and plain bias related to using Sketchup to produce game assets, specifically towards Unity (as that is the engine I've currently been developing on). The greatest cause for this happens to be the lack of any good information relating to how Sketchup works and what it can actually produce. Because it's designed primarily as an architectural tool, not generic 3d modeling platform, most of the Sketchup veterans have no interest in game design. Likewise, most game design veterans are loath to use a program that is not 3ds Max or Maya.

I've decided to attempt to dispel many of the rumors and clear up misinformation surrounding the use of Sketchup for game design. This paper, if you can call it that, is broken up into 3 sections - comparison, usage, and conclusion. Hopefully you, as a reader, can walk away from this with a tad more understanding of how Sketchup fits in the game development process. Bear in mind that Sketchup is not an all inclusive tool, not by any stretch of the imagination. Even if you do decide to use it, you'll need additional tools.

Comparison

Lets begin by outlining the basic characteristics of Sketchup:

Easy to learn.
Excellent for hard surface modelling.
Non-alpha texturing.
Component design and manipulation.
Generally spline based modeling.
Automatic Topology management.
Free*.
Extensive Plugins.
Poor organic modelling.
No advanced tools (UV wrapping, rigging, poly painting, etc)
Exports to Collada*.
No manual Topology editing.

If you're new to 3d modelling, you're probably wondering what all that means, so lets go over it briefly.

Hard Surface vs Organic Modelling: Imagine in one hand you have a rubik's cube and in the other you have an apple. Now, at first glance these are both "hard surface" objects. But when we discuss hard surface and organic in 3d modelling, we are referring to the complexity of the geometrical shape - or how many curves are on a surface. In the case of the rubik's cube, it's completely flat along each side. Even if we were to turn one of the sections, it would still be composed of entirely straight edges. The apple, on the other hand, is not even symmetrical. It is oblong and mostly rounded, but also curves in at the top and bottom. It has small dimples and imperfections that cause the surface to be rough.

However, do not mistake organic for explicitly meaning only biological entities. Consider a modern car and and a cyborg from the Terminator series. Both are inorganic - that is, they're just machines. But the terminator is still an organic model, with all the complexities of a human skeleton.

This is organic:

This is hard surface:

Sketchup is capable of creating organic models, and there are plugins to make this much easier. It is far simpler, however, to limit any type of organic modeling you do with Sketchup to a minimum, as you're trying to reinvent the wheel at that point. It is much more expedient to use a program like zBrush that was designed specifically for creating very detailed organic models in little time.

Texturing: Sketchup uses a very primitive surface texturing system that applies a single layer to a single, continuous surface. This means you can't brush in fading paint or specific detailing. The following image shows how Sketchup divides a surface based on lines. These lines denote what is a continuous surface. As you can see, it's impossible to bleed one texture into another for any kind of fading effect.


This entire object is a single surface with arbitrary lines placed on it. Note how the texture simply stops at the line. There are plugins to convert surfaces to quads and perform primitive unwrapping, but they are spotty at best, and highly unreliable. As a general rule, you will want to use another program, such as 3ds max, blender, or zBrush if you want to create a high quality texture for the model. Sketchup is also incapable of adding additional alpha textures, so you can't do bullet holes and blood splatters as decals.

Component Design: The strongest part of Sketchup is its component system. Starting with nuts and bolts, it is possible to design an entire component hierarchy where every part of a car is quickly and efficiently reusable. And this transfers between projects. An artist designing motors on his machine can export them as components for separate artists to bolt onto frames, who can then export those components to the body designer. Because all of these parts are reusable and rapidly re-sizeable, artists can produce buckets of interchangeable parts.

When a component is edited, it updates all instances of that component in the scene, reducing the time it takes to fix mistakes. Finally, it allows for extremely fast prototyping. A group of artists can collaborate, sharing components to snap together mockups of different objects and generate scenes with very little time or effort.

Topology Management: Sketchup automatically manages all the topology in a model. This is both good and bad. Topology in Sketchup is almost always clean by default, even when doing some pretty weird things. But in the even that you want to manually adjust the topology, you're out of luck. However, given the nature of Sketchup, this shouldn't be an issue. Your geometry should remain fairly basic, as will be outlined in the next section. A good thing to remember is that Sketchup is purposely simple. You shouldn't be doing anything too complex with it.

Plugins: The final, and possibly most important, characteristic of Sketchup is its robust plugin system. There are a considerable number of plugins that make modeling easier. The vast majority of these plugins are produced by the community, generally free and regularly updated. Keep in mind though, these plugins may become abandoned at any time, and therefore cease to function as intended.

*There is a professional version of Sketchup that costs money, but includes the ability to export to .obj and .stl natively.

Usage

Now that we're a bit more familiar with Sketchup, lets look at how it works in practice.This won't be a comprehensive tutorial, but should serve as some basic guidelines for using Sketchup and Unity.

Getting a Model Into Unity: I don't recommend using Sketchup for conventional game models. You can't control their level of detail (LoD), you would still need a 3d modeling suite to rig and animate them, and they will have only basic texturing. However, that said, they are excellent for terrain, mockups, and any game that doesn't require animations.

You can, for example, make item drops, along with their inventory icons rather quickly. Make a basic item (remember, we're looking for hard surface models that we can make very quickly). This sword took me only a couple of minutes to model:


Note that it's untextured and rather bland. From here, you can open photoshop or gimp and make yourself some basic texture sets. Because this is a sword, I made mostly metal textures to apply. Then, open the Materials section of Sketchup (it's the paint bucket in the tool bar) and click the new material button (the + in the upper right corner). From here, just add the texture you made and name the material:


Then apply the materials to your object. Here, I applied the textures and separated out the components so you can see how I could quickly make custom blades, cross guards, grips, and pommels for a huge variety of swords:


Here is the interesting part - if you were to export the model without doing any coloring or texturing, every surface appears as its own object in unity. This makes the model both unusable and highly unwieldy. Thus, if you are going to use any model made in Sketchup (no matter how you export it) you must apply some color to it, even if it's white.This defines the object groups and makes it manageable.

Also, make certain your item is as close to the center of the axis as you can possibly make it. Otherwise, Unity will not be able to rotate it properly. Keep in mind that blue is "up" when imported in Unity. This means that all 3 colors should intersect in the middle of the object, and blue should come out of the top:


Now, at this point you have two options:

1) Get an obj exporter plugin.
2) Use the native .dae or .obj exporter (depending on whether you have the free or pro version respectively).

I personally use the .obj exporter at the moment because it spits out the textures in a usable folder as well. But again, it's not necessary as you can just as easily create the Unity materials from your existing texture files.

Using GIMP or photoshop, you can also create a sprite sheet:



You're not quite done yet if you want to use this to quickly generate icons. If you're interested in doing this, I have a decent write up for it here. Otherwise, drag and drop your object into your Unity project and follow the usual steps to texture it (make a material for each texture and apply it). From here you can throw together a lot of prefabs:




Now, for the million dollar question - are these items legit? As in, can they be used just like any other swords in a game? Yes! In fact, here is a tech demo that features models made and textured in Sketchup. Keep in mind, it's just a tech demo and very, very far from a polished game.

Conclusion

This outlines exactly how it is possibly to rapidly produce models, either as mockups or finished products, for your game using Sketchup. A professional studio may find fewer uses for Sketchup, but many studios do actively use it as part of their design pipeline. Indie developers can make even better use out of this free tool, rapidly creating background and environmental assets that don't require a great deal of detailed textures or animations, or by importing it into blender for texturing (as Sketchup is far easier to create the base model with). 

It's also possible to use Sketchup to design your primary art assets if they don't contain animations. Tanks, helicopters, star fighters, even spaceships are all easy to design, texture, and plug into a game without any kind of budget. Indeed, the ease of use makes it excellent for new developers to begin with, and prevents them from launching into a game that will simply be too complex (IE, prevents them from embarking on yet another MMO) by forcing them to choose a much more simple game.

Sketchup isn't without its drawbacks, but any tool that works is a tool worth having, especially if its free. 


Monday, March 12, 2012

Working with round objects part 2

Now that we have the basics down, lets look at something that puts these ideas into practice, such as a space marine shoulder pad. At first glance, the shoulder pad looks simple, right? Just make a circle, then a cone and you're 50% there.

I wish it were that simple.

Let me take a moment to point out an infinitely useful tool to have if you have your heart set on miniature design: a digital caliper. This inexpensive measuring tool will certainly save your bacon on multiple occasions, and it's worth knowing how to use one.

Anyway, I digress. We need to be diligent and make certain that our shoulder pad is going to fit on the intended model. The are two surfaces we need to make a note of. The first is the outer surface. This must be small enough to fit in front of the back pack, and the top must not come into contact with the marine's head. It is also a good idea to keep track of the size so it doesn't get out of hand and look ridiculous on the model.

The second, and by far most important surface, is the inner section where the shoulder pad is glued to the arm. The angles MUST be very similar to the shoulder so that the pad makes good contact and remains in place when glued. If there is too much variation, the shoulder pad could fall off or decrease the spacing between the backpack and the outer surface.

Remember your crusty old shop teacher when he said measure twice and cut once? Measure 3 times and print once is the saying here. If you don't measure correctly, it could cause a lot of pain and hours of wasted work.

As you take measurements, make certain to write them down in clear, concise fields on a notebook. I'll probably do a section on keeping your data organized in the future. Basically, you don't want to have to go back and remeasure everything if you start on a new model.

Areas to measure:

Measure the height and width of the interior and exterior sections.





Next, take two shoulder pads and push them together so that they look like this:



The first thing you should notice is that it is asymmetrical. That means that simply using the previous methods will not create a workable shoulder pad. For this, we have to introduce a couple new tools.

Before we do that, however, I need to make a quick comment about scaling. Make certain that everything is in Meters, not millimeters. Sketchup does not work well with small dimensions, but can very easily scaled a model in meters down to millimeters.

First, start by creating a circle with the Circle tool. Give it a radius of 3.075 (giving a full diameter of 6.15):





Next, use the Guide tool to make a guide in the center and a mark at 7.6m:





This shows how much larger the circles needs to become to form into the oval shape of the interior shoulder pad. However, we are not ready to change its size just yet. Before we can do that, we need to add height and then volume.

Make another circle inside of the first circle with the same dimensions:



Once you have done this, mark the center portion with the Line tool to divide everything:





Delete the excess lines by using the Select tool and the delete button on your keyboard:





Alrighty, now it's time to make one more guide. This one will be 6.75m to the top of the shoulder:



Ready to add volume? To do this, we just draw a line down the middle of the second circle to divide it in half, and then delete that half, then use the follow me tool to make a half cylinder. Don't forget to use shift to select both sides of the cirlce:





So far, so good. Now its time to stretch the model to the right proportions. Select the model with the Select tool, and then click the Scale tool. Drag the model until it touches the guides:







And now we are very close to having the interior completed. To do this, we need to divide the model in half, but also retain a face on the flat surface. The quickest way I've discovered to do this, is simply draw a square in the middle of the model using the Square tool:





Using the guides that are already in place is the best way to keep the square perfectly centered. Once this is completed, drag select the entire model, right click on it, and select Intersect Faces > With Selection. The model will be deselected, but if you select any portion of it, you'll noticed that everything has merged. Delete the square and half of the model:



Congratulations, you now have the interior section of a shoulder pad! I recommend saving this as component. I'll cover component usage in another blog post.

We'll finish up the shoulder pad tomorrow, but see if you can do it on your own, using what you have learned so far.