Metaplace! That's what!

Build a virtual apartment and put it on your website. Work with friends to make a huge MMORPG. Share your puzzle game with friends. We have a vision: to let you build anything, and play everything, from anywhere. Eventually, anyway. We have to finish first.

Latest Forum Posts

Diehvel on Alpha Closed?

July 24th, 2008 at 8:54 AM PDT
3 Replies, 29 Views

DarknessFalls on Alpha Closed?

July 24th, 2008 at 8:49 AM PDT
3 Replies, 29 Views

Diehvel on HELLO RED NAMES

July 24th, 2008 at 8:42 AM PDT
12 Replies, 128 Views
MetaForums
Media Info

Feel like writing about Metaplace.com on your own site? Maybe you're a journalist? Here you'll find all sorts of materials that might make that easier: fact sheets, screenshots, logos and other artwork, and all the other handy stuff that goes in a Media Kit. Go nuts -- you've got blanket permission to use any of this stuff!

Contact Info
Areae, Inc.
11770 Bernardo Plaza Court
Suite 101
San Diego, CA 92128
USA
Phone: 858-451-2700 Fax: 858-451-2722
For press enquiries, please email:
FAQ

Our motto is: build anything, play everything, from anywhere. Until now, virtual worlds have all worked like the closed online services from before the internet took off. They had custom clients talking to custom servers, and users couldn't do much of anything to change their experience. We're out to change all of that.

Metaplace is a next-generation virtual worlds platform designed to work the way the Web does. Instead of giant custom clients and huge downloads, Metaplace lets you play the same game on any platform that reads our open client standard. We supply a suite of tools so you can make worlds, and we host servers for you so that anyone can connect and play. And the client could be anywhere on the Web.

We hope there will be millions of worlds made with Metaplace. It could get hard to find stuff if we're right, so the portal lets you easily search, rate, review, and tag worlds and games of all sorts. You also get a user profile so you can find each other.

That's sort of the whole point. You should be able to stage up a massively multiplayer world with basic chat and a map you can build on in less than five minutes. It's that easy. Inherit a stylesheet -- puzzle game, or shooter, or chat world -- and off you go! Building maps and places is as easy as pasting in links from the Web, and dragging and dropping the pictures into your world.

What's more, you can link your world to someone else's world. Put a doorway in your virtual apartment that leads to Pirate Vs Ninja-land! Stick your world in a widget on your Facebook or MySpace profile. Mail it to a friend and they can log in with one click.

You can make pretty much any sort of game or world you want. You can decide whether it's massively multiplayer or not (it's MMO out of the box, but you can set it to a lower size if you want). You can decide whether to have physics or not, you can change the keymappings and the interface, the sort of stuff there is in the world, the maps... basically, it's all up to you. Game logic is written in MetaScript, which is based on Lua. So it's easy to make whatever kind of game or world that you want.

Metaplace will support everything from 2d overhead grids through first-person 3d. However, right now we only have clients that do 2d of various sorts, including grid view, 2d isometric, 2.5d heightfields, and so on. We expect to keep working on the 3d client support.

We speak Web fluently. Every world is a web server, and every object has a URL. You can script an object so that it feeds RSS, XML, or HTML to a browser. This lets you do things like high score tables, objects that email you, player profile pages right on the player -- whatever you want. Every object can also browse the Web: a chat bot can chatter headlines from an RSS feed, a newspaper with real headlines can sit on your virtual desk, game data could come from real world data... you get the idea. No more walled garden.

Metaplace is made by Areae, Inc. We're a team of veterans of the game and Web industries who thought that the current way of doing things was kinda slow and didn't give users like you enough control. Check out the company website to learn more about us!

Developer Blog

Scripting Philosophy

A key component of the Metaplace architecture is the back-end scripting system that drives the game server. This system has been designed based on lessons learned from the team members’ 50+ years of combined experience developing and producing on-line games and web applications. Exposure to the internal workings of many MMOs and MUDs has given the Areae team a rich source of both successful and not-so-successful examples of scripting engines for on-line games, and general programming language development. Even though MetaScript is still at the alpha stage, it is the result of applying these lessons and integrating them with modern programming language ideas.

The goals of MetaScript are conflicted - it must be easy to use, but it must also be powerful. During the process of developing MetaScript and fighting with these requirements, we came up with a list of goals for the programming environment. Below is a summary of that list that was cut&pasted directly from our internal wiki:

  • Easy to learn
    • familiar or easily understood coding syntax
    • familiar or easily understood scoping rules
    • small number of new keywords
    • limited number of language infrastructure API functions
    • consistent behavior of API functions
    • consistent behavior of data objects
  • Ability to write code quickly
    • avoid boilerplate code and redundant code
    • consistent and uniform behavior of objects
    • minimize workflow dependencies on outside tools
    • type inference (don’t require users to specify type when it can be inferred by the system)
    • scope inference (don’t require users to specify scope when it can be inferred by the system)
  • Others
    • Prevent users from making mistakes
    • Performance
    • Stability
    • Ability to debug
    • Practicality of implementation
    • Security
    • Ability to expose meta-data to external tools

