Where do we set the movement info structure fields? menu

User Tag List

Results 1 to 11 of 11
  1. #1
    amadmonk's Avatar Active Member
    Reputation
    124
    Join Date
    Apr 2008
    Posts
    772
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Where do we set the movement info structure fields?

    Edit: ignore this. I realized that there are much better ways to try to reverse WoW's polygon cache, such as the TraceLine function, which by definition has to find various terrain intersections. Reversing it through a non-static like the movement fields is not a good choice.

    Edit2: looks like TraceLine is using D37E24 as a tri cache, but this can't be a global terrain cache because at one point we call qsort on it (sorting by distance from the intersect point, I'm thinking). The loop at 006C46E0->006C4924 is definitely scaling through this list 0xC bytes (three floats, one tri) at a time. There's no way we could be re-sorting the ENTIRE terrain cache for every TraceLine, is there? I wish I could get WoW live so I could look at the contents of D37E24 and how we source this information.

    Yeah, D37E20 is the count. Only thing I'm not sure of is who sets these, since IDA shows no meaningful xrefs to D37E20 or D37E24, and no writes at all (which makes no sense, since qsort would trap on null; so this has to be an IDA failure.)

    Edit3: looks like the actual structure is at D37E1C, as we use it as a "this" pointer in at least one place. I think that there's maybe a linked list of tri lists? afterwards. I'm guessing that this is maybe the current map tile?
    Last edited by amadmonk; 02-15-2011 at 01:10 PM.
    Don't believe everything you think.

    Where do we set the movement info structure fields?
  2. #2
    namreeb's Avatar Legendary

    Reputation
    668
    Join Date
    Sep 2008
    Posts
    1,029
    Thanks G/R
    8/222
    Trade Feedback
    0 (0%)
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    It's not necessarily a failure. You've probably found a portion of a class or something which is referenced relative to the class instance's location (as opposed to a direct global reference to the position in question). You just gave me a sweet idea, though. Perhaps we can use the data you refer to and generate a mesh from it, for purposes of local steering? Meshing an area that is 'really small', say in WoW terms 100 yard radius, would take probably < 10ms.

    Incidentally, have you just not been on MSN all week or is Pidgin acting up on me again?

  3. #3
    amadmonk's Avatar Active Member
    Reputation
    124
    Join Date
    Apr 2008
    Posts
    772
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh I got off IM since I was getting craptons of porn-spam bots. Bleargh. I'll logon.

    Yeah, meshing the local data -- if we can churn it into a small area of tris -- was exactly my intent I figured that we can use that for local steering and probably remesh it on-demand, since it's small enough. But of course, this requires actually GETTING to the data. My reversing skills are decent, but my XMM reversing skills -- not so much. However, I see a number of sqrt operations going on, and I pretty much never see those being used aside from in distance calcs, which is a hopeful thing.

    Edit: incidentally, looking at the TraceLine function makes me believe that the cached mesh data already stores all the flags needed to determine if the poly is water or air or lava or whatever. Talk about letting them do the work for you

    Now if only I could find a compact heightfield structure
    Don't believe everything you think.

  4. #4
    namreeb's Avatar Legendary

    Reputation
    668
    Join Date
    Sep 2008
    Posts
    1,029
    Thanks G/R
    8/222
    Trade Feedback
    0 (0%)
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Well I'm pretty sure that this is the method that ppather used. It's a stupid thing to do for overall navigation, but for local situational awareness (the sort where the corrections from straight-line pathing are "small"), it sounds perfect.

  5. #5
    jjaa's Avatar Contributor
    Reputation
    245
    Join Date
    Dec 2006
    Posts
    562
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by namreeb View Post
    Well I'm pretty sure that this is the method that ppather used. It's a stupid thing to do for overall navigation, but for local situational awareness (the sort where the corrections from straight-line pathing are "small"), it sounds perfect.
    Nah, IIRC PPather read the mpq's at runtime.
    EDIT: So i'm taking a look at traceline. 00D37E1C is the start of the structure. What your refering to seems to get set at 006C33AD
    Last edited by jjaa; 02-16-2011 at 03:26 AM.

  6. #6
    amadmonk's Avatar Active Member
    Reputation
    124
    Join Date
    Apr 2008
    Posts
    772
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So what's the mathematical formula for calculating the normal vector of a tri? I'm looking at CMovement__GroundNormal (006105D0 not rebased) and its child function GetGroundNormal (00610300). These might be fruitful for scaling into an in-memory tri list, since you have to figure out what your current tri is to get its normal, right?

    ---------- Post added at 10:08 AM ---------- Previous post was at 10:04 AM ----------

    Originally Posted by jjaa View Post
    Nah, IIRC PPather read the mpq's at runtime.
    EDIT: So i'm taking a look at traceline. 00D37E1C is the start of the structure. What your refering to seems to get set at 006C33AD
    I think that 6C33AD may either be a constructor-type function or a tri-list copy function, since there's a block of code in there that essentially zeroes everything out.

    Note to self: important to set comments on IDA's various auto-named float/double constants. I spent 10 minutes being excited about repeated uses of AB8348 before realizing it was just a double constant for 1.0, and we were just initializing a 4x4 identity matrix (in CMovement::GetPosition at 0041F400).

    Edit2: I *think* that the code block starting at 0061047A is where we're actually calculating the normal of the tri to return a ground normal. If someone could confirm this bit of floating-point code, I'd appreciate it. If so, we need to figure out where this tri comes from. I REALLY wish that I had the latest HexRays, with better SSE support...
    Last edited by amadmonk; 02-16-2011 at 11:59 AM.
    Don't believe everything you think.

  7. #7
    caowenyu's Avatar Member
    Reputation
    9
    Join Date
    Apr 2009
    Posts
    44
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the formula to caculate the normal vector is list x/|x|, where x is the vector and |x| is the length of it.

  8. #8
    schlumpf's Avatar Retired Noggit Developer

    Reputation
    755
    Join Date
    Nov 2006
    Posts
    2,759
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by caowenyu View Post
    the formula to caculate the normal vector is list x/|x|, where x is the vector and |x| is the length of it.
    Normalizing a vector is not the same as calculating a normal to a plane. For a convex polygon (such as a triangle), a surface normal can be calculated as the vector cross product of two (non-parallel) edges of the polygon.

  9. #9
    caytchen's Avatar Contributor
    Reputation
    138
    Join Date
    Apr 2007
    Posts
    162
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by caowenyu View Post
    the formula to caculate the normal vector is list x/|x|, where x is the vector and |x| is the length of it.
    Nope, thats for normalizing a vector, he is asking about calculating the normal of a plane given a triangle. Given three vertices A, B, C the normal vector of the plane they span would be the crossproduct of AB and AC or whatever other combination you prefer (given that they are independent).

  10. #10
    caowenyu's Avatar Member
    Reputation
    9
    Join Date
    Apr 2009
    Posts
    44
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks caytchen and schlumpf, you guys are right. to calculate the normal of a plane, get the vector from the cross product of the 2 edges' vector of a triangle, which is in the plane, then the normal of the vector is the normal of the plane, right?

  11. #11
    _Mike's Avatar Contributor
    Reputation
    310
    Join Date
    Apr 2008
    Posts
    531
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by caowenyu View Post
    thanks caytchen and schlumpf, you guys are right. to calculate the normal of a plane, get the vector from the cross product of the 2 edges' vector of a triangle, which is in the plane, then the normal of the vector is the normal of the plane, right?
    The resulting vector is the normal of the plane. There is no such thing as a normal of a vector. Did you perhaps mean to normalize the vector in to a unit vector?

Similar Threads

  1. [Question] How do i set the rates of XP and Loot?
    By Gadella in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 12-11-2007, 05:43 AM
  2. All renting or PLing etc. websites have the same info ..
    By Eskiimo in forum World of Warcraft General
    Replies: 1
    Last Post: 12-05-2007, 06:06 AM
  3. [Item set] The Mighty Tim [fun/godly] warlock set
    By weaselking1973 in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 11-04-2007, 02:33 PM
  4. where cna i locate the wowemu.exe folder?
    By Hinata_92 in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 09-02-2007, 08:58 PM
All times are GMT -5. The time now is 06:24 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search