Vedir’s Dogma case study

Results 1 to 2 of 2
  1. #1
    Member feanturi is offline
    Mar 2018 Join Date

    Vedir’s Dogma case study

    Vedir’s Dogma case study
    For a couple of days now I'm trying to figure out what's wrong with Vedir’s Dogma (Dark Knight's skill) and the longer I dig the more problems I find. Nothing makes sens - from orders coming from the client, to missing configuration, to apparently random buffs, and finally to erratic behavior. Right now I think it's just completely broken...

    So, I'm guessing that toggle skills are just not (fully) implemented yet? I could just add a code for that but I figured it'll be better to ask to not reinvent a wheel.

    That said, here's what I come up with...

    Chapter 1 - Client sent what...?!
    The very first problem appears right away when it turns out that when you press a skill button on the client server actually executes 2 skills, one after another. One is Skill Id 2258, which is actually alright, according to bddatabase, at least. The second skill is Skill Id 2298, which is... Evasion? It kinda looks like the dodge roll that's executed with double-tap on movement keys, but it's not actually that. At first I though that maybe it's supposed to be a hack to give this skill an armor, but nope - it's even stranger than that.

    Chapter 2 - A buff... Yeah, right.
    At this point you would think that Skill 2258 is actual Vedir’s Dogma (with all relevant mechanics) and nameless Skill 2298 is... something else, whatever it supposed to be. Since the mechanics of Vedir’s Dogma say that player character should get +20% damage and -20 MP degen I started by looking into effects that Skill 2258 applies.

    For those who don't know how it works, a skill can apply an number of effects. An effect is described by type (what changes it causes) and a value (how strong the applied change is). In theory, Vedir’s Dogma should apply 2 effects - damage increase and MP degen. Now, the twist - Skill 2258 only apply 1 effect. And it's neither one of the described.

    Skill 2258 applies a Buff with Id 9247. This is a transformation effect (ModuleBuffType.TRANSFORMATION). What a transformation effect do, you ask? Well... I don't know, actually :D I don't think it's relevant to the Vedir’s Dogma. I may be wrong, though.

    In any case, I figured it's time to take a look at this second, mysterious skill. And right of the bat, skill 2298 does apply 5 effect!

    Buff Id Type Value

    9250 buff is a dispelling buff - one that is supposed to remove 9249 (or actually any buff with Group = 550, but that's only 9249 anyway), but those should be called alternatively, not at the same time.
    And those speed modifiers you see - those are copied from the skill that consumes Black Spirit energy.

    ... Yeah, right.

    Chapter 3 - It kinda-sorta makes sens, but not really.
    Alright then. At this point we have a client that sends multiple skills when single one would be expected, quite strange set of buffs configured in database and a broken Vedir’s Dogma, which applies MP degen but does not apply damage increase, replacing it with super speed boost for free. On top of that, while Vedir’s Dogma is configured in DB to be Toggle skill, this is not implemented in at all. The flag is set in DB, but it's never read into the server and there don't seems to be any mechanics to handle toggle skills at all.

    The bottom line appears to be that... everything is broken :D Now, the real question here is whether that there is some kind of greater design that I'm just not able to notice, or all this is just waiting to be fixed.
    If this is just a bug, though, it seems that there's a lot of codding to be done to support toggle skills in the first place. And maybe an edit of DB would be best - just to change strange configuration of Vedir’s Dogma skill. Are there any "official" channels of distribution for such big change? It would include new DB, I guess...

    So, while I can handle codding, could someone explain how would community proffered for this to be handled?


    P.S.: ...Yes, I got a bit frustrated while figuring all this out. How can you tell? ;)

  2. #2
    Member FactoryOwner is offline
    Sep 2009 Join Date

    Re: Vedir’s Dogma case study

    To be able to "dig in" and find the exact cause you'll first and foremost need to do reverse enginnering work.
    The server is receiving packets from the client, analyzing a packet, forming a new one and sending back on a circular endless route.
    If you want to really grasp what's going on under the hood the best would be to either use a packet sniffer such as wireshark and decrypt
    the packet data that is transmitted, OR, use tools such as IDA pro to rebuild the packet structures.
    once you rebuild the packet structure you're more likley to understand what exactly is the problem.
    if you look closely at the ogre fest source you'll see that sometime when creating a new packet object they're filling it with empty data.
    why? because the size of server packet must match to client packet to successfully be received in client.

    "At this point we have a client that sends multiple skills when single one would be expected"
    TLDR; spend your time wisely. find and map out the entire client packet data structures, the reason for sending multiple skills can be directly related
    to the packet structure OR to client logic. if you really want to find the cause you must dig under the hood.