RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Instances Experiment

Kamron

Knight
Yes.. I have a working, current version of it. I haven't added any useful examples of it, but it serializes/deserializes fine.. :)
 

HellRazor

Knight
Not yet, I still need to merge it in and compile it. Will do that this week and try to create some instances to mess around in. :)
 

AodhanW

Wanderer
I don't know if this project has been considered a failure, a success, or if it merely hasn't seen a post in a month because its under heavy testing. But I had one rather important question to ask.

Can you create an instance of an area, and *save* that instance so it can be returned to at a later date?

The specific application I'd like to turn this to:
Creating patches of 'land' that players can get to place homes, or that owners of cities can 'purchase' to add on to their towns as instanced neighborhoods. I know that since the current set-up only allows for players, partys, or groups to go in that it won't quite work the way I imagine. But is it possible to set it up so only certain people can get in? Kind of a 'friends list' set by the players?

In the instance of neighborhoods, a publicly accessible neighborhood, so basically you click on the teleporter, and select a particular 'neighborhood' to go into?

Just a couple of thoughts.

I know that this would require something in place that doesn't delete pets and the like. Which is why I was curious if it was possible to save the 'state of the instance'.
 

Rocko Wang

Wanderer
AodhanW;707116 said:
Creating patches of 'land' that players can get to place homes, or that owners of cities can 'purchase' to add on to their towns as instanced neighborhoods.

The typical reason for doing instance in MMO is so that there is less conflict in competing for the dungeon resources on a shard with a lot of players. Creating copies of the same dungeon for different players/groups makes sense. Why would you want to create patches of land as instance just so people can place homes? For that purpose, there are plenty of space on the regular maps, why not just do it on a regular map? It is much easier that way.
 

AodhanW

Wanderer
Rocko Wang;707265 said:
The typical reason for doing instance in MMO is so that there is less conflict in competing for the dungeon resources on a shard with a lot of players. Creating copies of the same dungeon for different players/groups makes sense. Why would you want to create patches of land as instance just so people can place homes?
You are aware that most MMO's that HAVE homes (UO being the sole exception of which I am aware) have those homes instanced? See EQII.

For that purpose, there are plenty of space on the regular maps, why not just do it on a regular map? It is much easier that way.

Because the map will not allow homes to be placed on it in my shard, and any homes that DO get placed on the main map will be special awards given during Dev run events.

Additionally, I am intending on working up a system for entire player built towns. To give you an idea of how I see it working, think of cities in the early UO games. They occupied one square of the map, and you 'went into' the towns which were quite large. I intend on accomplishing much the same by using carefully placed teleporters that will teleport the character off, for instance, the Trammel map, into the Felucca map, which will be repurposed to contain only cities, neighborhoods, farming fields, and perhaps dungeons.

The answer as to 'why' I would want to instance this kind of thing? To create a limitless supply of neighborhoods with a minimal investment of real estate from the 5 maps available to me.
 

Kamron

Knight
The answer to all of your questions is yes.

Speak to HellRazor about getting my code for instances. The code that I produced is the basic core mod needed to code your own use for instances.

Basically you add a map and set it to be serializable. The map saves in Saves\Maps to its own binary file. You can save any items, mobiles, or players on any of the maps. You can destroy the map (of course, eject players first), etc.

The code works and has been tested against RunUO SVN 200.
 

AodhanW

Wanderer
One last question before I pester Hellrazor Kamron.

Is it possible to have it create an instance of only PART of a map? IE - X/Y to X/Y... Or does it have to instance the ENTIRE map?

Just wantin' t'know. :)
 

Kamron

Knight
Yes and no.

You would have to instance the whole map, but you can use blocker items to prevent people from walking outside of that area. You can also limit the size of the map starting from 0,0 to wherever you want the map to stop, and the server will not let them walk outside of the map perimeter.

I suggest using the (los)blocker items.
 

AodhanW

Wanderer
Kamron;707348 said:
Yes and no.

You would have to instance the whole map, but you can use blocker items to prevent people from walking outside of that area. You can also limit the size of the map starting from 0,0 to wherever you want the map to stop, and the server will not let them walk outside of the map perimeter.

I suggest using the (los)blocker items.

Thats at least something... And to reduce server load I can surely reduce the size of map 4 or 5 for the purpose of using as an instance base. That will help.

Alternately, I was thinking that I might be able to create instances that are then broken up.. IE - A instance contain 50 plots of usable land seperated from each other. As players 'claim' new property, it checks existing instances to see if all plots on that instance are used, if they are, it creates a new instance, if not, it assigns them an existing unoccupied plot.

Get where I'm going with this?
 

Rocko Wang

