Kuribo64
Views: 22,896,645 Home | Forums | Uploader | Wiki | Object databases | IRC
Rules/FAQ | Memberlist | Calendar | Stats | Online users | Last posts | Search
10-07-24 10:24 AM
Guest:

0 users reading Launch Stars (and Totally Not Breaking the Game's Code) | 1 bot

Main - General SM64DS hacking - Launch Stars (and Totally Not Breaking the Game's Code) Hide post layouts | New reply

Pages: 1 2
mibts
Posted on 11-27-16 12:31 AM (rev. 2 of 11-27-16 12:36 AM) Link | #79976
[image]

Guess what? Now this game has launch stars! Just press A when you're near one and BOOM, the character is launched along a path.

The big question is: What do they replace?
The answer, however, is nothing! They are a completely new object with an object ID of 0x146 and an actor ID of 0x168. So how did this happen?

List of Edits
  • There is a table that maps object IDs to actor IDs. Said table was moved to 0x4b00 in the ROM for expansion. 3 edits were made in overlay 2 to reflect that move.
  • There is a table that maps actor IDs to function pointers to spawn the actors. Said table was moved to 0x6590 in the ROM for expansion. An edit was made in arm9.bin to reflect that move.
  • The FAT, FNT, and overlay 0 were modified to add a new directory with 4 new files: lstar.bin, lstar.bmd, ls_wait.bca, and ls_launch.bca.
  • Code to initialize and cleanup the code for new objects (lstar.bin only in this case) has been added at 0x90864 and 0x90b2c. Branches to each of these have been added in the main code
  • The interpolation and cubic interpolation functions were added at 0x8f670 and 0x8f840, overwriting some of the object names, but the game didn't need those anyway.
  • And maybe some more...

You would notice the new lstar.bin file, which is an experiment on elegantly adding new code to the game.
Documentation
Offset
Size
Description
Notes

0x00
0x02
Actor ID

0x02
0x02
Offset to array of pointers to fix
This is in here to avoid lots of offsets to individual pointers in the vtable

0x04
0x02
Number of pointers in said array
For each pointer, if the most significant nybble is not 0, treat the pointer as an offset from the start of the file instead of an absolute position in RAM

0x06
0x02
Offset to array of offsets from the start of the file to other pointers to fix

0x08
0x02
Number of offsets in said array
Each offset is a 2-byte offset from the start of the file to a pointer to fix. For each pointer referenced, if the most significant nybble is 0, treat it as an offset from the start of the file. If the nybble is 1, treat it as a branch to an absolute location in RAM. If the nybble is 2, treat it as a branch link to an absolute location in RAM.

0x10
0x02
Offset to object spawn function

0x12
Whatever!
The actual data and code


The launch stars have been added in:
  • Bob-Omb Battlefield (you'll see where :)): A multi-Bezier-curve spline
  • Jolly Roger Bay: At the start of the level, a test path that takes the player through invisible walls.
  • Jolly Roger Bay: On one of the wooden planks, a test path through water
  • Rainbow Ride: At the start of the level, a straight-line path

How to add a launch star:
  • Add one with the parameters:
    Parameter 1: Path ID
    Parameter 2: Speed (1 unit here = 0x1000 units in game)
  • Add a path made of Bezier curves: Every 3rd point starting from the first one is a vertex, and the others are the control points between them. The first one should be in the same position as the launch star.
  • Enjoy!

Here's the xDelta:
Launch Star xDelta

Oh, and before I forget, this does not work with the current SM64DSe. You need a new version of SM64DSe to add the launch stars:
SM64DSe Patched

____________________
Current hack: Excerpt from Super Mario 256

Any map on a flat torus can be colored with at most 7 colors.

Arisotura
Posted on 11-27-16 12:34 AM (rev. 2 of 11-27-16 12:39 AM) Link | #79977
Hey, that's pretty cool! The star looks neat, too.

____________________
NSMBHD - Kafuka - Jul
melonDS the most fruity DS emulator there is

zafkflzdasd

poudink
Posted on 11-27-16 03:10 AM Link | #79979
Cool to see that some fancy ASM hacks are being made! It's kinda the last thing I expected to see since I thought that SM64DS hacking was dead :P

____________________
Nothing to say, so jadnjkfmnjamnfjkldnajfnjkanfjdksan jsdnvj m.

Hiccup
Posted on 11-27-16 11:54 AM Link | #79981
Nice work! Btw, are you going to add your SM64DSe changes to the git? https://github.com/StapleButter/SM64DSe

mibts
Posted on 11-27-16 09:52 PM Link | #80006
Not yet, because I want to completely get rid of the hardcoded number-of-objects constant (327). But this is an unofficial release, so ask Fiachra first.

____________________
Current hack: Excerpt from Super Mario 256

Any map on a flat torus can be colored with at most 7 colors.

MK7tester
Posted on 11-28-16 12:43 AM Link | #80015
That looks way cool. I would like to see them in action though, so I hope someone makes a video.

pacmainia&luigi
Posted on 11-28-16 08:44 PM Link | #80021
Can you make it so that you can place them in castle grounds?

____________________
Waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka.........

mibts
Posted on 11-28-16 10:48 PM Link | #80028
You can place it anywhere.

____________________
Current hack: Excerpt from Super Mario 256

Any map on a flat torus can be colored with at most 7 colors.

poudink
Posted on 11-29-16 01:22 AM Link | #80029
Tested it and it's surprising to see how well it works! Good job!

____________________
Nothing to say, so jadnjkfmnjamnfjkldnajfnjkanfjdksan jsdnvj m.

CodingKoopa
Posted on 11-29-16 09:39 PM Link | #80054
I don't know if this is a DeSmuMe error or just intentional, but the moving tower seems to disappear when I get close to it, with no collision either.
[thumbnail]
[thumbnail]

____________________
Website | Twitter


mibts
Posted on 11-30-16 01:51 AM (rev. 2 of 11-30-16 01:52 AM) Link | #80069
That had nothing to do with the launch star. :P

Yes, the moving tower is legitimately glitched. It is, first of all, not supposed to move until a switch is hit. I know how to fix the collision and draw-distance issue, but am saving that for later because I want to add a system for creating new level-specific objects.

____________________
Current hack: Excerpt from Super Mario 256

Any map on a flat torus can be colored with at most 7 colors.

FireMario74
Posted on 11-30-16 09:52 PM (rev. 2 of 11-30-16 09:52 PM) Link | #80084
This is flat out amazing! I want to test this and maybe use this for a hack if that's alright with you(Of course I'll credit you). Unfortunately when I went to patch it I got an error. What version of the rom did you patch this to? Thanks in advance, and thank you for making this!

poudink
Posted on 11-30-16 10:22 PM Link | #80085
0022 Super Mario 64 DS (EU)(M5)

____________________
Nothing to say, so jadnjkfmnjamnfjkldnajfnjkanfjdksan jsdnvj m.

mibts
Posted on 12-01-16 12:28 PM Link | #80095
And make sure it hasn't been patched with SM64DSe.

____________________
Current hack: Excerpt from Super Mario 256

Any map on a flat torus can be colored with at most 7 colors.

pacmainia&luigi
Posted on 12-01-16 10:32 PM Link | #80097
Posted by FireMario74
This is flat out amazing! I want to test this and maybe use this for a hack if that's alright with you(Of course I'll credit you). Unfortunately when I went to patch it I got an error. What version of the rom did you patch this to? Thanks in advance, and thank you for making this!

Patch with a clean Rom (I get mine from emuparadise)

____________________
Waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka waka.........

ThatZeroFrozn
Posted on 03-08-17 08:45 PM Link | #81840
This look extremly awesome!
Good job mibts!
I got 2 questions:
1.Are we allowed to use it in our own rom hack (And then of course credit you)?
2.Is a SM64DS version with a launch star patch still possible to be played on a Nintendo DS/i (XL)?

mibts
Posted on 03-09-17 03:27 PM Link | #81865
1. Yes, and actually, I have a better version that doesn't spawn a new particle system every time a sparkle appears.
2. Not sure.
(Look out for a showcase of some other new stuff coming soon!)

____________________
Current hack: Excerpt from Super Mario 256

Any map on a flat torus can be colored with at most 7 colors.

ThatZeroFrozn
Posted on 03-09-17 09:42 PM Link | #81885
Too bad I dont have a Flashcard or something like that ;_; i'd love to try that
When will the new version be for download
(Or did you actually update your top post)?

Shilz
Posted on 03-24-17 01:19 PM Link | #82112
I have a flashcard (R4i Gold). It works like a charm.

FallenLogic
Posted on 07-12-20 10:05 PM Link | #99321
Hello, I was attempting to use the newer patch in v2 of the ASMPatchTemplate to add launch stars to a hack of mine, and I followed StarPants/Pants64's YouTube tutorial (the code compiled, looks like it was applied, since the filesize and checksum changed), but the model obviously isn't in the game's files, and attempting to add the overlays from above to the game just throws errors. Does somebody know how to apply the new version?

Thanks in advance!
Pages: 1 2

Main - General SM64DS hacking - Launch Stars (and Totally Not Breaking the Game's Code) Hide post layouts | New reply

Page rendered in 0.042 seconds. (2048KB of memory used)
MySQL - queries: 29, rows: 237/237, time: 0.009 seconds.
[powered by Acmlm] Acmlmboard 2.064 (2018-07-20)
© 2005-2008 Acmlm, Xkeeper, blackhole89 et al.