Forums WoW Modding Support Archives TrinityCore Discord Archives [DiscordArchive] how does phasing work? that the player enters another phase after sending a quest, for example? or N

[DiscordArchive] how does phasing work? that the player enters another phase after sending a quest, for example? or N

[DiscordArchive] how does phasing work? that the player enters another phase after sending a quest, for example? or N

Pages (5): 1 2 3 4 5 Next
rektbyfaith
Administrator
0
10-11-2022, 09:33 AM
#1
Archived author: Krutok • Posted: 2022-10-11T09:33:36.597000+00:00
Original source

how does phasing work? that the player enters another phase after sending a quest, for example? or NPCs appear then?
rektbyfaith
10-11-2022, 09:33 AM #1

Archived author: Krutok • Posted: 2022-10-11T09:33:36.597000+00:00
Original source

how does phasing work? that the player enters another phase after sending a quest, for example? or NPCs appear then?

rektbyfaith
Administrator
0
10-11-2022, 09:55 AM
#2
Archived author: <o> • Posted: 2022-10-11T09:55:42.641000+00:00
Original source

phasing is 100% a serverside concept.

in master this is more complicated, but in 3.3.5 players have a simple 32-bit number called a phase mask. when the player walks around in the world and the server thinks the player needs to see some creature or other player, it takes the players phasemask checks it against the creatures/other players mask with a binary comparison. If a single bit overlaps between the two numbers, the player can see the other entity.

These updates happen when players move around in the world or their phasemask changes.
rektbyfaith
10-11-2022, 09:55 AM #2

Archived author: <o> • Posted: 2022-10-11T09:55:42.641000+00:00
Original source

phasing is 100% a serverside concept.

in master this is more complicated, but in 3.3.5 players have a simple 32-bit number called a phase mask. when the player walks around in the world and the server thinks the player needs to see some creature or other player, it takes the players phasemask checks it against the creatures/other players mask with a binary comparison. If a single bit overlaps between the two numbers, the player can see the other entity.

These updates happen when players move around in the world or their phasemask changes.

rektbyfaith
Administrator
0
10-11-2022, 09:56 AM
#3
Archived author: <o> • Posted: 2022-10-11T09:56:18.621000+00:00
Original source

If a player changes phase and no longer sees a creature, the server simply despawns it for them just like it would if you went out of range of them, and similarly spawns it for them if they change phase and suddenly _can_ see the creature
rektbyfaith
10-11-2022, 09:56 AM #3

Archived author: <o> • Posted: 2022-10-11T09:56:18.621000+00:00
Original source

If a player changes phase and no longer sees a creature, the server simply despawns it for them just like it would if you went out of range of them, and similarly spawns it for them if they change phase and suddenly _can_ see the creature

rektbyfaith
Administrator
0
10-11-2022, 09:59 AM
#4
Archived author: Krutok • Posted: 2022-10-11T09:59:33.685000+00:00
Original source

<@787614711738138634>The best example is the event before Dalaran, where the phases change. You do a series of quests and suddenly you see an outpost, you do more quests and the undead aren't running around everywhere anymore. Last quest the tower is built and the undead are all dead and friendly NPCS are celebrating.

the question is how does it work?
rektbyfaith
10-11-2022, 09:59 AM #4

Archived author: Krutok • Posted: 2022-10-11T09:59:33.685000+00:00
Original source

<@787614711738138634>The best example is the event before Dalaran, where the phases change. You do a series of quests and suddenly you see an outpost, you do more quests and the undead aren't running around everywhere anymore. Last quest the tower is built and the undead are all dead and friendly NPCS are celebrating.

the question is how does it work?

rektbyfaith
Administrator
0
10-11-2022, 10:05 AM
#5
Archived author: <o> • Posted: 2022-10-11T10:05:40.065000+00:00
Original source

I don't know the exact numbers used there, but let's pretend that:

"The undead running around" consists of a few creatures that all have the phasemask 0x2 (in binary, 0b10)
"The outpost" consists of a few gameobjects that all have the phasemask 0x4 (in binary, this is 0b100)
"The tower + the dead undeads + the celebrating npcs" consists of a few gameobjects + creatures that all have the phasemask 0x8 (in binary, this is 0b1000)

When players first enter this area, the server decides that they haven't completed the quest so it sets the players phasemask to 0b11 (players typically _always_ have bit 1 set so they can always see other players, but if you didn't want this then you could instead set it to 0b10, here i will assume 0b11)

We now have four possible groups of objects the player might be able to see, and we use binary logic to check that.

The players 0b11 and the running undeads 0b10 has a single bit overlapping, the second bit, so the player can see the running undeads. 0b11 does not have any overlapping bits with either 0b100 or 0b1000, so they cannot see the outpost or the tower+dead unedads+celebrating npcs.

If the player completes the first quest, the server might be scripted to change the players phasemask to 0b101 instead. Now, they no longer have overlapping bits with the running undeads so all running undeads disappear. Instead, they overlap with the outpost, but not the final group.
rektbyfaith
10-11-2022, 10:05 AM #5

Archived author: <o> • Posted: 2022-10-11T10:05:40.065000+00:00
Original source

I don't know the exact numbers used there, but let's pretend that:

