Engine reversing/exploration

Yes, the site you linked gives an IDA script to populate Mapper symbols.
It's worth noting that the pseudocode is fairly useless for all but small, contained branches, or for getting a five-foot overview. It doesn't seem to like the calling convention that the game uses. (For the record, I don't either. The code Watcom generated is absolutely terrible by today's standards. It annoys me to read it.)

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
 
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:
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 :-)
 
Right. I figured anything I say is probably not new, but you never know until you say it. :smile:

nothing is difficult to download the game source database and read how it works.
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?
 
Back
Top