Welcome to the Shining Force Central Forums!
SFC Forums Index Shining Forums Shining Force II
Register for your free forum account now or Login to remove this advert.

The SF2 Disassembly Super Thread

One thread to link them all.

Discussion about this classic Genesis/Mega Drive game.

The SF2 Disassembly Super Thread

Postby Wiz » Wed Aug 02 2017 11:12pm

This is the entry-point thread to link all SF2 Disassembly-related discussions.

For a brief summary, the disassembly is a more complex and powerful approach for modifying Shining Force II, and eventually create whole new Shining Force adventures based on its engine.
Details :
WARNING: SPOILER!

Disassembly quick start guide :
WARNING: SPOILER!


sf2hack Discord Server


Main threads :

- [GitHub] ShiningForceCentral/SF2RE
WARNING: SPOILER!

- [GitHub] ShiningForceCentral/SF2DISASM
WARNING: SPOILER!

- SF2 Disassembly Tool Suite
WARNING: SPOILER!

Tool suite screenshots :
WARNING: SPOILER!


HOWTOs :
[SF2DISASM][HOWTO] Scrolling text introduction
[SF2DISASM][HOWTO] Music resuming
[SF2DISASM][HOWTO] Battle search fix
DiegoMM's "Is it feasible?" thread

Other disassembly-related threads :

- [SF2DISASM] Cutscene Documentation
With cutscene macros for easier creations.

- [SF2DISASM] Map Setups Documentation and Formatting

