Skip to content

Commit

Permalink
3P Partner Code V2 by Donut; Prepare for 2.0 ship
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamsyntax committed Sep 20, 2019
1 parent 2528f42 commit 0eafc14
Show file tree
Hide file tree
Showing 8 changed files with 141 additions and 60 deletions.
57 changes: 43 additions & 14 deletions HOW TO PLAY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@
=== Release 5 / v2.0 - 2019.09.19 ===

=== Things to Know ===
- Airbug is NOT FIXED IN THIS BUILD! Use Chaos Blast to break out of endless floating if you enter this glitched state
- Change characters:
Select 2P-VS, select characters, back out to the main menu at the 1-3 round select screen. Your character choices will carry over to 2P CO-OP.
- Air-vents/Air Blower bug - either player may get stuck in the animation.
Use Chaos Blast to break out of the animation. (either player Z+L to fill meter)
- Z+L is Chaos Blast Activator, Z+R is Chaos Control Activator, Z+L+R is Clear Chaos Powers

=== Setup ===
Expand All @@ -45,7 +44,7 @@ To play this mod, you must:
(1) copy over the files in 'root' onto the root of the ShadowTheHedgehog.iso
(2) enable Gecko codes and use provided GCT (Wii/Nintendont) or game config .ini (Dolphin)

You can find a setup tutorial video at: https://www.youtube.com/watch?v=FNH20sALtJM or search for "dreamsyntax" on YouTube
You can find a setup tutorial video by searching for "Shadow 2P Mod - How To Setup by dreamsyntax" on YouTube

=== Extracting and Rebuilding ISO ===
Open gcr.exe (GameCube Rebuilder)
Expand Down Expand Up @@ -90,27 +89,57 @@ You can find a setup tutorial video at: https://www.youtube.com/watch?v=FNH20sAL
Video Width (Set to whatever fills your screen if you want the same aspect as Dolphin, in my case it was 714)

=== Dolphin Setup ===
The easiest way to do this is with the packaged PreConfigured-Dolphin
DO NOT USE 5.0 STABLE! Use 5.0-10912 or newer!
There are tons of performance fixes that directly impact this game
You can download the latest Dolphin here: https://dolphin-emu.org/download/
Be sure to install the pre-req of "64-bit Visual C++ redistributable for Visual Studio 2017" linked at the top of Dolphin download page

Clockspeed is set to 165% by default. Performance varies widely by system
If performance is bad dial clockspeed back to 100%, then slowly raising it (see "For performance issues" below)
Some testers reported 100% worked best for them, others 120%, with the majority being 165%
0. GUPE8P.ini needs to be moved/copied to your Documents\Dolphin Emulator\GameSettings\ folder
OR if you are in portable mode (add portable.txt to Dolphin dir to enable) this folder instead be in "<Dolphin.exe Directory>\User\GameSettings\"
^ DO NOT FORGET THIS STEP!

Open Dolphin
Open Dolphin
1. Add Game to Dolphin
Select Config
Select Paths Tab
Select "Add" for Game Folders
Navigate to the folder with the newly built ISO
Configure Controllers
Play!

For performance issues adjust clockspeed while running the game (Note: Dolphin only saves this change for next run if your game is NOT running; You should find the value that runs best then close the game, set it again and it will stay there):
Select Config
2. Best Performance Configuration
Select Graphics
Under General:
Set Backend to Direct3D 11 or Vulkan (as of 5.0-10912 Direct3D 12 can cause crashes for 2P-ShdTH)
Set Aspect Ratio to Force 16:9 or Stretch to Window
Under Enhancements:
I recommend 3x Native, other settings here are optional
Under Hacks:
Check/Enable everything
Under Advanced:
Check/Enable Load Custom Textures and Prefetch Custom Textures**
**This is for the HD Texture pack which is not yet available as of 2019-09-19
3. Configure Controllers
4. Play!
5. FPS optimization (CPU variable):
Adjust clockspeed while running the game (Note: Dolphin only saves this change for next run if your game is NOT running; You should find the value that runs best then close the game, set it again and it will stay there):

It varies per system, some run better with underclock/overclock

I recommend trying 80%, 120%, 165%, 189%, 217%, 230%, 287%
Note that higher clockspeeds may result in audio distortions, if it occurs lower the clockspeed.
I run 217% on a Ryzen 9 3800X, and ran 165% on a Intel i5-3570k with both having great FPS
How?:
Select Config
Select Advanced Tab
Adjust CPU Clock Override slider

I recommend loading in Glyphic Canyon, have one player stay at the start and the other go to the first area with enemies and Knuckles.
Try adjusting the slider here to reach 60fps. (It will be ~30fps before adjustments)

6. Gecko customization:
Right click the game and choose Properties
Choose the Gecko Codes tab
Here you can enable/disable some of the codes used in the mod. The rest are embedded in the dol and are not able to be disabled.
Enjoy!


