Ness-Wednesday wrote: ↑Fri Aug 01, 2025 7:11 pm
Mainly looking for how blocks, bgos, and mounts are handled. Especially anything related to rendering and whatever's hardcoded. I was only able to find anything regarding NPCs.
blocks are unsurprisingly handled in modBlocks. a good way to search for code that handles a specific block is to search ".Type = X" (or other comparison operators like <=, >= etc. (without the quotes)) because similarly to npcs, most of the logic is handled in these winding if statements
background objects don't have their own module, instead backgrounds that have special interactions will have them programmed from the other side (e.g. the code that handles keyhole exits is in the npc module, the key npc is the one that checks for collision), though some of the hardcoded ones like door locks and star warp indicators are partially handled in modMain, if memory serves me right
mounts are handled in the player module, you can check the player type definition in the main module to see all the fields related to mounts/yoshis and then ctrl+f for them in modPlayer, there are a ton of sporadic checks done throughout the different methods so i can't really give any more advice unless it's about a particular interaction
as for "whatever's hardcoded", the answer is that
a lot is hardcoded, to the point where it's only really worthwhile to check if something specific is hardcoded or not rather than trying to be systematic about it, simply due to the sheer volume of magic numbers and long if statements that check against them
lastly, 1.3's rendering is done in modGraphics, once again in a messy chain of if statements (though well-commented compared to the other modules i think), but i'm not sure how reliable looking at it is given that lunadll implements its own rendering pipeline which i'm not super familiar with, so there might be obscure quirks that differentiate them (a lot of stuff that's been added/reworked in smbx2 just uses lua drawing anyways so i'm not sure if the bitblt call emulation even matters there)
this is all a bit vague because i do need to stress that the base game has a surprising lack of generic code, and a lot of things will just have some special interaction programmed inside an if statement. i'd be glad to go into more detail about how particular interactions (that i know of) work, but there's too many of them to just start listing them off