Wanderer
It is not the size of the instance that matters for CPU load, but the items/spawns in that instance. So if you instance the whole trammel and only have one player placing a house inside, compare to you instance Tokuno but have 20 players placing houses inside, the latter costs more server resource. Of course if you want to decor/spawn the instance, a smaller map would cosume less decor/spawn to be playable.
 

AodhanW

Wanderer
Rocko Wang;707383 said:
It is not the size of the instance that matters for CPU load, but the items/spawns in that instance. So if you instance the whole trammel and only have one player placing a house inside, compare to you instance Tokuno but have 20 players placing houses inside, the latter costs more server resource. Of course if you want to decor/spawn the instance, a smaller map would cosume less decor/spawn to be playable.

Realistically it would probably be more conservative to use use smaller maps so that the existent maps are only spawned into existence when someone is in them, thereby reducing overall server load. And since they will contain homes and such, there is bound to be a fair amount of decor going on.

On a side note: What role do Multi's play, and how do they differ from the buildings used to build towns? (In this case I refer specifically to the multi's used to build homes).
 

Rocko Wang

Wanderer
Multi is an invisible item controlling a group of items not much different from the static items you used to build static towns. If you don't freeze the static town into the map, you got almost the same number of item counts. If you use Knive's townhouse to make the static towns dwellable, then the difference is very minimal.
It is different though if you freeze the static town into the map. That would save you a lot of item counts. But in case you are doing instance, you may not be able to freeze them since you expect they are different for each instance (unless you want the house to look identical in each instance minus the decor).
That's why I think of the following preference of building house in terms of lowering server load:
build static house on static map, use knive's townhouse, freeze house into map > build static house on static map, use knive's townhouse, not freeze them = player build house on static map >= build static house on instanced map, no freeze = player build house on instanced map

The latter two will have overhead due to you can not use the default saving/loading routine. But if you really have to go the instance route, then that's what you have to deal with with care. Though to be honest, if you don't want the instance to expire (so players' house will not poof), somewhere on the static map still sounds like a better choice to me.
 

AodhanW

Wanderer
Rocko Wang;707407 said:
Multi is an invisible item controlling a group of items not much different from the static items you used to build static towns. If you don't freeze the static town into the map, you got almost the same number of item counts. If you use Knive's townhouse to make the static towns dwellable, then the difference is very minimal.
It is different though if you freeze the static town into the map. That would save you a lot of item counts. But in case you are doing instance, you may not be able to freeze them since you expect they are different for each instance (unless you want the house to look identical in each instance minus the decor).
That's why I think of the following preference of building house in terms of lowering server load:
build static house on static map, use knive's townhouse, freeze house into map > build static house on static map, use knive's townhouse, not freeze them = player build house on static map >= build static house on instanced map, no freeze = player build house on instanced map

The latter two will have overhead due to you can not use the default saving/loading routine. But if you really have to go the instance route, then that's what you have to deal with with care. Though to be honest, if you don't want the instance to expire (so players' house will not poof), somewhere on the static map still sounds like a better choice to me.

I believe Kamron indicated it is unnecessary for the items in the instance, including the house, to go 'poof'. That being the case, there is no reason to make it on the static map.

But I would not choose the static map, as I wish to have the houses as customizable as possible, the plots of land as well, hence no static houses on the instances. Additionally, there are things such as farming and such that I wish to do similar to the existing plant system, but with a 'farmland' plot similar to the existant customizable multies that will only accept 'plant seed' lockdowns.

Difficult to explain in short.. But I still believe that the Instances are the way to go. But I *TRULY* appreciate your input, its nice to have the voice of experience to turn to and say. "Ok.. Fine.. You were right.. NYAH!". ;)
 

Rocko Wang

Wanderer
Yeah they won't physically poof if you don't delibrately delete them, just if you have an instance expired, everything on that map will have their MAP value point to an invalid map, unless you move them somewhere else temporarily (an exit point, fall back to the blue print, works fine for a mob/player, but neither is very safe for something like a house)...
So that means you would never allow an instance someone created to expire (unless it is totally empty of player house). To not expire an instance (save everything in it, and upon server restart, reinitialize the map, and load stuff back into it), just makes the instance no difference to one of the 5 static maps. Sure you got more copies of the same map, as many as the code allows you. In my case, I can't stop thinking about the practical question though: is the player base really crowded to a point you really need more layers of maps, while the need could have been satisfied by somewhere on the 5 existing maps? :)
Of course technically all that you wanted to try are feasible. :) There is no limit to how fancy or creative you want to make it.
 

Rocko Wang

Wanderer
To create a copy of an existing map that never expires, I think (never tried it but you can give it a try), it would be as easy as to create an entry in MapDefinition.cs like this, then I think you don't have to worry about loading and saving.

