Modules and Stylesheets
If you’ve been following Metaplace for a while, you have probably seen these two terms tossed around. But there’s hasn’t been a clear explanation about what the difference is – and they are very different! These are pretty central aspects of the Metaplace system.
A big part of the point of Metaplace is making world- and game-building much easier. After all, over the last few years, it’s gotten really hard to even make game mods, much less make games from scratch. And in the case of virtual worlds, it has basically been out of most people’s reach since the days of text muds. With Metaplace, we wanted to attack this problem on two fronts: make it easy to base a new world on an existing one, and make it easy to use stuff that others have made in your world.
Stylesheets
A stylesheet is basically a whole world, ready to go out of the box. When you go through our Create World wizard, you are asked if you would like to use a stylesheet as a starting point. You can choose to say no if you think you’re “l33t,” but if you say yes, you can basically have a fully-functional world up and running in thirty seconds instead of thirty months.
How does it work? When you are in the build tools, instead of hitting the usual “save world” button, there’s a “save as stylesheet” choice. This will save everything that you have done thus far in that world: all map building, placed objects, scripts, imported art, everything. If you choose to publish it to everyone, it goes into the stylesheet directory on the website, and then worldbuilders can use it as a starting template.
For example, we have a space shooter game that we made in-house called Uberspace – we’ve posted screenshots of it before. You fly Asteroids-style through space, in an overhead view, and shoot each other. We have an "Uberspace stylesheet" that you can create a fresh world with. The original Uberspace will be untouched, of course – but your new world will look identical, and it’ll be just as functional as the original pretty much as soon as you finish the wizard.
But then you can log into that new world of yours with the build tools, and start replacing the sprites with hand-drawn pencil sketches of World War II tanks. Change the walls to isometric trees, change the view to isometric, and change the movement script slightly so that your tanks don’t fly forever with a little bit of thrust, but instead coast to a stop pretty quickly. Just like that, you’d have a very different feeling game that still had all the other nice stuff that the Uberspace stylesheet supplied, like online high score tables or a power-up system.
Bottom line, stylesheets are a very powerful way to get going with a world of your own without needing to design from scratch. We plan to create a bunch of stylesheets internally, including a few common types like puzzle games, a few types of arcade game, chat rooms, and so on. But we also expect the library to grow rapidly, because any user can make their world into a stylesheet.
To help you find stylesheets, they get profile pages just like actual worlds do, so they can be discussed, reviewed, rated, tagged, and searched for.
Modules
What if you don’t want a whole world, but just a small piece of functionality? That’s what modules are for.
A module is a package of world elements. It could include scripts, template data, art, or commands and keymappings. You build a module by identifying all the pieces that you want to bundle up, then exporting those pieces as a standalone little package. Unlike a stylesheet, a module cannot be booted up on its own and logged into. It has to be imported into a world. One of the building tools is, naturally enough, the tool to bring in modules from elsewhere so you can use them in building.
A well-designed module is a standalone piece of functionality that doesn’t rely on other scripts or assets to be present. In other words, it can be pasted into any world. It might even be configurable – the scripts in a module can choose to expose configuration values so you can set them up in a properties window, without needing to actually open the code.
An example might be a little radio that chatters out headlines from an RSS feed – say, from the Metaplace blog. The module builder would select the script for the radio, the art, and maybe two commands – turn on and turn off, let’s say. The script might expose some configuration fields, like the address of the RSS feed to read in, and an interval at which to spit out text.
These elements get bundled together and exported as a module. You can browse modules on the website and import them into your world. In this case, you might see “RSS Radio” in the search results. Bring it into your world, and you automatically get everything needed to just place the radio. Click on the radio’s script, and in the properties window you can change the RSS feed’s address and the chat interval. Then just place the radio in your world somewhere.
Modules are great for adding “smart objects” like the radio, soccer balls with physics, dance mats, etc., but they’re also good for adding things like leaderboards, health bar systems, online high score tables, web services, and so on. Think of them like widgets for your world, applets or plug-ins. We expect and hope that buying and selling of modules will be one of the top activities on the Metaplace marketplace. And again, any builder can create a module, so we hope that the library will be large.
So that’s the low-down on stylesheets and modules. We’re especially excited not only about how they make it easier for non-technical folks to make stuff, but also how they provide a nice on-ramp for people who want to learn scripting. With these tools, you can start out by making small projects, like modules, or just modifying an existing world, before you tackle that giant three-year project you’ve always wanted to make.
-Raph Koster
Founder
Previous Post | 3 Comments | Next Post
Posted on Monday, November 5th, 2007 at 2:41 AM PST
Reader Comments
Mycon said:
on Monday, November 5th, 2007 at 1:19 PM PST:
Eolirin said:
Also, the way I'm reading it, a module may contain more than one script, but a well formed module shouldn't have outside dependencies. Internal dependencies should be fine, since they're packaged up with the module... but if you need a script outside of the module to run the module, then you're going to run into problems. That's pretty common sense though... it defeats the entire purpose of easy drag and drop functionality with the modules if you can't actually get them to work because there's a script missing. That being said, I'm *not* a dev member, so I could be wrong. It just wouldn't seem to make much sense for them to do it the other way...
I am curious though if you can package up graphical/audio assets into a module? I know that you wouldn't, or shouldn't at least, have a module package that requires a specific external asset, but is it possible to include one inside the module? At that point you've very easily be able to make it a requirement, since it's sent around with the scripts. I think it could be kind of interesting to allow that, even though there are some issues with it. If you make the asset part of the closed source functionality, such that you couldn't change it for a scripted object if the maker set it to closed, it would basically allow content generators to have very easily identifiable objects. It'd be almost like putting their signature on an object, and after a while, you'd be able to easily tell when their object was being used. It would however, prevent the object's use in worlds that have conflicting styles, so there is a big downside to allowing it. And granted, you *can* achieve a similar concept of "signature" simply by using the scripting system (having a button or popup that says "item scripted by ... " for instance, but it's not quite as immediately obvious, or impacting on a sensory level, and if done badly it becomes extremely annoying.
I'd also hope that if that were possible, that it's equally possible to make the assets changable respective to the script, assuming the content creator allows it. Preferably without having to edit the scripts directly.
on Monday, November 5th, 2007 at 2:13 PM PST:
dr0 said:
Modules kind of remind me of Maya's basic structure, which is 'nodes with attributes that are connected.' Everything is a node with an input and an output, and you can build really powerful objects and processes that way.



-Mycon-