Anarchy Arcade

Anarchy Arcade

Not enough ratings
How to add a SketchUp model (work in progress)
By Vermilicious
A guide on how to take a SketchUp model, prepare it for use with the Source engine and adding it as a prop in Anarchy Arcade. ( Work in progress. )
   
Award
Favorite
Favorited
Unfavorite
Setting up SketchUp
SketchUp can be downloaded from http://www.sketchup.com/. The free version is more than enough for our purpose. Before going further, it would be a good idea to look up some tutorials on how to do basic things in SketchUp. You're going to have to get used to the mouse controls in particular, and it takes a little while getting used to.

When you first launch SketchUp, you will be met with a welcome screen. From this screen you can select a template to use. Just press the "Start using SketchUp" button for now. The editor opens, with a more or less blank space. If there's a character showing near the origin (where the red, green and blue lines meet), right click it and select "Erase".

The first thing we shall do is set up the measurement units. Click "Window" in the main menu and select "Model Info". In the list, select "Units". Format should be set to "Decimal" and "Inches". The precision is okay to leave at "0.00", which should be more than enough for a prop. Length snapping helps you drawing geometry, and I would advice leaving at 0.01". If you are going to make your own models, you might want to increase the precision and snapping for angles, but if you are going to work on finished models, the defaults of "0.0" and "15" are fine.

While you have the "Model info" window up, select "Statistics" in the list. Click "Purge Unused" to remove any remnants from your model, like the charater you removed earlier. It might be a good idea to do this now and then. You may close the window when you're done.

Every 2D geometric shape in Sketchup consists of edges (lines) and faces (the fill). Each face has two sides; a front and a back. By default, the back face is hard to see, so we should change it. Next, click "Window" in the menu again, this time selecting "Styles". Select the "Edit" tab in the window that appears. Just below the tabs, there are some icons. Click the second one, called "Face Settings". Click the colored box next to the "Back color" label. Choose the "RGB" picker and set R to "255", G to "0" and B to "255". Click "OK". This sets the back face to the magenta color, which is commonly used in the Source engine. You may now close the "Styles" window.

By default, you might have a limited toolkit available. Click "View" in the main menu, and select "Toolbars". Check the "Large Tool Set" toolbar and click "Close".

Lastly, we're going to add a special material used in the Source engine. If the "Materials" window isn't open already, click "Window" in the main menu, and select "Materials". In the window, click the house icon. In the top right corner of the window, are some small buttons. Press the second one, called "Create Material...". A window appears. In the text field at the top, type "tools/toolsblockbullets". According to the developer wiki any valid material should do, but we'll just use this one now, since it kind of makes sense anyway. Choose the "RGB" picker, and set R to "255", G to "100" and B to "0". Set Opacity to "100" and click "OK". This will give the material a brigt orange color.

That should be enough configuration for now. If you wish, you can save the configurations you've made by making a template. To do so, click "File" on the main menu, and select "Save As Template". Give it a meaningful name, like "Source Model". Click outside the "Name" field, and click "Save". Next time you launch SketchUp, make sure you're using this template.

Before we move on, you'll have to install a couple of plug-ins that we can use to export models to the necessary formats. You can find the instructions here: https://developer.valvesoftware.com/wiki/SketchUp_Source_Tools
Note: In Windows 7, the plugin folder is "C:\Users/<UserName>/AppData/Roaming/SketchUp/<SketchUpVersion>/SketchUp/Plugins"
Preparing a model for export (part 1)
Before we begin, I'd like to say something about good practice when using SketchUp.

Firstly, when you draw basic geometry, always do so on Layer0. This is the default layer. I advice only creating other layers when there are specific groups or components that in some situations should be "switched" on or off. For the scope of making models for Anarchy Arcade, you will likely not need to create any such layers.

Secondly, when you have geometry that is closely linked, you should group them. For example, if you have a three dimensional block, select all the edges and faces and group them. That way you can select and modify that box without disturbing other parts of the model. And, when it makes sense to do so, make components instead of groups. The difference is that changes made to a component, affect all copies of it.

Lastly, when it comes to making maps and collision meshes the models should be made of only convex shapes. This is usually not a big problem, but it's a limitation that can cost a little extra effort. The only time we have to worry about it when we are making models are the collision meshes. We'll very soon get to what a collision mesh is and how we make it.

To keep this tutorial as simple as possible, we'll use a finished model from the 3D Warehouse; a dart game board. To import a model from the 3D Warehouse, simply click "File" in the main menu, and select "Get models..." from the "3D Warehouse" sub-menu. In the search field, type "Darts" and click the "Search" button. In the result list, look for a suitable model, like the one made by Ollie Choz, and click the download icon. In the dialog box that appears, click "Yes".

This loads the model right into your own. Note that when looking for models in the 3D Warehouse, you might want to check the number of "polygons" on the detail page. High numbers will cost performance when rendering it in the game.

When the model has been imported, click somewhere to place the component. To navigate in your model, there's a really helpful tool available. It's called the "Outliner". You can turn it on by clicking "Window" in the main menu, and select "Outliner". In the window that appears, you can inspect the entire model's hierarchy. You view should now be something like below. Click once on a node to select it and double click it to edit it.