"The undead running around" consists of a few creatures that all have the phasemask 0x2 (in binary, 0b10)
"The outpost" consists of a few gameobjects that all have the phasemask 0x4 (in binary, this is 0b100)
"The tower + the dead undeads + the celebrating npcs" consists of a few gameobjects + creatures that all have the phasemask 0x8 (in binary, this is 0b1000)

When players first enter this area, the server decides that they haven't completed the quest so it sets the players phasemask to 0b11 (players typically _always_ have bit 1 set so they can always see other players, but if you didn't want this then you could instead set it to 0b10, here i will assume 0b11)

We now have four possible groups of objects the player might be able to see, and we use binary logic to check that.

The players 0b11 and the running undeads 0b10 has a single bit overlapping, the second bit, so the player can see the running undeads. 0b11 does not have any overlapping bits with either 0b100 or 0b1000, so they cannot see the outpost or the tower+dead unedads+celebrating npcs.

If the player completes the first quest, the server might be scripted to change the players phasemask to 0b101 instead. Now, they no longer have overlapping bits with the running undeads so all running undeads disappear. Instead, they overlap with the outpost, but not the final group.

rektbyfaith
Administrator
0
10-11-2022, 10:07 AM
#6
Archived author: <o> • Posted: 2022-10-11T10:07:49.138000+00:00
Original source

once the second quest is completed, the server might instead change the players phasemask to 0b1000. Now, it only overlaps with the final groups so the player can only see the final group.

If you for some reason wanted the player to see both the tower and the camp at the same time, you could instead change the players phasemask to 0b1100. This is what makes phasemasks so powerful, you can control exactly what combination of things in your area the player is supposed to see at any one time.
rektbyfaith
10-11-2022, 10:07 AM #6

Archived author: <o> • Posted: 2022-10-11T10:07:49.138000+00:00
Original source

once the second quest is completed, the server might instead change the players phasemask to 0b1000. Now, it only overlaps with the final groups so the player can only see the final group.

If you for some reason wanted the player to see both the tower and the camp at the same time, you could instead change the players phasemask to 0b1100. This is what makes phasemasks so powerful, you can control exactly what combination of things in your area the player is supposed to see at any one time.

rektbyfaith
Administrator
0
10-11-2022, 10:11 AM
#7
Archived author: Krutok • Posted: 2022-10-11T10:11:56.251000+00:00
Original source

Yes, but how do you create such quests? There is no option in the quest template that says put player in phaseX when the quest is complete. I found a video here, but this phase_area table doesn't even exist: https://www.youtube.com/watch?v=J3CJS3xsvOY
[Embed: #13 TrinityCore SQL - Event Phase Mask [3Server, WoW WoTLK, 3.3.5, CZ]]
Odkaz na 3Server: https://novy.3server.cz/
TrinityCore Atlassian(dokumentace): https://trinitycore.atlassian.net/wik...
Základní GM příkazy: https://3server.net/GM_prikazy.htm
https://www.youtube.com/watch?v=J3CJS3xsvOY
rektbyfaith
10-11-2022, 10:11 AM #7

Archived author: Krutok • Posted: 2022-10-11T10:11:56.251000+00:00
Original source

Yes, but how do you create such quests? There is no option in the quest template that says put player in phaseX when the quest is complete. I found a video here, but this phase_area table doesn't even exist: https://www.youtube.com/watch?v=J3CJS3xsvOY
[Embed: #13 TrinityCore SQL - Event Phase Mask [3Server, WoW WoTLK, 3.3.5, CZ]]
Odkaz na 3Server: https://novy.3server.cz/
TrinityCore Atlassian(dokumentace): https://trinitycore.atlassian.net/wik...
Základní GM příkazy: https://3server.net/GM_prikazy.htm
https://www.youtube.com/watch?v=J3CJS3xsvOY

rektbyfaith
Administrator
0
10-11-2022, 10:15 AM
#8
Archived author: <o> • Posted: 2022-10-11T10:15:39.217000+00:00
Original source

it's often done with area spell auras for blizzlike stuff, and you can filter things like area in smart scripts / conditions as well
rektbyfaith
10-11-2022, 10:15 AM #8

Archived author: <o> • Posted: 2022-10-11T10:15:39.217000+00:00
Original source

it's often done with area spell auras for blizzlike stuff, and you can filter things like area in smart scripts / conditions as well

rektbyfaith
Administrator
0
10-11-2022, 10:17 AM
#9
Archived author: <o> • Posted: 2022-10-11T10:17:01.579000+00:00
Original source

the `spell_area` table has most of what you need
rektbyfaith
10-11-2022, 10:17 AM #9

Archived author: <o> • Posted: 2022-10-11T10:17:01.579000+00:00
Original source

the `spell_area` table has most of what you need

rektbyfaith
Administrator
0
10-11-2022, 10:18 AM
#10
Archived author: Krutok • Posted: 2022-10-11T10:18:15.282000+00:00
Original source

you explained everything nicely what it does, but unfortunately you don't know how to create something like that.

Sure can create an npc and set phasemask to 2,3,4 or whatever the player will just never see the npc because he doesn't get into that phase.
rektbyfaith
10-11-2022, 10:18 AM #10

Archived author: Krutok • Posted: 2022-10-11T10:18:15.282000+00:00
Original source

you explained everything nicely what it does, but unfortunately you don't know how to create something like that.

Sure can create an npc and set phasemask to 2,3,4 or whatever the player will just never see the npc because he doesn't get into that phase.

Pages (5): 1 2 3 4 5 Next
Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)