Implementing: Instancing
Posted: Thu Oct 06, 2011 10:10 pm
Scat, since we've talked about this before, and I know you started planning some things out, let's talk about any details here for implementing Instanced zones.
The reason this is coming up (from me) right now is that I am re-doing the Zones tables while populating some zones for Content, and realized we definitely could trim a ton of fat off our Zones tables if Instancing were available.
Now, I am not talking about full on, raid zones or housing. I simply mean, /zone WorkshopEvil and it will use a single (parent) tradeskill_workshop zone entry and append the specific (child) details to make a virtual zone.
What I have done so far, is tore the `zones` table apart. In Zones, all there is are these fields:
Those are the parent zone records. I've also created zone_details:
which has all the more unique values per zone in it (just like characters + character_details, etc).
What I want to create now is a zone_instances table (just an example):
which points to the `zones`.`id` record as a parent, so it knows what File to launch. Then we can set the instance name (for the /zone command) and the description (for screen display while zoning in). I figure the other instance-related fields from zone_details can come to this table, or another one which configures the actual running instance later (see Image's `instances` table idea).
This is where I am falling down. I am not sure how to offer an "instance /zone Name" that overrides the parent /zone Name. Unless..... because only GMs would ever use /zone Instance, maybe we can have a new command /instance DartharsLair instead of /zone? And our scripts that zone players around can be told to handle them any way we choose?
Again, I do not want to get hung up on details of raids, lockout timers or any of that... just get me to be able to /zone into the same file for Queen's Colony, only this time, it's Darthar's Lair (or whatever).
Does this make sense?
I kinda would like to do this before going any further with spawn pops, because spawn IDs are related to their zone_id, and if we're going to change things here, I'd rather not repop again later.
Get yer thinkin cap on!
The reason this is coming up (from me) right now is that I am re-doing the Zones tables while populating some zones for Content, and realized we definitely could trim a ton of fat off our Zones tables if Instancing were available.
Now, I am not talking about full on, raid zones or housing. I simply mean, /zone WorkshopEvil and it will use a single (parent) tradeskill_workshop zone entry and append the specific (child) details to make a virtual zone.
What I have done so far, is tore the `zones` table apart. In Zones, all there is are these fields:
Code: Select all
CREATE TABLE `zones` (
`id` int(11) unsigned NOT NULL auto_increment,
`name` varchar(64) collate latin1_general_ci NOT NULL default '',
`file` varchar(64) collate latin1_general_ci NOT NULL default '',
`description` varchar(255) collate latin1_general_ci NOT NULL default '',
`zone_type` tinyint(3) unsigned NOT NULL default '0',
`login_checksum` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `ZoneNameIDX` (`name`),
KEY `ZoneDescIDX` (`description`),
KEY `ZoneFileIDX` (`file`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ciCode: Select all
CREATE TABLE `zone_details` (
`id` int(10) unsigned NOT NULL auto_increment,
`zone_id` int(11) unsigned NOT NULL default '0',
`safe_x` float NOT NULL default '0',
`safe_y` float NOT NULL default '0',
`safe_z` float NOT NULL default '0',
`safe_heading` float NOT NULL default '0',
`underworld` float NOT NULL default '-1e+006',
`xp_modifier` float NOT NULL default '0',
`min_recommended` tinyint(3) unsigned NOT NULL default '0',
`max_recommended` tinyint(3) unsigned NOT NULL default '0',
`always_loaded` tinyint(3) unsigned NOT NULL default '0',
`city_zone` tinyint(3) unsigned NOT NULL default '0',
`min_status` int(10) NOT NULL default '0',
`min_level` int(10) NOT NULL default '0',
`max_level` int(10) NOT NULL default '0',
`start_zone` tinyint(3) NOT NULL default '0',
`instance_type` tinyint(3) NOT NULL default '0',
`default_reenter_time` int(10) unsigned NOT NULL default '0',
`default_reset_time` int(10) unsigned NOT NULL default '0',
`default_lockout_time` int(10) unsigned NOT NULL default '0',
`force_group_to_zone` smallint(5) unsigned NOT NULL default '0',
`lua_script` varchar(255) collate latin1_general_ci default '',
`shutdown_timer` int(10) unsigned NOT NULL default '300',
`zone_motd` varchar(250) collate latin1_general_ci default '',
`ruleset_id` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `ZoneDetailsIDX` (`zone_id`),
CONSTRAINT `FK_zone_details` FOREIGN KEY (`zone_id`) REFERENCES `zones` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ciWhat I want to create now is a zone_instances table (just an example):
Code: Select all
CREATE TABLE `zone_instances` (
`id` int(10) unsigned NOT NULL auto_increment,
`parent_zone_id` int(10) unsigned NOT NULL default '0',
`instance_name` varchar(64) collate latin1_general_ci NOT NULL default '',
`instance_description` varchar(64) collate latin1_general_ci NOT NULL default '',
`instance_shutdown` int(10) unsigned NOT NULL default '300',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ciThis is where I am falling down. I am not sure how to offer an "instance /zone Name" that overrides the parent /zone Name. Unless..... because only GMs would ever use /zone Instance, maybe we can have a new command /instance DartharsLair instead of /zone? And our scripts that zone players around can be told to handle them any way we choose?
Again, I do not want to get hung up on details of raids, lockout timers or any of that... just get me to be able to /zone into the same file for Queen's Colony, only this time, it's Darthar's Lair (or whatever).
Does this make sense?
I kinda would like to do this before going any further with spawn pops, because spawn IDs are related to their zone_id, and if we're going to change things here, I'd rather not repop again later.
Get yer thinkin cap on!