DCFFVII Research Thread

Vincent's acrobatic movements and the responsiveness of the controls when doing the game's various maneuvers is, to me, one of the more beautiful parts of the game. The beauty is only stained by the limited applicability of Vincent's double-jump and the added ability of shooting in mid-air. It feels good to shoot in mid-air but as I've learned from playing the original JP version, the single player campaign was not designed with aerial combat strategies in mind. Even so, I often do various double-jumps, backwards jumps and melee just because it feels good. The stiffness of Zack's movement in Crisis Core is frustrating in comparison.

Dirge of Cerberus is thus far mockingly glitchless in terms of the player character's movement. The programming for all the maneuvers is just so solid that it seems equally watertight from exploitable glitches as the game's wall- and ground collision. I bring this up because I did find a glitch today. It has no real exploit potential at the current time but I am still happy to have found at least ONE obscure glitch in Vincent's movement. Some details before we get into the glitch.


Midair mechanics of Vincent Valentine

If you are playing the post-original releases of DoC, Vincent can perform various actions in mid-air: Shooting, melee and an additional jump.


When in free fall from a simple ground- or double jump, the game doesn't put any restrictions on how many melee strikes you can perform in midair. The only "limit" is that after you've performed the first chain of beautiful midair strikes, the next set of strikes will use the animations for Vincent's ground-melee chain. It will look like Vincent is performing melee strikes on solid ground even though he is clearly falling. This little oddity aside, if you were to fall for infinity you'd still be able to use melee for however long you'd like.


Shooting while in midair does reveal some restrictions if you end up experimenting with it.
Handgun: 3 midair shots maximum.​
Rifle: 2 midair shots maximum.​
Machine gun: Dependent on the firing rate stats of your setup, with the final cap ranging from 1 to 12 shots maximum.​

Most players will only experience machine guns firing anything from 6 shots maximum to 12 shots maximum while in midair. The internal stat for your firing speed is at value 0 (equivalent to almost no delay) when you are at maximum speed and higher values indicate a longer delay.

Fire, Thunder and Blizzard do not have the above restrictions and can be fired indefinitely while the player character is in free fall.

Code:
Left column: Maximum midair shots with machine gun
Right column: Internal firing rate of weapon slot

12    0 - 5
11    6
10    7
9     8
8     9
7     10
6     11 - 13
5     14 - 16
4     17 - 20
3     21 - 28
2     29 - 43
1     44 and up

One needless restriction I found is that the Auto Reloader item doesn't fully function in midair. This item makes it so that the reloading animation is skipped and your gun immediately loads the next clip without delay, assuming you have any ammo left. Unfortunately the Auto Reloader will only load the next ammo clip so long as you are on the ground.

If you want to reload in midair you need to employ the "Menu Reload" trick. The game is programmed so that when you change ANYTHING in any of your three weapon slots, that weapon slot will have its gun reloaded. Playing on Normal difficulty mode, the game will freeze when you enter the menu thus giving you all the time you need to auto-reload a weapon and bypass any reload animations! Menu Reload still works in the harder difficulties but because the game continues playing even while in the menu you'll find it near impossible to do a midair Menu Reload before touching the ground.


As an aside, you are normally restricted from switching weapon slots while you are above ground. This can be bypassed by entering the menu...or by using melee. For some reason, while doing midair melee strikes you are able to switch weapons. Quite odd behavior.

Switching weapons can't be used to increase your total number of midair shots. For example if you've fired three handgun shots and then switch to a high-speed machine gun, you'll only have nine shots maximum left to fire (3 + 9 = 12) before the game says that you can't perform any more midair shots.


This leads me to some neat nuances of Vincent's movement that I had not considered before. If you perform a double-jump and then fall off a ledge you will NOT be able to perform a jump while you are still falling! The game, surprisingly enough, has not reset the value to indicate that the double-jump is available. You must perform a normal ground-jump for this value to reset so that the second jump becomes available.

This also applies to raising the aiming reticle. The game limits you to raising the aiming reticle ONCE per midair event. But it needs you to perform a ground-jump to reset this. So if you jump, raise the reticle, cancel the gun aim, land and then finally fall off a ledge...you won't be able to raise the reticle again before you've landed on the ground.

