Kuribo64
Views: 8,229,504 Home | Forums | Uploader | Wiki | Object databases | IRC
Rules/FAQ | Memberlist | Calendar | Stats | Online users | Last posts | Search
04-20-18 02:30 PM
Guest:

0 users reading [ASM Resource] Customising behaviour of existing objects | 1 bot

Main - General SM64DS hacking - [ASM Resource] Customising behaviour of existing objects New reply


dy
Posted on 04-14-18 10:23 AM (rev. 6 of 04-14-18 07:51 PM) Link | #94061
Firstly, huge thanks to the team behind SM64DSe and the ASM Patch Template, as well as everyone who's contributed documenting the object parameters and memory addresses. Special thanks also to Fiachra who helped point me in the right direction when I first got started.

The purpose of this thread is to be a resource of useful ROM addresses (EUR) for customising object properties/behaviours that can't be changed using the editor alone. You will need some basic ARM ASM knowledge to understand how to use this information.

This thread is not intended to be a general ASM help thread, but you can find plenty of tutorials online. You will also need:
1. ASM Hacking Template for SM64DS to create ASM hacks (http://kuribo64.net/board/thread.php?id=1758)
2. no$gba debug version to change and test code live in-game, or to set breakpoints and conduct your own research (http://problemkaputt.de/gba.htm)

OK - now onto the good stuff.


WHO CAN BREAK ORANGE BRICK BLOCKS

Ground pound:
[thumbnail]
Kick (including spin kick):
[thumbnail]

WHO CAN DEFEAT BOOS

[thumbnail]

WHO CAN GET WING CAP IN SINGLEPLAYER

There are several parts to this. Firstly, whenever a Feather is spawned, the game constantly checks whether the player is Mario and immediately despawns the Feather if not (eg, if player loses their Mario disguise). Secondly, the game checks whether the player is Mario when the Feather is collected (if not, the Feather disappears without giving any powerup). You can either use "! Block VS" to spawn wings for everyone, or change who "? Blocks" give feathers to (for "? Blocks" with the relevant Parameter 1).

Despawn loop check:
[thumbnail]
Whether to give wings when collected:
[thumbnail]
Whether "? Block" spawns Feather or Power Flower:
[thumbnail]

WHO CAN SEE MIRROR ROOM POWER FLOWERS

[thumbnail]

Unfortunately crashes when collected by Mario/Wario (in Castle 2F level only) and no reflection for Yoshi's fire breath. But seems to work properly in painting levels (including in case anyone wants to use static Power Flowers in their level)

BOB-OMBS: WHETHER TO REAPPEAR / WHAT THEY SPAWN

Whether to reappear:
[thumbnail]
What to spawn:
[thumbnail]

PIRANHA PLANTS: WHETHER TO REAPPEAR / WHAT THEY SPAWN

[thumbnail]

WOODEN CRATES: WHETHER TO REAPPEAR / WHAT THEY SPAWN

When broken:
[thumbnail]
When swallowed by Yoshi:
[thumbnail]

STAR/CHARACTER REQUIREMENTS FOR BOWSER STAR DOORS

[thumbnail]

STAR/CHARACTER REQUIREMENTS FOR ENDLESS STAIRS

Music / lighting effects:
[thumbnail]
Whether can get to top:
[thumbnail]

WHETHER YELLOW/BLUE COINS DISAPPEAR

[thumbnail]

EASY WAY TO CHANGE DRAW DISTANCES

[thumbnail]

Something easy: you could set a fixed draw distance for everything (r2 = 0x600000 gives really good results without killing the frame rate)
Something fancy: if you go to the address in r4, it contains another address (pointer to the object's vtable) which should be unique for each type of object - so you could create a switch table for [r4] and have different draw distances for different objects


To figure out / wishlist

- Ice blocks breakable by Wario with particle effects from CCM Ice Sheet
- Change how some enemies respond to being hit by Yoshi's egg (eg, Bullies)
- How to change whether enemy can be swallowed / give fire breath
- Star requirements for courtyard Boos (when start showing vs when have red coins, etc)
- For secret/boss levels, how to change whether Power Star teleports you out or lets you continue
- Jump out of correct painting after selecting "Exit Course"

If anyone's already figured any of these out, please let me know! Please also feel free to share if you've made any other helpful discoveries.


Tips for DIY research

For those who are interested in doing their own research and wondering how I discovered these (the short answer is a lot of work and a bit of creativity), the process essentially involves:

1. Finding a suitable starting breakpoint, eg Actor::Spawn() function or NumStars() function
2. Either tracing backwards through the LR (eg, figure out where and how the game determines whether to spawn coin or not) or searching forwards (eg, figure out where the game checks the player's type after the player hits a "? Block")

For step 1, symbols.x (from v2 of the ASM Hacking Template) is a fantastic resource of currently known game functions and their memory address. Action Replay codes can also be helpful. Lastly, you can find addresses of object-specific callbacks (eg, OnGroundPounded(), OnKicked(), etc) by following steps 1-8 of Fiachra's tutorial for finding the object's constructor (http://kuribo64.net/board/thread.php?pid=67624#67624) - after the address that contains the constructor address, you'll see a long list of more addresses (which are the addresses of the various callback functions).

For step 2, you'll need some ASM knowledge and a bit of patience. Conditional breakpoints can be very useful - eg, we know where the player's type is stored, so we can set a breakpoint to trigger whenever the game tries to "read" from that memory location (eg, check the player type). We usually still need an initial breakpoint though (step 1) - for example, the game checks the player's type several times per frame.

StarPants
Posted on 04-14-18 12:50 PM (rev. 3 of 04-14-18 05:04 PM) Link | #94063
This is extremely awesome. Keep up the great work!

____________________
my newish yt channel for sm64ds stuff


Main - General SM64DS hacking - [ASM Resource] Customising behaviour of existing objects New reply

Page rendered in 0.031 seconds. (2048KB of memory used)
MySQL - queries: 29, rows: 198/198, time: 0.022 seconds.
[powered by Acmlm] Acmlmboard 2.064 (2017-11-20)
© 2005-2008 Acmlm, Xkeeper, blackhole89 et al.