[MMO] Named items - a mechanism for a consensus reality.

Admin

I've been wondering how I could intuitively make it so that some things would only be real to one player, and other things would be globally, part of the "consensus reality".

I've come up with the idea of "Cosmetic items", "Named items" and "Hero items". This should be intuitive to anyone who's ever watched a movie or read a book. If you give something a name, it's important to the plot. Cosmetic stuff doesn't matter at all. And the hero, he's critical to the plot.

PROPERTIES

While objects may have many properties (how damaged they are, what they are made of, who owns them, etc) there are a few properties that the server will care about for every item. These properties do not have to be fixed: an jewel could become Gettable, for example, once you levered it from the idol's eye socket.

  1. Static - Static items are for boulders, trees, and buildings. Anything that cannot be moved or changed or damaged, should be a Static item. Knowing that something won't be moving lets us optimise all sorts of things, like the lighting, collision detection, and so on. Static things can't be Destroyable or Gettable.
  2. Gettable - Gettable items can be placed in inventories, and given to people, and traded. They may have a value. They can't be Static.
  3. Destroyable - Destroyable items are things that the user can bash into powder, eat, flush down a drain, or otherwise remove from the world. They can't be Static.
  4. Physicsable - Physicsable items are those subject to physics. Bouncing, rolling, falling, flapping, sliding, being thrown, floating, or having things bounce off them, etc. While all Scriptable items can have physics faked with a script, only Physicsable items are optimised to do it really fast with no scripting. All Static objects are Physicsable. Hero items can't be Physicsable.
  5. Scriptable - All items can have clientside scripts and behaviours attached. Scriptable items are those which can have serverside ones, too. These scripts can include the command "let everyone nearby know this script was run". So you can have an Named door with a serverside script to open it, that lets everyone know you did so, so they'll see the door opening too.
  6. Per-player - Sometimes, you need an item that everyone can get one of. Keys for quests are a good example. If you only have one key for a door, then if someone takes the key and hides it, the quest is no longer completable. If every player who "picks up" the key just gets a copy of it instead of the real thing, then the problem's sorted. These can be either Named or Hero items, but are special in that whatever a player does with them, the details of the action are never sent to any other player.

TYPES

Cosmetic
The server does nothing at all with Cosmetic items, and does not know they exist. Cosmetic items can't be Static, Gettable or scripted. They can be Physicsable and Destroyable. They are always created and destroyed by the client, which doesn't tell the server anything about them.

Cosmetics are for sparkles, ripples in water, puffs of steam, and stuff that other people might never see, or will see their own version of. If you have a dripping pipe, making a Named pipe with a clientside script to create Cosmetic drips would be best. Cosmetics cannot be placed in your inventory. Cosmetics will not be there if you walk away and come back - neither your client nor the server will remember they ever existed.

  1. If your friend opens a Cosmetic chest, you won't see him do so: the opening only happens on his computer.
  2. If he sits in the open chest, you will see him sit, ghostlike, inside the solid chest.
  3. If he pushes it across the floor, then you will see him do so, since it is affected by physics on everyone's machine.
  4. If either of you leave and come back, then to the person who left, the chest will not be there.
  5. He cannot pick the chest up.
  6. If he smashes it, then his computer will decide whether he manages it, but any results will be shown only to him.

Named
The server does very little with Named items, caring only if they are created, destroyed, or added to/removed from an inventory (which it treats the same as destroy/create). Everything else is left to the client. The server does not keep track of where the items actually are in the world. Named items can be Static, Gettable, and/or scripted. They are always Physicsable. They may be created or destroyed by the server, which would then tell all local clients; or by the client, which which would then tell the server, which would then pass the message on to other local clients.

Named items are for sandwiches and pebbles, cutlery and clutter, houses and hedges. Most stuff in the world should be Named, particularly Static things. As they are subject to physics, they are the most "believable" objects, however, this means they can become "desynched", so they are the things that either do not move, or, while you want other to people see them, you don't mind whether they all see them in the same place or state.

Any unimportant Gettable item is a candidate for a Named item. Named items aren't "worth" anything, since the server doesn't store them, they're entirely clientside. The server will let anyone in the area know when you take one out of your inventory - but because they aren't stored serverside, it won't check that it was in your inventory in the first place! It will also believe you when you put them into your inventory, rather than checking to see if you're close enough and strong enough and all that jazz. It will check the item is Gettable, though, so no popping houses into your bag.

