Page 9 of 11

Re: The Hack Library

Posted: Tue Jan 29 2013 8:56pm
by ronnen
Yeah, I was one of the people that helped him figure that stuff out.

I have a module to allows editing the growths... adding new growths though requires more space the ROM doesn't have without doing growth curve compression or moving stuff (obviously the former being considerably easier).

Let me see if I can find the post where we discussed that...

Yeah it was here: http://forums.shiningforcecentral.com/v ... 1&start=20" onclick="window.open(this.href);return false;

And I made a patch for him that did growth curve compression so he could add growth types: http://www.fileden.com/files/2012/1/27/ ... ession.zip" onclick="window.open(this.href);return false;

Re: The Hack Library

Posted: Tue Jan 29 2013 8:59pm
by MXC
I found something the other day but found it hard to follow (being my hex knowledge is a nice round 0)

Re: The Hack Library

Posted: Tue Jan 29 2013 9:02pm
by ronnen
Doesn't the CP have an irc channel somewhere? I'd be happy to get on and chat you up on how the SF2 curves work.

Re: The Hack Library

Posted: Tue Jan 29 2013 9:05pm
by MXC
It does not but you can contact me via AIM and MSN

Re: The Hack Library

Posted: Tue Jan 29 2013 10:33pm
by ronnen
Pinged you on AIM but no response. I guess I smell :(

So basically the way the stat growths work is like this:

Every stat, for every character, has an expected "start" value (SV), "end" value (EV), and "growth type" (GT)

"None" is a special growth type that always returns 0, so it doesn't have a table associated with it... so lets ignore that one.

All other GTs have 29 entries associated with them (because the expected EV is for what we expect the stat to be at for level 30.) Each entry in a GT has two parts, which are basically expressions of percent growth (PG). The first value in the table is a representation of how much "Percent Total Growth" the character should have by this level. The second value is a representation how much "Percent incremental growth" the characters should gain for this specific level.

The crux here is that the first value is used more as a way to "boost" a stat if it falls behind due to bad randomization. The second value is the primary determinant of how much the character gains on a given level up.


So, the game basically takes the difference (EV - SV) and multiplies that times the incremental growth value for that level's entry in the GT table. Then it compares that to the expected total growth value and adds an extra 1 to whatever it determined you should gain based on the (EV - SV) * incremental growth value.

So for example, Bowie SDMN has a start HP value of 12, end value of 60, growth of linear.

When going from level 1 to 2, it will look at the 1st entry in the Linear GT... which turns out is in decimal "8" and "8"

The game will take 60 - 12 = 48 and multiply that times the second entry in the table so... 48 * 8 = 384...
Then generate a random number between 0 and 128, (lets say 108) add that to your value so ... 384 + 108 = 492
Then generate a random number between 0 and 128, (lets say 20) subtract that from your value so ... 492 - 20 = 472
Then add 128 so ... 472 + 80 = 552
Then divide by 256 so ... 552 / 256 = 2 (okay it actually equals 2.15625 but there are no floating points here, so no decimals they just fall off!)
(Call this the incremental growth = 2)

Then we take 60 - 12 = 48, and multiply it times the first entry in the table so... 48 * 8 = 384
Then add 128... 384 + 128 = 512
Then divide by 256... 512 / 256 = 2
(Call this the long term growth = 2)

Then add your base value 12 back into your incremental and long term results
(incremental result) so ... 2 + 12 = 14
(long term result) so ... 2 + 12 = 14

If the long term result is >= the incremental result, add 1 to your incremental growth. Here they are equal (2 and 2) so we add 1... so
2 + 1 = 3

Thus Bowie will gain 3 HP this level up.

Here is the entire "Linear" table for your reference:
Spoiler
8 - 8
17 - 9
26 - 9
35 - 9
44 - 9
52 - 8
61 - 9
70 - 9
79 - 9
88 - 9
97 - 9
105 - 8
114 - 9
123 - 9
132 - 9
141 - 9
150 - 9
158 - 8
167 - 9
176 - 9
185 - 9
194 - 9
203 - 9
211 - 8
220 - 9
229 - 9
238 - 9
247 - 9
256 - 9
Note that in the table the difference between the "total growth" value for one level and its previous level is generally equal to the "incremental growth" value for the level.

In other words, 211 - 203 = 8 for the values...
203 - 9
211 - 8

This isn't always the case though!

Here's the actual code:
Spoiler
ROM:000096DC loc_96DC: ; CODE XREF: sub_96BA+16j
ROM:000096DC and.w #7,d2
ROM:000096E0 subq.w #1,d2
ROM:000096E2 muls.w #$74,d2 ; 't'
ROM:000096E6 movea.l (p_19toFigureOut).l,a0 ; related to level up stat gains ?
ROM:000096EC add.w d2,a0
ROM:000096EE move.w d5,d2
ROM:000096F0 subq.w #1,d2
ROM:000096F2 lsl.w #2,d2
ROM:000096F4 add.w d2,a0
ROM:000096F6 move.w (a0)+,d0
ROM:000096F8 move.w (a0)+,d7
ROM:000096FA sub.w d3,d4
ROM:000096FC mulu.w d7,d4
ROM:000096FE
ROM:000096FE loc_96FE: ; CODE XREF: sub_96BA+20j
ROM:000096FE move.w #$80,d6 ; 'Ç'
ROM:00009702 jsr Randomize ; randomize a few bits in D7 based on RAM:dea4
ROM:00009706 add.w d7,d4
ROM:00009708 jsr Randomize ; randomize a few bits in D7 based on RAM:dea4
ROM:0000970C sub.w d7,d4
ROM:0000970E add.w #$80,d4 ; 'Ç'
ROM:00009712 lsr.w #8,d4
ROM:00009714 move.w d4,d6
ROM:00009716 movem.w (sp)+,d1-d5
ROM:0000971A sub.w d3,d4
ROM:0000971C mulu.w d4,d0
ROM:0000971E add.w #$80,d0 ; 'Ç'
ROM:00009722 lsr.w #8,d0
ROM:00009724 add.w d3,d0
ROM:00009726 add.w d6,d1
ROM:00009728 cmp.w d0,d1
ROM:0000972A bge.s loc_972E
ROM:0000972C addq.w #1,d6
ROM:0000972E
ROM:0000972E loc_972E: ; CODE XREF: sub_96BA+70j
ROM:0000972E move.w d6,d1
ROM:00009730 movem.l (sp)+,d0/d2-a0
ROM:00009734 rts
ROM:00009734 ; End of function sub_96BA
Also, I could probably write a python chunk up to do this algorithm... not super familiar with ruby though I'm sure I could figure it out if you really wanted me to (since those seem to be the languages you guys are using in the CP)

Re: The Hack Library

Posted: Tue Jan 29 2013 11:05pm
by MXC
I responded to the IM (an hour late >.>) check back on there to see if we can connect while I read through this ;)

