Engine reversing/exploration

Discussion in 'Fallout General Modding' started by Kanhef, Apr 25, 2009.

  1. phobos2077

    phobos2077 Vault Dweller

    Apr 24, 2010
    Well, it's very useful to me, since now I can actually understand how functions work and what calls what :)
    Of course 90% of code is nonsense, since there are many struct references, unnamed local varaibles, etc. But this 10% is better than 0.001% as it was before :D
  2. Falloutbunker

    Falloutbunker Brotherhood soldier

    Jan 3, 2017
    why are my action points 0ne instead of 10?
  3. QuantumApprentice

    QuantumApprentice Look, Ma! Two Heads!

    Feb 9, 2018
    Probably because
    "Drugs'r bad...mkay?"

    Jet will do that :P
  4. Cyrus

    Cyrus It Wandered In From the Wastes

    Nov 5, 2015
    I'm gonna post this here because I think it fits here best.

    As I've been meddling with modding and testing I've ran into a few things which if not mentioned before I think are useful to mention. My list of discoveries if you will.

    1. The debug_msg command has a character limit of somewhere between 260 to 270 characters. If you exceed it, you will get error. Which means, you can't have long error reports in a single debug_msg.

    2. The display_msg command is much longer. I tested with 1000 characters and it was fine. Seems it can handle much more than that.

    3. It seems throwing and unarmed do not take light level into consideration when calculating hit chances. I haven't tested all modes and all weapon.

    4. It seems burst mode is affected by light level for NPCs but single shot is not.

    5. in a multi target attack (burst) Afterhitroll hook is only called for primary target. Also explains why secondary targets have no critical hit. Critical hit or not hit is part of afterhitroll. The calculation for if and how secondary targets get hit happens in a different calculation.

    6. When a burst attack happens secondary targets are calculated first. So damage hook runs several times for them first and then afterhitroll is called for primary target and then damage hook is called for primary target. When all damages are calculated, then damage for primary target is printed first, then damage for secondary targets is printed. This is probably due to the "fixed" burst mode that is introduced in sfall which I have on. In a burst, there is 3 columns of bullet attack, each can be several bullets, each hitting a target. Sometime (often) a secondary target can get hit by all 3 columns. So firing a 10 bullet burst can end up hitting 7 bullets to the secondary target and 3 to the primary target (often the case). However these hits to the secondary target do not all happen in one stack. Damage hook can get called up to 3 times for the secondary target each time hitting 2 to 3 bullets. So the targets gets hit 3 times, each time with 2 or 3 bullets (for a 10 bullet attack; If a 40 bullet attack ,then more). So instead of damage hook being called once with lets say a 7 bullet hit, it gets called 3 times, each time with 2 or 3 bullets. Damage for each set is calculated separately and seems to be added together for the same target inside attack complex. This is relevant because if your mod has special considerations for the "first" bullet then the first bullet in a damage hook call may not actually be the first bullet. This also means that to give critical chance to secondary targets would require a different tracking system than afterhitroll.

    7. DR values can be set to negative inside proto files for critters however as soon as they are loaded they will be reset to 0 in memory (not in proto file). So not usable.

    8. One thing Atom didn't mention in his notes about knockback, multihex objects also have 0 knockback.

    .. And a few more things that I can't recall right now. Will add when they come to me.
    Last edited: Nov 15, 2020
    • [Rad] [Rad] x 1
  5. Cyrus

    Cyrus It Wandered In From the Wastes

    Nov 5, 2015
    9. The in-game display has a width of 54 chars. 53 or 54.
  6. Mr.Stalin

    Mr.Stalin Mildly Dipped

    Oct 29, 2015
    over the past two or three years, almost all the game mechanics in the engine have already been disassembled, nothing is difficult to download the game source database and read how it works.

    3 and 4 probably just seem :-)
  7. Cyrus

    Cyrus It Wandered In From the Wastes

    Nov 5, 2015
    Right. I figured anything I say is probably not new, but you never know until you say it. :smile:

    The wording of your sentence I didn't quite fully understand (I know english is second language for you :) , A for effort!). Are you refering to the drobovik database? Are you saying all game mechanics are documented there?
  8. NovaRain

    NovaRain Casual Modder Modder Moderator

    Mar 10, 2007
    No, it's the engine dump database. You need a copy of IDA Pro to open it.
  9. Cyrus

    Cyrus It Wandered In From the Wastes

    Nov 5, 2015
    Thanks for the link.

    And I suppose I need assembly knowledge to use?
  10. Mr.Stalin

    Mr.Stalin Mildly Dipped

    Oct 29, 2015