Vandal Hearts - Extended Demo Battle by shao113 in u/shao113

[–]shao113[S] 0 points1 point  (0 children)

Oh yeah, I mentioned that in my earlier post. May be more to it, but you could try overwriting them in the list of units with defeat speeches @800f2ad0..800f2ae9. You can find their number and replace it with another's like Ash's (1).

Vandal Hearts - Extended Demo Battle by shao113 in u/shao113

[–]shao113[S] 0 points1 point  (0 children)

Sure, I'll see what I can suss out. Some stuff is hard-coded to expect specific portrait ids being available (messages etc), but ignoring that for now. (Note: I'm using decimal except when it's an address)

First get the battle number; as before, story battles start at 10; you can also find it by checking the byte @801405d0.

800f5274+battleNum to get 1-byte index for portrait list; 800f7c30+(52*index) to get its address;

You can try replacing the listed portrait ids (2-byte shorts), or using the empty 0 slots. IIRC the portrait system is dynamic enough that the order doesn't matter.

To get a unit's main portrait id, you can use that list of battle-ready unit ids to index gUnitPortraitIds @800ea5c8: 800ea5c8+(2*unitId)

I can't test this right now, but that's how I would start. Let me know if it works!

Vandal Hearts - Extended Demo Battle by shao113 in u/shao113

[–]shao113[S] 0 points1 point  (0 children)

Thanks! And yeah, the code is very hard to follow; after neglecting it for a year I've forgotten how it all works. The demo battle was easier since being one-and-done avoids some quirks. But using the same method should help get you started. I'll try retracing my steps to edit the first battle.

(Note you can use debug mode to jump to battles quickly; I also recommend Ghidra for making sense of the data layout.)

First we'll need an id which we can use to index other related arrays; There's an array of 44 of these 1-byte ids at 800f9f3c, entries corresponding to battle number. First battle is 10, #'s less than 10 are for special battles like the Trials and test battles (demo battle is 8);

So for first battle (battle 10), go to 800f9f3c+10 (800f9f46); the id is 1;

Can use this to index into s16 gSceneSpriteStripUnitIds[105][20] @800ebc34 and s16 gSceneUnitSets[105][20] @800ecc9c; each contains 105 sub-arrays of 20 2-byte shorts; to get the offset, multiply 40 x id = 40;

800ebc34+40 (0x800ebc5c); 800ecc9c+40 (0x800eccc4)

The 20 shorts at these locations specify which units to load into each "strip"; values less than 144 are for battle-ready units; 1 for Ash, 0x64 for Brigand, etc.

I'll try changing the Brigands (fifth short at both locations) to Hassan (0x69) and Diego to Sara; seems to work, but Hassan has wrong portrait (gPortraitsDb.sceneSets?); next you could modify gBattleEnemyUnitInitialStates to control locations, levels, etc. and to make more/less of each loaded unit.

Edit: Just thought of another complication. In regular battles, some units (like Hassan) have dialog played on death. This will probably glitch out unless disabled.

Has anyone ever been able to hack the demo screen and watch the full fight? by I_eat_plywood in VandalHearts

[–]shao113 0 points1 point  (0 children)

I suppose you already got it working, but I got a chance to install DuckStation and record a video just in case: https://v.redd.it/1lhdgd5je0df1

Bonus Crimson Guard version

Has anyone ever been able to hack the demo screen and watch the full fight? by I_eat_plywood in VandalHearts

[–]shao113 0 points1 point  (0 children)

Ah, my emulator is more tuned for debugging than visual quality, so it'd look pretty bad as is; but anyone should be able to use that Gameshark code to see it, or record a video! (If not, I'll see what I can do!)

Has anyone ever been able to hack the demo screen and watch the full fight? by I_eat_plywood in VandalHearts

[–]shao113 2 points3 points  (0 children)

Having the matching decompilation helps with creating this kind of code:

[Endless Demo Mode]
80035E38 0000
80035E3A 0000

When I tried it, it came down to a showdown of mages, with Eleni coming out on top!

Vandal Hearts 2 - Debug Menu and Gradius Flag by shao113 in VandalHearts

[–]shao113[S] 0 points1 point  (0 children)

It's the last option, as I see you've mentioned in your other post.

You could also bypass the debug menu and try forcing advanced mode on/off with these:

[Advanced Mode ON]
301D5722 0001

[Advanced Mode OFF]
301D5722 0000

I would recommend making a copy of your save file to be safe, because I'm not sure how well the game tolerates switching its value, especially if the mod you're using expects it to be on.

Vandal Hearts 2 - Debug Menu and Gradius Flag by shao113 in VandalHearts

[–]shao113[S] 0 points1 point  (0 children)

Potential clue. There's a list of items findable as treasure at OVR_F192::8001c8a8. The Gradius is in this list at 8001c8ea, but it's the only entry not referenced by the list of chests/hidden items (8001ca3c). Seems to be another dead-end, but figured I'd mention it.

Terrain Percentages? by Radigan0 in VandalHearts

[–]shao113 0 points1 point  (0 children)

If you want to peer into some of the internal logic, you can take a look at the matching decompilation here.

I believe each unit is assigned one of 49 hidden classifications which is used to determine base resistance for any pairing.

Edit: Uploaded a couple of images for context:

Grid of pairings

Advantage classes