Esco may have some insight into the PSX stuff or maybe even notes.
He did trudge through SotN's engine extensively before he decided to just remake the game from scratch.
Thanks, I'll keep that in mind when I get there.
Earlier in the thread it was asked if it was possible to port enemies and bosses from one game to another.
Just to get a bit of a better idea of how much work would have to go into it, how different is the coding between the NDS games?
If we're just talking about enemy-specific code, it's not any different in my experience. For a given enemy shared between multiple games the code looks almost identical. There could be minor differences but I'm not aware of them.
I imagine the majority of the work for porting enemies between games would be figuring out every single function that enemy calls in the source game, and then finding all the equivalent functions in the destination game so that you can replace those function calls.
Some things to note:
No$GBA's "Disassemble to File" feature (under Utility) is very useful for this, not only because it saves you from having to manually type the asm code, but because if you have it set up so that No$GBA uses the right symbol files
, then the disassembled output file also uses those function names in place of the pointer to the function. So if the symbol files had all relevant functions for both games, the ASM No$GBA spits out would already have all function names ready to be used in the other game.
In reality my symbol files only have a handful of the functions used by enemies, so a lot more would need to be found and added to them to get this working. But once somebody found every function used by one enemy, then it should be a lot easier for other enemies after that since a lot of these functions are shared by many enemies (e.g. EnemyCheckStatusEffects, this seems to be called by every single enemy, even ones that aren't weak to any status effects in the base game).
Also, it wouldn't be enough to port just the Create and Update functions for the enemy, even though those are the only ones shown in DSVEdit. Each enemy has several other functions that seem unique to it, like a callback function for when it takes damage from the player, a callback for when it hits the player, and if the enemy creates any projectiles the projectile also has a Create and Update function, etc. These extra functions aren't listed in the enemy DNA, you'd only find these while you're reading through the enemy's Create/Update functions.
Also, how difficult would it be to convert a normal enemy into a boss or is that even realistic to consider?
I think that wouldn't be that hard. Giant Skeleton in OoE is already both a boss and a common enemy at the same time (controlled by var A). Things that would be necessary:
Boss doors: Shouldn't need any special coding. I think they just work even with common enemies in the room based off Nest of Evil/Large Cavern.
Boss staying dead permanently: Would require a boss death flag. Thankfully this won't require you to find free space in the save file, the bitfield of boss death flags has plenty of unused bits and any one can be chosen. Then when the boss is created you read that bit, and if it's set you just delete the entity and return, or if it's not set you continue on with the normal create code. Then when the boss dies you set that flag.
For reference, in PoR, Dragon Zombie is a common enemy that uses a boss death flag to stay permanently dead when you kill it.
Spawning a full-heal orb: I don't know the specifics, but it seems to involve calling a function to create the orb when the boss dies.
Changing the music: When the boss is created it calls a function to change the music to boss music. Then when it dies it seems to call a function to mute the music. The reason it comes back when you leave the room is because the engine will actively play whatever the correct BGM for that sector is whenever you enter a room if it's not already playing, so no need to worry about that.