This model holds a bit more stuff than we want. Firstly, let's get rid of the topmost component. In the Outliner window, notice that component names are written in angle brackets. From the Outliner tool, right click the "Darts" component and select "Explode". Alternatively, right click on the model itself. This command takes a component or group and removes it, leaving behind all its parts free and selected. Next, let's remove all components and groups other than the one called "Dart board". It's easiest to do this with the Outliner. Click them while holding either the Ctrl or the Shift key, just like in Windows. Then press the Delete button or right click them and select "Erase". After doing all this, you should be left with only the board:



Next, we're going to rename the component. Right click on it in the Outliner or in the main window and select "Entity Info". In the "Definition" text box, replace the contents and write the name the model is going to be identified with in the Source Engine. Let's call it "Ollie Choz/Dart board.ref_smd". Notice that you can give models hierarchical names like this. In this case, under the folder "Ollie Choz". The ".ref" part is just a simple shorthand for reference mesh - a fancy name for the base model. The "_smd" ending is used by the export plugin. Close the little window, and you should be seeing this:



Double click the component, either in the Outliner or in the main view, to edit it. Turn the model by holding the middle mouse button and dragging the mouse. On the back side there should be some extra detail we won't bother keeping. Choose the Eraser Tool and remove it by holding down the mouse button and drag over it. It might take a couple of repitions to get it all.

The model is almost ready. To make it work well with Anarchy Arcade, we're going to have to modify the axes. The "axes" tool defines a new origin - a zero reference if you will. In Anarchy Arcade, the origin of a model is where it sticks to the mouse pointer when you move it around. To determine where the origin should be, consider how the model is going to be used. An object that is to be placed on a wall, should have its origin placed at the back side. An object that is to be placed on the floor should have its origin on the bottom. Likewise, an object to be placed in the ceiling should have its origin at the top. Then you have combinations of these. For a cabinet standing on the floor against a wall, the origin is best placed at the back bottom.

Choose the axes tool and place the origin in the center of the backside. This requires 3 clicks; first to set the origin, second to define the red axis and third to set the green axis. For finding the center of circular faces, hover on the edge for a short while first, and the cursor should snap to the center when you're close. For more complicated models, you might have to measure up beforehand where that point is if the model has pertruding parts. You should now have the following on your screen:



When you exit edit mode for the component, for example by click outside it or pressing Esc, click "Yes" in the dialog that appears.
Preparing a model for export (part 2)
This part is optional for props.

Todo: Update for Dart board.

Now that we have the base model ready, it's time to make a collision mesh. A collision mesh is a secondary model that tells the Source engine the model's physical shape. In Anarchy Arcade, the mesh is important because it's used to determine where you can click to select it. If you enable physics for a model, it will also be used to determine how it interacts with its surroundings.

There are many ways to make a collision mesh, including automatically. Automatically generated meshes aren't very precise though. The easiest way to make a mesh yourself, is to copy the base model. Select the top level component and equip the move tool. Hold the "Ctrl" key down while clicking on the component. Then click again in the same spot. In the Outliner, you should now see two instances of the component. Select one of them, and right click on it. Select "Explode". In the Outline window still, right click on the component parts that are selected, and select "Make component". Call it something meaningful, for example by sawpping ".ref" with ".phys". To continue working on the collision mesh, it might help to hide the original model. Right click on it in the Outliner and select "Hide".

Double click the Collision mesh to edit it. Remove all the textures that are on it. Also make sure there are no concave shapes. Depending on the complexity of the model, this might take quite a lot of fiddeling. Alternatively, you can make some simple box shapes instead of dealing with all the detail. However, the closer the mesh is to the actual model, the more realistic it will behave. Performance can also be a factor here. When the mesh is ready, paint all faces with the "tools/toolsblockbullets" material we created in the first part of the tutorial. Note that just selecting the components/groups and paint the whole thing in one click doesn't work. Lastly, select all the edges in the model, by editing every part and selecting everything by pressing Alt+A. Right click the geometry and select "Soften/Smooth Edges". In the dialog that appears, drag the slider to 180 degrees. Close the dialog. Continue this process until all parts of the mesh is painted and smoothed.
Exporting materials
Export from SketchUP / custom texture for color

VTFEdit: VTF texture (and VTF bumpmap)

VMT

Copy to materials folder
Exporting a model
Selecting and exporting reference mesh

Selecting and exporting collision mesh

QC file

Compile

Half-Life model viewer (hlmv) [AA-style origin makes it a little weird] and Source MDL Texture Info.
Import prop
Rename model- capital letters.

console - scanmodels. spawning

making changes - deleting from library.
Cabinets
Special textures for screen and marquee.
models/smarcade/dynmarquee
models/smarcade/dynscreenglow

.cat file in resource/models
Templates and examples
Templates

Source Template

AA Prop Template

AA Cabinet Template

Examples




Vermilicious' models[www.dropbox.com]

Closing statement

Thanks for checking out my guide. I hope it was helpful. Feel free to ask questions in the comment field (or in the Anarchy Arcade discussion area).
2 Comments
Mr. Cat (Real) 5 Jan, 2015 @ 11:37pm 
Even though it's not finished, thanks for the well-needed kick in the right direction I needed. I can't believe it actually worked! Custom cabinets! Woo!
レ.̠̪͎̯̮ͤ͛̋̀͆ͮ̐7̶ 3 Jan, 2015 @ 6:08pm 
I'm going to try this. I got the Pro version.