Trinitycore: [master] TC Zone Area Model Rework

Created on 9 Dec 2016  路  5Comments  路  Source: TrinityCore/TrinityCore

Description:
TrinityCore Zone Area system needs a rework with slight consistency update.

Current behaviour:
Currently TC uses Zones and Areas in Zone. And is ignoring the tertiary areas.
Or not handling the tertiary areas as part of Zone.

Expected behaviour:
Rename Examples:
Zone -> Area
Area -> SubArea
Tertiary Area (NYI) -> SubSubArea

OR

Zone -> Zone
Area -> Area
Tertiary Area (NYI) -> SubArea

OR

Zone -> Zone
Area -> SubZone
Tertiary Area (NYI) -> Area

But not only renaming it. Also the Core needs to handle the tertiary area as a part of the whole Zone.
This would make the definition of a Zone whole again.

Examples with seeable Subareas are:
Vashj'ir, Stranglethorn Vale, ALL starting areas

Branch(es):
master

TC rev. hash/commit:
bfa9a4c9597c748734836fa2293f1ccf9724dbba

TDB version:
703.00

Operating system:
Win 10 64x

Branch-master

Most helpful comment

Stranglethorn Vale is Zone 5339.
Inside this Zone there are 2 other zones.
Northern Stranglethorn (33) and Cape of Stranglethorn (5278).

Defining GY/condition for the Zone 5339 will not work, at least not for Cape. So you would need to assign Them to subzone

All 5 comments

Wrong, TC Area/Zone system based on AreaTable.db2 which already got 5500+ Area there is no any reason to support even smaller areas.

Stranglethorn Vale is Zone 5339.
Inside this Zone there are 2 other zones.
Northern Stranglethorn (33) and Cape of Stranglethorn (5278).

Defining GY/condition for the Zone 5339 will not work, at least not for Cape. So you would need to assign Them to subzone

FWIW, I like this convention:

Zone -> Zone
Area -> SubZone
Tertiary Area (NYI) -> Area

In terms of human thinking, the relationships are easy to understand. For example (using 3.3.5), The zone Stranglethorn Vale contains a subzone Northern Stranglethorn which contains an area called The Rebel Camp (which is a quest hub)

drop "zone" and "subzone" terms.
AreaTableEntry field name CLEARLY describes the relation ParentAreaID - its a tree. current zone+area pair assumes that tree max depth is always <= 2 which is clearly not the case.
There should only be 2 methods in WorldObject, no more zone bullshit

uint32 GetAreaId() { return current_area_id; }
bool IsInArea(uint32 areaId)
{
    // handle special case where both passed arg and object's current area are invalid but are the same
    if (areaId == current_area_id) 
        return true;

    // walk the area tree up to root
    AreaTableEntry const* area = sAreaTableEntry.LookupEntry(current_area_id);
    while (area)
    {
        // check if we found a match
        if (area->ID == areaId)
            return true;

        // check parent area
        area = sAreaTableEntry.LookupEntry(area->ParentAreaID);
    }

    // nothing was found
    return false;
}

Seems like deprecated

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Teppic1 picture Teppic1  路  3Comments

Rochet2 picture Rochet2  路  3Comments

Rushor picture Rushor  路  3Comments

Jonne733 picture Jonne733  路  3Comments

DDuarte picture DDuarte  路  3Comments