Anything Destroyable is a candidate for a Named item. Again, the server will believe you when you say you destroyed it, if it's a Destroyable item.

Anything Physicsable is a candidate for a Named item. Cloth and liquids must either be Named or Cosmetic, because these rely on clientside physics.

  1. If your friend opens a Named chest, you won't see him do so (just like Cosmetics), unless "opening" is a server-scripted action with a line saying "let everyone know".
  2. If he sits in the open chest, you will see him sit, ghostlike, inside the solid chest.
  3. If he pushes it across the floor, then you will see him do so, since it is affected by physics on everyone's machine.
  4. If either of you leave and come back, then the chest will still be there when you return, but in the original spot, rather than where he pushed it to.
  5. If he picks it up, then it will be gone into his inventory, even if you go away and come back.
  6. If he smashes it, then his computer will decide whether he manages it, and if so, it tells the server, the server believes him, and the server tells everyone in the area that it has been destroyed.

Hero
The server carefully tracks the position and state of Hero items. No Hero item may be moved without the server giving permission, and the server may move them at any time. Hero items can be Static, Gettable, scripted and/or Destroyable. They are never Physicsable, nor Static. They may only be created or destroyed by the server, which then tells all local clients that the item exists.

Hero items are for movable things like players, NPCs, monsters, important doors that you don't want people to cheat past, and important keys that you don't want people to make two of. They are the "consensus reality", in that anything that happens to them happens on everyone's machine, but you are limited with what you can do with them. They are not Physicsable, so they are not as "believable" - any physics behaviour needs to be added on with a script. Because they are expensive in terms of server load, you should keep Hero items to a minimum.

Any important Gettable item is a candidate for a Hero item. Hero can have a value, since the server stores and manages them, and can prevent cheating. The server will let anyone in the area know when you take one out of your inventory, but will check that you have it in your inventory first. It will also check whether the item type is Gettable and you're close enough and strong enough and have enough inventory space etc before letting you pick one up.

  1. If your friend opens a Hero chest, you would see him do so.
  2. If he sits in the open chest, you will see him sit, inside the open chest.
  3. If he tries to push it across the floor, he will be unable to, unless this action has been scripted into it,
  4. since it is unaffected by physics.
  5. If either of you leave and come back, then the chest will still be there when you return, in the state you left it in.
  6. If he tries to pick it up, the server will check whether he can, and if so, it will be gone into his inventory.
  7. If he smashes it, then the server will decide whether he manages it, and if so, tell everyone in the area that it has been destroyed.

NAME SYNTAX

Not sure what to use for names. Here're some thoughts though.

On the cover of the book it could be anything the artist wanted, with their name automatically appended, like "Little Red Riding Hood - Dewi Morgan". But that'd get a bit lengthy so internally, if I've done ten stories, then the story I'm working on now could be called "DewiMorgan_11".

All named and Hero items would also need a unique name. First, there'd be the name that the programmer used, which would only need to be unique within their own story. So:
NPC_Wolf
MainDoorToCastle
MagicRock

If there are multiple clones of an item, then:
NPC_Wolf(1)
...
NPC_Wolf(312)

Then, the "canonical" name, unique to every item on the server, which is just the storyname tacked onto the front, like:
DewiMorgan_11.NPC_Wolf(42)
DewiMorgan_11.MainDoorToCastle
DewiMorgan_11.MagicRock

Of course, the server will internally most likely just use a number.

STORY CONFLICTS

If you had a Hero item in a story, this would cause problems in various ways:
1) You could write a story about having a million dollars (money's a Hero item, it has value), and then become rich just by reading your story.
2) If someone had a Hero item in a story, the server would have to know not to send messages about it to other people, because they couldn't see it.
3) If someone had a Hero item in a story, another Hero item could hit it and bounce in one direction... while also NOT hitting it in everyone else's reality. The server would then need to track multiple realities, which is not possible.

So, stories can ONLY use Cosmetic and Named items, and scripts attached to Named items in stories cannot affect Hero items.
However, non-Physicsable Named items can be marked to become Hero items if the story becomes "canon" through the voting process described elsewhere.

--Yet another geek.

Click to Give Kudos
Discworld MMO
Login or register to tag items

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: [MMO] Named items - a mechanism for a consensus reality.

