Jump to content
  • Advertisement
Sign in to follow this  
Anton Vatchenko

Property in games

This topic is 3448 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Everybody talk about fight or skill aspects on MMO games, but I want to ask about ownership. Yes, there are some pets, mounts, but they exist like items in my bag: if I need I can wear them and use them, and then put back in my bag. But are there land owners, that can build something? Or buildings owners, or some objects' owners (I own a market and fill the sell object then get the money). Do some games have such aspects? And how do they look? For example I own a market (maybe some bot with a box), and everybody see sell-menu and I see sell and admin menu, or I need to press some ADMIN button-or-skill on it? Or how the own problems are solved if I own the land and build a house for somebody (I sell it), but then I can destroy it and get the cash?

Share this post


Link to post
Share on other sites
Advertisement
Vanguard has housing, Anarchy online has the tower system for guilds, Conan has the city system for guilds.

What happens is the server knows what character Id owns the building (or is admin) and sends this information to the client. the client will then open a admin gui instead of a normal gui.

The server obviously have to check for validity for the admin messages as the client can fake/hack messages to pretend its admin.

If you own a house, the desicion if you can sell/destroy it and get cash back is more a game design issue. There are no programatically "big" challenges to solve these issues if you already have the basics of an mmo game up.

Share this post


Link to post
Share on other sites
But does the player usually knows (or see) what he owns? So I try to understand which method is used:

1. Every time when I interract with object server checks if I'm the owner and shows User menu + Admin menu ("Buy items" + "Add more items to sell", "Get the cash").

2. There are some admin button. If I press it on the object, the server will check and show "Add more items to sell", "Get the cash" or just "You can't do this!"

3. Server every time checks the owners and send ADD_OBJECT(TREE, X, Y), ADD_OBJECT(BOX, X, Y, YOU_RE_THE_OWNER) and when I click on the box I'll see the menu USER_ACTION, ADMIN_ACTION.

Or how? Another problem is to remove objects.

Share this post


Link to post
Share on other sites
Quote:
Original post by Anton Vatchenko
But does the player usually knows (or see) what he owns? So I try to understand which method is used:

1. Every time when I interract with object server checks if I'm the owner and shows User menu + Admin menu ("Buy items" + "Add more items to sell", "Get the cash").

2. There are some admin button. If I press it on the object, the server will check and show "Add more items to sell", "Get the cash" or just "You can't do this!"

3. Server every time checks the owners and send ADD_OBJECT(TREE, X, Y), ADD_OBJECT(BOX, X, Y, YOU_RE_THE_OWNER) and when I click on the box I'll see the menu USER_ACTION, ADMIN_ACTION.