The concrete nature of this list was extremely useful is guiding design discussions and implementation choices. One of the most interesting items is “limited number of language infrastructure API functions”. What this really means is that a lot goes on behind the scenes in the framework that makes it easy for users to write powerful scripts – even when they know what is happening in the background. The results of this are a system that really allows you to get work done fast. Once people are familiar with MetaScript and the surrounding framework they will be able to make all kinds of interesting things very quickly and easily.

 

The MetaScript Framework

So, with all this theory in the bag, what does the actual framework look like? MetaScript is an event-driven environment like Flash or Director, and not coincidentally, this is also how many on-line game servers work. The components of the framework are templates, commands, triggers and scripts. At a very high level, templates are meta-data that define types of game objects, commands define entry points into the system from users and NPCs, triggers define events that occur within the system, and scripts define handlers for commands and triggers. These components are described in more detail below.

The scripting environment uses the programming language Lua as the scripting language. To quote www.lua.org, “Lua is a powerful, fast, light-weight, embeddable scripting language”. These characteristics make it ideally suited to be the language for writing behavioral code in virtual worlds and on-line games. It matches well with the philosophical goals outlined above, and its open nature allows us to sand-box it to allow safe execution of user written code in our servers. There is a tension in any programming sand-box between giving users power and imposing restrictions to ensure safety and stability. In a pure web environment, CGI scripts give users the ability to write almost any kind of on-line application, but they can easily bring down the web server or even the entire machine. The MetaScript environment will (at least initially) be more restrictive than a pure CGI environment. For example there will be no direct file I/O, from server side lua scripts, and no way to execute shell commands from server side lua scripts. However, it will still provide plenty of power for making cool games.

Scripts are small, modular pieces that are attached to game objects. They implement behavior as responses to triggers and commands. As scripts are independent of each other, they make it easy to do collaborative development. You can have multiple developers writing and using scripts in the same game world at the same time without stomping on each other. This type of setup dates back to the collaborative, real-time development that took place on text-based MUDs and has been proven to be very effective.

Scripts are a convenient packages of inputs, commands, triggers that can implement chunks of functionality such as WASD movement system, or a user interface for an RSS feed reader. Since scripts are self-contained, you can drop-in or cut and paste a script into a world to add functionality. We already have a bunch of scripts internally for common game tasks, and as the community grows, we anticipate that the amount of re-usable scripts and script libraries will become a powerful tool.

Triggers are events that are generated by user code in scripts, or generated by the game engine. Each trigger causes script handler functions to be invoked on scripts that are attached to the objects involved in the interaction. Triggers are the events in the event-based framework. They convey information between game objects and allow objects to respond to changes in the game world. For developers familiar with event-based systems, triggers should be a natural mechanism for making game behaviors. Here is an example of a simple trigger function:

 

function trg_enter()
MoveObject(self, 16, 16, 1)
end

 

This particular trigger is invoked automatically by the game engine when the object enters a place. The code in the body of the trigger function causes the object to be moved to a specific location in that place.

 

function trg_rotate()
newRot = (self.rotation + 1)
if (newRot == 5) then
newRot = 1
end
Debug("NewRotation: %d", newRot)

-- try new rotation
if (try_rotate_blocks(newRot) == 1) then
return
end

-- actually rotate the blocks
rotate_blocks(newRot)

self.rotation = newRot
end

 

This trigger is from an implementation of a falling block puzzle game – it accesses object properties and calls local function defineds in the script such as try_rotate_blocks.

Commands are inputs from users that come in from the network. They are the entry points for user interactions into the system, so they have an additional layer of validation and privileges that triggers do not have. To support different types of users in worlds such as administrators, developers and players, access to commands is controlled by a role system. So, players of a game will not be able to create any type of objects or kick other players – even though commands for these operations could exist in the world. As Metaplace has an open client and network protocol, the only way to ensure commands are secure is to do the validation on the server. The old axiom of “never trust the client” applies doubly here as the client could have been written by anyone!

Below the scripting level of the framework are what we call Platform Services. These are game-like infrastructure that would be inefficient to write in script and is commonly required to make different types of worlds. The set of platform services will grow over time based on user demand as the metaplace platform evolves. It will provide specific services such as collision detection, pathfinding, web operations, user interface and persistence. Usually each platform services exposes a set of functions to the scripting interface, and in addition some platform services will generate triggers when events occur. For example, when a bullet collides with a spaceship, a collision trigger would be generated to the objects involved.