For future updates:
For source and possible future updates:
https://github.com/ShadowTheHedgehogHacking/2P-ShdTH
42 changes: 32 additions & 10 deletions LATEST_GECKO_CODES/GUPE8P.ini
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,20 @@ E2000001 80008000
*Prevents underflow of meters
$Partner mapped to AI only [dreamsyntax]
C606F830 8006F870
$Partner mapped to PORT3 (Broken If Dark Partner is activated first) [DonutStopGaming]
C20A85C4 00000007
83E30010 7FF2F850
2C1F0000 40820020
3FE08056 63FFED78
7FF2F850 2C1F0000
4082000C 3A52002C
92430010 82430010
$Partner mapped to PORT3 v2 [DonutStopGaming]
C20A85C4 0000000C
3FE08056 63FFED4C
82430010 7FFF9050
281F0000 41820038
82430010 3FE08056
63FFED78 7C1F9040
40820030 826D314C
3A730001 926D314C
28130001 4182001C
3A5F002C 92430010
48000010 824D314C
3A400000 924D314C
7C7F1B78 00000000
*Needs to be updated to account for different partner start cases
$Fill Dark Meter with Z + L [Zzetti]
2856ED4E 00001020
045766D4 00007724
Expand Down Expand Up @@ -113,6 +117,24 @@ $Clear Both Meters with Z + L + R - P2 Remote [dreamsyntax]
E2000001 80008000
$GravitySwitcher Restart Patch [dreamsyntax]
04247860 60000000
$Airbug WIP Code (Not Recommended) [DonutStopGaming]
C21DBAE4 00000005
82C40000 82D6022C
82D60030 82D60010
2C160018 40820008
4E800020 9421FFE0
60000000 00000000
C2103794 00000009
3EC0807D 62D671A0
82D60000 82D60000
82FF0024 7C16B840
40820020 3EC0807D
62D671A8 82D60000
82D60000 82FF0024
7C16B840 40820004
92DF0024 92C10010
7EC0B378 00000000
*WIP Code; Fixes airbug however if two or more air blowers are loaded at once results in very slow movement (calls fall/rise rapidly)
[Core]
GPUDeterminismMode = auto
CPUThread = True
Expand All @@ -130,7 +152,7 @@ $Widescreen Hack v2
$2P Essentials SplitScreen Widescreen Hack
$2P Essentials Vertical-SplitScreen v3
$2P Essentials ChaosPowers Activation for P2 v2
$Partner mapped to PORT3 (Broken If Dark Partner is activated first)
$Partner mapped to PORT3 v2
$Fill Dark Meter with Z + L
$Fill Hero Meter with Z + R
$Fill Dark Meter Z + L - P2 Remote
Expand Down
50 changes: 16 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,14 @@ Story Mode, Select Mode, Expert Mode, Last Story.
## Level Status
# ALL LEVELS ARE NOW PLAYABLE!

## Road to 2.0 (WIP) | Release Date: 2019-09-19 (Today)
* Fix "Air bug" - [PARTIAL / Multiple blower objects result in issue]

#### Completed for 2.0
* Verify 1:1 misc/unknown bytes for level edits per HPP v0.7.6+
* Vehicles map to correct player's controlpad
* Fix "ChaosPowers activate for both players" - add underflow check
* Fix "Disable ScreenShake" - (occasional endless shake issue)
* Partner does not despawn if P1 is not in range of "RW:Range" activation patch for P2
* All bosses are free-cam
* Circus Park Hero Mission counts P2's rings
* GUN Fortress Security Camera segments are free-cam
* Culling issue for P2's screen when near force-fields / or near Vacuum effect (effect removed)
* Key Doors, Westopolis Triggers, Computer Room react to P2
* Android characters have unique JumpBall colors
* Individual death-to-checkpoint (Basic)
* Physics Rewrite for GUNMech Jumpers
* Downscale all stage and stage_gdt textures to reduce crashing
* Coaster/Pulley/Ziplines Fix v2
* Proper CameraHook for Turrets/Flyables/Vehicles
* Devil Doom / Super for P2
* Checkpoint Warping/Backtracking separate warping
* Make Space Gadget Coasters Grindable
* Space Gadget Gravity Switchers Fixed* (Checkpoint warp/deaths may run into issues)
* Vehicles/Turrets/Flyables Controls/Cams detect which player uses them by distance
* All bosses act on closest player

## Problems
* "Air bug" (occasionally P1 or P2 will be stuck in the floating state until hurt when activating a wind tunnel) - Break out with Chaos Blast or move back to the source of the wind
* If Dark Partner is activated first, P3 remapping fails
* Phase 2 Warp for P2 in Diablon Boss
* For SpaceGadget if both players warp/respawn to the same checkpoint while the other player is in range, the latter player will not have correct gravity set