- Ronnen's disassembly hacks :
Ronnen wanted SF1-style level-up, so he forked SF2DISASM and did a patch for that :
https://forums.shiningforcecentral.com/viewtopic.php?f=5&t=27885
When ronnen wanted to change monster spells, he did this :
https://forums.shiningforcecentral.com/viewtopic.php?f=5&t=28068
Then he wanted to make attack power have influence on magic, so he did this :
https://forums.shiningforcecentral.com/viewtopic.php?f=5&t=28098
Ronnen is working to change the world.
Be like ronnen.
(loosely based on the Elon Musk meme, please don't take this seriously :D)

- Lyanel's Lataura hack :
https://forums.shiningforcecentral.com/viewtopic.php?f=5&t=41765
This is an examplary way of packaging ips patches along with disassembly assets !
Thanks to anybody willing to share their work like this !

- Music resuming patch :
https://forums.shiningforcecentral.com/viewtopic.php?f=5&t=42200

- Siel's various stats engine patches :
https://forums.shiningforcecentral.com/viewtopic.php?f=5&t=42340
https://forums.shiningforcecentral.com/viewtopic.php?f=5&t=43516
[Gameplay Mod] SF2 Counteraction v0.2 (demo)
SF2 Counteraction v1.0.0

- Xenometal's SF2DISASM workshop

That'll do for the moment, please MXC, you can unpin the SF2RE and SF2DISASM threads and sticky this one instead. :)
Edit : thanks Stor !
Last edited by Wiz on Fri Mar 01 2019 10:50pm, edited 25 times in total.
Wiz

User avatar
Shining Member
Shining Member
 
Posts: 155
Joined: Sun Mar 18 2007 2:43pm
Location: Blois, France

Re: The SF2 Disassembly Super Thread

Postby Stordarth » Thu Aug 03 2017 2:33pm

Relevant topics stickied/unstickied.

Code: Select all
Dice Codes
Attack/Marked Target: /roll 8d100
Damage Variance (Rebels): /roll d26 [Everyone.]
Damage Variance (Emissaries): /roll d24 [Assassins with Katana], /roll d21 [MXC, TUM with Blade], /roll d26 [Any other case.]
Magic: /roll d26
Status Effects: /roll d100
Level-Ups (No MP): /roll 4d11
Level-Ups (Has MP): /roll 5d11

---
SFCW-A: Durandar
Sunken Castle: Fintan Kahn

Code: Select all
Dice Codes
Attack/Marked Target: /roll 8d100
Damage Variance (Rebels): /roll d26 [Everyone.]
Damage Variance (Emissaries): /roll d24 [Assassins with Katana], /roll d21 [MXC, TUM with Blade], /roll d26 [Any other case.]
Magic: /roll d26
Status Effects: /roll d100
Level-Ups (No MP): /roll 4d11
Level-Ups (Has MP): /roll 5d11

---
SFCW-A: Durandar
Sunken Castle: Fintan Kahn
Stordarth

User avatar
The L-Block Anomaly
Administrator
 
Posts: 16751
Joined: Thu Sep 16 2004 3:30pm
Location: The Midlands, Staffordshire, England

Re: The SF2 Disassembly Super Thread

Postby jordanelias » Wed Aug 16 2017 10:37am

This is phenomenal, and learning enough Motorola 68000 to dabble is certainly more approachable than diving in through hex editing.

I'm interested in code\gameflow\battle\aiengine.asm and code\gameflow\battle\battlefieldengine.asm. This article (http://ladyabaxa.livejournal.com/65619.html) elaborates on what we've all noticed in the game: the AI makes some silly decisions to heal or not heal, and the AI is incapable of using Attack or Boost.

Some members have started doing interesting work to tackle things like SF1-style EXP gains...but making the AI smarter with healing and support spells would be amazing.
jordanelias

Newbie
Newbie
 
Posts: 9
Joined: Mon Aug 14 2017 10:04pm

Re: The SF2 Disassembly Super Thread

Postby jordanelias » Wed Aug 16 2017 10:57am

In fact, I think the following in battlefieldengine.asm covers the healing selection process:
Code: Select all
; =============== S U B R O U T I N E =======================================

; In: D0 = heal target char idx
;     D4 = heal spell idx

sub_CD68:
      movem.l d0-d1/d3-a6,-(sp)
      clr.w   d5
      move.b  d4,d5
      lsr.w   #6,d5
      andi.w  #3,d5
      move.w  d1,d3
      jsr     GetCurrentHP
      move.w  d1,d2
      jsr     GetMaxHP
      sub.w   d2,d1           ; d1 = max HP - current HP
      moveq   #$FFFFFFFF,d2
      cmpi.w  #ENEMYAI_THRESHOLD_HEAL1,d1
      bls.w   loc_CDDC
      moveq   #0,d2
      cmpi.w  #ENEMYAI_THRESHOLD_HEAL2,d1
      bls.w   loc_CDB8
      cmpi.w  #2,d5
      bcs.w   loc_CDB8
      moveq   #2,d2
      cmpi.w  #ENEMYAI_THRESHOLD_HEAL3,d1
      bls.w   loc_CDB8
      cmpi.w  #3,d5
loc_CDB2:
      bcs.w   loc_CDB8
      moveq   #3,d2
loc_CDB8:
      move.w  d3,d0
      jsr     GetCurrentMP
      move.w  d1,d3
loc_CDC2:
      moveq   #0,d1
      add.w   d2,d1
      lsl.w   #5,d1
      add.w   d4,d1
      jsr     GetSpellDefAddress
      cmp.b   SPELLDEF_OFFSET_MPCOST(a0),d3
                  ; check if spell cost is more than current MP
      bcc.w   loc_CDDC
      dbf     d2,loc_CDC2
loc_CDDC:
      cmpi.b  #1,d2
      bne.s   loc_CDE4
      moveq   #0,d2
loc_CDE4:
      movem.l (sp)+,d0-d1/d3-a6
      rts

   ; End of function sub_CD68
jordanelias

Newbie
Newbie
 
Posts: 9
Joined: Mon Aug 14 2017 10:04pm

Re: The SF2 Disassembly Super Thread

Postby FfuzzyLogik » Thu Jan 03 2019 5:47pm

Hello there,

Sorry to be totally loosed on there... The potential of these tools looks phenomenal and Wiz made many new ones... But I'm just stopped at the first stages... I downloaded many of tools, do as asked the steps... But between, I'm loosed.
I mean after decompressing file, I don't know how to open the tools and make them work to change things before "compile again".
That's surely a very stupid question but I don't know how to open/make work the tools...

Have a good day !
FfuzzyLogik

User avatar
Member
Member
 
Posts: 24
Joined: Wed Dec 12 2018 4:46pm

Re: The SF2 Disassembly Super Thread

Postby Wiz » Fri Jan 04 2019 12:59am

Hey !

The tools available in SF2DISASM's data folders are executable JAR files : Java code pre-compiled to be executed in a Java Virtual Machine (JVM), no matter the actual OS and hardware.
For a Windows workstation, the most obvious choice for a JVM implementation is the standard Java Runtime Environment, which you can get here : https://www.java.com/en/
The tools are compiled with Java Development Kit (JDK) version 1.8, so you'll need JRE 1.8 or higher.

Once your JRE is installed :
- you can launch an executable jar from command line, for example : "java -jar SF2GraphicsManager-1.0.0.jar"
- or you can associate the ".jar" extension with the JRE's java.exe program to launch SF2DISASM's tools with a simple open action ! :)
Wiz

User avatar
Shining Member
Shining Member
 
Posts: 155
Joined: Sun Mar 18 2007 2:43pm
Location: Blois, France


Return to Shining Force II

Who is online

Users viewing this topic: No registered users and 1 guest