The same was true for midair shooting. If you max out your midair bullet shots, land and fall off a ledge you will not be able to fire any bullets. The game REALLY wants you to reset the values with a proper ground jump!


The Midair-shot Overflow Glitch

The variable that keeps track of how many shots have been fired in midair is a signed 1-byte integer which means it takes on values ranging from -128 to 127. The value is 0 by default and then counts upwards as you shoot in free fall. If the value is 2 you can't fire more rifle bullets, if it's 3 you can't fire more handgun bullets, etc.

The signed 1-byte integer resets to 0 when you...
- Perform a ground jump.
- Progress through chapters/cutscenes/checkpoints.
- Select "Release" on a ladder mid-climb.
- Start a new Extra Mission.

If you are able to get this value up to 127 and then increment it by 1, the normal restrictions on how many bullets you can fire in midair will no longer apply! So long as the variable is not reset to 0, you'll be able to fire freely so long as this variable has a negative value. For each shot fired the value is changed by +1, same as always. -128, -127, -126, -125 ... -3, -2, -1 and then finally back around to 0 and then the normal rules apply once again. The glitch thus gives you 128 midair shots for free plus whatever remains when the normal rules resume.


The only way to increment this value beyond 12 is by repeatedly using magic spells while in free fall. Remember that magic doesn't have any restriction on how many times it can be fired in midair and thus it becomes our ticket to triggering this glitch.

Let's say that we've used the machine gun to reach a value of 12, now we just need to increment it 116 times by using Fire Lv1. The spell consumes 14 MP, the least amount of any available magic spell in the post-original versions of DoC, yet this still means we need to consume a total of 1624 MP. The only "reasonable" way to have enough MP is by equipping Manasoul which gradually restores your MP but even with this item and some MP restoratives to help it will still take a really long time to cause the overflow. That's not even mentioning the difficulty of keeping count on your number of free-fall magic shots and making sure you don't accidentally count a Fire Lv1 spell that was fired when you actually stood on solid ground.

There is currently zero use for this glitch in any context. I was investigating potential ways of making Vincent ascend to higher heights than normal so that speedrunners might skip certain segments of the game. Jumping over EM barriers won't happen with our current knowledge however. Even with cheats to give myself limitless midair shots and by giving the gun more recoil than normal, it took 2000 BULLETS to traverse above an EM barrier...and that's when I had already ascended with a double jump. You may carry no more than 500 bullets of any ammo type, so clearly ascending above EM barriers with the help of midair-gun-recoil is not an option.


While making the video demonstration I also noticed a nuance of Vincent's movement that happens regardless of the overflow glitch: When Vincent has fired a machine gun while in free fall, the game will remember Vincent's accelerated downwards speed even after you reach the ground and then enter free fall again. That's what happens in 0:17 at the video. Vincent descends at great speed, the machine gun recoil for some reason no longer having a decelerating effect on his fall. For some reason handguns and rifles do not exhibit this behavior of "forgetting" their own recoil properties. But so long as you perform a ground jump, Vincent's properties will be "reset" once more and the recoil of the machine gun will resume.

I could observe that no matter how well I reloaded the machine gun, any height gained from firing straight down is limited to the size of your clip. In this case, the 99-bullet ammo clip of the Sonic Griffon. Reloading after this point is pointless because the gun can no longer suspend you in midair with its recoil.


It pleases me that the movement is more glitched than I expected. The ultimate dream would be to find a movement exploit that allowed you to skip large chunks of the game. The way things are looking now however...the programming of Vincent Valentine's movement is just too gosh darn good. :wacky:
 
Last edited:
After reading myself silly on assembly code for a day I finally have a damage calculation formula for Dirge of Cerberus. It has been tested true for when using Fire Lv.1 on two cargo crates: The stacked boxes in Ch8-2-2 right before the Rosso fight and one of the boxes at the beginning of Ch10-3. Yes, each box has a set amount of HP and when the value reaches 0 the box is destroyed.

Damage has not been tested to see how the magic-boosting power of Manaheart/Manamind/Manasoul is added into the calculation.

Ch8-2-2
WmcBxDd.png


Ch10-3
ZOZKx8B.png

Boxes are unique in that they are programmed to always receive the same damage from melee attacks regardless of your power level but bullets and magic are still calculated same as it might be done on an enemy.