## Done so far:
* Level chunks load/unload based on both players
* ChaosPowers activate for both players
* Partner/Mission Helpers can be remapped to permanent AI or P3* (P3 has some issues depending on Partner activation order)
* Partner/Mission Helpers can be remapped to permanent AI or P3/SLOT3
* ChaosPowers EventsCamera and ChaosControl Effects removed
* Load P2 in any mode (including camera)
* Enable splitscreen in 1P, disable when in cutscenes/event cameras
Expand All @@ -62,13 +34,21 @@ Story Mode, Select Mode, Expert Mode, Last Story.
* Culling issue for P2's screen when near force-fields / or near Vacuum effect (effect removed)
* Circus Park Hero Mission counts P2's rings
* Partner/Mission Helpers (Sonic, Doom's Eye, Espio, etc...) no longer despawn if P2 activates trigger without P1 being in range
* Vehicles no longer alter P1's camera if P2 uses it; P2 can control CarType Vehicles if mounting while P1 is not driving
* Vehicles/Turrets/Flyables properly assign Controls and Cameras based on player distance
* Key Doors, Westopolis Triggers, Computer Room react to P2
* Independent Warping/Backtracking via Checkpoints
* Coasters / Ziplines / Pulleys (e.g. hang-rail in Circus Park) activate on correct player
* Bosses (with the exception of Egg Dealer) will attack closest player
* Gravity Switchers on Space Gadget alter proper player's gravity
* Bosses will act on closest player
* Gravity Switchers on Space Gadget alter proper player's gravity* (Checkpoint warp/deaths may run into issues)
* SuperShadow/DevilDoom activates for both players
* 1:1 misc/unknown bytes for level edits per HPP v0.7.6+
* Fix "Disable ScreenShake" - (occasional endless shake issue)
* All bosses are free-cam
* GUN Fortress Security Camera segments are free-cam
* Android characters have unique JumpBall colors
* Individual death-to-checkpoint (Basic)
* Physics Rewrite for GUNMech Jumpers
* Downscale all stage and stage_gdt textures to make the game crashless

## Other Known Issues (Not planned to be fixed)
* P2 spawns according to nukkoro2.inf initially fine, but on restart seems to occasionally be off by +-5 - +-20 (stage dependent, game bug)
Expand All @@ -77,6 +57,7 @@ Story Mode, Select Mode, Expert Mode, Last Story.
* Rare instance has been recorded where P1 uses a rocket but the rocket never takes off (state issue?)
* Worm Enemies and AlienShips will only target P1
* Checkpoint Bonus (Rings, Bubble, Lives) are based off P1's ring count if P2 activates checkpoint
* Phase 2 Warp for P2 in Diablon Boss

## Bonus Roadmap
* Static weapon swaps for Metal Androids
Expand All @@ -90,8 +71,9 @@ Story Mode, Select Mode, Expert Mode, Last Story.
* DonutStopGaming

## Credits
* dreamsyntax for starting this project/everything
* DonutStopGaming for major contributions to chunks, P3/AI partner mapping, CoasterFix, GravitySwitchers, PlayerPointer, structs analysis, and numerous other address discoveries
* LimblessVector for his work on identifying objects, work on the initial memory list, SinglePlayer Widescreen Hack, Stray Pixel under HP Bars fix,
* LimblessVector for his work on identifying objects, work on the initial memory list, SinglePlayer Widescreen Hack, Stray Pixel under HP Bars fix
* TheHatedGravity for red/yellow TrueBlackShadow textures, v1.2+ MenuUI, v2.0 Banner, and a ton of testing
* Original Shadow vector used in banner by nibroc_rock (modified)
* Muzzarino for some symbol findings
Expand Down
Binary file modified res/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/main_banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified root/csdFiles/honban_EN.txd
Binary file not shown.
Binary file modified root/opening.bnr
Binary file not shown.
52 changes: 50 additions & 2 deletions workspace/dreamsyntax-notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8064,6 +8064,54 @@ lfs f0, 0x8(r3)
Success; However this only affects 'flee' action; But this makes the boss more easily attackable as P2.

Airbug final attempt for v2.0:
Donut's current WIP code breaks if player X is near a blower but player Y is out of range of any blower obj.
Need to address both states somehow.
Donut's current WIP code breaks if multiple Fan Exec()s are happening at the same time
Need to address this condition somehow.
Mad matrix blowers are also entirely separate?

height fix:
[801dbae4]
lwz r22, 0x0(r4)
lwz r22, 0x22C(r22)
lwz r22, 0x30(r22)
lwz r22, 0x10(r22)

cmpwi r22, 0x18
bne- original
blr

original:
stwu sp, -0x20(sp)

C2103794 00000009
3EC0807D 62D671A0
82D60000 82D60000
82FF0024 7C16B840
40820020 3EC0807D
62D671A8 82D60000
82D60000 82FF0024
7C16B840 40820004
92DF0024 92C10010
7EC0B378 00000000


My ver:
lis r22, 0x807D
ori r22,r22,0x71A0
lwz r22,0(r22)
lwz r22,0(r22)
lwz r23,0x24(r31)
cmplw r22,r23
bne- 0x14
lis r22, 0x807D
ori r22,r22,0x71A8
lwz r22,0(r22)
lwz r22,0(r22)
stw r22,0x24(r31)
stw r22,0x10(sp)
mr r0,r22

Idea: Airbug only happens if players enter fan near each other; SO:
Only do custom code if players are close enough to X range?

Inject @ 80103794
Original: lwz r0, 0x0010 (sp)

0 comments on commit 0eafc14

Please sign in to comment.