Sunday, May 20, 2007

Sketchup

Sketchup is a modelling tool which Google bought a little while ago. It’s used, in part, to create buildings and such for the Google Earth project. It’s not as sophisticated as something like Maya, but it’s easy to use to create simple static models. It comes in two forms, a free version, and a more feature rich version for $500. There’s also an SDK you can ask them for (email sdk@sketchup.com and they'll ask you to complete a Non Disclosure Agreement), which allows you to read sketchup files.

It occurred to me that the free version, and SDK, could be used as a level editor for simple home projects or shareware games.


The idea for how to build levels would be similar to how I said that Inkscape could be used. The general level geometry is built using the normal modelling tools, and then gameplay information is layered over the top. For example a box with a spider texture on it, would turn into a spider enemy in game, or an object with a wood texture, would become a wooden dynamic physics object. The limitations come when you want to do scripting, such as configuring a platform to move back and forth, or triggering an event when the player reaches a certain point.

As with using middleware, you should aim to bend your designs to fit with what you're given. Though the limitations might change the game you're making, the time saved in having such a stable and feature rich editor on day one would be massive.

Level editing aside, Sketchup is a lot of fun. If you’ve not had a play, I recommend watching this video, and having a play yourself. Also take note of the huge free collection of models in the warehouse.

There's a great 15 minute video which shows you the features here, and you can download Sketchup here (the free one is the button on the left).

Here's a timelapse view of someone building a house in sketchup...

{Edit May 2009} I just spotted on Jim's blog that exporters for XNA '.X' format are available for Sketchup. More on this at my newer post.

9 comments:

Beaty said...

Hi Mark - very interesting movie. I particularly liked you solution to making a stairway!

I hope you don't mind, but I have placed your movie on my blog.

Cheers, Beaty

Mark Pope said...

I don't mind... not my movie :)

Christopher said...

Mark,

I know this post is a few months old but I just bumped into it while searching for anyone using sketchup to build game levels and this was one of the few relevant hits.

I've been trying to get back into building levels for BSP based games. True Combat to be specific.

It had been so long since I had used what is now gtkradiant that, in all honesty I wasn't looking forward to relearning everything. Plus, I know sketchup pretty well and it is so fun I was wondering if it was possible to meld the two.

Of course it didnt work but it was fun to experiment.



I dug up an old copy of 3ds2map, exported the skp file to a 3ds file then converted it. (Knowing full well how old 3ds2map is.)

It didn't open in gtkradiant but I was able to at least view them in notepad, just to get an idea of their guts.

The converted map file is remarkably close to an actual file that would come out of radiant. The headers are different, the newer maps need to have each brush numbered and it appears the converted doesn't do that.


The coordinate format is the same while the system used for point locations are different.

The texture section of the map file is basically the same. The only difference being the orientation points of the texture from the converted file contains a decimal. (It also uses a default texture name)

Only thing really "missing" from the converted file is the closing curly bracket.

Each "map" was nothing more than a simple square box.

Here is the sketchup file, exported as a 3ds file and converted using 3ds2map.


{
"classname" "worldspawn"
"wad" "gfx\medieval.wad"
{
( 10, 10, 0 ) ( 0, 10, 0 ) ( 0, 0, 0 ) FrontCol 0 0 0 1.0 1.0
( 10, 10, 0 ) ( 10, 0, 0 ) ( 10, 0, 9 ) FrontCol 0 0 0 1.0 1.0
( 10, 10, 0 ) ( 10, 10, 9 ) ( 0, 10, 9 ) FrontCol 0 0 0 1.0 1.0
( 0, 0, 0 ) ( 0, 10, 0 ) ( 0, 10, 9 ) FrontCol 0 0 0 1.0 1.0
( 0, 0, 0 ) ( 0, 0, 9 ) ( 10, 0, 9 ) FrontCol 0 0 0 1.0 1.0
( 10, 0, 9 ) ( 0, 0, 9 ) ( 0, 10, 9 ) FrontCol 0 0 0 1.0 1.0
}


...and here is the map file made from gtkradiant 1.5


// entity 0
{
"classname" "worldspawn"
// brush 0
{
( 64 64 64 ) ( 64 -64 64 ) ( -64 64 64 ) NULL 0 0 0 1 1
( 64 64 64 ) ( -64 64 64 ) ( 64 64 -64 ) NULL 0 0 0 1 1
( 64 64 64 ) ( 64 64 -64 ) ( 64 -64 64 ) NULL 0 0 0 1 1
( -64 -64 -64 ) ( 64 -64 -64 ) ( -64 64 -64 ) NULL 0 0 0 1 1
( -64 -64 -64 ) ( -64 -64 64 ) ( 64 -64 -64 ) NULL 0 0 0 1 1
( -64 -64 -64 ) ( -64 64 -64 ) ( -64 -64 64 ) NULL 0 0 0 1 1
}
}


Now in the reverse, I saved the above simple box from gtkradiant, used MAP23DS, converted the map file to a 3ds file and imported it into sketchup and that worked fine.


I figured this might be food for thought for anyone who is looking to do the same. I'm no programmer, just an on again off again mapper who is tinkering around.

Cheers

-Christopher

Mark Pope said...

Thanks for the post Christopher. You win the 'longest post on the blog' accolade :)

So you're using the non-free version to export to 3DS, correct?

Thanks,
Mark.

Harrison said...

The general level geometry is built using the normal modelling tools, and then gameplay information is layered over the top

yah but how do you layer the game play information over the top of sketchup I have been trying to make a game using SketchUp for a long time how do you put game play into SketchUp?

Mark Pope said...

Hi Harrison,

My hacky idea above was to make pieces of geometry with special textures on. So a box with a 'spider.bmp' texture would be removed, and replaced with a spider enemy. Similarly a box with a 'physics_wood.bmp' texture would become a dynamic physics object instead of being static.

The length to which you can push this isn't very far. You'd need to design your game around the limitations. If you needed more, then the next cheapest solution might be to do some editing in Sketchup, and then develop your own in game editor functionality.

Hope this helps.
Mark.

Harrison said...

I have -for the last day- been using Terragen™ for the terrain and structural design, GoogleSketchUp for buildings, I need something to create the characters and enemies. And to know how to exactly take it and put them in a form of : .bmp

Harrison said...

Click here to download Terragen™

Mark Pope said...

To make and animate models yourself, you can use a free modeling package (http://gamecreator.blogspot.com/2008/07/free-3d-modeling-packages.html).

There are also some sites where you can buy pre-made models, like this one: http://www.3drt.com/3dm/3dm.htm

Hope this helps.