don't click here

SADX/SA1 Hacking/Modding

Discussion in 'Engineering & Reverse Engineering' started by MainMemory, Aug 15, 2009.

  1. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    There are two probable issues: one, the SA2 LandTables all have a reference to the PVM file in the data, so it'll always look for that specific filename rather than whatever PVM the level originally loaded; two, all LandTables include a texture list pointer, which tells SADX how many textures are in the PVM and where each texture is loaded in RAM. Currently the only way to edit either of those is with a hex editor, address 8 in an sa1lvl file points to the LandTable struct, which is described at SCHG:Sonic Adventure/Level Data Formats. But editing it won't help you much unless Emerald Coast's PVM has the same number of textures as Green Hill's, since there's no way to edit the list size yet either (SADXTweaker might work, or might break). Also there may be differences between SA1 and SA2 that I'm unaware of.

    Edit: @Commando Beta: The texture names are entirely meaningless to SADX.
     
  2. Turbohog

    Turbohog

    Member
    923
    117
    43
    Thanks a bunch for the info. Since I'm awful at hex editing I went and found that Red Mountain(mountain01) and Mad Space from SA2 have the same amount of textures. I got the landtable in, but for some reason whenever I change Sonic's spawn in SADXLVL2, it doesn't seem to actually save it. I also noticed that for some reason it's ridiculously difficult to even select Sonic/any character in SADXLVL2...all objects and land are selected and moved fine though....just in case you weren't aware of that.
     
  3. E-122-Psi

    E-122-Psi

    Member
    2,470
    612
    93
    Out of curiosity how intelligent are the character specific objects in different levels anyway? eg. can the COM Sonic still find a route to the end of non-Tails levels or ZERO still chase the player in non Amy levels, or do they just glitch up or run frantically in the middle of nowhere?
     
  4. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    Sonic (and Eggman, they're loaded by the same object) have specific paths for each of Tails' levels. Loading the object in a non-Tails level will have them follow the path for the last Tails level you were on. ZERO afaik will just follow Amy in any level until it hits a despawner object, at which point he goes away.
     
  5. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    New version of SADXPCTools, and I don't even remember what all I've added since it's been three months, but some highlights are:
    • New .sa1mdl format for models (except for chrmodels)
    • Skybox for Emerald Coast and Windy Valley
    • Fixed rendering of transparent objects
    • Fixed mouse picking on objects that use a model hierarchy (turns out I forgot to pop the transformations off the stack when I finished processing the model's children)
     
  6. Dude

    Dude

    Tech Member
    3,138
    0
    16
    Southbridge, MA
    Random VR/AR trash
    Is there a way to do a 'clear all' of emerald coast without it crashing yet?
     
  7. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    If you mean "delete all the items from the layout and add completely new ones", yes, it's possible, but there's no method for doing so automatically yet (you could just hex edit the COL count to 0 in the .sa1lvl file). The texture animations operate on specific addresses, and build doesn't alter the original data in the exe, it appends new data in a new segment and changes the pointers.
     
  8. Dude

    Dude

    Tech Member
    3,138
    0
    16
    Southbridge, MA
    Random VR/AR trash
    Right but if you alter the COL count in sadxlvl, won't it be impossible to import a nodetable?
     
  9. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    ...You still can't create brand-new levels with SADXLVL, unless you're planning on editing it in SADXLVL, splitting the modified EXE (which may or may not work), and then building it off a clean EXE.
     
  10. Are character-specific actions driven only by the animations or are they hardcoded? I'm thinking of things such as Tails flying, Knuckles gliding etc.
     
  11. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    Every action is hardcoded.
     
  12. I see. I wonder if there's a way to change that, if of course we know where the actions are hardcoded to. For now, I'd be happy simply removing an action entirely.

    Does anybody know the address for Metal Sonic's afterimage effect when he begins to hover? I'd like to kill it.
     
  13. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    In order to, say, make Tails spindash like Sonic, you would have to copy and modify all of Sonic's spindash code to work with Tails. You cannot simply mix and match actions. Removing an action would probably be done by removing the code that triggers it.

    The answer to the after-images depends on whether you want to disable them only when he starts hovering, or every time they're used.
     
  14. Pretty much every time Metal Sonic uses them - I've noticed switching his running animation from "Metal Sonic Hover" in SADXTweaker to a different running animation makes the afterimages appear whenever Metal Sonic runs.
     
  15. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    You can disable the after-image object entirely by going to 95A54 and replacing the bytes there with C7 41 10 70 B5 40 00 C3.
     
  16. I've started working on my own mod for SADX now that I have the modelling issue sorted. What I'd like to know is whether cutscene heads are modifiable - I'm not certain on this one because I don't know how they operate in-game (as well as this, I only have the offset for Sonic's cutscene head)
     
  17. Dude

    Dude

    Tech Member
    3,138
    0
    16
    Southbridge, MA
    Random VR/AR trash
    Heads yes, cutscenes themselves not so much as far as I know. The heads each have a series of 'extra' vertex arrays that serve as morph targets. I don't know of any tool that lets you place new morph target data in either the original dll space or the extended area, you'd have to do it in a hex editor and then manually update the pointers.
     
  18. I'm simply making a "classic" mod, so I'm not inserting new meshes, simply resizing existing ones. Would that still involve having to recreate the morph codes in the dll?
     
  19. Dude

    Dude

    Tech Member
    3,138
    0
    16
    Southbridge, MA
    Random VR/AR trash
    This depends on one thing - the model you're using is a vertex edit of the original sadx model, right? If not, it doesn't matter that you're making morph targets for the new model you imported, you'll need extra space and therefore need to migrate things.
     
  20. Yes, I'm simply shrinking Sonic's spines to 'classic' length, nothing else.