STEP 1: Calculating the Base Magic Power based on Vincent's INT stat and the underlying magic damage coefficient- and constant.

Base Magic Power = (Magic Coefficient * INT) + Magic Constant + 0,5

The result of this calculation is then rounded down to the closest whole integer.

Magic Coefficient = 0,27
Magic Constant = 1,4

These values are unchanging throughout the game. They reside in the "bgd" file which contains a great number of the underlying gameplay values, ergo why I like to call this the "basic game data" file.

When Vincent is on Level 1 his INT stat is 1 and if he reaches Level 50 the INT stat is maxed out at 100. Though some values are skipped, let's check out the resulting Base Magic Power (BMP) in relation to INT stats 0->100, both before- and after rounding down.

Code:
INT      BMP     BMP(rounded down)
0        1,9     1
1        2,17    2
2        2,44    2
3        2,71    2
4        2,98    2
5        3,25    3
6        3,52    3
7        3,79    3
8        4,06    4
9        4,33    4
10        4,6    4
11        4,87    4
12        5,14    5
13        5,41    5
14        5,68    5
15        5,95    5
16        6,22    6
17        6,49    6
18        6,76    6
19        7,03    7
20        7,3     7
21        7,57    7
22        7,84    7
23        8,11    8
24        8,38    8
25        8,65    8
26        8,92    8
27        9,19    9
28        9,46    9
29        9,73    9
30        10       10
31        10,27    10
32        10,54    10
33        10,81    10
34        11,08    11
35        11,35    11
36        11,62    11
37        11,89    11
38        12,16    12
39        12,43    12
40        12,7     12
41        12,97    12
42        13,24    13
43        13,51    13
44        13,78    13
45        14,05    14
46        14,32    14
47        14,59    14
48        14,86    14
49        15,13    15
50        15,4     15
51        15,67    15
52        15,94    15
53        16,21    16
54        16,48    16
55        16,75    16
56        17,02    17
57        17,29    17
58        17,56    17
59        17,83    17
60        18,1     18
61        18,37    18
62        18,64    18
63        18,91    18
64        19,18    19
65        19,45    19
66        19,72    19
67        19,99    19
68        20,26    20
69        20,53    20
70        20,8     20
71        21,07    21
72        21,34    21
73        21,61    21
74        21,88    21
75        22,15    22
76        22,42    22
77        22,69    22
78        22,96    22
79        23,23    23
80        23,5     23
81        23,77    23
82        24,04    24
83        24,31    24
84        24,58    24
85        24,85    24
86        25,12    25
87        25,39    25
88        25,66    25
89        25,93    25
90        26,2     26
91        26,47    26
92        26,74    26
93        27,01    27
94        27,28    27
95        27,55    27
96        27,82    27
97        28,09    28
98        28,36    28
99        28,63    28
100        28,9    28
Thanks to this we basically have a look-up table for the Base Magic Power. The game doesn't use a look-up table like this one but that doesn't stop us.


STEP 2: Calculating the final damage

Damage = (Spell Power + 0,50) * (Base Magic Power + Target Defense + Chain Damage + 100) * 0,01

The calculated damage value is then rounded down to the closest whole integer before being applied on the target's remaining HP.

Fire Lv.1 has a Spell Power of 200.

Base Magic Power we already calculated in Step 1.

Target Defense naturally varies between targets.
Thus far the most common value for Target Defense is the negative value of "-50". This is the defense used by the Ch10-3 box and indeed by the DG Sergeants and the DG Elite in that area. Most boxes in Ch8-2-2 also use this defense value, which is retrieved from the bgd file, but the stacked boxes right before the boss room actually have a lower defense of exactly value "0".

Chain Damage is the damage boost based on your active killchain. The maximum possible damage boost is a value of 9600 at a 99-chain. The chain loops back around to 0 if you try to increment it further.