Re: The Hack Library

Posted: Tue Jan 29 2013 11:33pm
by ronnen
Note to self:
Spoiler
i can release SF2edit.Net beta and write an alternate stat growth module compatible with my compression patch I gave nightshade
that'd be pretty easy
10 mins ago

the promo level code is already in there so that's free
the only tricky part would be the "fall back" leveling in SF2 is actually pretty generous, and it triggers at level 30
so I'd have to write a separate patch for that
For resolution see http://forums.shiningforcecentral.com/v ... =5&t=23959" onclick="window.open(this.href);return false;

Re: The Hack Library

Posted: Fri Jun 07 2013 5:20pm
by Mormegil
well i know i am new here, but the Hack Library seems to have not been updated in a while shouldn't someone do it ?

Re: The Hack Library

Posted: Thu Jun 13 2013 7:39pm
by RastaOddeye
That's because there aren't any new completed hacks yet.

Re: The Hack Library

Posted: Wed Aug 07 2013 9:50am
by Nyfret
*Edit* Found the patch, very sorry!!

Re: The Hack Library

Posted: Mon Aug 19 2013 3:07pm
by Shining Hopeful
I just tried to get Drakonis' hack and ShiningForceHero's hack, but both links are dead. I think perhaps a mod should (if they have time) mark some hacks with an asterisk to denote dead links.

Re: The Hack Library

Posted: Mon Aug 19 2013 3:15pm
by Corsair
Else, consider hosting them elsewhere.

I'd be willing to use my dropbox as an unofficial SFII hack hosting space, if nobody else has a better option.

Re: The Hack Library

Posted: Mon Aug 26 2013 4:56am
by SirHedge

Re: The Hack Library

Posted: Mon Sep 02 2013 12:19am
by Drakonis
Excuser moi mes dames et mes sieurs, but I am actually kinda somewhat really unexcusably lazy with this topic when I really shouldn't.
Hedge, thank you very much for uploading those. Even though I'm not particularly proud of my delvings into hacking as I always gave up like 50-75% in... Someday I should really do the "Drakonis really means it this time for realz yeah no excuses now" hack. Though I'll probably be busy with the Community project until then. Sorry.
Updated the OP accordingly.

Re: The Hack Library

Posted: Tue Jan 14 2014 1:45am
by alex_man
http://www.romhacking.net/hacks/1736/" onclick="window.open(this.href);return false;

here is another

Re: The Hack Library

Posted: Sun Jan 19 2014 12:14pm
by Helldhaz
Rather than bump Space King's old SF2Edit topic, I'll ask here - is there any way to edit the damage of the Burst Rock's explosion? The "Burst Rock" spell doesn't seem to govern this like other enemy special attacks.

Re: The Hack Library

Posted: Sat Feb 08 2014 7:57am
by SirHedge
Helldhaz wrote:Rather than bump Space King's old SF2Edit topic, I'll ask here - is there any way to edit the damage of the Burst Rock's explosion? The "Burst Rock" spell doesn't seem to govern this like other enemy special attacks.
I just noticed this. You can find a whole bunch of useful hacking information on the first post of this topic. More specifically, the blast rock damage can be found at this link under the "pointer locations" section:

Sir Hedge's Hack Resources

Re: The Hack Library

Posted: Sat Feb 08 2014 4:06pm
by Faisal
I would want to play each and every hack but my studies just wont let me (I am asian) .-. ._. :p

Re: The Hack Library

Posted: Sun Feb 09 2014 12:39am
by Omega Entity
Huh. I've only seen that stereotype applied to East Asians, not South Asians.

Re: The Hack Library

Posted: Tue Sep 30 2014 8:19pm
by guntz46
:thumbsup: im really liking the shining tactics hack, chesters already lvl 99 promoted as peg knight at moun battle ^.^