Open matukaa opened 7 years ago
in my sniffs, the frozen orb areatrigger does not have this flag
Yes, you are right, it does not, it was just a random example, but since we have a "Flags" column in area_trigger_template, we can set that flag for anything we'd like. I'm not really concerned about the client-side implications for setting the flag or not, my main problem is that currently we have no option to make an areatrigger follow terrain. Even if it's not set in blizzard sniffs, if you cast the spell, the orb perfectly follows terrain. In the current implementation, sending the trigger 40 yards forwards will make it to pass through terrain, walls, basically everything. I could come up with a solution for individual triggers (manually generate the path in OnInitialize hook and use that), but I would like to have something a lot more general, even for areatriggers that have more complicated splines than go 40 yards directly forwards. Setting the flag does not really do anything client-side from what I saw by doing some tests, since we actually have to send the spline points anyway, and server-side those are generated in a straight line as of now, following the caster's orientation. No terrain, etc are taken into account
Tl;dr: if you think that there would be complications for setting that flag for triggers that do not have them on blizzard, I would still like something (maybe a custom flag? dunno) that could handle generating splines that follow terrain
if the flag is not present in sniff, it should not go into db
did you even tried to set path in spell_areatrigger_splines table? it takes ground into account
Yes I did try it.
I am aware that you did use UpdateAllowedPositionZ(spline.x, spline.y, tempZ);
when calculating path, which most of the cases is okay-ish, but I am talking about steeper terrain. In the video I attached, the terrain is even walkable, so it's not that steep, but frozen orb should follow even unwalkable terrain.
Captured 2 minutes ago on my local server: https://www.youtube.com/watch?v=CcsuHMnVSuA
Additional info: I tried scripting several areatriggers with splines, but using UpdateAllowedPositionZ caused several issues: sometimes z was set to an incredibly high negative number, making my client lose all fps (in the yt video you can see that my PC is actually rather good, and yet when using UpdateAllowedPositionZ, I got invalid coordinates, which were sent to the client, so my fps dropped to like 10-15 :( ). Please do not take this issue as some kind of offensive stuff, I am not here to flame, I deeply appreciate the current implementation of the whole areatrigger system that you created :) I just wanted this addition, so we can handle generally the "follow terrain" thingy.
@matukaa : The way that orb moved into the rock looks similar to how my hunter pets (and often minions) behave on current 3.3.5. Also reminds me of how pets can't handle transport surfaces. (sorry if this is too much unrelated info)
-- Entry! (not spell misc), Index, X, Y, Z, VerfiedBuild
(12740, 16, 41.69012, -0.4806273, -0.5579126, 22522),
(12740, 15, 41.69012, -0.4806273, -0.5579126, 22522),
(12740, 14, 39, -3.005264E-05, -1.996704, 22522),
(12740, 13, 36, 2.472237E-05, -1.91687, 22522),
(12740, 12, 33, 1.661626E-05, -1.390991, 22522),
(12740, 11, 30.00001, 8.510155E-06, -0.916626, 22522),
(12740, 10, 26.99999, 3.627318E-06, -1.095093, 22522),
(12740, 9, 24, -4.478791E-06, -1.511353, 22522),
(12740, 8, 21, -1.25849E-05, -1.831543, 22522),
(12740, 7, 17.99999, -1.746774E-05, -1.996704, 22522),
(12740, 6, 15, -2.557385E-05, -1.958496, 22522),
(12740, 5, 12, 2.920116E-05, -1.570557, 22522),
(12740, 4, 9.000003, 2.109505E-05, -0.8094482, 22522),
(12740, 3, 6.000007, 1.298895E-05, -0.4459229, 22522),
(12740, 2, 2.999996, 8.106109E-06, -0.4329834, 22522),
(12740, 1, 0, 0, 0, 22522),
(12740, 0, 0, 0, 0, 22522),
try to use these coordinates, these are calculates from sniff, you see x is always a multiple of 3, the y values are nearly zero (calc inaccuracies), and set z to zero
@tkrokli you are mixing 2 totally different things
My first idea was the same: split 0,0 -> 40,0 to have a step of 2 (I tried initially with 20 indexes, now I tried with your data as well), but sadly I get the same result. As long as the terrain is not too steep, it is working perfectly, the more indexes you put, the better, but even like this, my trigger goes straight through everything if the terrain gets steep enough :(
https://www.youtube.com/watch?v=b7j_3jqo2Ew
Also, don't we use SpellMiscId as primary key in the spell_areatrigger_table? (in the video i just show actual entry, but I wasn't sure which one to use, so I have inserted the same data for both 8661 (miscid) and 12740 (areatriggerid))
yes, pk is misc, that sql was generated by my old parser which got lost because of a providers fault
just a minor info I forgot about: I did try both with and without mmaps generated, not sure if it should help or not, but it's exactly the same with or without them
Thanks for the info. Fair point, even though I suspected it to be the case.
I did the implementation using mmaps I don't know if is the correct way of fix, but work perfectly?? I'm thinking in make a PR, but need some info here because I don't have any sniff of some areatrigger with that flag
Description:
Currently AREATRIGGER_FLAG_HAS_FOLLOWS_TERRAIN has the NYI comment in the core (thus not working at all)
Current behaviour:
When you send an areatrigger with a spline (for example you set x1 = 0, x2 = 20, thus sending the trigger 20 yards directly forwards from the caster's position and orientation) it will go through terrain. For example if a hill is in front of you, the trigger will simply ignore terrain and pass through it.
Expected behaviour:
Using AREATRIGGER_FLAG_HAS_FOLLOWS_TERRAIN we should be able to generate path for the areatriggers so that they properly follow the terrain.
Steps to reproduce the problem:
Branch(es):
master
TC rev. hash/commit:
https://github.com/TrinityCore/TrinityCore/commit/6c60dddbc6fbc8b5179dc4c763054edc7ad487bd
TDB version: 7.x
Operating system: Win64