Code:
Chain - Damage Boost
0     0
1     30
2     60
3     90
4     120
5     200
6     300
7     400
8     500
9     600
10    700
11    800
12    900
13    1000
14    1100
15    1200
16    1300
17    1400
18    1500
19    1600
20    1700
21    1800
22    1900
23    2000
24    2100
25    2200
26    2300
27    2400
28    2500
29    2600
30    2700
31    2800
32    2900
33    3000
34    3100
35    3200
36    3300
37    3400
38    3500
39    3600
40    3700
41    3800
42    3900
43    4000
44    4100
45    4200
46    4300
47    4400
48    4500
49    4600
50    4700
51    4800
52    4900
53    5000
54    5100
55    5200
56    5300
57    5400
58    5500
59    5600
60    5700
61    5800
62    5900
63    6000
64    6100
65    6200
66    6300
67    6400
68    6500
69    6600
70    6700
71    6800
72    6900
73    7000
74    7100
75    7200
76    7300
77    7400
78    7500
79    7600
80    7700
81    7800
82    7900
83    8000
84    8100
85    8200
86    8300
87    8400
88    8500
89    8600
90    8700
91    8800
92    8900
93    9000
94    9100
95    9200
96    9300
97    9400
98    9500
99    9600
100   0

To start with, let's compare the observed damage results on the stacked Ch8-2-2 boxes with the calculated damage (before round-down).

Manually generated damage chart
ch8-2-2_boxes_damage-chart.png

Damage chart based on damage formula before final round-down to closest whole integer
ch8-2-2_boxes-calc.png

They match perfectly!

Each of these stacked boxes in Ch8-2-2 had a Target Defense of 0. The box in Ch10-3 has a Target Defense of -50 meaning that the calculated damage output will become smaller. Let's check how my manually generated chart for that box checks out with the calculated damage.


Manually generated damage chart
ch10-3_box_damage-chart.png

Damage chart based on damage formula before final round-down to closest whole integer
ch10-3_box_calc.png

Once again, the actual observed damage matches with the formula!


A point of admission is that there might still be some edge cases where the deduced formula for even this simple case of "Fire Lv.1 on cargo crate" is incorrect. During Step 1 there is actually a complicated calculation performed on the Magic Constant of 1,4 which lowers its value ever so slightly. This changed value is the one that's actually applied in the formula.


Magic Constant before the calc:
Value with one decimal point: 1,4
Value with nine decimal points: 1,399999976
As an array of bytes: 33 33 B3 3F

The exact value of 1,400000000 can't be represented in 32-bit floating point numbers (far as I can tell) so you must round it to fewer decimal digits if you want to read it 1,4.

Magic Constant after the calc:
Value with one decimal point: 1,4
Value with nine decimal points: 1,399999857
As an array of bytes: 32 33 B3 3F

While the final instruction that led to this new value is a simple Bitwise Logical AND calculation...
FFFFFFFE AND 3FB33333 = 3FB33332
...the road to this point is complicated and I don't know how it might be represented in more simple arithmetic terms. This same type of AND instruction is performed on other constants as well though in my example only the Magic Constant was changed to have its value slightly lowered. Hopefully I can one day understand what is actually going on here and if the impact is ever large enough that the damage formula has to be updated to become more accurate.
 
Maybe he could restore the online mode that way lol, at least sort of.
That's the dream, yes. Alas if I am to do it on my own the work will take decades. See ya all in fifty years when I'm finished modding Dirge of Cerberus to bring back the online multiplayer! :lol:

A strategy guide would take away too much time from my research and it'd have to be updated constantly because of new discoveries. So unfortunately I don't see myself picking up such a project. But I can spoil that the host of the DoC Speedruns Discord channel is currently working on a tutorial video for speedrunners. He made such a tutorial two years ago but due to new strategies and discoveries he is working on an updated version. A lot is happening in the game's speedrunning scene even though not many people run it frequently.
 

Odysseus

Ninja Potato
AKA
Ody
You know, I was wondering. How much of Dirge's online mode just exists on the disc? Are all the assets just sitting around on there, never to be used again? Or were elements of it downloaded directly to the PS2 while play online was active, and as such can no longer be accessed? I'm just wondering because I know other long dead games have active fan servers, to the point where even your dreamcast can still get online with enough work.
 

Makoeyes987

Listen closely, there is meaning in my words.
AKA
Smooth Criminal
Pretty sure a lot of the assets were recycled from the disk.

However, there were new assets that were exclusively online. Such as the bonus hats, and customizables you'd get for playing.
 

Odysseus

