|
||
|
|||||||
| Other Cant find a category above, use this one! Core mods not listed above go here! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
The noob formerly known as Jakob
Join Date: Jan 2005
Posts: 316
|
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. |
|
|
|
|
|
#3 (permalink) |
|
UO Gamers: Divinity Seer
Join Date: Oct 2003
Age: 23
Posts: 790
|
Instances have all sorts of great uses, from "adventure" type Dungeons, where you fight
your way down, to Duel Arenas. (Those "challange system") Where you can have your own arena with minimal lagg caused by bistanders and no waiting in lines. |
|
|
|
|
|
#4 (permalink) |
|
Connection Reset by Peer
Join Date: Jan 2003
Posts: 676
|
I've got a brilliant use for this.
I've been trying to make a good single player RPG from UO for a while, and I needed a way to do multiple copies of Trammel on the fly, but never really attempted coding it. This gives me all the code I need, I just need to rewrite the way it saves ![]() |
|
|
|
|
|
#6 (permalink) |
|
Forum Expert
Join Date: Sep 2002
Age: 23
Posts: 1,472
|
I did something similar before, although with a different approach. My method was an Array of "InstanceMap", that were basically Item/Mobile lists. When sending new Mobile/Effect/Item data, I checked wether the emitting object was in the same InstanceMap as the destination object.
|
|
|
|
|
|
#7 (permalink) | |
|
The noob formerly known as Jakob
Join Date: Jan 2005
Posts: 316
|
Quote:
It's just too much modification (imo) for a script that isn't even a part of the official release. |
|
|
|
|
|
|
#9 (permalink) |
|
Forum Expert
|
So, what happens? I'm gonna run a few senarieo's by ya, I want to know what would happen.
Player a runs in, player b runs in afterwards. player a leaves, player b leaves player b comes back in, player a comes back in In order, would player b then see player a's instance? Or is it seralized per player? Next: Player a runs into instance a, player c runs into instance c player b leaves, player a leaves, player a runs back in, does he still see player b's instance? last: Player a is in party with player c. Player a runs into instance a, player c runs into instance b. player c runs into (a) instance a or (b) instance c. Which is it? This reminds me of guildwars... ![]()
__________________
Procrastinators unite!
Tomorrow. Saying that Java is nice because it works on all OS's is like saying that anal sex is nice because it works on all genders. ![]() |
|
|
|
|
|
#10 (permalink) | |
|
The noob formerly known as Jakob
Join Date: Jan 2005
Posts: 316
|
Quote:
This can be solved by giving the instance a Reset() method that deletes all corpses and reset all spawners (providing all items are decoration only). |
|
|
|
|
|
|
#11 (permalink) | ||||
|
The noob formerly known as Jakob
Join Date: Jan 2005
Posts: 316
|
Quote:
If you set it per player: Quote:
Quote:
Quote:
|
||||
|
|
|
|
|
#12 (permalink) |
|
Forum Expert
|
Also, the instance would work off of frozen items as well, correct? Once again, pretty neat script.
__________________
Procrastinators unite!
Tomorrow. Saying that Java is nice because it works on all OS's is like saying that anal sex is nice because it works on all genders. ![]() |
|
|
|
|
|
#13 (permalink) |
|
Join Date: Dec 2004
Location: Sweden
Posts: 117
|
Ok, i dont know if you still support this script, but il ask a question anyways.
The core, would you like to me more exact? i do not got a Item.cs (do you mean BaseItem.cs?) and neither one of those other Core scripts. would be cool if some one told me how to replace these files and replace with what.. realy nice idea btw |
|
|
|
|
|
#15 (permalink) |
|
The noob formerly known as Jakob
Join Date: Jan 2005
Posts: 316
|
The core is the Server.exe executable you click when starting RunUO. You need to get the source code for that to be able to do this thing, and it doesn't seem like yuo can download that atm.
And like XxSP1DERxX said, it was just a quick example of the idea that works, but it's not very pretty at all, and it's not really supported. |
|
|
|
|
|
#17 (permalink) | |
|
Forum Expert
|
Quote:
Why don't you make it so you can choose to only copy a specified area? (i'm loving my scenarios today...) Say you got your map (splats map down on table)... It has towns, cities, and stuff... Copying all that makes massive lag... Copying a SPECIFIED area creates less lag... Copy I dunno... (0, 0) to (500, 500)... Not all of (0, 0) to (6112, 4096)... We see what i'm getting at? (I hope... if you don't I dunno how to explain it more... :P) -Aiden
__________________
|
|
|
|
|
|
|
#18 (permalink) |
|
Forum Expert
Join Date: Jan 2004
Location: England
Age: 20
Posts: 442
|
I know this is an old thread so sorry if a Mod feels that I am digging it up.
However I've just started to play around with this, it looks exactly what I need for the project that I want to undertake. So first a big thanks to Jakob from me for his hard work in creating this. Instead of copying the core files and replacing my old Core files I wanted to merge Jakob's changes with my current Core files. His instructions and commenting was great to help me find all his core changes, however there was only one bit that was missed out so this post is to correct this and help any others if they encounter the same problem. I encountered this compile error: 'Server.Map' does not contain a definition for 'Index' To fix this: In Map.cs you will need to find these two methods: Code:
public static Map[] GetMapValues()
{
CheckNamesAndValues();
return m_MapValues;
}
Code:
public static Map Parse( string value )
{
CheckNamesAndValues();
for ( int i = 0; i < m_MapNames.Length; ++i )
{
if ( Insensitive.Equals( m_MapNames[i], value ) )
return m_MapValues[i];
}
try
{
int index = int.Parse( value );
if ( index >= 0 && index < m_Maps.Length && m_Maps[index] != null )
return m_Maps[index];
}
catch
{
}
throw new Exception( "Invalid map name" );
}
Code:
// Jakob's instances
public int Index
{
get
{
for (int i = 0; i < m_Maps.Length; ++i)
if (m_Maps[i] == this)
return i;
return -1;
}
}
// end instances
Code:
public static Map[] GetMapValues()
{
CheckNamesAndValues();
return m_MapValues;
}
// Jakob's instances
public int Index
{
get
{
for (int i = 0; i < m_Maps.Length; ++i)
if (m_Maps[i] == this)
return i;
return -1;
}
}
// end instances
public static Map Parse( string value )
{
CheckNamesAndValues();
for ( int i = 0; i < m_MapNames.Length; ++i )
{
if ( Insensitive.Equals( m_MapNames[i], value ) )
return m_MapValues[i];
}
try
{
int index = int.Parse( value );
if ( index >= 0 && index < m_Maps.Length && m_Maps[index] != null )
return m_Maps[index];
}
catch
{
}
throw new Exception( "Invalid map name" );
}
|
|
|
|
|
|
#19 (permalink) |
|
Forum Expert
Join Date: Jan 2004
Location: England
Age: 20
Posts: 442
|
After some more playing with this I noticed that when the world saved it crashed during Serialization of Mobiles.
So I did some error checking using Console.WriteLine and narrowed it down to m_LogoutMap being null during Serialization. This caused crashes because it checks m_LogoutMap.IsInstance, during Serialization and because m_LogoutMap was null it couldnt check the IsInstance and caused a null object reference crash. The fix for this is to find the following code in the Serialize method of Mobile.cs: Code:
//writer.Write( m_LogoutMap );
if (m_LogoutMap.IsInstance && m_Player) // Jakob's instance implementation
writer.Write(m_LogoutMap.Parent); // TODO: Better "kick" method that prevent break-ins and such (move to last location?)
else
writer.Write(m_LogoutMap);
Code:
//writer.Write( m_LogoutMap );
if (m_LogoutMap != null && m_LogoutMap.IsInstance && m_Player) // Jakob's instance implementation
writer.Write(m_LogoutMap.Parent); // TODO: Better "kick" method that prevent break-ins and such (move to last location?)
else
writer.Write(m_LogoutMap);
|
|
|
|
|
|
#24 (permalink) |
|
Forum Novice
Join Date: Aug 2007
Age: 31
Posts: 120
|
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'. |
|
|
|
|
|
#25 (permalink) |
|
Newbie
Join Date: Jan 2004
Posts: 98
|
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.
|
|
|
|