Instances Experiment
Before you do anything, read this whole post (especially the last part). This is not for beginners.
First off, what is an instance?
An instance alone is not different from any place anywhere. However there can be several instances of the same area which adds a lot of possibilities! Multiple people can be in seemingly the same area but without bumping into eachother. This is not only cool but also an upcoming feature of some UO:ML dungeons and I just had to give it a shot.
How it works
Everytime an instance is created is makes a new map. This map is derived from another map and it gets all the properties that the "master map" had as of looks and basic rules. When the instance is removed the entire map with all items and mobiles is removed.
This one of the easiest way to do instancing, but not necessarily the best.
Alrighty, how do I get to instanciating?
InstanceTeleporter options
More about the instances
Known issues
Fix list
13 aug. First release.
Some more info...
I mark everything I modify in the core with // Jakob's instance implementation
The code is not very well commented, but I try to keep it simple enough for most people to follow what's going on.
Special thanks to..
Asayre8 for sharing some thoughts on instancing
Xavier for helping me test the scripts
This system is in no way ready for use on a production shard. It may (read probably will) cause some irregularities on your shard. DO NOT use it for anything other than playing around with as of now. I created this as an experiment and you are more than welcome to help fixing it into something stable, but again, please do not use this on a regular shard right now.
Before you do anything, read this whole post (especially the last part). This is not for beginners.
First off, what is an instance?
An instance alone is not different from any place anywhere. However there can be several instances of the same area which adds a lot of possibilities! Multiple people can be in seemingly the same area but without bumping into eachother. This is not only cool but also an upcoming feature of some UO:ML dungeons and I just had to give it a shot.
How it works
Everytime an instance is created is makes a new map. This map is derived from another map and it gets all the properties that the "master map" had as of looks and basic rules. When the instance is removed the entire map with all items and mobiles is removed.
This one of the easiest way to do instancing, but not necessarily the best.
Alrighty, how do I get to instanciating?
- Download the files here and either overwrite or merge with the existing ones. (Item.cs, Map.cs, Mobile.cs and World.cs go into the core, the rest into your custom scripts folder)
- Compile your new core and start your server
- Decorate the "instance blueprint". All instances will look like this area. Keep in mind that if you want mobiles you need to put spawners instead of actual mobiles. And yes, XmlSpawner is supported (if you uncomment some code in Instances.cs.) And don't forget the exit teleporters! They can be any kind of teleporters or gates or whatever. The important thing is that they have a "real" map as target and not an instance.
- Add an InstanceTeleporter
- Setup your teleporter (see below for options)
- Play around with it.
- Report all bugs here!
InstanceTeleporter options
- InstanceID: when you have multiple teleporters that have the same target you want to specify the same InstanceID in all of them
- InstanceType: do you want one instance for every player, every party or every guild?
- Bounds (X1Y1 and X2Y2): Area from where to copy items to the new instance. When you have multiple teleporters that have the same target you want them all to have the same bounds to avoid weirdness
More about the instances
- Instances decay 10 minutes after the last player leaves it. If any player comes back it will reset the timer.
Known issues
- Pets will be deleted if they are in the instance when it decays
- If players are saved in an instance they will pop up in the "blue print" on next server load
- Almost no speed or resource optimizations
- If you enter a party instance you can't re-enter if the party would dissolve for some reason. The same goes for guild instances.
- A region needs to be added to the newly created instance to prevent people from marking runes, walking outside the bounds etc.
Fix list
13 aug. First release.
Some more info...
I mark everything I modify in the core with // Jakob's instance implementation
The code is not very well commented, but I try to keep it simple enough for most people to follow what's going on.
Special thanks to..
Asayre8 for sharing some thoughts on instancing
Xavier for helping me test the scripts
This system is in no way ready for use on a production shard. It may (read probably will) cause some irregularities on your shard. DO NOT use it for anything other than playing around with as of now. I created this as an experiment and you are more than welcome to help fixing it into something stable, but again, please do not use this on a regular shard right now.