Making Sketchup Your Bitch
There are a lot of people on both sides of the fence regarding Sketchup as a game development tool. There are those who tout its ease-of-use, and those who hate the wasteful triangulation that gets performed at all contact points/lines/etc. I recently decided to design my own levels for Dead Shift, and only rely on purchased assets for items, characters, and filler. I chose to use Sketchup for this purpose because it’s the only 3D modeler my coder brain can comprehend. There have been some caveats, so I’m going to share a few hacks and work-arounds for other developers in the same situation.
Problem: Triangluation
Sketchup’s Triangulation of the mesh generates many unwanted polygons. This can easily slow down rendering and kill the performance of collision detection routines. This happens because Sketchup considers every point on a plane important, even if the points are simply another object touching a wall. A common worst-case scenario is extruded text placed on a wall, this will generate so many unwanted polys that it’s almost funny!
Solution:
When you have objects touching, try moving them 1cm towards each other (causing slight interpenetration), or 1cm away from each other (for a slight gap) if you prefer. As long as the points/lines are no longer perfectly coplanar, they won’t affect the polycount! I’ve reduced the polycount on a test level by 1,000 only expanding the walls slightly. It’s a great technique, and allows you to create much more detail with fewer polygons!
Problem: Materials
Sketchup only supports a simple Diffuse texture, and that’s about it.
Solution:
Write a content pipeline extension (or something equivalent if not using XNA) that will parse an XML file and apply custom material info based on the exported material name. Here’s a rough example:
Exported Material Name: “Bricks001″
XML Example Excerpt:
<Material>Bricks001</Material>
<NormalMap>Path/To/BrickNormals.png</NormalMap>
<SpecularPower>0.25</SpecularPower>
Problem: Entity Placement
There isn’t a good way to place entities without writing custom importer/exporter scripts.
Solution:
Create a material with a name such as: “Entity_MachineGun”. Create a single-polygon component using this material that points downward. From your pipeline extension, you can use the bottom vertex of each polygon as a placement position. You could use other shapes, but I feel the triangle is easiest to deal with. Note: Sketchup has a nifty little feature to have components always face the camera.
Problem: Collision Meshes
Sketchup doesn’t provide a nice way of managing collision meshes.
Solution:
Create a new Material named “CollisionOnly”, and make it a bright transparent color (to stand out). Make sure your game is aware that anything using this material should never be drawn (using your pipeline extension, or whatever method you please). When you want a complex shape to have a simpler collision mesh, simply create a bounding mesh using the “CollisionOnly” material, and make sure the visible shape’s material has collision disabled.
Note: If you place all collision shapes on a “Collision” Layer, it’s easy to show/hide your collision mesh while editing the level! Make sure you follow the “Triangulation” tip to ensure the collision mesh doesn’t generate unwanted polygons… or it defeats the purpose!
Misc Tips:
- Always “Explode” your level before exporting. I use the freely available BombAll.py script to automatically explode everything.
Todo:
- Decals might work nicely with Sketchup by using custom materials… hrmmm
Well, I’m running low on caffeine and should probably be getting back to work… That’s all for now, folks!






I would give SunBurn a shot if I could afford it, I am flat-on-my-ass broke. And the free version doesn’t have shadows I don’t think. Don’t you just hate it when you friends are being dicks with your laptop and they break you’re charger then you spend 3 hours repairing it, having to ring up your electronics teacher and ask him which way round the cables go?
@Andres
Can’t say that’s happened to me, but we did leave a brand-new laptop on our car’s roof a few years ago as we left for a road trip… It hit the ground at about 60-70mph and exploded…
That sounds awesome, besides the fact you lost a badass laptop because of carelessness
But I must say we have similar thinking
I suppose for spheres you are using a closest point collision test which would explain why small objects are unstable
So yeah I’m satisfied to a certain extent at the moment but it would be nice to get resting contacts in to make obb’s not look like shit when colliding with other obbs
I’m putting off physics improvements so I can implement shadow mapping for direct lights then point lights so maybe in a bit I will be looking at that post to get some help.
Well I just did a bit of work on my game, improved some of the command handling on the Console, continued with some of the PlaneObject.cs and PhysObjectLibrary.cs, now all I need to do is find and efficient way to network it all, at the moment I have that the player.tag is being transmitted over the network and then all the stuff happens client side, all collision, all sounds, everything, so there is a small chance when epic lag happens that on one persons screen a player dies but on the players screen he doesn’t die. Very small chance though.