Description: We need implement a way to change max visibility distance of a specific creature / game object
Something like: https://github.com/TrinityCore/TrinityCore/pull/18067
Current behaviour: We're stuck in default value
It need to bosses like Razorscale (3.3.5), Ragnaros (4.x), etc
Branch(es): 3.3.5
TC rev. hash/commit: d3d003d69e91fb9b019a06b0402acebae5d6d250
Closed issues #9205 and #9036 -- may contain useful comments.
Afaik you can see any creature / object at any distance in instances / PVP locations.
Fel Reaver should be active and visible in map 530(https://github.com/TrinityCore/TrinityCore/issues/9036#issuecomment-12618373)/.
Also maybe some creatures should be visible only in specific range, that's what your issue about.
Yes, you can see XT002 on Ulduar entrance
Afaik you can see any creature / object at any distance in instances / PVP locations
This doesn't seem to be the case for instances. I have seen multiple destory object packets in dungeons for alive units
Then you can control visibility by column in some table, for each map. It was implemented for private servers 8 years ago.
I don't think someone will test real values for each map on retail.
Im 99% sure its a limited list of ranges and not just "any" value - in which case i might have that list somewhere
and Lord Marrowgar's should be visible from entrance
It's a combined system, for example here you can see the boss, but you can't see normal mobs(second walking blue and two groups of mana wyrms).
But here you can see everything. Also those mobs are located only at the end of instance, so their visibility can be 250. Same for other parts of this and another instances, because in most cases some mobs are located only in specific place.
Same for Lord Marrowgar and everything before him, but in Lord Marrowgar's case 250 is not enough :)
So https://github.com/TrinityCore/TrinityCore/pull/18067 wasn't too bad as idea.
Infinite - well... you guess
Gigantic - 400 yards
Large - 200 yards
Normal - 100 yards
Small - 50 yards
Tiny - 25 yards
Does something like this work ok for you? Try and set Creatures distance_visibility to 5 (for very far), or '0' for tiny distance.
See:
https://gist.github.com/Langerz82/2173af5739f72b94d6d8f3ee1a5dce9f
Make a PR @Langerz82 :)
And again i don't like adding 1 column for few creatures.
@Aokromes then we have to replace MySQL with a NoSQL Database xD
@Aokromes the custom flag currently has limited amount of positions. Would you like me to create a new one which includes the walking on aggro flag?
Ignore his opinion, visibility deserves its own field
creature_addon looks a good place to me :)
flags_extra2 :trollface:
How much custom flags this system required? Can we use 500y where only 350y is enough? Or can we use 1000y where only 700y is required? Or 1500y instead of 1200y?
What can we do if we have only flag for 150y, but only 135y is required?
Normal - 100 yards
Small - 50 yards
Tiny - 25 yards
"Normal" handled by default currently, where "small" and "tiny" will be used? Is there any case?
Predefined values without knowing retail values has too many questions.
Could we just make the flags uint64?
Shauren what would you suggest to call visibility updates on them? Store them in a special container? Changing visiblity notifiers seems the wrong way. I'm talking about the unlimited (or above max grid size thing)
Somehow related to https://github.com/TrinityCore/TrinityCore/issues/16455
After https://github.com/TrinityCore/TrinityCore/pull/20725 visibility and active grid are no longer linked, each option could be activated alone.
Shauren pointed out on IRC, for each gameobjects type with "large" in data (templates, server\game\Entities\GameObject\GameObjectData.h) have gigantic view distance. So for example GAMEOBJECT_TYPE_BUTTON has large in Data5 and the gobs with int 1 (in DB, this is also sniffed data) should have gigantic view distance (400.0f). Same with GAMEOBJECT_TYPE_QUESTGIVER (Data9), GAMEOBJECT_TYPE_GENERIC (Data3), GAMEOBJECT_TYPE_TRAP (Data10), GAMEOBJECT_TYPE_SPELL_FOCUS (Data5), GAMEOBJECT_TYPE_GOOBER (Data13), GAMEOBJECT_TYPE_SPELLCASTER (Data 4), GAMEOBJECT_TYPE_CAPTURE_POINT (Data18).
I was looking into maybe add it in float WorldObject::GetVisibilityRange() const
but thats not the best place.
Here a complete list of visibility distance for game objects:
TrueInfinite - ?
Infinite - well... you guess
Gigantic - 400 yards
Large - 200 yards
Normal - 100 yards
Small - 50 yards
Tiny - 25 yards
GAMEOBJECT_TYPE_DOOR = 0
data9: Gigantic AOI
data10: Infinite AOI
GAMEOBJECT_TYPE_BUTTON = 1
data5: GiganticAOI
GAMEOBJECT_TYPE_QUESTGIVER = 2
data9: GiganticAOI
GAMEOBJECT_TYPE_CHEST = 3
data27: GiganticAOI
data28: LargeAOI
GAMEOBJECT_TYPE_GENERIC = 5
data3: GiganticAOI
data7: LargeAOI
GAMEOBJECT_TYPE_TRAP = 6
data10: GiganticAOI
GAMEOBJECT_TYPE_SPELL_FOCUS = 8
data5: GiganticAOI
GAMEOBJECT_TYPE_GOOBER = 10
data13: GiganticAOI
GAMEOBJECT_TYPE_MOTRANSPORT = 15
data10: TrueInfiniteAOI
GAMEOBJECT_TYPE_SPELLCASTER = 22
data4: GiganticAOI
GAMEOBJECT_TYPE_FLAGSTAND = 24
data10: GiganticAOI
data11: InfiniteAOI
GAMEOBJECT_TYPE_FLAGDROP = 26
data7: GiganticAOI
data8: InfiniteAOI
GAMEOBJECT_TYPE_CAPTUREPOINT = 29
data18: GiganticAOI
GAMEOBJECT_TYPE_DUNGEONDIFFICULTY = 31
data8: LargeAOI
data9: GiganticAOI
GAMEOBJECT_TYPE_NEW_FLAG = 36
data5: GiganticAOI
data6: InfiniteAOI
GAMEOBJECT_TYPE_CAPTURE_POINT = 42
data1: GiganticAOI
GAMEOBJECT_TYPE_GARRISON_SHIPMENT = 45
data1: GiganticAOI
data2: LargeAOI
GAMEOBJECT_TYPE_ARTIFACT_FORGE = 47
data1: LargeAOI
GAMEOBJECT_TYPE_UI_LINK = 48
data2: GiganticAOI
GAMEOBJECT_TYPE_GATHERING_NODE = 50
data15: GiganticAOI
data16: LargeAOI
For creature we can add VisibilityDistance on creature_template and creature_addon
VisibilityDistance = 0 Normal visibility distance from world conf
VisibilityDistance =1 Tiny - 25 yards
VisibilityDistance =2 Small - 50 yards
VisibilityDistance =3 Normal - 100 yards
VisibilityDistance =5 Large - 200 yards
VisibilityDistance =6 Gigantic - 400 yards
VisibilityDistance =7 Infinite - well... you guess
That is for cata and master, not for 335. 335 has only large. Which is 400.0f range aka GiganticAOI. Already tried to look into this but grid system isn't my friend.
I guess needs to be implemented just like:
https://github.com/lh-server/core/commit/a7f8c58c6077f1a57ad808428d06f113d30caa84
If anyone wants to port it.
For master (creatures):
LargeAOI - UnitFlags2 0x200000
GiganticAOI - UnitFlags2 0x400000
InfiniteAOI - UnitFlags2 0x40000000
We should start from this.
For master (creatures):
LargeAOI - UnitFlags2 0x200000
GiganticAOI - UnitFlags2 0x400000
InfiniteAOI - UnitFlags2 0x40000000
Can you check the unit flags 2 for the fel reaver on hellfire peninsula if he has such a flag to support your theory?
Fel Reaver has InfiniteAOI flag.
This is not my theory - took from:
https://github.com/TrinityCore/TrinityCore/blob/master/src/server/game/Entities/Creature/CreatureData.h#L65
https://github.com/TrinityCore/TrinityCore/blob/master/src/server/game/Entities/Creature/CreatureData.h#L116
For Fel Reaver UNIT_FIELD_FLAGS_2: 2048/2.869859E-42 on 3.3.5 and 4.3.4 https://paste2.org/JdcmUA2x
So as we can see here then, Fel Reaver does not have such a flag and thus this theory starts to crumble and is suspected to be invalid
I wrote master
Master is the same.
Yeah, you were right. I meant WoD world.
Atleast this can be implemented for gameobjects already. I haven't seen any flag for creatures as of yet. This could be custom and we don't have sniff data for this. Only the max range between you and the creature object can be checked i guess.
GAMEOBJECT_TYPE_DOOR = 0
data9: Gigantic AOI
data10: Infinite AOI
This could be wrong. Tested with rainbow bridge in trial of valor legion raid. data10 is 1 but gobject fade near the Odyn doors so not "infinite", more like 400y.
Maybe the client limits it? I doubt it tho.
The main problem with implementation might be the fact, that we cannot load/unload specific creature/gameobject without loading/unloading the whole grid. So the question is: does the Blizz use grids to load creatures/gameobjects?
i think they actually load zones, not specific area's (grids).
I was kinda working on enhancing this suggested system to support gameobjects as well and the grid system is clearly the prime evil on that one.
The core recognized the visibility ranges as I wanted them to be but they still got unloaded for some reason.
I think the grid system needs an overhaul so that it can decide between priorities.
With such an overhaul it would solve all grid issues without losing too much performance.
I think we should drop grid system entirely, add mobs to map (just like we do this now) and only play with visibility range of every creature/gameobject, so it will decide whenever make this object visible and do its stuff (waypoints, ai, creation). Grid system is too static.
According test:
all test in the same game screen settings: set the visible range to the farthest.All settings are highest.
Well, the grid system is necessary for performance's sake. You can see that if you disable grid unloading the startup time as well as the overall performance is beyond terrible. It is important to keep that system running to prevent performance loss. Some tasks just need to be handled independently. For example like showing creatures and movement and keep everything else at grid range so that the core does not need to handle everything when its not needed at all.
@qyh214 not to forget that players in a pvp instance are visible from the end of the map...
d1c3ee9
Most helpful comment
I think we should drop grid system entirely, add mobs to map (just like we do this now) and only play with visibility range of every creature/gameobject, so it will decide whenever make this object visible and do its stuff (waypoints, ai, creation). Grid system is too static.