Ninja Potato
AKA
Ody
I was just thinking, if ever it were possible to dump all of Dirge's assets, perhaps a workable version could be jerryrigged together
 

Makoeyes987

Listen closely, there is meaning in my words.
AKA
Smooth Criminal
Well they sorta did that with those Extra Missions. Those Extra Missions are copy-pasted maps and missions from the multiplayer mode, just stripped of the Tsviet storyline and online co-op, and formulated for single player mode. xD
 
There are huge chunks of the multiplayer, in various stages of the mode's development, left on disc. While the post-original releases contain the most data in the form of online mode NPCs, battle arenas and game text, some stuff like the installation screen can only be found on the original JP disc and on the Beta version disc. *EDIT: Just realized I'm not 100% sure if the installation screen was removed for the post-original releases, but regardless my point still stands that you need to Frankenstein data from multiple versions to make the most complete restoration.*

To restore any version of the online mode, be it the 2006 "retail" version or the 2005 beta-period version, you'd have to combine data and assets from multiple game disc versions. Then you'd fill in the blanks based on documentation found on the web. For example in the post-original releases of Dirge, the online item descriptions fit the Beta/2005 period but the actual item traits are actually way more congruent with the public/2006 period. :lol:

We can be happy at least that a lot of the behavior from the multiplayer still exists on the disc to be unlocked, like the parabolic Fire spell and the Cure spell.



Based on data extractions and my inability to jump to these maps, the following areas are missing from the game discs:
- Fort, City and Temple
- Snowy Mountain
- Old Administrative Building and Proving Grounds (though "Proving Grounds" might have never actually been implemented)
There is a tiny possibility that Noesis simply failed to extract these particular arena files but all the maps that I can teleport to in-game appear present in the Noesis extraction, so...

Hopefully somebody from the development team still has the battle map data on one of their harddrives and may one day be gracious enough to share the data. Heck, ANY exclusive data from a former developer would be an incredible gift.


It is still up in the air whether the PS2 HDD of somebody who subscribed to the multiplayer might have any remaining data on it. I vaguelly recall some archived statement on the PlayOnline website that when the online mode ended that any data would be automatically deleted from your HDD, but I can't find it at this time. Even if the statement is real, I am not inclined to trust it 100%. Plenty of software and services will claim to delete data when in fact all it does is make the data unavailable only to have it removed once you overwrite it with something else. Heck, Dirge of Cerberus claims to erase your Tempsave data when you load it up, but in fact all it does is set a flag that makes the Tempsave unavailable. The data is still in the memory card until you overwrite it with a new Tempsave.


There is no sign that anybody ever extracted packet data from PlayOnline much less how the service worked in conjuction with DoC. So if the Dirge of Cerberus online mode were to be restored with PlayOnline functionality in mind you would have to reverse engineer how PlayOnline uploaded- and downloaded data. Thusly, our challenge is not just to figure out DoC in its entirety but also learn how the defunct PlayOnline worked. You'd also need a thorough understanding of how the PS2 HDD works if you were to undertake a proper restoration project.

I sometimes wonder if enough knowledge of Dirge of Cerberus would make it easier to just create your own version of PlayOnline for it and just forego all the PlayOnline stuff.


The long and short of it: Restoring the online multiplayer of DoC is possible but it's way more difficult than with other PS2 titles.


Such as the bonus hats, and customizables you'd get for playing.
All the masks are on disc and we can compare how they changed between beta/2005 and 2006. All item equipment is also in there, though many retain beta- or placeholder names.
 
Last edited:

Odysseus

Ninja Potato
AKA
Ody
Honestly actually restoring the play online functions would be less desirable to me than taking what's still on the disc(s), along with what we know about the play online mode and just recreating it as an offline secondary campaign. I, of course, have no idea how that would even be possible though.
 
The Cait Sith Ch5-2 skip is way harder than it looks. You really need to make it so that Cait Sith performs the jump when he is technically in midair but without pressing too late or accidentally prompting Cait to climb down the ladder.

City Hall first reported that a clip can happen here and indeed if you practice this jump for any length of time you are bound to see the box-clip happen.


This box-clip just makes me so happy because it's the closest to evoking the kind of clipping that is so often seen in popular speedrunning games. Dirge of Cerberus has plenty of cases where you'll clip through thin platforms, but only this one in Ch5-2 actually aids in a time-saving skip.