Code:
RegisterMap( 5, 1, 1, 7168, 4096, 0, "TrammelDupe", MapRules.TrammelRules );

Also to be convenient, inside Map.cs under server folder, create
Code:
public static Map TrammelDupe { get { return m_Maps[5]; } }

Edit: if you use earlier version of UO, the third number would be 0, since map 1 was only introduced not too long ago.
 

AodhanW

Wanderer
Rocko Wang;707518 said:
I can't stop thinking about the practical question though: is the player base really crowded to a point you really need more layers of maps, while the need could have been satisfied by somewhere on the 5 existing maps? :)

Don't want houses on the primary map.. At all. And I'm moving cities off the primary map as well, or rather, when the custom map gets made, there won't be any cities on it. Just a square of strategically placed Teleporters that will move you from the 'primary' map to the one containing all the cities.

The reason for wanting to do things this way is to allow for a limitless supply of housing/farmland. Not that I *NEED* a limitless supply, simply because I'd like to have the security of knowing I'll never run out.

To not expire an instance (save everything in it, and upon server restart, reinitialize the map, and load stuff back into it), just makes the instance no difference to one of the 5 static maps. Sure you got more copies of the same map, as many as the code allows you.

The idea is for areas like the players home to not initialize until they go *INTO* it. So until its occupied, it doesn't exist.

Of course technically all that you wanted to try are feasible. :) There is no limit to how fancy or creative you want to make it.

I will admit much of this is a mental exercise ATM.
 

HellRazor

Knight
AodhanW;707576 said:
The idea is for areas like the players home to not initialize until they go *INTO* it. So until its occupied, it doesn't exist.

But the thing is, if you do each house this way it *WILL* exist. As an instance.

If you're planning on making each house an instance, once it is created, the instance will need to be saved. Otherwise the player won't be able to customize it or save anything inside it.

So in the long run, it will probably eventually end up putting a lot of stress on the server because every house will end up being a new instance of the map and be saved as such. Multiply that by the number of houses and I imagine it is going to start eating away at your system memory.

Instances by their very nature are intended to be temporary.

Now doing something like making one entire map for housing wouldn't even require instances, you could use one map as your "housing" map and then put your teleporters on the "non-housing" map.

I think, tho, in actual practice this isn't going to work very well. I think it will end up confusing your players who are used to just placing houses on the map.

You might also want to consider static houses (like kwill's Townhouse system), in which you just have pre-built houses that players can purchase.

In the end there really isn't such a thing as "unlimited housing" because you will always have some limits, whether it be physical map space or system resources like memory. I think using instances for housing is likely to not be worth the price in system resources you'll end up paying for a conveniance you really don't need.
 

Rocko Wang

Wanderer
AodhanW;707576 said:
Don't want houses on the primary map.. At all.

Technically that won't ever happen, because the client can only recognize one of the 5 primiary maps. Even if you use a cutoms map, you have to replace one of the 5 primary maps with it. You can not have the 5 primary map existing while adding a 6th map, and hoping the client will see the 6th map. In essense, your 6th map has to be one of the 5 primary map (index 0 to 4) to be recognizable by the client.

If your custom map is instead on part of the 5 OSI map, say, green acre of trammel, when you instance (technical term is, register a copy of) that particular portion of green acre, you are really instancing the whole trammel as well. You can not register a copy of a map that is smaller than the size of the map tied to the index (0-4) you choose to use. The boundary in this author's code only defines within which area the items got duped into the new instance. But you will have Britain, Yew and everything on your new instance, just they would be empty of any decor or mobs. You can ingore their existance as the players won't be able to access them if you dont allow them, but they exist on the new instance, and as a GM you can go there.

Anyway, I think I know what you mean. :) I am talking about one of the 5 maps the client will recognize (custom or OSI); you are instead talking about the actual OSI map. Sure you don't have to use them if you don't want to.
 

HellRazor

Knight
Rocko Wang;707592 said:
... when you instance (technical term is, register a copy of) that particular portion ...

Those aren't the same things. An "instance" is a temporary copy of an area that only certain players can enter. And then, when there is no more use for the "instance", it is deleted.

Registering a new map means that the map stays with the server and isn't deleted.

And I think this difference illustrates why (in UO anyways) instances aren't good for housing and housing areas. Instances are SIMILAR to registering a new copy of the map, but instances are intended to go away. You wouldn't want to register a new map for each house, just like you wouldn't want to create an instance for each house. (Although you might want to register a new map for use as a housing area).

You can't really compare it to 3D games like DAOC and other 3D games that have housing because their architecture is entirely different...everything from the way maps are stored to the client using 3D models instead of art items is different. Quite honestly, the way UO does it probably wouldn't work well for a 3D game like that either, even though it does work best for the way UO is designed.
 
Top