The idea of player created content, specifically Cosmetic items and Named items is great, but the key to MMO's is that not only the player using the items are impacted by their presence, whether through visuals or phsysics. The need for the unlimited potential these items will create to be limited on how they effect the server is also paramount.

So will these items have a scripting option that will be a ranged aura telling nearby clients they are there? Something to bypass the need for the server to maintain them but to allow other clients in range to be effected visually or physically by them? What would be the point of a dripping pipe if only 1 person sees it dripping? As well as an option within a client to limit how many with-in range checks are effecting them, or to turn off recieving these item auras altogether. For client side stability.

Also perhaps the ability for any Hero item to become temporarily Static? I dont know your eventual plans on player owned spaces - but assuming its included the space should be able to be decorated with items that have a simple physics, maybe just collision. A person should be able to display any hero items in those spaces - making them be able to be temporarily static - to prevent others from doing anything to it.


Click to Give Kudos

Re: [MMO] Named items - a mechanism for a consensus reality.

Admin
Fithean wrote:

What would be the point of a dripping pipe if only 1 person sees it dripping?

As a non-moving, static Named object, the pipe would be visible to everyone.

For the drips, though, there's no point at all in having the server send each individual drip to the client, so they would be generated on the client side by a script attached to the pipe, saying "generate one drip item every 3 seconds just below the pipe, and apply gravity." Everyone would see the same pipe, and everyone would see some drips - but not the same drips.

These are called "particle effects": placing a water-particle generator in the pipe would be the cheapest way to achieve the drip effect.

Not just particles though: no clients need to be told where each leaf of each tree is: they don't even need to be told where each tree is, just "you are at (location), the terrain is (terrain), the seasons is (season), the weather is (weather)". Then the client generates the trees according to the terrain type, seeding from the location, generates the leaves according to the season, and animates them according to the weather.

Quote:

Something to bypass the need for the server to maintain them but to allow other clients in range to be effected visually or physically by them?

I dislike the idea of any direct client-client interaction: I don't want to expose people's IPs to eachother. Maybe at some point I could do something Skypeish and P2P, but not in the foreseeable future, I think.

[Edit: I should explain this more. Privacy and anonymity are important in an MMO. Just like when visiting a website, you should be free of stalking, and only the personal details that you choose to give out should be made available. IP numbers can give your region, and sometimes even your name and address, to stalkers. Also, you should be free to be whoever you want, without people saying "you can't be a woman, you were playing a man five minutes ago!" - if people's IPs are accessible, then people can tell that every character you play is really the same person. This cramps people's style and freedoms. The flipside to this is that harassment becomes easier with anonymity. However, commands like "ignore" can work on IPs without exposing the IP publicly.]

Which means that any data sent from client to client needs to go via the server, which needs to be minimised.

The closest to the "auras" thing I'm planning is to have a "range" beyond which people will not be informed of changes. This could be octree-based as well as just a simple range check, so people nearby in the next room wouldn't need to be sent stuff.

Quote:

Also perhaps the ability for any Hero item to become temporarily Static?

Hero items would not be affected by collisions with Cosmetics or non-static Named items, but basic collision detection should work between two Hero items, and Hero items and statics/terrain. Clientside, the collision detection will be "better", but the server may "correct" the positions to match the more simple serverside collision.

Statics would be very different, under the hood. To turn a static into a movable object could mean redoing any light-mapping for the local area, which would be less than fast. It'd also mean changing collision optimisations and stuff like that. Statics are intended for things like terrain, not stuff that can be moved.

I think if people want to lock stuff up in plain sight, give them lockable display cabinets, or just have them use a copy of the mesh of the Hero item and make a separate Named item out of it, either a Static Named, or if they expected to move it, a regular Named with a script that only allows the owner to move it.


Click to Give Kudos
--

Yet another geek.


Re: [MMO] Named items - a mechanism for a consensus reality.

Admin

Doubtless some are wondering whether I realise just how awful this topic title is.
From a chat with my sister today:

Quote:

Dewi Morgan says: I posted something to my forums with the title "Named items - a mechanism for a consensus reality." Mwahaha! Anal titles for the win!
My Sister says: Yes--you could be in Pseud's Corner. Well done!


Click to Give Kudos
--

Yet another geek.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.