Or how? Another problem is to remove objects.
A combination. You go to the object, and the client asks the server if you're the owner. If the server says you are, then the client shows the extra admin options. When you then try to perform an admin action, the server will check that you're allowed to do that (I.e. you're the owner), and then perform the action if you're allowed.

For removing objects, it's exactly the same. You click on the object, the server replies with "You're the owner", client shows admin options and "Delete" option. User clicks "Delete", and the client sends the delete object message to the server. The server checks if you're allowed to do that (If you're the owner), and then deletes it.

In both cases, the client doesn't have to wait for confirmation of the admin action, it can just show you the result visually. If the server then replies to say that you weren't allowed to do that, then you must have been hacking, or there's a bug in the client, so it'll likely disconnect you (Or show you an invalid state).

Share this post


Link to post
Share on other sites
The gui and server code is usually separated.

Imagine the admin gui and customer gui's as two separate web pages. The client shows them, and the server only interacts when the client tries to do an action from the gui.

It would make sense for me, at least, for the server to send ownerid along with the house. The client would always know its own id, so for the house it could do a simple

if (myid == house.ownerid ) {
// display admin gui
ShowGui("house_admin.html");
} else{
ShowGui("house_normal.html");
}


The html here is arbiatary. Some guis use xml, others use flash, and some guis have their own language to define what properties they have.

If a property changes on the server, the server will send a network message to the client saying "new furniture" or "remove furniture" for example. The gui would have to listen for these network messages and update the gui list accordingly.

// pseudo code

//how a house GUI class might look (used by house_admin.html and house_normal.html)

class House : public Window {
public:
// this request comes from server
// adds furniture to furniture list
void SlotNewFurniture(uint32 furnitureID)

// this request comes from server
// removes furniture from furniture list (if exist)
void SlotRemoveFurniture(uint32 furnitureID)

// admins only
// this slot is triggered when users clicks the new furniture button in the GUI
// will send a message to the server, and the server will reply with newFurniture or an error message
void SlotButtonNewFurnitureClick(uint32 furnitureID)

// signal handler to create an instance of this class for a house
// creates a new window and puts it on screen until [x] or quit is pressed
static void ShowHouse(uint32 ownerid)
{
if (myid == house.ownerid ) {
ShowGui(new House("house_admin.html"));
} else{
ShowGui(new House("house_normal.html"));
}
}

private:
uint32 owner;
std::vector<uint32> furniturelist;
}

// in network code
// if packet == house
// then emit Signal ShowHouse


This is just an example of how it might be done. I personally like signal systems for handling stuff like this because you can separate modules pretty cleanly without too much dependencies. (ie, network code does not have to know about House window to be able to display one, it can just send out a signal.)

Share this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
You go to the object, and the client asks the server if you're the owner.

But there are a lot of objects. If there were only big houses in the world it would be easy, but there are trees, bots, players. In every game I see about 100 objects around me. If "going to object" means "in radius of 10 meters", there can be about 5 objects in this criteria at time.

Quote:

If the server says you are, then the client shows the extra admin options.

If it's really in some games then developers are not clever. Admin options are not the same for every object usually.

So result is a huge server to allow players to check every object for ownership on quite every step, and then if you click on it, you get an admin menu from server!?

Share this post


Link to post
Share on other sites
Quote:
Original post by Anton Vatchenko
Quote:
Original post by Evil Steve
You go to the object, and the client asks the server if you're the owner.

But there are a lot of objects. If there were only big houses in the world it would be easy, but there are trees, bots, players. In every game I see about 100 objects around me. If "going to object" means "in radius of 10 meters", there can be about 5 objects in this criteria at time.
I don't really follow - each object has an ID number, the server just needs to check if the object you tried to get information on is owned by you. I'm assuming you mean you click on an object to interact with it?

Quote:
Original post by Anton Vatchenko
Quote:
If the server says you are, then the client shows the extra admin options.

If it's really in some games then developers are not clever. Admin options are not the same for every object usually.
Yes, the client will show the options appropriate for the object.

Quote:
Original post by Anton Vatchenko
So result is a huge server to allow players to check every object for ownership on quite every step, and then if you click on it, you get an admin menu from server!?
The server only checks for ownership when you click on it.

Another alternative would be that the server sends the client a is_owner flag with every object. The server needs to tell the client where all the objects are in the world as you move around anyway.

Share this post


Link to post
Share on other sites
Quote:
Original post by Anton Vatchenko
Quote:
Original post by Evil Steve
You go to the object, and the client asks the server if you're the owner.

But there are a lot of objects. If there were only big houses in the world it would be easy, but there are trees, bots, players. In every game I see about 100 objects around me. If "going to object" means "in radius of 10 meters", there can be about 5 objects in this criteria at time.

But these typically aren't owned. So why would you need to check them?

Quote:

Quote:

If the server says you are, then the client shows the extra admin options.

If it's really in some games then developers are not clever. Admin options are not the same for every object usually.

Again, most items are not owned. So you don't need to check everything, nor do you need hundreds of different menus. Just 1 per type of owned object, which is probably not even a handful.

Share this post


Link to post
Share on other sites
Quote:
Original post by Anton Vatchenko
Yes, I've mentioned possible ways, but how it's implemented in games?


Games are not implemented in one specific way. If one method works, then go with it. I am sure this is probably handled a different way for each different game that uses such a system.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!