Author Topic: How come there's no Disgaea thread in there?  (Read 9276 times)

Tea Devil

  • wowee!! ♥
Re: How come there's no Disgaea thread in there?
« Reply #30 on: October 25, 2016, 02:26:24 AM »
It's not resisting magic that baffles people, it's that some particular units will have a gigantic RES stat seemingly at random. The example given, with the 3x3 sentinels in the Cave of Ordeal, some will just have twice as much RES as the others. Makes it kinda annoying to level magic users at first because of this.

Delfigamer

  • * Merry, bride, absolute (HR)
  • of course the best girl never wins
Re: How come there's no Disgaea thread in there?
« Reply #31 on: October 25, 2016, 03:52:16 AM »
It's not just giant RES, they also literally cut you magic in half. You can be an INT999999 mage standing against lv4 brawlers, and some of them will still receive only half the damage compared to their colleagues. Large RES only correlates with this stat due to how the enemies are spawned, in the code, this "magic resistance" is a separate stat that is not shown explicitly.
And if we are talking about sentinels, their huge RES will be subtracted from the already reduced attack, making your magic even less effective.
« Last Edit: October 25, 2016, 03:55:30 AM by Delfigamer »

The Jealous Witch did nothing wrong.

Delfigamer

  • * Merry, bride, absolute (HR)
  • of course the best girl never wins
Re: How come there's no Disgaea thread in there?
« Reply #32 on: October 25, 2016, 08:42:57 PM »
And now I've finally managed to reliably reproduce the EXP function.
The EXP values are calculated at the game startup once and stored inside a table as 64-bit integer values. During the gameplay, the code simply looks into the table to obtain the EXP required to reach a certain level, and works from here.
Unit's ENEXT isn't actually stored in the unit description, it is obtained as a difference between the next EXP threshold and current accumulated EXP of the unit each time it's requested.
Analogously, as EXP yield of a slain enemy is determined by the maximum possible ENEXT of its level, this value is obtained as a difference between the consecutive EXP thresholds. For that purpose, the game also stores EXP for level 10000 - you can't reach it, but for level 9999 enemies to yield EXP, there must be a gap between their total EXP and the next level's one.
Interestingly, when the game first fills the table, the values are obtained with floating-point arithmetic, and then rounded. Disgaea PC in particular uses x87 instructions in the calculation, which give slightly different results than PS versions of the game (unless PSs had 80-bit FPUs as well, and I doubt they did), though they don't affect gameplay in any noticeable way.
Another side effect of using x87 is that the operations are becoming a pain to make sense of; it took me long enough to just replicate the disassembly in an actual C++ program. Though, since I did, I guess I could give the table that I got already.
Lastly, a little useless fact: the constants used are stored with double precision in the game code, but their actual values are upconverted from single precision. If instead of 4.92f you write 4.92, the resulting values start to diverge a little, reaching about 200 EXP in difference at level 10000.
« Last Edit: October 25, 2016, 08:52:16 PM by Delfigamer »

The Jealous Witch did nothing wrong.

Delfigamer

  • * Merry, bride, absolute (HR)
  • of course the best girl never wins
Re: How come there's no Disgaea thread in there?
« Reply #33 on: October 26, 2016, 01:29:41 PM »
Welp, here we go.
Code: [Select]
int64_t exp_value( int lv )
{
long double pol_a;
long double pol_b;
if( lv <= 98 )
{
pol_a = lv / 25. + 1;
pol_b = lv;
}
else
{
pol_a = 4.92f;
pol_b = 123 - 400. / ( lv - 78 );
}
long double result = ( pol_b + 1 ) * ( lv + 1 );
result *= ( lv + 2 );
result *= pol_a / 4;
return result;
}
The results may diverge a little if you order the operations differently or use some other type instead of long double, but it's nothing substantial.

The Jealous Witch did nothing wrong.

Raikaria

  • Do Tank Girls Dream...
  • *
  • Of Floating Eyeballs?
Re: How come there's no Disgaea thread in there?
« Reply #34 on: January 28, 2017, 02:46:11 PM »
Gonna bump this up because of a notification I got on Steam today.

Disgaea 2 PC is coming on Monday.


http://www.malevole.com/mv/misc/tribute/
I don't even remember who put the above in my sig. [Wasn't me] Nor do I understand why I keep it here anymore.
Those two facts sum me up pretty well.

Third Eye Lem

  • Time Ticker
  • Castle Bal
Re: How come there's no Disgaea thread in there?
« Reply #35 on: January 28, 2017, 07:46:00 PM »
Ah yes, I almost forgot about D2 PC. I'd definitely get into it if I wasn't slogging through D5 already.

On a related note, I looked at the D5 Complete special edition on NISA's site and...I'm not that impressed. It doesn't seem to give you much more than the original version's special edition did (and it also lacks an Usalia figure, which is bogus). It's also 90 bucks, so I'm sadly not gonna get this when it and the Switch hit this Spring.