What I'm curious about is why this clip happens at all.

cait-sith-clipping000.png

cait-sith-clipping001.png

cait-sith-clipping002.png

It's not a case of Cait Sith reaching an unloading-zone by jumping too far and high. Moon jumping with the help of Cheat Engine pretty much disproves that, as even with a super jump Cait will land on the boxes no problem. Oh how much I want a collision-visualizer tool for Dirge. :wacky:

A prime example of an actual unloading-zone is the Ch5-1 sewer platform. If you touch the air within this area marked red, the platforms will unload and you fall to the bottom level.

Ch5-1_sewer_area-unloading-collision.png
If a speedrunner opts to make a shortcut by double-jumping across to reach the control panel (right next to the Sahagin) they have to be extremely careful not to touch the area that unloads the platform or Vincent will fall right through. In the original Japanese game you'd only ever notice this if you performed a Galian Beast jump across but with the addition of Vincent's double-jump this bug becomes quite apparent.
 
GocuComeBack just smashed the Dirge of Cerberus Any% Normal mode WR, showcasing their deeply planned route that involves a lot of Fire- and Thunder magic. The new time is 1:33:23, breaking NT1_Evolution's old record with over three minutes. While most of the time save is due to the new routing, it also helped that they got insanely good Crystal Feeler RNG at the end. Gocu also focused hugely on triggering Omega Weiss to do the ground-pin-shockwave attack by staying in close proximity to the boss, thus lowering the odds of OW firing missiles and distracting the fight.

https://www.twitch.tv/videos/885284243

Note that GocuComeBack does not employ City Dashing and some other recent strats and discoveries, so once those get incorporated in Gocu's run they'll be able to push the time even lower. A sub-1:30 definitely looks very possible in my eyes.
 

cold_spirit

he/him
AKA
Alex T
I gotta make time to watch that. I think Dirge would be a perfect game to speedrun. The RPG mechanics make it fun to route, the action mechanics make execution rewarding. A good mixture. Unfortunate that the biggest RNG section is at the end though.

At least cutscenes are skippable. Pour one out for Crisis Core. I think CC would be an interesting game to route with the all the optional materia and equipment from side missions to consider, but who wants to watch the whole story every time?
 
Last edited:
Today I learned...

1) That the PS2 doesn't use the IEEE-754 Floating Point standard. My word! I do not know if this ever leads to PCSX2 calculating the wrong damage values in Dirge of Cerberus.​
2) That in order for my C++ programs to do the decimal calculations correctly I need to set it to Floating-point environment "FE_DOWNWARD" (so-called "rounding towards negative infinity") or "FE_TOWARDZERO" (both work for my current cases) and I need to represent the values as variables and not literals.​

I still have a lot to learn about floating-point arithmetic but the gist of it is that the damage calculation equations are not nearly so neat as I had hoped. Some of it is because of how 32-bit floating points can't perfectly represent certain decimal number (like 0,1 or 0,33) and others may be a result of either the developers trolling us with needlessly long decimal values or the PS2 using some rounding-mode I have not yet grasped.

Some examples of how values that looked small and neat should actually be written if we are to even approach an exact calculation.

Magic Coefficient = 0,27 [0x3E8A3D71] is actually 0,270000010729
Magic Constant = 1,4 [0x3FB33333] is actually 1,39999997616
Multiplier 0,01 [0x3C23D70A] is actually 0,00999999977648
You can see these numbers by entering the hexadecimal representations into this floating point converter.

The kicker is that not even these very exact numbers can be trusted for your calculations because conversion errors will occur when you represent these numbers as literals in your code. You may only perfectly replicate the calculations by having them represented by their 4-byte building blocks. In other words I don't know of a way to make these calculations happen correctly in Microsoft Excel or in the standard Windows calculator. I can only repeat the calculations (as I see them in Cheat Engine) by writing programs in C++.

What confirmed the deeper precision involved in damage calculations was when I checked how the damage Vincent receives from exploding drum cans is calculated. In the final step the calculation looked like this from my point of view.

248,50 * 200 * 0,01 = 497,00

Simple and clean, I thought. Then the float value of 497,00 was converted to an integer and the final result was 496. That is of course because the result of the calculation was just below 497, though the FPU viewer rounded it up to 497 which is why I didn't notice at first.

248,50 * 200 * 0,00999999977648 ≈ 496.999969482421875 [0x43F87FFF]

Notice that your standard Windows calculator will give a different result. I think this happens because the calculator use Doubles (64-bit floating points rather than the 32-bit floating point of Float variables).

Thusly, the final damage was rounded down to 496 and applied accordingly. I had to confirm that this was true on both emulator and console. Indeed, both led to a damage of 496 being inflicted on Vincent when the stats- and equipment setup was identical. Hopefully there will be no case where a test on emulator leads to different damage outputs compared to console. Maybe the situation with NaNs and INFs being handled differently never comes into play here.


In short
Any damage calculation I present here will be subject to error because the decimal values can't be perfectly represented with common arithmetic notation. For proper damage calculation you need to build a program that handles 32-bit floating point variables in the intended fashion.
 
Last edited:
Now that I've finished lamenting the imperfections inherent in posting the damage calculations here, I shall post the expanded magic damage calculation formula.

The post-JORG exclusive item Manaheart can be upgraded to Manamind and finally to Manasoul. All of these gradually restore your MP but only Manamind and Manasoul actually boost the output of your magic. Indeed, these two items are the only ones that actually boost your magic power (apart from levelling up materia) hence why I shall refer to their effect as the "Mana Booster" in contrast to the "Power Booster" item.

Looking at this damage output based on Manamind/Manasoul revealed that the magic damage calculation is better summarized in three steps rather than two. After each step the calculated result is rounded down to the closest whole integer.

STEP 1
(Magic Coefficient * INT) + Magic Constant + 0,50 = Base Magic Power

STEP 2

(Spell Power * 0,00999999977648 * (100 + Mana Booster)) + 0,50 = Final Spell Power

STEP 3

(Final Spell Power + 0,50) * (Base Magic Power + Target Defense + Chain Damage + 100) * 0,00999999977648 = Damage

Manamind: Increases magic dmg output by roughly 60%.
Manasoul: Increases magic dmg output by roughly 140%


Since the Manaheart/Manamind/Manasoul may only be acquired in Ex Hard mode, let's imagine we are fighting the Black Widow in Ch5-4 where their Target Defense is -50. In Normal and Hard mode their defense here is 0. Let's line up the values.

Magic Coefficient: 0,270000010729
INT: 1 (Vincent on Level 1)
Magic Constant: 1,39999997616
Spell Power: 999 (Thunder Lv3)
Mana Booster: 140 (Manasoul)
Target Defense: -50
Chain Damage: 120 (4-chain)

We now enter these into the various steps of the magic damage calculation, warts and all.

Step 1
(0,270000010729 * 1) + 1,39999997616 + 0,50 = 2,169999986889
Base Magic Power is rounded down to an exact value of 2 and shall be used in Step 3.

Step 2
(999 * 0,00999999977648 * (100 + 140)) + 0,50 = 2398,0999464088448
The Final Spell Power is rounded down to an exact value of 2398 and used in Step 3.

Step 3
(2398 + 0,50) * (2 + (-50) + 120 + 100) * 0,00999999977648 = 4125,41990778861216
The Damage is rounded down to an exact value of 4125 and applied on the enemy. The Black Widow starts out with 10000 HP, so after this attack they will be down to 5875 HP. Attacking with a higher killchain is extremely effective thought so let's increase our killchain.

5-chain (200)
(2398 + 0,50) * (2 + (-50) + 200 + 100) * 0,00999999977648 = 6044,21986489959456

6-chain (300)
(2398 + 0,50) * (2 + (-50) + 300 + 100) * 0,00999999977648 = 8442,71981128832256

7-chain (400)
(2398 + 0,50) * (2 + (-50) + 400 + 100) * 0,00999999977648 = 10841,21975767705056

With a 7-chain we have already maxed out the damage. Against this boss, magic may only cause a maximum of 9999 damage per shot. I have found that the values setting this damage cap exists in the instruction space in memory. What this means is that I am unlikely to ever find a damage-cap indicator in a file like the bgd (Basic Game Data file) which primarily includes variables and disguised pointers but not actual instructions.
 
Happy 15th anniversary to the original release of Dirge of Cerberus!

What a huge difference it is between the 10th anniversary back in 2016 and now the 15th anniversary in 2021. We've learned more about the game in these five years than in the years 2006 - 2016. Feels weird to note that I didn't start using Cheat Engine until November 2016. So much has happened since then.

Back in March 2018 I tried to spot a pattern that might reveal the damage calculation formula for when Vincent is in the vicinity of an exploding drum can. How naive that looks now. After recently learning the magic damage formula I did figure out the brunt of the explosion-damage formula.

As before, the calculated result after each step is rounded down to the closest whole integer before being applied in the subsequent step(s).

STEP 1
(DEF * Defense Coefficient) + Modified_Defense Constant + 0,50 = Base Damage

STEP 2
(Explosion Power + 0,50) * (100 - (Base Damage + Defense Booster)) * 0,00999999977648 = Final Explosion Power

STEP 3
(Final Explosion Power + 0,50) * (100 - (0 - Base Defense)) * 0,00999999977648 = Damage

STEP 4 (Only if Vincent is in Galian Beast form)
Damage * 0,200000003 = Final Damage


Using the same exploding drum can in Ch10-3 that we looked at back in March 2018, let's repeat the scenario that I used when learning the above formula.

DEF = 54 (Vincent's DEF stat at Lv17)
Defense Coefficient = 0,330000013113 [0x3EA8F5C3]
Defense Constant = 0,40000000596 [0x3ECCCCCD]
Explosion Power = 400. Different drum cans have different explosion power associated with them.
Defense Booster = 20. Both Cerberus Relief Gamma (+15 defense) and Guard N Barrel (+5 defense) are equipped in our example.
Base Defense = 100

In the same way that the Magic Constant is sometimes modified before being applied in the calculation, the Defense Constant may sometimes be modified as well. I do not yet know why/when this happens. I'll once again skip most of the complicated programmer math and get straight to the final step for when the Defense Constant is modified.

FFFFFFE0 & 3ECCCCCD = 3ECCCCC0
Modified_Defense Constant = 0,39999961853 [0x3ECCCCC0]

Now we insert these values into each step of the damage calculation.

STEP 1
(54 * 0,330000013113) + 0,39999961853 + 0,50 ≈ 18,720000326632
The calculated Base Damage is rounded down to exactly 18 and is used in Step 2.

STEP 2
((400 + 0,50) * (100 - (18 + 20)) * 0,00999999977648 ≈ 248,30999444977488
The Final Explosion Power is rounded down to exactly 248 and used in Step 3.

STEP 3
(248 + 0,50) * (100 - (0 - 100)) * 0,00999999977648 ≈ 496,999988891056
The calculated damage is rounded down to exactly 496. The game does various checks such as if you are in Galian Beast mode or if you are currently invincible.

STEP 4 (Only if Vincent is in Galian Beast form)
496 * 0,200000003 = 99,200001488
Final damage is rounded down to exactly 99. The defense modifier of "0,200000003" is retrieved from instruction space, so it can't be found in a file like the bgd.


There is more to learn about what goes on during damage calculation even in this simple example of Vincent getting caught in an explosion, but this level of knowledge is good enough for figuring out how damage might change depending on your setup. For example if our Defense Booster had been value 0 (no defensive equipment on) the final HP depletion on Vincent would have been...
((400 + 0,50) * (100 - (18 + 0)) * 0,00999999977648 ≈ 328,40999265937968
(328 + 0,50) * (100 - (0 - 100)) * 0,00999999977648 ≈ 656,999985314736

...656 damage and on Galian Beast...
656 * 0,200000003 = 131,200001968
...it would have been 131. These results line up with the tests I performed almost 3 years ago.
 

ultima espio

Pro Adventurer
I remember someone asking for a specific texture from DoC that they couldn't find, you can now use an updated PCSX2 and graphics plugins to dump and replace them:

You'll need PCSX2EX and the plugins linked in the video above.

Anyway I poked around the Shera, and I noticed that Cid has posters of the OG backgrounds behind him. You can see the interior of Shinra No26, his back yard with the Tiny Bronco and some artwork of the Highwind.
 
Top Bottom