So to summarize, the core of the engine behaves like a traditional on-line game server – it has user connections, game objects, a log file, a physical simulation, etc. At a high level, the flow of operations through the server is:

  1. a command arrives from a user and is validated
  2. the command handler function is located in script
  3. the command handler is executed
  4. triggers are generated by user code and by the game engine


Sean Riley
Lead Programmer

Previous Post | 13 Comments | Next Post
Posted on Friday, October 12th, 2007 at 8:35 AM PDT

Reader Comments

Scopique said:
Sweet! Thanks Sean!
on Friday, October 12th, 2007 at 10:46 AM PDT:
Chris Threlfo said:
Wow, thanks for that article, thats really good!

I missed the alpha but I'm a multi-tier programmer and now I'm really keen to get into the beta after reading that. It makes a lot of sense, and theres no real limits on the type of advanced logic/data manipulation you can do - since you can always offload more complex logic to an off-site webservice that wraps some C# code, for example.

By the sounds of it though, most of your game logic can be implemented very sensibly and powerfully, which definitely shows that you guys have thought this through.
on Friday, October 12th, 2007 at 1:27 PM PDT:
drOffset said:
Thanks, it makes sense even to me!
on Friday, October 12th, 2007 at 2:53 PM PDT:
Allan Melsen aka Raam said:
Hey nice update.

Thanks for the posting this... LUA is definately becoming more and more adapted in the gaming world by various parties...

I'll be looking forward to seeing how this works in 'the real (meta) world'.

- Raam
on Friday, October 12th, 2007 at 3:05 PM PDT:
naum said:
why lua instead of a better OO scripting language like python (or javascript or ruby)?
on Friday, October 12th, 2007 at 7:31 PM PDT:
Simon said:
Interesting stuff, thanks for the in-depth look.

Any details about interworld objects? Ie if I go to Bob's island adventure world and kill the mighty T-Rex boss and the loot it's head is it possible to return to my own world and plop it on my dining room table so I can show my friends (assuming the looted head was a trophy item in Bob's world)?
on Friday, October 12th, 2007 at 10:54 PM PDT:
NinjaInhibitor said:
Why lua instead of an "OO" language? There are many reasons why we picked lua, and why MetaScript is not really an object-oriented framework from the world builder's perspective. Lua is pretty advanced in terms of language features - it allows you to implement class-like data structures and objects, so we don't really lose anything in direction. If you dig into the Lua community and architecture, you'll discover it compares well with more common scripting languages. It doesnt have a large standard library like Python or PHP, but for an embedded environment like the MetaServer that is actually an advantage. There is less to "take out" of the APIs exposed to users.
on Saturday, October 13th, 2007 at 2:58 PM PDT:
Tide said:
This is Sean Riley of the Python game dev books?

How are you guys going to manage data? What kind of connection libs will be available to what kinds of databases? Cause there's nothing in LUA to manage data driven apps.
on Saturday, October 13th, 2007 at 4:08 PM PDT:
NinjaInhibitor said:
Yes, the very same Sean Riley!

Oh, there will be data, there will be lots of data. In MetaScript, there are user-configurable data objects called Templates that live in the game's stylesheet. I mentioned them briefly above. These are for meta-data (no pun intended) - they are for defining types of parameterizable game objects and behaviors. Then, when the game is running "game objects" can be instanced from templates.

It is a very data-driven system. At the risk of invoking meta-fatigue, I'd even say it was a MetaData-driven system.
on Saturday, October 13th, 2007 at 5:35 PM PDT:
m3mnoch said:
for those of you who missed the irony there, the guy who literally wrote the book on game programming with python chose lua for our metascript. and for very deliberate reasons, no less.

sounds like a ringing endorsement of lua for what we needed, eh?

m3mnoch.
on Saturday, October 13th, 2007 at 6:30 PM PDT:
Akkarin said:
o.k. i got about 80% of what you guys are talking about so i'm going to google the stuff i don't know... sounds really good though! will people have to have a basic understanding of code to use it though? for example making an object like in some of your pictures would require you to make an object then set any possible event that could happen to it and the subsequent reaction, otherwise the object would muck up under certain circumstances [the space ship best fits here], so no matter which way i look at it the whole thing will be complicated, could someone please clear this up [preferably using small words :)]
on Friday, October 19th, 2007 at 6:33 PM PDT:
Ycros said:
Will there be some sort of built-in support for automated testing of code? (eg. unit tests of code, running simulations with certain start conditions, controlling objects, recording gameplay sequences)
on Friday, October 19th, 2007 at 6:53 PM PDT:
nectarine said:
This sounds so exciting, lua reminds me of nwscript. In all my neverwinter scripting, I kept dreaming of being able collaborate on user created game worlds that could be 'any' game (ie not just more neverwinter nights). I'm so looking forward to digging my teeth into metaplace now.
Finally we'll have game worlds just for us!
I'm seriously considering the possiblities of a game that's essentially a MetaBlog.
on Friday, October 19th, 2007 at 9:39 PM PDT: